var tz = -60;
var msie = navigator.userAgent.indexOf("MSIE");
var now = new Date();
var nowL = new Date();
var nowSydney=new Date();
var TZL = nowL.getTimezoneOffset();
if(msie > -1)
{	if(navigator.userAgent.substring(msie+5,msie+6) <= 3) TZL *= -1;
   	else if(navigator.userAgent.indexOf("4.0b2") > -1) TZL += 60;
}
now.setTime(nowL.getTime() + (TZL - tz) * 60000);
var H = now.getHours() + now.getMinutes()/60 + now.getSeconds()/3600;
var M = now.getMonth();
var d = now.getDate();
var D = now.getDay();
if((M>2 ||
    (M==2 && (D==0 && d>24 && H>2 || D==1 && d>25 || D==2 && d>26 ||
              D==3 && d>27 || D==4 && d>28 || D==5 && d>29 || D==6 && d==31)
    )) &&
   (M<9 ||
    (M==9 && (d<25 || D==0 && d>24 && H<2 || D==1 && d<26 || D==2 && d<27 ||
              D==3 && d<28 || D==4 && d<29 || D==5 && d<30 || D==6 && d<31)
    ))) { letnicas=1; tz = tz - 60; }  // Daytime Saving Time - Letní eas
else letnicas=0;
var offset = (TZL - tz) * 60000;
var ti, tiOld, delay = 950;
	
function IniTime(mesto)
{	tiOld = nowL.getTime();
	setTimeout('casCE()',delay);
	UTCplus_min=0;
	switch (mesto)
	{	case "Brisbane": if (letnicas) UTCplus_hours=8; else UTCplus_hours=9; break;
		case "Perth": if (letnicas) UTCplus_hours=6; else UTCplus_hours=8; break;
		case "Adelaide": if (letnicas) { UTCplus_hours=7; UTCplus_min=30; } else { UTCplus_hours=9; UTCplus_min=30; }break;
		case "Darwin": if (letnicas) { UTCplus_hours=7; UTCplus_min=30; } else { UTCplus_hours=8; UTCplus_min=30; } break;
		default: if (letnicas) UTCplus_hours=8; else UTCplus_hours=10; break;
	}
}
function casCE()
{	nowL = new Date();
	now.setTime(nowL.getTime() + offset) 
	var min = now.getMinutes()
	var sec = now.getSeconds()
	var yer = now.getYear(); if(yer<2000) yer += 1900; yer -= 2000
	// document.getElementById('cr_time').firstChild.data=" " + now.getHours() +  ((min < 10) ? ":0" : ":") + min + ((sec < 10) ? ":0" : ":") + sec ;
	nowSydney=now;
	nowSydney.setMinutes(nowSydney.getMinutes()+UTCplus_min);
	nowSydney.setHours(now.getHours()+UTCplus_hours);
	document.getElementById('au_time').firstChild.data=" " + now.getHours() +  ((now.getMinutes()< 10) ? ":0" : ":") + now.getMinutes() + ((sec < 10) ? ":0" : ":") + sec ;
	ti = nowL.getTime();
	delay += 1000 - (ti - tiOld);
	tiOld = ti;
	Timer = setTimeout("casCE()",delay);
}
