 var countDownInterval=60; 
    var RefreshMaxTimes=40;
    var countDownTime=countDownInterval; 
    var gimage="live/video.jpg";

    //configure width of displayed text(applicable only in NS4) 
    var c_reloadwidth=200 


function countDown(){ 
       if (countDownTime <=0){ 
             countDownTime=countDownInterval; 
             clearTimeout(counter) 
             
             if(typeof navigator.RefreshCurrTimes != 'number') 
                 navigator.RefreshCurrTimes = RefreshMaxTimes;
             
             if(navigator.RefreshCurrTimes > 0) {
                 navigator.RefreshCurrTimes--;
                 tmp = new Date();
                 tmp = "?" + tmp.getTime();
		 document["gimage0"].src=  gimage + tmp;
                 document.getElementById("countDownText").innerHTML = countDownTime;         
             } 
             else {

                 return
             }             
             countDown() 
             return 
       } 

       countDownTime--; 
       if (document.all) 
           document.all.countDownText.innerText = countDownTime+" "; 
       else if (document.getElementById) //else if NS6+ 
           document.getElementById("countDownText").innerHTML=countDownTime+" " 
       else if (document.layers){  
           document.c_reload.document.c_reload2.document.write('Next live image in <b id="countDownText">'+countDownTime+'</b>Seconds') 
           document.c_reload.document.c_reload2.document.close() 
       } 
        counter=setTimeout("countDown()", 1000); 
} 
                         
function startit(){ 
    if (document.all||document.getElementById)
          document.write('<font size="1">Next live image in <i id="countDownText">'+countDownTime+'</i>Seconds --- Click on the image to see it full size</font>') 
     countDown() 
} 
                         
if (document.all||document.getElementById) 
    startit() 
else 
    window.onload=startit

document.onmousemove = function() {
    if(typeof navigator.RefreshCurrTimes == 'number') {
        navigator.RefreshCurrTimes = RefreshMaxTimes;
    }
    return true;
} 
