// For IE8 and earlier version. // http://afuchs.tumblr.com/post/23550124774/date-now-in-ie8 Date.now = Date.now || function() { return +new Date; }; jQuery(function () { if (!JSINFO.autologoff) return; var autologofftimer = window.setTimeout(autologoff_check, (JSINFO.autologoff - 1) * 60 * 1000); var autologoffrefresh = Date.now(); jQuery('body').keypress(function(){ if((Date.now() - autologoffrefresh) < 60*1000) return; autologoffrefresh = Date.now(); autologoff_refresh(); }); function autologoff_check() { jQuery.post(DOKU_BASE + 'lib/exe/ajax.php', {call: 'autologoff'}, function (timeremains) { if (timeremains <= 0) { // remove any onunload handlers window.onbeforeunload = function(){}; window.onunload = function(){}; // log off window.location.reload(); } else { timeremains -= 65; if (timeremains <= 0) { var $dialog = jQuery('