function showHideMenu(obj) {
	mytarget = obj;
	uls = $(obj).getElementsByTagName("UL");
	for(i=0;i < uls.length; i++) {
		if(uls[i].nodeName == "UL") mytarget = uls[i].id;
	}
	submenus = $('navigation').getElementsByTagName("UL");
	for(i=0; i<submenus.length; i++) {
	 test = submenus[i];
		if(test.parentNode.nodeName == "LI") {
			if(submenus[i] != $(mytarget) && test.style.display != "none") {
				new Effect.BlindUp(submenus[i].id, {duration:0.5});
			}
		}
	}
	if($(mytarget).style.display == "none") {
		new Effect.BlindDown(mytarget, {duration:0.5});
	}
}
function init() {
	submenus = $('navigation').getElementsByTagName('UL');
	for(i=0; i<submenus.length; i++) {
		menuItem = submenus[i];
		if(menuItem.className == "submenu") {
			menuItem.style.display = "none";
			//active = menuItem.getElementsByClassName("active");
			if(menuItem.hasChildNodes()) {
				var temp = menuItem.firstChild;
				while(true) {
					if(temp.className == "active") {
						menuItem.style.display = "block";
						break;
					}
					if(temp == menuItem.lastChild) break;
					else temp = temp.nextSibling;
				}
			}
//			alert(menuItem.childNodes[0]);
//			if(active.length == 0) menuItem.style.display = "none";
			//menuItem.id = "menu_" + i;
		}
	}
	checkFlashHeight();
}

function checkFlashHeight() {
	relation = 1024/713;
	contentHeight = $('container').offsetHeight + 125;
	// hšhe!
	wh = window.innerHeight;
	if(wh == null) wh = document.documentElement.clientHeight; // ie >= 6
	if(wh == null) wh = document.body.clientHeight; // ie <= 6
	// breite
	ww = window.innerWidth;
	if(ww == null) ww = document.documentElement.clientWidth; // ie >= 6
	if(ww == null) ww = document.body.clientWidth; // ie <= 6
	
	h = Math.max(contentHeight, wh);
	$('backgroundImage').style.width = (h * relation + 2) + "px";
	$('backgroundImage').style.height = h + "px";
	if(h * relation < ww) {
		$('backgroundImage').style.height = (ww / relation + 2) + "px";
		$('backgroundImage').style.width = "100%";
	}
	$('flashid').style.height = h+'px';
}
function showHideComments() {
	if($('comment_toggle').style.display == "none") { 
		Effect.BlindDown('comment_toggle', {afterUpdate: checkFlashHeight});
	} else { 
		Effect.BlindUp('comment_toggle', {afterUpdate: checkFlashHeight});
	}
}

window.onload = init;
window.onresize = checkFlashHeight;