Computer turns off if left idle

Hi was hoping that someone can help me for the last 2 weeks if I leave my computer idle for any time it will just turnsoff, not shut down. When I turn it back on I get the message would you like to restart in safe mode.
No viruses, new power cable, just done a clean install of windows 7 for the second time, I have installed both 64bit and 32bit but it still turns off.

Just win 7, but I installed 7 months ago had no problem until 2 weeks ago. I did some more work on the computer last night and still could not find anything wrong.
Could it have something to do with the power supple.

I have changed all the power settings, and yes it is really true only when the system is sitting idle. I can use it all day and it will not turn off but if I leave it, it will turn off, I will leave the room then come back and it will be off.

OK then the only feasible thing I can think of is one of your PC components is incorrectly sending a request to shut-down when idle. That is why I asked you to check setting the OS to ignore all shutdown requests.

There are two other things you should look at. 1st the monitor may shut down on idle but the PC is still running which confuses you... and 2nd there can be similar power-saving settings in the motherboard bios, so check there.

Oh, and finally, check the event log which might contain the exact reason for shut-down. Win7 help will show that if you don't know where it is.