//var openmenu = -1;

//function donkereVersie(nr){
//	var el=document.getElementById("hoofdbutton" + nr);
	//if (el.className=="hoofdbutton") el.className="hoofdbutton aktief";
//}

//function origineleVersie(nr){
//	var el=document.getElementById("hoofdbutton" + nr);
//	el.className=el.className.replace(" aktief","");
//}

//function verbergSubmenu(thisDiv,nr) {
//	document.getElementById("submenu"+nr).style.display="none";
//	thisDiv.className="leftmenuheader";
//}


// voor divs in divs: thisDiv.childNodes[1].style.display
// voor divs naast divs: thisDiv.nextSibling.style.display

function toonSubmenu(thisDiv){
	
	var childIds = new Array();

	 for (i=0;i<thisDiv.childNodes.length;i++){
		  if(thisDiv.childNodes[i].nodeType ==1 ){
		  	childIds[childIds.length] = i;
		  }
	  }
 	if(thisDiv.childNodes[childIds[1]].style.display=='none'){
 	  sluitSubmenus(thisDiv.parentNode);
	  thisDiv.childNodes[childIds[1]].style.display="inline";
 	  //thisDiv.childNodes[childIds[0]].className = thisDiv.childNodes[childIds[0]].className.concat(' hi');
 	}
 	else
 	{
 		// thisDiv.childNodes[childIds[0]].className = thisDiv.childNodes[childIds[0]].className.substring(0, (thisDiv.childNodes[childIds[0]].className.length-3) );
 		thisDiv.childNodes[childIds[1]].style.display="none";
 	}
}

function sluitSubmenus(thisDiv){
	var wrapperIds = new Array();

  for (i=0;i<thisDiv.childNodes.length;i++){
	  if(thisDiv.childNodes[i].nodeType ==1 ){
	  	wrapperIds[wrapperIds.length] = i;
	  }
  }
  for (i=0;i<wrapperIds.length;i++){

    if(thisDiv.childNodes[wrapperIds[i]].id=='wrapperDivMenu'){
    	var childIds = new Array();
    
    	for (j=0;j<thisDiv.childNodes[wrapperIds[i]].childNodes.length;j++){
    	  if(thisDiv.childNodes[wrapperIds[i]].childNodes[j].nodeType ==1 ){
    		 	childIds[childIds.length] = j;
    		}
    	}
    	  thisDiv.childNodes[wrapperIds[i]].childNodes[childIds[1]].style.display="none";


//      if(thisDiv.childNodes[wrapperIds[i]].childNodes[2].id=='submenu'){
//        thisDiv.parentNode.childNodes[i].childNodes[2].style.display="none";
    }
  }
}

 // if ((thisDiv.nextSibling.style.display == 'none')){
 //   thisDiv.nextSibling.style.display="inline";
 //   thisDiv.className = thisDiv.className.concat(' hi');
 // }
 // else {
 
 // 	thisDiv.className = thisDiv.className.substring(0, (thisDiv.className.length-3) );
 // 	thisDiv.nextSibling.style.display="none";
  
 // }