well, i have the same/similar problem - random restarts. and mine is a new 24"/2.8 GHz/10.5.6/iMac bought about 5 months back. problem started about a month back and incidentally a few days after i upgraded to 10.5.6. so, i assumed the issue was with the upgrade. please see the thread
http://discussions.apple.com/thread.jspa?threadID=1835711&tstart=0 for my initial experiments. i have since concluded the issue is not 10.5.6.
i then called apple and they tell me that they have had a couple of similar cases and the issue was the main DC power cable which had to be replaced. they have ordered one for me and am waiting for the part to arrive and for the repair. hopefully, the cable indeed is the issue and the problem will be solved once and for all. will keep you posted.
you may want to investigate along similar lines...