It sounds like the battery may be going bad, not holding a charge anymore, or the processor may be overheating and shutting itself down as a precaution. Some BIOS may have a temp reading if you enter the bios at boot up, usually by pressing del key or F1 key, it should tell you at reboot, right at the first second or two after power is turned on "press del key to enter setup" or something similar.
If your BIOS does not have a temp readout, you can download freeware temp reading tools from cnet.com.
Make sure that your fan is blowing out the port in the back and that it is not obstructed by something.
If it is none of these, you may have a virus, In which case, try the following:
While the system is booting --before the
xp
logo shows, hold down the F8 key. This will bring up a menu. Choose
"start windows in safe mode with networking".
The os will start in
safe mode. run a virus scan, defrag and
scandisk, then restart the system. If is still wont run normally, do
the same thing then run a registry fixing program such as uniblue
registrybooster, then
reboot.
If it still won't run right, you may want to reinstall the OS and see if that works. If reinstalling the OS after formating the drive doesn't fix it, it is definitely a hardware problem. good luck.
PLEASE
RATE THIS ADVICE WITH SOME THUMBS UP!!!