Just thought I would update as I was exhausted last night. Reinstalling Leopard didn't fix the problem so I did an erase and reinstall losing all my pictures and programs and it works fine now. This has made me decide to buy a ups and a timemachine as I didn't know the imac could be wiped out by a power outage.