One foolproof way to check for software problems is to install linux. If it still reboots, it's definitely hardware. Also, if you run it from a livecd, you could test the hard drives as the source of problems.
That said, i don't think it's a software problem. I think it's something shorting out. Did you say it rebooted when you rattled it? Have you checked that there's no little pieces of metal or similar just lying around (maybe even behind the mobo, between it and the case) that could shortcircuit something? Did you build the system yourself or was it purchased whole?
I once had a problem with the system rebooting instantly after shutdown. Turned out I had connected one of those proprietary CD/DVD audie connectors (they have like 2 or 3 pins or something and they're small and grey and in no way necessary for the operation of the drive) to the wrong pins on the mobo, so somehow that rebooted the computer instantaneously after I shut it down. That's probably not your problem though. You're getting reboots while you're still running stuff.
Basically at this point if I were you I would take the system completely apart and clean it out (an inverted vacuum cleaner is better than canned air for cleaning out whole computer cases). Then just but in the mobo and CPU and test the memory sticks with memtest for a couple of hours each, and then together. If that works, gradually add component after component and keep running all the tests and taxing applications you can think of before adding a new component. Once it crashes, you should be able to tell where the problem is. Of course, chances are it's a PSU or mobo problem, but just in case. You could also get one of the better UPCs or at a minimum a voltage spike protector in case it's an external power issue. It really would help if you and a friend would switch PSUs for a week.
One last contingency: It might be your videocard, if it's not getting enough power it will lock up the system (this is an issue in my current system with an EVGA 6800GS Co with a factory overclock, it's a pain to get it to run stable even at the shipped speeds). I haven't ever experienced a reboot though. This would typically be more of a problem when you're running demanding games or such, so it's probably not your issue. But what video card are you running? Could it be overheating/not getting enough power/other similar issues?