I would recommend that you do a hard shutdown, then open your case and make sure that everything is connected as is supposed to. If it is start your computer and run a virus scan and check for spyware, and malware too.
Your computer is probably doing that because it experiences an error and automatically restarts, which is a feature of Windows XP (I assume you're using that.)
Do the following:
1. Right-click on My Computer.
2. Click Properties
3. Click the Advanced tab
4. Under "Startup and Recovery" click on Settings.
5. Under "System Failure," go ahead and uncheck the automatic restart box.
Then try shutting down. See if you get any error messages or reports. If this doesn't work, come back and I have a few other things you can try.