Setting NetworkManager policies?

view story

http://unix.stackexchange.com – I have a linux laptop with NetworkManager. It's supposed to manage my network connections. It has wired ethernet and wifi. I would like to to automatically turn on and connect the wifi interface when the ethernet is unplugged, and bring down wifi when the ethernet is plugged. Is it possible to set a policy like this using NetworkManager? My distro is Gentoo, and I don't have Gnome installed so I don't have it's GUI, just the cli tools. (HowTos)