/*By JavaScript Kit
http://javascriptkit.com
Cut & Paste Live Clock without forms
Credit MUST stay intact for use
*/

zone=0;
isitlocal=true;

function show1(){
//Hanford, WA (GMT -8)
isitlocal=false;
zone=-8;
if (!document.all&&!document.getElementById)
return
thelement=document.getElementById? document.getElementById("tick1"): document.all.tick1
var Digital=new Date()
ofst=Digital.getTimezoneOffset()/60;
var hours=(isitlocal)?Digital.getHours():(Digital.getHours() + parseInt(ofst)) + parseInt(zone);
var minutes=Digital.getMinutes()
var seconds=Digital.getSeconds()
var dn="PM"
if (hours<12)
dn="AM"
if (hours>12)
//hours=hours-12
if (hours==0)
hours=12
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
var ctime=hours+":"+minutes+":"+seconds
thelement.innerHTML="<span class='time'>"+ctime+"</span><br /><span class='location'>WA, USA</span>"
setTimeout("show1()",1000)
}

function show2(){
//Las Vegas, NV (GMT -8)
isitlocal=false;
zone=-8;
if (!document.all&&!document.getElementById)
return
thelement=document.getElementById? document.getElementById("tick2"): document.all.tick2
var Digital=new Date()
ofst=Digital.getTimezoneOffset()/60;
var hours=(isitlocal)?Digital.getHours():(Digital.getHours() + parseInt(ofst)) + parseInt(zone);
var minutes=Digital.getMinutes()
var seconds=Digital.getSeconds()
var dn="PM"
if (hours<12)
dn="AM"
if (hours>12)
//hours=hours-12
if (hours==0)
hours=12
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
var ctime=hours+":"+minutes+":"+seconds
thelement.innerHTML="<span class='time'>"+ctime+"</span><br /><span class='location'>NV, USA</span>"
setTimeout("show2()",1000)
}

function show3(){
//Idaho Falls, ID (GMT -7)
isitlocal=false;
zone=-7;
if (!document.all&&!document.getElementById)
return
thelement=document.getElementById? document.getElementById("tick3"): document.all.tick3
var Digital=new Date()
ofst=Digital.getTimezoneOffset()/60;
var hours=(isitlocal)?Digital.getHours():(Digital.getHours() + parseInt(ofst)) + parseInt(zone);
var minutes=Digital.getMinutes()
var seconds=Digital.getSeconds()
var dn="PM"
if (hours<12)
dn="AM"
if (hours>12)
//hours=hours-12
if (hours==0)
hours=12
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
var ctime=hours+":"+minutes+":"+seconds
thelement.innerHTML="<span class='time'>"+ctime+"</span><br /><span class='location'>ID, USA</span>"
setTimeout("show3()",1000)
}

function show4(){
//PSI HQ (GMT -5)
isitlocal=false;
zone=-5;
if (!document.all&&!document.getElementById)
return
thelement=document.getElementById? document.getElementById("tick4"): document.all.tick4
var Digital=new Date()
ofst=Digital.getTimezoneOffset()/60;
var hours=(isitlocal)?Digital.getHours():(Digital.getHours() + parseInt(ofst)) + parseInt(zone);
var minutes=Digital.getMinutes()
var seconds=Digital.getSeconds()
var dn="PM"
if (hours<12)
dn="AM"
if (hours>12)
//hours=hours-12
if (hours==0)
hours=12
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
var ctime=hours+":"+minutes+":"+seconds
thelement.innerHTML="<span class='time'>"+ctime+"</span><br /><span class='location'>PSI HQ</span>"
setTimeout("show4()",1000)
}

function show5(){
//Savannah River, SC (GMT -5)
isitlocal=false;
zone=-5;
if (!document.all&&!document.getElementById)
return
thelement=document.getElementById? document.getElementById("tick5"): document.all.tick5
var Digital=new Date()
ofst=Digital.getTimezoneOffset()/60;
var hours=(isitlocal)?Digital.getHours():(Digital.getHours() + parseInt(ofst)) + parseInt(zone);
var minutes=Digital.getMinutes()
var seconds=Digital.getSeconds()
var dn="PM"
if (hours<12)
dn="AM"
if (hours>12)
//hours=hours-12
if (hours==0)
hours=12
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
var ctime=hours+":"+minutes+":"+seconds
thelement.innerHTML="<span class='time'>"+ctime+"</span><br /><span class='location'>SC, USA</span>"
setTimeout("show5()",1000)
}

function show6(){
//DR Congo (GMT +2)
isitlocal=false;
zone=2;
if (!document.all&&!document.getElementById)
return
thelement=document.getElementById? document.getElementById("tick6"): document.all.tick6
var Digital=new Date()
ofst=Digital.getTimezoneOffset()/60;
var hours=(isitlocal)?Digital.getHours():(Digital.getHours() + parseInt(ofst)) + parseInt(zone);
var minutes=Digital.getMinutes()
var seconds=Digital.getSeconds()
var dn="PM"
if (hours<12)
dn="AM"
if (hours>12)
//hours=hours-12
if (hours==0)
hours=12
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
var ctime=hours+":"+minutes+":"+seconds
thelement.innerHTML="<span class='time'>"+ctime+"</span><br /><span class='location'>DR Congo</span>"
setTimeout("show6()",1000)
}

function show7(){
//Baghdad, Iraq (GMT +3)
isitlocal=false;
zone=3;
if (!document.all&&!document.getElementById)
return
thelement=document.getElementById? document.getElementById("tick7"): document.all.tick7
var Digital=new Date()
ofst=Digital.getTimezoneOffset()/60;
var hours=(isitlocal)?Digital.getHours():(Digital.getHours() + parseInt(ofst)) + parseInt(zone);
var minutes=Digital.getMinutes()
var seconds=Digital.getSeconds()
var dn="PM"
if (hours<12)
dn="AM"
if (hours>12)
//hours=hours-12
if (hours==0)
hours=12
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
var ctime=hours+":"+minutes+":"+seconds
thelement.innerHTML="<span class='time'>"+ctime+"</span><br /><span class='location'>Baghdad</span>"
setTimeout("show7()",1000)
}

function show8(){
//Kabul, Afg (GMT +4.5)
isitlocal=false;
zone=4.5;
zpart=60*(zone - parseInt(zone));
if (!document.all&&!document.getElementById)
return
thelement=document.getElementById? document.getElementById("tick8"): document.all.tick8
var Digital=new Date()
ofst=Digital.getTimezoneOffset()/60;
var hours=(isitlocal)?Digital.getHours():(Digital.getHours() + parseInt(ofst)) + parseInt(zone);
var minutes=Digital.getMinutes()+zpart;
var seconds=Digital.getSeconds()
var dn="PM"
if (hours < 12)
dn="AM"
if (minutes > 59)
hours=hours+1
if (minutes > 59)
minutes=minutes - 60;
if (hours < 0) 
hours+=24;
if (hours > 23) 
hours-=24;
if (hours <= 9) 
hours="0"+hours;
if (minutes <= 9)
minutes="0"+minutes
if (seconds <= 9)
seconds="0"+seconds
var ctime=hours+":"+minutes+":"+seconds
thelement.innerHTML="<span class='time'>"+ctime+"</span><br /><span class='location'>Kabul</span>"
setTimeout("show8()",1000)
}

function ticktock(tickid,zone,loc){
//tickid - tick8 etc
//zone - gmt offset
//loc - name to display
tickid = tickid
zone = zone
loc = loc
isitlocal=false;
zpart=60*(zone - parseInt(zone));
if (!document.all&&!document.getElementById)
return
thelement=document.getElementById? document.getElementById(tickid): document.all.tickid
var Digital=new Date()
ofst=Digital.getTimezoneOffset()/60;
var hours=(isitlocal)?Digital.getHours():(Digital.getHours() + parseInt(ofst)) + parseInt(zone);
var minutes=Digital.getMinutes()+zpart;
var seconds=Digital.getSeconds()
var dn="PM"
if (hours < 12)
dn="AM"
if (minutes > 59)
hours=hours+1
if (minutes > 59)
minutes=minutes - 60;
if (hours < 0) 
hours+=24;
if (hours > 23) 
hours-=24;
if (hours <= 9) 
hours="0"+hours
if (minutes <= 9)
minutes="0"+minutes
if (seconds <= 9)
seconds="0"+seconds
var ctime=hours+":"+minutes+":"+seconds
debugstring=""
//uncomment line below to debug times
//debugstring=" hr: "+Digital.getHours()+" ofst: "+ofst+" zone: "+zone
thelement.innerHTML="<span class='time'>"+ctime+debugstring+"</span><br /><span class='location'>"+loc+"</span>"
setTimeout("ticktock('"+tickid+"',"+zone+",'"+loc+"')",1000)
}


function initclocks(){
	ticktock("tick1","-8","Hanford, WA");
	ticktock("tick2","-7","Albuquerque, NM");
	ticktock("tick3","-6","Pantex,<br />TX");
	ticktock("tick4","-5","<strong>PSI HQ</strong><br /><span style='font-size:9px;'>Arlington, VA</span>");
	ticktock("tick5","-5","Savannah River, SC");
	ticktock("tick6","-5","Oak Ridge, TN");
	ticktock("tick7","-4","Dominican Republic");
	ticktock("tick8","2","DR Congo, Africa");
	ticktock("tick9","3","Baghdad, Iraq");
}
window.onload=initclocks
