whirlpool dryer runs about 3-5 min. and shuts off

I have a whirlpool dryer that runs about 3 min. then shuts off like it locks up but afer it cools about 15 min it will start again.I dont really think its the motor.It acts more like a switch shutting it off.Can you tell me any ideas of what may cause this?