var cssmenuids=["ultopmenu"] //Enter id(s) of CSS Horizontal UL menus, separated by commas

function createcssmenu2(){
for (var i=0; i<cssmenuids.length; i++){
  var ultags=document.getElementById(cssmenuids[i]).getElementsByTagName("ul")
    for (var t=0; t<ultags.length; t++){
    	ultags[t].parentNode.onmouseover=function(){
					this.style.zIndex=100
    	this.getElementsByTagName("ul")[0].style.visibility="visible"
					this.getElementsByTagName("ul")[0].style.zIndex=0
    	}
    	ultags[t].parentNode.onmouseout=function(){
					this.style.zIndex=0
					this.getElementsByTagName("ul")[0].style.visibility="hidden"
					this.getElementsByTagName("ul")[0].style.zIndex=100
    	}
    }
  }
}

if (window.addEventListener)
window.addEventListener("load", createcssmenu2, false)
else if (window.attachEvent)
window.attachEvent("onload", createcssmenu2)

function chclass(wat)
{
	var naam = "btn" + wat.substr(0,wat.length-1);
	if ("btntest2,btntest3,btntest4,".indexOf(naam)==-1) {
		var obj = document.getElementById(naam);
		if (wat.charAt(wat.length-1)=="1") {
			obj.style.fontWeight="bold";
			obj.style.color="#000000";
			obj.style.backgroundColor="#98EA30";
		}else{
			obj.style.fontWeight="normal";
			obj.style.color="#98EA30";			
			obj.style.backgroundColor="#004A00";
		}
	}
}

function chclass2(wat)
{
	var naam = "btn" + wat.substr(0,wat.length-1) + "2";
	if ("btntest22,btntest32,btntest42,".indexOf(naam)==-1) {
		var obj = document.getElementById(naam);
		if (wat.charAt(wat.length-1)=="1") {
			obj.style.fontWeight="bold";
			obj.style.color="#000000";
			obj.style.backgroundColor="#98EA30";
		}else{
			obj.style.fontWeight="normal";
			obj.style.color="#98EA30";			
			obj.style.backgroundColor="#004A00";
		}
	}
}

function goto(wat)
{
	switch (wat) {
		case "home" : whtogo = "../main/main.aspx"; break;
		case "tast" : whtogo = "../main/tasting.aspx"; break;
		case "links" : whtogo = "../main/links.aspx"; break;
		case "fotos" : whtogo = "../main/fotos.aspx"; break;
		case "leden" : whtogo = "../leden/verslagen.aspx"; break;		
		case "contact" : whtogo = "../main/contact.aspx"; break;
		case "copyright" : whtogo = "#";
	}
	window.location.href = whtogo; 
}

function IsValidObject(obj) {
	if (null == obj) {
		return false;
	}
	if ("undefined" == typeof(obj) ) {
		return false;
	}
	return true;
}

