how to wire new motor

need HELP ! bought at appliance pro . new whirlpool motor to replace maytag dryer motor need to know how to wire it motor W10410999 it has 5 wires a red, a blue, a black, a gray, a double yellow wire . wired according to appliance pro rep. agent and nothing works old motor worked but kept stopping and smoking after 5 minutes of operation