function counttoShow(){ var A= [], B= [], x, d, diff,cd=document.getElementById('countdown'), cdimg=document.getElementById('onair'), onair= new Date(Date.UTC(2011, 2, 18, 11)), now= new Date(); while(onair 1){ A.push( "" + d + ""); B.push( "days" ); x%= 86400000; } x= Math.floor(x/1000); if(x>= 0){ d= Math.floor(x/3600); A.push( "" + d + "" ); B.push( "hour" +(d== 1? "": "s") ); x%= 3600; } if(x>= 0){ d= Math.floor(x/60); A.push( "" + d + "" ); B.push( "minute" +(d== 1? "": "s") ); x%= 60; } if(x>= 0){ A.push( "" + x + "" ); B.push( "second" +(x== 1? "": "s") ); } cdimg.style.display='none'; //cd.value= A.join(" "); document.getElementById("numbers").innerHTML=A.join(''); document.getElementById("labels").innerHTML=B.join(''); } } window.onload=function(){ var cdtimer=setInterval(counttoShow,1000); document.body.ondblclick=function(){ if(cd.timer){ clearInterval(cdtimer); cdtimer=null; } else cdtimer=setInterval(counttoShow,1000); } }