If the machine completely powers off, it could be several things. A switch doesn't sound likely though. If the battery has a full charge, and it just "shuts off" when moved, i'd look for either a loose internal connection or a bad motherboard (cold solder or broken trace). If the battery doesn't hold a charge, and it turns off when moved, i'd first check the DC power jack. They tend to break, and if the power is interrupted for even a split second, and your battery is bad, the laptop will power off. It will take some time to pinpoint.