There's several threads about this already. It's to do with the latest software update. I don't know why, but it's the most surprising thing my mac's ever done - and hopefully not a sign for the future when it comes to intel macs!
Turn the iMac on, and hold the shift key till the spinny logo comes up under the apple logo.
This will do a "Safe Boot". you'll get to the login screen, which should say "Safe Boot" in red.
Next, open System Preferences->Accounts->Startup Items and remove all the startup items. Then go to Macintosh HD/Library/StartupItems and trash that (then empty the trash).
So now StartupItems for your Account and your Library should be empty and trashed.
Restart.
This should fix it fine!
Perhaps I forgot to trash them, but the first time I tried this, I think the StartupItems folder may have un-emptied itself. If you're still having trouble booting normally, you may want to try safe booting again and re-deleting the folders.
Good luck!