Javascript syntax fixes
Set control menu direction based on window width