My Laptop shuts off when it moves

I have a Lenovo Ideapad Z575 and whenever it moves it turns off and reboots. This problem happens when it is on battery and plugged in. I know that it must be something wrong with the hardware but what is it and how do I fix it. Thanks for all of the help
 
So any time the laptop is moved whether it is plugged into it's charger or not, it shuts off?
 
Back