

 window.onload=checkActive;

 function hideall() {
  //alert('hello hide js');
	for (var i = 1; i<=10; i++) {
		if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
	}
 }

 function checkActive() {

  hideall();

	var a = document.getElementsByTagName("a");
	if (window.location.href.substr(location.href.length - 1, 1) == '/') {
		var loc = window.location.href + 'index.html';
	}
	else {
		var loc = window.location.href;
		//alert('loc is '+loc); 
	}
	//in var a staan nu alle a href elementen
	for(var i=0; i < a.length; i++) {
	 
	 //alert(i +' nr geeft '+a[i].href);
	
		if (a[i].href == loc) {
		  var menuid = a[i].id;
		  //alert('menu link zou zijn '+menuid);
			a[i].setAttribute("class", "active");
			a[i].setAttribute("className", "active");
			if ((a[i].id) && (a[i].id > 0))  {
			   document.getElementById('smenu'+a[i].id).style.display='block';
			}
		}
	}
}


 function showsmenu(smenunr) {
 //alert('hello show smenu '+smenunr);
   
  hideall();
	
  document.getElementById('smenu'+smenunr).style.display='block';
  

 }

