Fix obvious browser compatibility issues, notably 'focusin' and 'focusout' lack of support in firefox