function win_timeout() { if (alive==false) { window.clearInterval(idle_timer); cur_timeout_val=logout_timeout; document.getElementById('counter').innerText=cur_timeout_val; var mydiv=document.getElementById('timeout_div'); window.focus(); mydiv.style.display=''; mydiv.style.pixelTop=(document.body.clientHeight-mydiv.clientHeight)/2+document.body.scrollTop; mydiv.style.pixelLeft=(document.body.clientWidth-mydiv.clientWidth)/2-(document.body.scrollWidth-document.body.clientWidth-document.body.scrollLeft); document.getElementById('btn_work').focus(); logout_timer=window.setInterval(prepare_logout,1000); } else alive=false; } function prepare_logout() { cur_timeout_val--; document.getElementById('counter').innerText=cur_timeout_val; if (cur_timeout_val<=0) { window.clearInterval(logout_timer); self.close_opened_windows(); document.location='?a=logout'; } } function continue_work() { window.clearInterval(logout_timer); idle_timer=window.setInterval(win_timeout,interval); document.getElementById('timeout_div').style.display='none'; var ifrm=document.getElementById('hlpifrm'); ifrm.src='?a=customers/blank&v='+nowadays(); alive=false; } function update_alive() { if (window.alive!=undefined && window.alive!=null) window.alive=true; else { if (window.opener!=null && window.opener!=undefined) window.opener.update_alive(); } } function close_opened_windows(mode) { var i; for (i=0;i