﻿var offdate = new Date() 
var localOffset = offdate.getTimezoneOffset();
var boxlocalOffset = 0; 
var boxopenedflag = false; ﻿
var agt=navigator.userAgent.toLowerCase();
var is_major = parseInt(navigator.appVersion);
var is_minor = parseFloat(navigator.appVersion);
var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
var is_ie3    = (is_ie && (is_major < 4));
var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );
var is_ie5    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
var is_ie5_5up =(is_ie && !is_ie3 && !is_ie4 && !is_ie5); ﻿
var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1));
var is_nav4 = (is_nav && (is_major == 4)); 
var is_nav6 = (is_nav && (is_major == 5));
var is_gecko = (agt.indexOf('gecko') != -1);
var is_opera = (agt.indexOf("opera") != -1);
var is_opera5up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4);
var workon = is_ie5 || is_ie5_5up || is_gecko;
var PNGsupport = 'none';
if (is_ie5_5up) PNGsupport = 'filter';
if (is_gecko) PNGsupport = 'full';

function getObjStyle(DivID) {
   obj = document.layers ? document.layers[DivID] :
   document.getElementById ?  document.getElementById(DivID).style : document.all[DivID].style;
   return obj;
}
function getObj(DivID) {
   obj = document.layers ? document.layers[DivID] : document.getElementById ? document.getElementById(DivID) : document.all[DivID];
   return obj;
}
function toggleDiv(DivID, iState) {
obj = getObjStyle(DivID);
obj.visibility = iState ? "visible" : "hidden";
}
function findPosY(id) {
obj = document.getElementById(id);
var curtop = 0;
while (obj.offsetParent) { curtop += obj.offsetTop; obj = obj.offsetParent; }
return curtop;
}
function findPosX(id) {
obj = document.getElementById(id);
var curtop = 0;
while (obj.offsetParent) { curtop += obj.offsetLeft; obj = obj.offsetParent;}
return curtop;
}
function Map(width, height, zeroX, zeroY) {
this.layoutImageSrc = imgTimemapPath + '/layout.jpg';
this.zeroX = zeroX;
this.zeroY = zeroY;
this.lightImageSrc = imgTimemapPath + '/strip.gif';
this.delta = 1;
this.lightOpacity = 30;
this.width = width;
this.height = height;
this.coordX = 0;
this.coordY = 0;
this.drawLayout = function() {
document.write('<div id="layout" style="position: absolute; z-index: 1; visibility: hidden;"><img src="'+this.layoutImageSrc+'" width="'+this.width+'" height="'+this.height+'" border="0"></div>');
var style = getObjStyle('layout');
style.width = this.width;
style.height = this.height;
style.top = this.coordY + 'px';
style.left = this.coordX + 'px';
style.clip = 'rect(0px '+this.width+'px '+this.height+'px 0px)';
}
this.drawLight = function() {
document.write('<div id="light" style="position: absolute; z-index: 2; visibility: hidden; filter: alpha(opacity='+this.lightOpacity+'); -moz-opacity:'+(this.lightOpacity/100)+' !important; opacity:'+(this.lightOpacity/100)+' !important;">');
var style = getObjStyle('light');
style.width = this.width;
style.height = this.height;
style.top = this.coordY + 'px';
style.left = this.coordX + 'px';
style.clip = 'rect(0px '+this.width+'px '+this.height+'px 0px)';

var i = 0;
var loop = 1 + Math.round(this.width/this.delta);
while (i < loop) {
var alpha = 2*i*Math.PI/loop;
var shiftY = Math.round(this.height*(getShift(alpha)-1));
document.write('<img style="position: absolute; left: '+i*this.delta+'px; top: '+shiftY+'px; width: '+this.delta+'px; height: '+3*this.height+'px;" src="'+this.lightImageSrc+'" >');
i++;
}
document.write('</div>');
}
this.setX = function(newX) {
this.coordX = newX;
getObjStyle('layout').left = newX + 'px';
getObjStyle('light').left = newX + 'px';
}
this.setY = function(newY) {
this.coordY = newY;
getObjStyle('layout').top = newY + 'px';
getObjStyle('light').top = newY + 'px';
}
this.setVisible = function() {
toggleDiv('layout', true);
toggleDiv('light', true);
}

}
var timezoneOffset = 0;
var timezonesTimer = null;
function MouseLocate(e) {
if( !e ) { e = window.event; } if( !e || ( typeof( e.pageX ) != 'number' && typeof( e.clientX ) != 'number' ) ) { return 0; }
if( typeof( e.pageX ) == 'number' ) { var tempX = e.pageX;} else {
var tempX = e.clientX;
if( document.documentElement && document.documentElement.scrollTop ) tempX += document.documentElement.scrollLeft;
else if( document.body && document.body.scrollTop ) tempX += document.body.scrollLeft;
}
timezoneOffset = getTimezone(TimeMap, tempX);
return true;
}
function getTimezone(mapObj, xcoord) {
var zonewidth = mapObj.width / 24;
var zeropoint = mapObj.zeroX;
var zoneshift = Math.floor((xcoord - mapObj.coordX - zeropoint + (zonewidth/2))/zonewidth)*60;
if (zoneshift <= -720) zoneshift += 1440;
return zoneshift;
}
function StartTimezones() {
CreateDate4(); timezonesTimer = setInterval("CreateDate4()",1000);
toggleDiv('zone-container', true);
toggleDiv('zone-container-text', true);
}
function StopTimezones() {
getObj('zone-container-text').innerHTML='&nbsp;';
clearInterval(timezonesTimer);
toggleDiv('zone-container', false);
toggleDiv('zone-container-text', false);
}
function CreateDate4() {
d = new Date();
var captionstring = 'Approximately';
if (!boxopenedflag) offset = timezoneOffset;
else { offset = boxlocalOffset; captionstring = 'Precisely'; }
Time24H = new Date();
Time24H.setTime(d.getTime() + (offset + localOffset)*60000);

var day=Time24H.getDay();
var month=Time24H.getMonth();
var daym=Time24H.getDate();
if (daym<10) daym="0"+daym;
var hours=Time24H.getHours();
var minutes=Time24H.getMinutes();
var seconds=Time24H.getSeconds();
if (minutes<=9) minutes="0"+minutes;
if (seconds<=9) seconds="0"+seconds;
var cdate=captionstring+": <b>"+hours+":"+minutes+"</b>:"+seconds+", "+dayarray[day]+", "+montharray[month]+" "+daym;
document.getElementById('zone-container-text').innerHTML=cdate;
}
function Box(id, nameString, TimeOffset, Latitude, Longitude) {
this.id = id;
this.timerId;
this.dayState = 'day';
this.nameString = nameString;
this.TimeOffset = TimeOffset;
this.TimeCorrectionFunction = '';
this.AncorImageDayGIFSrc = imgTimemapPath + '/ancor_day.gif';
this.AncorImageNightGIFSrc = imgTimemapPath + '/ancor_night.gif';
this.AncorImageDayPNGSrc = imgTimemapPath + '/ancor_day0.png';
this.AncorImageNightPNGSrc = imgTimemapPath + '/ancor_night0.png';
this.AncorImageWidth = 8;
this.AncorImageHeight = 8;
this.IconImageDayGIFSrc = imgTimemapPath + '/icon_day.gif';
this.IconImageNightGIFSrc = imgTimemapPath + '/icon_night.gif';
this.IconImageWidth = 24;
this.IconImageHeight = 24;
this.BoxImagePNGSrc = imgTimemapPath + '/box0.png';
this.BoxImageGIFSrc = imgTimemapPath + '/box.gif';
this.width = 170;
this.height = 60;
this.Latitude = Latitude;
this.Longitude = Longitude;
this.ancorX = 0;
this.ancorY = 0;
this.boundX = 100;
this.boundY = 100;
this.boundWidth = 400;
this.boundHeight = 250;
this.ConvertCoords = function(mapObj) {
var xxx = mapObj.zeroX + (this.Longitude*mapObj.width)/360;
if (xxx > mapObj.width) xxx = xxx - mapObj.width;
this.ancorX = Math.round(xxx);
var xxx = mapObj.zeroY - (this.Latitude*mapObj.height)/180;
this.ancorY = Math.round(xxx);
}

this.drawBox = function() {
var leftposition = false;
if (this.ancorX >= (this.IconImageWidth/2+this.width)) leftposition = true;
var topposition = false;
if (this.ancorY >= (this.IconImageHeight/2+this.height)) topposition = true;
var posX = 0;
var posY = 0;
switch(leftposition) {
case true: posX = this.ancorX - this.AncorImageWidth/2 - this.width; break 
case false: posX = this.ancorX + this.AncorImageWidth/2; break
}
switch(topposition) {
case true: posY = this.ancorY - this.AncorImageHeight/2 - this.height; break 
case false: posY = this.ancorY + this.AncorImageHeight/2; break
}
var AncorposX = this.ancorX - this.AncorImageWidth/2;
var AncorposY = this.ancorY - this.AncorImageHeight/2;
document.write('<a href="javascript:" onmouseover="Boxes['+id+'].showBox()" onmouseout="Boxes['+id+'].hideBox()">');
switch(this.dayState) {
case 'day' : paintDiv('ancor'+this.id, this.AncorImageDayGIFSrc, this.AncorImageDayPNGSrc, AncorposX, AncorposY, this.AncorImageWidth, this.AncorImageHeight, 4); break 
case 'night': paintDiv('ancor'+this.id, this.AncorImageNightGIFSrc, this.AncorImageNightPNGSrc, AncorposX, AncorposY, this.AncorImageWidth, this.AncorImageHeight, 4); break
}
document.write('</a>');
paintDiv('box'+this.id, this.BoxImageGIFSrc, this.BoxImagePNGSrc, posX, posY, this.width, this.height, 5);
getObjStyle('box'+this.id).visibility = 'hidden';
switch(this.dayState) {
case 'day' :paintDivContent('boxcontent'+this.id, this.IconImageDayGIFSrc, this.IconImageWidth, this.IconImageHeight, this.nameString, posX, posY, this.width, this.height, 5); break
case 'night' :paintDivContent('boxcontent'+this.id, this.IconImageNightGIFSrc, this.IconImageWidth, this.IconImageHeight, this.nameString, posX, posY, this.width, this.height, 5); break
}

getObjStyle('boxcontent'+this.id).visibility = 'hidden';


} 
this.showBox = function() {
getObjStyle('box'+this.id).visibility = 'visible';
getObjStyle('boxcontent'+this.id).visibility = 'visible';
boxlocalOffset = Boxes[this.id].TimeOffset;
CreateDate(Boxes[this.id].TimeOffset, this.id);
this.timerId = setInterval("CreateDate(Boxes["+this.id+"].TimeOffset, "+this.id+")",1000);
boxopenedflag = true;
}
this.hideBox = function() {
setTimeout("getObjStyle('box'+"+this.id+").visibility = 'hidden'", 100);
setTimeout("getObjStyle('boxcontent'+"+this.id+").visibility = 'hidden'", 100);
clearInterval( this.timerId );
boxopenedflag = false;
}
}
function paintDiv(id, GIFsrc, PNGsrc, x, y, width, height, z) {
switch(PNGsupport) {
case 'full' : document.write('<div id="'+id+'" style="position:absolute; height:'+height+'px; width:'+width+'px; top:'+y+'px; left:'+x+'px; z-index: '+z+';"><img src="'+PNGsrc+'" width="'+width+'" height="'+height+'" border="0"></div>'); break 
case 'filter': document.write('<div id="'+id+'" style="position:absolute; height:'+height+'px; width:'+width+'px; top:'+y+'px; left:'+x+'px; z-index: '+z+';filter:progid:DXImageTransform.Microsoft.AlphaImageLoader (src=\''+PNGsrc+'\',sizingMethod=\'scale\');"><img src=' + imgTimemapPath +'"/spacer.gif" width="1" height="1"></div>'); break
case 'none': document.write('<div id="'+id+'" style="position:absolute; height:'+height+'px; width:'+width+'px; top:'+y+'px; left:'+x+'px; z-index: '+z+';"><img src="'+GIFsrc+'" width="'+width+'" height="'+height+'" border="0"></div>'); break
}
}
function paintDivContent(id, iconsrc, iconWidth, iconHeight, text, x, y, width, height, z) {
document.write('<div id="'+id+'" style="position:absolute; height:'+height+'px; width:'+width+'px; top:'+y+'px; left:'+x+'px; z-index: '+z+';"><table cellspacing="0" cellpadding="0" border="0" width="170" height="40"><tr><td align="center" valign="middle" height="55" class="timemap-boxtext">'+text+'<br><span id="'+id+'-time" class="timemap-time"></span></td></tr></table></div>')
;
}
var present = new Date();
var UTime = present.getUTCHours() + (present.getUTCMinutes()/60) + (present.getUTCSeconds()/3600);
var presentY = present.getFullYear();
var presentM = present.getMonth()+1;
var presentD = present.getDate();
var JD = JulianDay(presentD, presentM, presentY, UTime);

function JulianDay(date, month, year, UT) {
if (month<=2) {month=month+12; year=year-1;}
return Math.floor(365.25*year) + Math.floor(30.6001*(month+1)) - 15 + 1720996.5 + date + UT/24.0;
}

var SunLongitude;
function getSunLongitude() {
var T = (JD - 2451545.0 ) / 36525;
var k = 2*Math.PI/360; 
var M = 357.52910 + 35999.05030*T - 0.0001559*T*T - 0.00000048*T*T*T;
var L0 = 280.46645 + 36000.76983*T + 0.0003032*T*T;
var DL = (1.914600 - 0.004817*T - 0.000014*T*T)*Math.sin(k*M) + (0.019993 - 0.000101*T)*Math.sin(k*2*M) + 0.000290*Math.sin(k*3*M); 
var L = L0 + DL;

L = ((L/360) - Math.floor(L/360))*360;
SunLongitude = L;
var maximum = 23.43999*Math.PI/180;
var beta = L*Math.PI/180;
var y = 90 - (180/Math.PI)*Math.acos( Math.sin(maximum)*Math.sin(beta));

return y;
}

var FormFactor = getSunLongitude();
function getSunShift() {
var L = SunLongitude;

var k = 2*Math.PI/360;
var eps = 23.43999;
var X = Math.cos(k*L);
var Y = Math.cos(k*eps)*Math.sin(k*L);
var Z = Math.sin(k*eps)*Math.sin(k*L);
var R = Math.sqrt(1.0-Z*Z); 
var RA = (24/Math.PI)*Math.atan(Y/(X+R));
var T = (JD - 2451545.0 ) / 36525;
var theta0 = 280.46061837 + 360.98564736629*(JD-2451545.0) + 0.000387933*T*T - T*T*T/38710000.0;
theta0 = ((theta0/360) - Math.floor(theta0/360))*360 - L;
theta0 = theta0*Math.PI/180;
return theta0;
}
var SunShift = getSunShift();
function getShift(angle) {

var pi = Math.PI;
var mapshift = (TimeMap.width/2 - TimeMap.zeroX)*2*pi/TimeMap.width //
var formfactorshift = 0;
if (FormFactor<0) formfactorshift = pi;
var beta = angle + mapshift + formfactorshift + SunShift;
var alpha = FormFactor *pi/180;
var betacos = Math.cos(beta);
var betasin = Math.sin(beta);
var betacos2 = betacos*betacos;
var alphacos = Math.cos(alpha);
var alphasin = Math.sin(alpha);
var alphasin2 = alphasin*alphasin;
var z2 = betacos2/( (1-betacos2)*alphasin2 + betacos2 );
var z = Math.sqrt(z2);
if (betacos < 0) z = -z;
var gammacos = alphacos*z;
var gamma = Math.acos(gammacos);
var d = gamma/pi;
if (alpha < 0) d=d-1;
return d;
}
var Boxes = new Array;
Boxes[0]  = new Box(0,'Taipei, Taiwan',480,25.04,121.64);
Boxes[1]  = new Box(1,'Berlin, Germany',60+DTS(60,1),52.5,13.4);
Boxes[2]  = new Box(2,'London, England',0+DTS(0,1),51.5,0);
Boxes[3]  = new Box(3,'Saint-Peterburg, Russia',180+DTS(180,1),60,30.5);
Boxes[4]  = new Box(4,'Los Angeles, USA',-480+DTS(-480,2),34.08,-118.37);
Boxes[5]  = new Box(5,'Delhi, India',330,28.7,77.25);
Boxes[6]  = new Box(6,'Moscow, Russia',180+DTS(180,1),55.75,37.6);
Boxes[7]  = new Box(7,'Novosibirsk, Russia',360+DTS(360,1),55,83);
Boxes[8]  = new Box(8,'Yerevan, Armenia',240+DTS(240,1),40.15,44.5);
Boxes[9]  = new Box(9,'Paris, France',60+DTS(60,1),48.87,2.33);
Boxes[10] = new Box(10,'Tokyo, Japan',540,35.6,139.7);
Boxes[11] = new Box(11,'Boston, USA',-300+DTS(-300,2),42.32,-71,08);
Boxes[12] = new Box(12,'Toronto, Canada',-300,43.6,-79.3);
Boxes[13] = new Box(13,'Tel Aviv, Israel',120+DTS(120,1),32,34.5);
Boxes[14] = new Box(14,'Sydney, Australia',600,-34,151.3);
Boxes[15] = new Box(15,'Stockholm, Sweden',60+DTS(60,1),59.4,18);
Boxes[16] = new Box(16,'San Francisco, USA',-480+DTS(-480,2),37.75,-122.5);
Boxes[17] = new Box(17,'Madrid, Spain',60+DTS(60,1),40.5,3.75);
Boxes[18] = new Box(18,'Kuwait City, Kuwait',180,29.4,48);
Boxes[19] = new Box(19,'Johannesburg',120,-26.1,27.9);
Boxes[20] = new Box(20,'Houston, USA',-360+DTS(-360,2),29.75,-95.4);
Boxes[21] = new Box(21,'Hong Kong, China',480,21.75,115);
Boxes[22] = new Box(22,'Seoul, South Korea',540,37.58,127.04);
Boxes[23] = new Box(23,'Athens, Greece',120+DTS(120,1),38,23.75);
Boxes[24] = new Box(24,'Beijing, China',480,39.92,116.39);
Boxes[25] = new Box(25,'Rio de Janeiro, Brazil',-180+DTS(-180,3),-22.5,-42.75);
Boxes[26] = new Box(26,'Mexico City, Mexico',-360+DTS(-360,2),19.5,-99.15);
Boxes[27] = new Box(27,'Almaty, Kazakhstan',360+DTS(360,1),43.3,76.9);
Boxes[28] = new Box(28,'Atlanta, USA',-300+DTS(-300,2),33.75,-84.45);
Boxes[29] = new Box(29,'Kuala Lumpur, Malaysia',480,3.1,101.75);
Boxes[30] = new Box(30,'Oslo, Norway',60+DTS(60,1),60,10.7);
Boxes[31] = new Box(31,'Detroit, USA',-300+DTS(-300,2),42.38,-83,08);
Boxes[32] = new Box(32,'New York, USA',-300+DTS(-300,2),40.75,-74);
Boxes[33] = new Box(33,'Denver, USA',-420+DTS(-420,2),39.72,-105);
Boxes[34] = new Box(34,'Minneapolis, USA',-360+DTS(-360,2),45,-93.25);
Boxes[35] = new Box(35,'Rome, Italy',60+DTS(60,1),42.87,12.62);
Boxes[7].AncorImageDayPNGSrc = imgTimemapPath +'/ancor_day_nsk0.png';
Boxes[7].AncorImageDayGIFSrc = imgTimemapPath +'/ancor_day_nsk.gif';
function DTS(off, type) {
d = new Date();
Time24H = new Date();
Time24Halt = new Date();
Time24Halt2 = new Date();
Time24H.setTime(d.getTime() + (off + localOffset)*60000);
Time24Halt.setTime(d.getTime() + (off + localOffset)*60000 + 60000*60*24*7);
Time24Halt2.setTime(d.getTime() + (off + localOffset)*60000 - 60000*60*24*7);
var day=Time24H.getDay();
var month=Time24H.getMonth() + 1;
var monthalt=Time24Halt.getMonth() + 1;
var monthalt2=Time24Halt2.getMonth() + 1;
var daym=Time24H.getDate();
var hours=Time24H.getHours();
var minutes=Time24H.getMinutes();
var seconds=Time24H.getSeconds();
var firstday = false; if ((day < 7) && (monthalt2 < month)) firstday = true;
var firstsunday = false; if ((day == 7) && (monthalt2 < month)) firstsunday = true;
var lastday = false; if ((day < 7) && (monthalt > month)) lastday = true;
var lastsunday = false; if ((day == 7) && (monthalt > month)) lastsunday = true;
if (type == 1) {
if ((month<3) || (month>10)) return 0;
if ((month>3) && (month<10)) return 60;
if ((month == 3) && lastday) return 60;
if ((month == 3) && lastsunday && (hours < 2)) return 0;
if ((month == 3) && lastsunday && (hours > 1)) return 60;
if ((month == 10) && lastday) return 0;
if ((month == 10) && lastsunday && (hours < 2)) return 60;
if ((month == 10) && lastsunday && (hours > 1)) return 0;
}
if (type == 2) {
if ((month<4) || (month>10)) return 0;
if ((month>4) && (month<10)) return 60;
if ((month == 4) && !firstday) return 60;
if ((month == 4) && firstsunday && (hours < 2)) return 0;
if ((month == 4) && firstsunday && (hours > 1)) return 60;
if ((month == 10) && lastday) return 0;
if ((month == 10) && firstsunday && (hours < 1)) return 60;
if ((month == 10) && firstsunday && (hours > 0)) return 0;
}
if (type == 3) {
if ((month>2) && (month<10)) return 0;
if ((month<2) || (month>10)) return 60;
if ((month == 2) && (daym < 15)) return 60;
if ((month == 2) && (daym > 14)) return 0;
if ((month == 10) && (daym < 15)) return 0;
if ((month == 10) && (daym > 14)) return 60;
}
else return 0;

}
function GetDayState(off) {
d = new Date();
Time24H = new Date();
Time24H.setTime(d.getTime() + (off + localOffset)*60000);
var day=Time24H.getDay();
var month=Time24H.getMonth() + 1;
var daym=Time24H.getDate();
var hours=Time24H.getHours();
if ((day == 6) || (day == 7)) return 'night';
if ((hours<9) || (hours>18)) return 'night';
else return 'day';
}
var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
function CreateDate(off, num) {
d = new Date();
Time24H = new Date();
Time24H.setTime(d.getTime() + (off + localOffset)*60000);

var day=Time24H.getDay();
var month=Time24H.getMonth();
var daym=Time24H.getDate();
if (daym<10) daym="0"+daym;
var hours=Time24H.getHours();
var minutes=Time24H.getMinutes();
var seconds=Time24H.getSeconds();
if (minutes<=9) minutes="0"+minutes;
if (seconds<=9) seconds="0"+seconds;

var cdate=dayarray[day]+", "+montharray[month]+" "+daym+"<br><b>"+hours+":"+minutes+"</b>:"+seconds;
document.getElementById("boxcontent"+num+"-time").innerHTML=cdate;
}
function CreateDate2(off, num) {
d = new Date();
Time24H = new Date();
Time24H.setTime(d.getTime() + (off + localOffset)*60000);

var day=Time24H.getDay();
var month=Time24H.getMonth();
var daym=Time24H.getDate();
if (daym<10) daym="0"+daym;
var hours=Time24H.getHours();
var minutes=Time24H.getMinutes();
var seconds=Time24H.getSeconds();
if (minutes<=9) minutes="0"+minutes;
if (seconds<=9) seconds="0"+seconds;

var cdate="<b>"+hours+":"+minutes+"</b>:"+seconds+", "+dayarray[day]+", "+montharray[month]+" "+daym;
document.getElementById("static"+num+"-time").innerHTML=cdate;
}
function CreateDate3(num) {
Time24H = new Date();
var day=Time24H.getDay();
var month=Time24H.getMonth();
var daym=Time24H.getDate();
if (daym<10) daym="0"+daym;
var hours=Time24H.getHours();
var minutes=Time24H.getMinutes();
var seconds=Time24H.getSeconds();
if (minutes<=9) minutes="0"+minutes;
if (seconds<=9) seconds="0"+seconds;

var cdate="<b>"+hours+":"+minutes+"</b>:"+seconds+", "+dayarray[day]+", "+montharray[month]+" "+daym;
document.getElementById("static"+num+"-time").innerHTML=cdate;
}
function StartClocks(){

offset = 360 + DTS(360,1);CreateDate2(offset, 1); setInterval("CreateDate2("+offset+", 1)",1000);
CreateDate3(0); setInterval("CreateDate3(0)",1000);
}
var TimeMap = new Map(400, 250, 187, 125);
function timemapPose() {
markerX = findPosX('marker') + 3;
markerY = findPosY('marker') + 2;
TimeMap.setY(markerY);
TimeMap.setX(markerX);
getObjStyle('boxes-container').top = markerY + 'px';
getObjStyle('boxes-container').left = markerX + 'px';
TimeMap.setVisible();
toggleDiv('boxes-container', true);
}
function timemapInit() {
StartClocks();
timemapPose();
}
if (workon) {
window.onload = timemapInit;
window.onresize = timemapPose;
}
var html = '';
html +='<style>';
html +='.timemap-boxtext {font-family: Verdana;font-size: 11px;color: #00186F;}';
html +='.timemap-time {font-family: Verdana;font-size: 11px;color: #000000;}';
html +='.subtimemap-boxtext {font-family: Verdana;font-size: 11px;color: #FFFFFF;}';
html +='.subtimemap-time {font-family: Verdana;font-size: 11px;color: #00186F;}';
html +='</style>';
html +='<table width="412" height="328" background='+ imgTimemapPath +'/box_bg.jpg" cellpadding="0" cellspacing="0" border="0">';
html +='<tr><td colspan="6"><img src="'+ imgTimemapPath +'/spacer.gif" width="412" height="3"></td></tr>';
html +='<tr>';
html +='<td><img src="'+ imgTimemapPath +'/spacer.gif" width="3" height="1"></td>';
html +='<td bgcolor="#002C7B" colspan="4"><img src="'+imgTimemapPath +'/spacer.gif" width="1" height="1"></td>';
html +='<td><img src="'+imgTimemapPath +'/spacer.gif" width="3" height="1"></td>';
html +='</tr>';
html +='<tr>';
html +='<td><img src="'+imgTimemapPath +'/spacer.gif" width="3" height="1"></td>';
html +='<td bgcolor="#002C7B" valign="top"><div id="marker" style="width: 1px; height: 1px;"><img src="'+imgTimemapPath +'/spacer.gif" width="1" height="1"></div></td>';
html +='<td bgcolor="#FFFFFF"><img src="'+imgTimemapPath +'/spacer.gif" width="224" height="254"></td>';
html +='<td bgcolor="#FFFFFF"><img src="'+imgTimemapPath +'/spacer.gif" width="180" height="254"></td>';
html +='<td bgcolor="#002C7B"><img src="'+imgTimemapPath +'/spacer.gif" width="1" height="1"></td>';
html +='<td><img src="'+imgTimemapPath +'/spacer.gif" width="3" height="1"></td>';
html +='</tr>';
html +='<tr>';
html +='<td><img src="'+imgTimemapPath +'/spacer.gif" width="3" height="1"></td>';
html +='<td bgcolor="#002C7B" colspan="4"><img src="'+imgTimemapPath +'/spacer.gif" width="1" height="1"></td>';
html +='<td><img src="'+imgTimemapPath +'/spacer.gif" width="3" height="1"></td>';
html +='</tr>';
html +='<tr><td height="32" background="'+imgTimemapPath +'/box_bot1.jpg" colspan="3"><span class="subtimemap-boxtext"><b>&nbsp;&nbsp;Your Local Time:</b></span></td><td colspan="3"><span class="subtimemap-time" id="static0-time"></span></td></tr>';
html +='<tr><td height="2" background="'+imgTimemapPath +'/box_bot3.jpg" colspan="6"><img src="'+imgTimemapPath +'/spacer.gif" width="1" height="1"></td></tr>';
html +='<tr><td height="35" background="'+imgTimemapPath +'/box_bot2.jpg" colspan="3"><span class="subtimemap-boxtext"><b>&nbsp;&nbsp;Novosibirsk Time:</b> </span></td><td colspan="3"><span class="subtimemap-time" id="static1-time"></span></td></tr>';
html +='</table>';

if (workon) {

document.write(html);

TimeMap.drawLayout();

TimeMap.drawLight();
document.write('<div id="boxes-container" style="position: absolute; width: 400px; height: 250px; top:100px; left:100px; visibility: hidden; z-index: 3; background-image: url('+imgTimemapPath +'/spacer.gif);" onMouseOver="StartTimezones();" onMouseOut="StopTimezones();" onMouseMove="MouseLocate();">');
var i = 0;
while (i < (Boxes.length)) {
Boxes[i].ConvertCoords(TimeMap);
Boxes[i].drawBox();
i++;
}

paintDiv('zone-container', imgTimemapPath +'/zonebox.gif', imgTimemapPath +'/zonebox0.png', 60, 219, 290, 26, 4);
toggleDiv('zone-container', false);
document.write('<div id="zone-container-text" class="timemap-time" style="position: absolute; width: 290px; height: 20px; top:224px; left:60px; visibility: hidden; z-index: 5; text-align: center;"></div>');
document.write('</div>');
}


if (is_gecko) {
zoneobj = getObj('boxes-container');
zoneobj.addEventListener('mousemove',MouseLocate,false);
}

