// time now variants (C) vk3khb (IP)
var startday = new Date();
var clkStart = startday.getTime();
// any meta_entries?
if ((document.getElementsByTagName("meta"))==null||(document.getElementsByTagName("meta"))=="") { mx=""; } else { 
 var mx=document.getElementsByTagName("meta");
 var vx= new Array(mx.length);
 var tc=0;
  for (i=0;i<mx.length;i++) 
  {
   vx=document.getElementsByTagName("meta")[i].httpEquiv; // refresh count?
   if ((vx.toLowerCase())=="refresh") {tc=document.getElementsByTagName("meta")[i].content;} // refresh
   if (tc==NaN) {s1=tc.indexOf('"'); s2=tc.indexOf(';'); tc1=tc.slice(s1,s2); tc=tc1; } // redirect
   if (tc==NaN) {document.write(tc);}
  } 
 } // exit no metas

function tcd()
{ 
var t1=setTimeout('tcd()',1000);
  if (tc<1) { stopCount(t1); return;}
  tc=tc-1;
  tc=chkT4d(tc);
  tc=chkT3d(tc);
  tc=chkT2d(tc);
  document.getElementById('txtcd').innerHTML=tc;
 return;
}

function initStopwatch()
{ 
 var myTime = new Date(); 
 return((myTime.getTime() - clkStart)/1000); 
}

function startTime()
{
 // time on page
 var tSec = Math.round(initStopwatch()); 
 var iSec = tSec % 60;
 var iMin = Math.round((tSec-30)/60);
 var sSec ="" + ((iSec > 9) ? iSec : "0" + iSec);
 var sMin ="" + ((iMin > 9) ? iMin : "0" + iMin);
 document.getElementById('txpage').innerHTML="<abbr title='your time on this page'>"+sMin+":"+sSec+"</abbr>";
 var t=setTimeout('startTime()',1000);
 if ( sSec != 5 && sSec != 20 && sSec != 35 && sSec !=50 ) {return;
 }
 // local / UT time update 15s
 var today=new Date();
 var lh=today.getHours();
 var zh=today.getUTCHours();
 var lm=today.getMinutes();
 var zm=today.getUTCMinutes();
 // add a zero in front of numbers<10
 lh=chkT2d(lh);
 lm=chkT2d(lm);
 zh=chkT2d(zh);
 zm=chkT2d(zm);
 document.getElementById('txtime').innerHTML="<abbr title='local time'>"+lh+":"+lm+"</abbr>";
 document.getElementById('tztime').innerHTML="<abbr title='universal time'>"+zh+":"+zm+"</abbr>";
 return; 
}

function chkT4d(i){ if (i<1000) { i="0" + i; } return i; }
function chkT3d(i){ if (i<100) { i="0" + i; } return i; }
function chkT2d(i){ if (i<10) { i="0" + i; } return i; }
function stopCount(){ var t; clearTimeout(t); return; }

// js code from vk3khb.gak.net.au March2010