Why is my PC logging off?

I’m been using the same PC for about a year. I’m running XP and use Firefox, AVG, Spybot, and ZoneAlarm, so I like to think I’m pretty secure.
About two weeks ago, my PC started acting strangely. As far as I know*, no new programs and/or files were installed, but it has started logging off without any input from me. There seems to be no rhyme or reason; sometimes it will stay on for hours, sometimes it will log off in fifteen minutes.
Further symptoms; when it logs off, sometimes it will take four or five times to get it to come back on. It will get to the “press enter to interrupt,” then shut itself off again.
When it does that, I have to hold in the power button and interrupt the normal loading XP by pressing “Enter” then resuming it by pressing “Esc” to continue with a normal start.
When I ran Ubuntu from disc, I went without problems for twenty-four hours, but when I removed the cd, the problem returned.
If anybody has had this problem or knows what it may be, please post.

Thanks in Advance - DESK

*my daughters, 8 and 5, use the PC, but pretty much stay on Barbie and Polly Pockets type sites.

I’m going to go out on a limb here and ask if the heat sink on the CPU and/or its fan are caked with dust. There’s a possibility that if it is, your computer is going into thermal shutdown. This happened to mine last year, and after vacuuming out the dust, the CPU ran 98 degrees fahrenheit cooler than it had been. With any luck, that’s your problem. If not, you’ll need more knowledge on the subject than I have. Those people with it will be along momentarily.

Thanks, fishbicycle. As soon as I find my PC toolkit and a “can 'o air,” I’ll clean that out.
It still kind of makes me scratch my head that Ubuntu ran for twenty-four hours with no problems though.
Either way, thanks for the advise - DESK