control panel joystick javascript improved