I suggest you open the laptop up and check the components/devices. Check if they are securely plugged in. Start with the RAM, then HDD and CD/DVD drive. Also check other components like cables, heatsink, etc.
Here's the service manual that you may use to guide you in the disassembly...
http://h10032.www1.hp.com/ctg/Manual/c01035657.pdf