crystaltrumpet,
более ничем помочь не могу
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
</head>
<body>
<div id="blockwait">blockwait</div>
<div id="blocktimer" style="display: none">blocktimer</div>
<form name="frm" action="http://">
<input name="clock">
</form>
<script>
var mya = true, tm, vtime = 5;
function startClock() {
clearTimeout(tm);
if (!vtime) {
document.getElementById('blockwait').style.display = 'none';
document.getElementById('blocktimer').style.display = '';
}
if (vtime >= 0 && mya ) {
document.forms['frm'].clock.value = vtime;
vtime--;
tm = setTimeout(startClock, 1000);
}
}
startClock()
window.onfocus = function(){ mya = true; startClock()}
window.onblur = function(){ mya = false;}
</script>
</body>
</html>