// JavaScript Document
function getBody(w){
    return (w.document.compatMode && w.document.compatMode == "CSS1Compat") ? w.document.documentElement : w.document.body || null;
}

function isBrowser(str){
	if(str == "IE6"){
		if (document.all && !window.opera && !window.XMLHttpRequest)
			return true;
	}	
	return false;
}

function setContentHeight(){
	var avail_height=window.innerHeight?window.innerHeight:getBody(window).clientHeight;
	document.getElementById("mainContainer").style.minHeight = avail_height + "px";
	if(isBrowser("IE6")){
			document.getElementById("mainContainer").style.height = avail_height + "px";
	}
}

var activeChild = "";
function showChild(element){
	if(element){
		if (activeChild != "") {
			activeChild.style.display = "none";
		}
		if(element.getElementsByTagName("UL").length == 1){
			var child = element.getElementsByTagName("UL")[0];
			child.style.display = "block";
			child.style.zIndex = 1000;
			child.onmouseout = function(){
				this.style.display = "none";
			}
			activeChild = child;
			
		}		
	}
}

function addFunction(){
	var list = document.getElementById("mainNaviList");
	for(var i = 0; i < list.getElementsByTagName("li").length; i++){
		var item = list.getElementsByTagName("li")[i];
		if(item.nodeName == "LI" && item.className != "static"){
			item.onmouseover = function(){
				showChild(this);
			}
		}
	}
}

window.onload = function(){
	setContentHeight();
	//addFunction();
}

window.onresize = function(){
	setContentHeight();
}


