crystaltrumpet,
var mya = true, tm;
function startClock() {
clearTimeout(tm);
if (vtime == stattime) {
document.getElementById('blockwait').style.display = 'none';
document.getElementById('blocktimer').style.display = '';
}
if (vtime > 0 && mya ) {
vtime--;
document.forms['frm'].clock.value = vtime;
tm = setTimeout(startClock, 1000);
}
}
window.onfocus = function(){ mya = true; startClock()}
window.onblur = function(){ mya = false;}