function showDiv(obj){
	if (obj.currentFrame < 1) {
		obj.element.style.visibility = "visible";
	}
}
 
  
function showSubMenu (elementId) {
	var allSubMenus = $$(".submenucontainer");
	for (i = 0; i < allSubMenus.length; ++i) {
		allSubMenus[i].hide();
	}
	
	if ($(elementId)) {
		$(elementId).show();
	}
}


function hightlightSubMenu (element) {
	var allSubMenus = $$(".menupt_on");
	for (i = 0; i < allSubMenus.length; ++i) {
		allSubMenus[i].removeClassName("menupt_on").addClassName("menupt");
	}
	
	$(element.parentNode.parentNode).removeClassName("menupt").addClassName("menupt_on");
}


function setTheClocks () {
	clocks = $$("div.worldtime");
	for (i = 0; i < clocks.length; ++i) {
		zone = $(clocks[i]).getAttribute("id");
		zone = zone.replace ("zone", "");
		zone = parseInt(zone);
		
		time = new Date();
		localTime = time.getTime();
		localTime += (zone * 3600 * 1000);
		time.setTime(localTime);
		month = time.getUTCMonth() + 1;
		
		minutes = time.getUTCMinutes().toString();
		hours = time.getUTCHours();
		// add german summer / wintertime manually - but without day handling
		if (month > 4 || month <= 10) {
			hours += 1;
		}
		hours = hours.toString();
		
		if (hours.length == 1) {
			hours = "0" + hours;
		}
		if (minutes.length == 1) {
			minutes = "0" + minutes;
		}
		$(clocks[i]).update(hours + ":" + minutes);
	}
}

document.observe("dom:loaded", function() {
	setTheClocks();
	$("timeslayer").show();
	$("timescontent").show();
	var clockTimer = window.setInterval("setTheClocks()", 30000);
});

