It's probably the kill switch on the handlebar next to the throttle. It's not protected from water intrusion, so rain or simply washing the bike might cause the problems your having. I had similar symptoms when I got caught in a heavy rain, ran fine till I shut it off. The fix is to blow out the interior of the switch from underneath with compressed air or use a hair dryer as Richard230 suggested. I preferred to remove the kill switch from the handlebar, blow out the insides until you don't see anymore moisture, then give the insides a shot or two of WD40, it acts as a water dis-placer, rock the switch a few times then blow the switch out again to remove any excess WD40 and reinstall. It should run normally now, if it doesn't your going to have to dig deeper.