// This file is (c) 2005-2006 qlock.com. Unauthorized copying is prohibited. (function(){var IE=document.all ? true : false;var startDate=new Date();var baseTime=startDate.getTime();var dayOfWeek=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");var local=document.location.href.substr(0,20)=="http://www.qlock.com";var dstList1=new Array([1,7,4,5,7,10],[5,7,3,5,7,10],[5,7,3,5,7,9],[5,7,3,1,7,10],[5,7,3,5,6,10],[1,0,4,1,0,10],[5,5,3,1,7,10],[1,7,4,1,7,10],[1,5,4,1,7,9],[4,5,4,4,1,9],[2,7,3,1,7,11],[5,7,10,5,7,3],[4,7,2,1,7,11],[1,7,10,3,7,3],[2,7,10,3,7,2],[2,7,10,2,7,3],[2,7,9,3,7,4],[1,7,10,5,7,2],[1,7,4,1,7,9]);var dstList2=new Array([1,7,4,5,7,10],[5,7,3,5,7,10],[5,7,3,5,7,9],[5,7,3,1,7,10],[5,7,3,5,6,10],[5,5,3,3,7,9],[1,7,4,1,7,10],[1,5,4,1,7,9],[4,5,4,4,1,9],[2,7,3,1,7,11],[5,7,10,5,7,3],[5,7,9,3,7,3],[5,7,12,3,6,3],[2,7,10,3,7,2],[2,7,10,2,7,3],[2,6,3,1,7,11],[2,7,9,3,7,4],[3,7,10,2,7,3],[1,7,10,2,7,3],[1,7,4,1,7,9]);if(!document.getElementById('qlock1')){qlocks=new Array();}function noselect(){return false;}function noevent(event){if(IE){window.event.cancelBubble=true;window.event.returnValue=false;}else{event.preventDefault();}}function getDSTDay(year, num, dow, mth){mth--;if(dow==0){adow=1;dt=new Date();}else{dow-=3;dt=new Date(year,mth,1);fdow=(dt.getUTCDay()+5)% 7;adow=(dow-fdow)+1;if(adow <=0)adow+=7;}if(num==5){dt=new Date(year,mth,(3*7)+adow);t=dt.getTime();for(var i=3;i<6;i++){dt=new Date(t);if(dt.getMonth()!=mth)break;t+=1000*60*60*24*7;}num=i;}dt.setUTCFullYear(year,mth,((num-1)*7)+adow);dt.setUTCHours(0,0,1);return dt;}function fixDigit(str){var s=new String(str);if(s.length < 2)return "0"+s;else return s;}function getTime(gmtOffset){var date=new Date();offset=gmtOffset*60*60*1000;diff=date.getTime()-startDate.getTime();date.setTime(diff+baseTime+offset);return date;}function formatTime(date){var time;var hour=date.getUTCHours();var min=fixDigit(date.getUTCMinutes());var sec=fixDigit(date.getUTCSeconds());var del=sec&1 ? ":" : ":";if(hour > 12)time=(hour-12)+del+min+" pm";else if(hour==12)time=12+del+min+" pm";else if(hour==0)time=12+del+min+" am";else time=hour+del+min+" am";return dayOfWeek[date.getUTCDay()]+" "+time;}function findChild(elem, className){if(elem.className==className)return elem;var i;for(i=0;i < elem.childNodes.length;i++){var e=findChild(elem.childNodes[i], className);if(e)return e;}return null;}function setCity(id,name){obj=document.getElementById(id);city=findChild(obj,"city");city.getElementsByTagName("P")[0].innerHTML=name;}function setTime(id,time,off,dst){obj=document.getElementById(id);l=findChild(obj,"time");l.getElementsByTagName("P")[0].innerHTML=time;if(off==0)gmt="GMT";else if(off > 0)gmt="GMT+"+off;else gmt="GMT "+off;l=findChild(obj,"gmt");l.getElementsByTagName("P")[0].innerHTML=gmt;l=findChild(obj,"dst");l.getElementsByTagName("P")[0].innerHTML=dst?"DST":"";}function updateTime(id,gmt,dstWeek1,dstDOW1,dstMonth1,dstWeek2,dstDOW2,dstMonth2){var time=getTime(gmt);dstON=false;if(dstWeek1 > 0){year=time.getFullYear();var start=getDSTDay(year,dstWeek1,dstDOW1,dstMonth1);var end=getDSTDay(year,dstWeek2,dstDOW2,dstMonth2);if(dstMonth1 > dstMonth2){if(time >=start || time < end)dstON=true;}else if(dstMonth1 < dstMonth2){if(time >=start && time < end)dstON=true;}else if(dstMonth1==dstMonth2){dstON=true;}}if(dstON){time=new Date(time.getTime()+(1000*60*60));}setTime(id,formatTime(time),gmt,dstON);}function setBGColor(id,clr){obj=document.getElementById(id);city=findChild(obj,"city");city.style.backgroundColor=clr;obj.style.borderColor=clr;}function setTextColor(id,clr){obj=document.getElementById(id);city=findChild(obj,"city");city.getElementsByTagName("P")[0].style.color=clr;}function update(){updateTime(this.id, this.gmt_offset, this.dst_week1, this.dst_dow1, this.dst_month1, this.dst_week2, this.dst_dow2, this.dst_month2);setCity(this.id,this.city_name);setBGColor(this.id,this.bg_color);setTextColor(this.id,this.text_color);}document.write('\ \ ');qlock_id='qlock'+(qlocks.length+1);if(typeof qlock_aff_id !="undefined"){document.write('\
\

city

\
\

dst

\

gmt

\

time

\
\
\ ');}else if(!local){document.write('\
\

city

\
\

dst

\

gmt

\

time

\
\
\ ');}else{document.write('\
\

city

\
\

dst

\

gmt

\

time

\
\
\ ');}function Qlock(){this.city_name=qlock_city_name;this.gmt_offset=qlock_gmt_offset;this.id=qlock_id;if(typeof qlock_dst_week1 !="undefined"){this.dst_week1=qlock_dst_week1;this.dst_dow1=qlock_dst_dow1;this.dst_month1=qlock_dst_month1;this.dst_week2=qlock_dst_week2;this.dst_dow2=qlock_dst_dow2;this.dst_month2=qlock_dst_month2;}else{if(typeof qlock_dst_index !="undefined"){if(qlock_dst_index >=0){this.dst_week1=dstList1[qlock_dst_index][0];this.dst_dow1=dstList1[qlock_dst_index][1];this.dst_month1=dstList1[qlock_dst_index][2];this.dst_week2=dstList1[qlock_dst_index][3];this.dst_dow2=dstList1[qlock_dst_index][4];this.dst_month2=dstList1[qlock_dst_index][5];qlock_dst_index=0;}}if(typeof qlock_dst_index2 !="undefined"){if(qlock_dst_index2 >=0){this.dst_week1=dstList2[qlock_dst_index2][0];this.dst_dow1=dstList2[qlock_dst_index2][1];this.dst_month1=dstList2[qlock_dst_index2][2];this.dst_week2=dstList2[qlock_dst_index2][3];this.dst_dow2=dstList2[qlock_dst_index2][4];this.dst_month2=dstList2[qlock_dst_index2][5];qlock_dst_index2=0;}}}if(typeof qlock_bg_color !="undefined")this.bg_color=qlock_bg_color;else this.bg_color="white";if(typeof qlock_text_color !="undefined")this.text_color=qlock_text_color;else this.text_color="black";this.update=update;}function updateAll(){for(i=0;i