var sessionRefreshMinutes = 5; var timerId; function newTimer() { return setTimeout("sessionNotify()",sessionRefreshMinutes*60*1000); } function sessionNotify() { if (confirm("You have been on this page of the QB for " + sessionRefreshMinutes + " minutes.\nIf you do not hit OK, the website will automatically log you out in a few minutes.\nRefreshing will keep you logged into the site. Would you like to refresh?")) { refreshSession(); } } function refreshSession() { var newwin = openWin('http://www.questionbag.com/QBAdmin/refreshSession.asp',10,10); timerId = newTimer(); } // Only start the session refresh timer if the minutes are greater than 0 if (sessionRefreshMinutes > 0) { timerId = newTimer(); }