You need an automatic transfer switch. Asco and Kohler both make very good ones. Square-D, GE and the other electrical component companies make medium and huge units, but it sounds like you need a small one. This would normally be installed along with your generator.
Tellurian Networks - The Ultimate Internet Connection
http://www.tellurian.com | 888-TELLURIAN | 973-300-9211
"Good will, like a good name, is got by many actions, and lost by one." - Francis Jeffrey