if (document.compatMode == "CSS1Compat") {
	window.onresize = resizeContentArea;
	window.onload = resizeContentArea;
}

var activeMenu;
	
function setActiveMenu(inName) {
	activeMenu = inName;
}
							
function applyActiveMenu() {
	var menu = document.getElementById("menu");
	
	if(menu && menu.hasChildNodes) {
		for(var node in menu.childNodes) {
			if(node.innerHTML != undefined && node.innerHTML.indexOf(activeMenu) > -1)
					node.className="active";
		}
	}
}

function getWindowHeight() { 
	if (window.innerHeight)
		return window.innerHeight; 
	else if (window.document.documentElement && window.document.documentElement.clientHeight)
		return window.document.documentElement.clientHeight; 
	else
		return window.document.body.offsetHeight; 
}

function getContentArea() {
	var divs = document.getElementsByTagName("div");
	for (var i=0; i<divs.length; i++) {
		if (divs[i].className == "contentarea")
			return divs[i];
	}
	
	return null;
}
		
function resizeContentArea() {
	var contentArea = getContentArea();
	if (contentArea != null) {
		var windowHeight = getWindowHeight();
		var windowPadding = contentArea.offsetTop + 46;
		
		contentArea.style.height = (windowHeight - windowPadding) + 'px';
	}
}

function doLangSubmit(inLang)	{	
	document.forms.langform.action="index.php?id=79&L="+inLang+"&detail=441"
	document.forms.langform.submit();
}

function doProgrammSubmit()	{	
	targetElement = document.getElementById("search_string");
	targetElement.value="";
	document.forms.eventform.submit();
}

function doSearchSubmit()	{	
	document.forms.eventform.submit();
}

function doNextSubmit(inUID)	{	
	document.forms.eventform.action="index.php?id=eventdetail&detail="+inUID;
	document.forms.eventform.submit();
}

function doPrevSubmit(inUID)	{	
	document.forms.eventform.action="index.php?id=eventdetail&detail="+inUID;
	document.forms.eventform.submit();
}

function doProtagonistSubmit(inUID)	{	
	targetElement = document.getElementById("protagonist_uid");
	targetElement.value=inUID;
	document.forms.eventform.action="index.php?id=protagonist";
	document.forms.eventform.submit();
}
