var activeSubMenu;

clickMenu = function(menu) {
	var getEls = document.getElementById(menu).getElementsByTagName("LI");
	var getAgn = getEls;
	
	//alert(getEls.length);alert(getAgn.length);
	
	for (var i=0; i<getEls.length; i++) {
		getEls[i].onclick=function() {
			for (var x=0; x<getAgn.length; x++) {
				getAgn[x].className=getAgn[x].className.replace("unclick", "");
				getAgn[x].className=getAgn[x].className.replace("click", "unclick");
			}
			
			if ((this.className.indexOf('unclick'))!=-1) {
				this.className=this.className.replace("unclick", "");;
			} else {
				this.className+=" click";
			}
			
		}
		
		getEls[i].onmouseover=function() {
			this.className+=" hover";
		}
		
		getEls[i].onmouseout=function() {
			this.className=this.className.replace("hover", "");
		}
	}
}

clicked = function(layer){

	var myLayer=document.getElementById(layer);
	var myKnop=document.getElementById(layer+"1");
	
	if(myLayer.style.display=="none" || myLayer.style.display==""){
		myLayer.style.display="block";
		myKnop.style.background="#a6aaaf";
		myKnop.style.color="#FFFFFF";
	} else { 
		myLayer.style.display="none";
	}
}

active = function(layer){

	var myKnop=document.getElementById(layer);
	var myKnopA=document.getElementById(layer+"1");
	
	//	myKnopA.style.color="#333333";
		//myKnop.style.background="#333333";
		//myKnop.style.background="#a6aaaf";
		myKnop.style.background="#989da1";
		
	
}