// AKTUALNI CAS
// UPRAVENO PRO RADIO GOTHIC  www.radiogothic.net
// 2008 (c) Ashus www.ashus.ashus.net


 // MK's Javascript Clock Version 2, March 12, 2000
 //   (Version 2 wouldn't probably give correct year for years < 2000)
 // This piece of js code should give the Central European time anywhere on Earth
 // To adapt to another time zone adjust the value of variable tz,
 //   and modify the daylight/standard time switching if necessary
 //   (see e.g. my CST/CDT clock).
 // [Original version (1) written on Nov. 23, 1997]
 // Copyright  1977-2000  M. Kolar (http://mkolar.org/)

 var tz = -60;  // Central European Standard (Winter) Time = GMT + 1 hour
                // Středoevropský čas
 var msie = navigator.userAgent.indexOf("MSIE")
 var frmSize = 21
 var now = new Date()
 var nowL = new Date()
 var TZL = nowL.getTimezoneOffset(); // = what browser thinks is TZ; but
        // MS IE version 3 gives wrong sign of TZ
	// MSIE 4.0b2 shifts TZ by -1 hour
	// Any other problems?
 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)
        // Summer/Winter Time switching: last Sunday of March at 2am WT
        //                  last Sunday of October at 3 am ST (2 am WT)
 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)
     ))) tz = tz - 60;  // Daytime Saving Time - Letní čas
 var offset = (TZL - tz) * 60000

 var ti, tiOld, delay = 950

function casCE() {
	nowL = new Date()
	now.setTime(nowL.getTime() + offset)
	var min = now.getMinutes()
	var sec = now.getSeconds()
// 	A quick Y2K patch:
// 	var yer = now.getYear(); if(yer<2000) yer += 1900; yer -= 2000
	update_time_div.innerHTML = now.getHours()
		+  ((min < 10) ? ":0" : ":") + min
		+ ((sec < 10) ? ":0" : ":") + sec
// 	   + "  " + now.getDate()
//        + "-" + (now.getMonth()+1) + ((yer < 10) ? "-'0" : "-'") + yer
	ti = nowL.getTime()
	delay += 1000 - (ti - tiOld)
	tiOld = ti
	}


var update_time_div = document.getElementById("update_time");

update_time_interval = setInterval("casCE()",1000)
