function vibrate(duration) {
        if (IS_MOBILE && window.navigator.vibrate) {
            window.navigator.vibrate(duration);
        }
    }
Vibrate on mobile devices.
@param {number} duration Duration of the vibration in milliseconds.