added http://stackoverflow.com/questions/3479734/javascript-jquery-test-if-window-has-focus