
activateMenu = function(nav) {
    /* currentStyle restricts the Javascript to IE only */
	if (document.all && document.getElementById(nav).currentStyle) {  		
		var navroot = document.getElementById(nav);
        /* Get all the list items within the menu */
        var lis=navroot.getElementsByTagName("LI");  
		for (i=0; i<lis.length; i++) {
            /* If the LI has another menu level */
            if(lis[i].lastChild.tagName=="UL"){
                /* assign the function to the LI */
             	lis[i].onmouseover=function() {		
                   /* display the inner menu */
                   this.lastChild.style.display="block";
      			}
				lis[i].onmouseout=function() {                       
                    this.lastChild.style.display="none";
				}
            }
		}
	}
}
// if different menus are used width the same class
function activateMenus (theClass) {  	
	//Populate the array with all the page tags  
	if (document.all) {  
		var allPageTags = new Array(); 	
		var allPageTags=document.getElementsByTagName("UL");  
		//Cycle through the tags using a for loop  
		//  alert(allPageTags.length)
		for (i=0; i<allPageTags.length; i++) {  
		//Pick out the tags with our class name  
			if (allPageTags[i].className==theClass) {  
				/* Get all the list items within the menu */
		        var lis=allPageTags[i].getElementsByTagName("LI");  
				// alert(lis.length)
				for (j=0; j<lis.length; j++) {
		            /* If the LI has another menu level */
		            if(lis[j].lastChild.tagName=="UL"){
		                /* assign the function to the LI */
		             	lis[j].onmouseover=function() {		
		                   /* display the inner menu */
		                   this.lastChild.style.display="block";
		      			}
						lis[j].onmouseout=function() {                       
		                    this.lastChild.style.display="none";
						} 
		            }
				} // end for
			}  
		} // end for	
	}
	
	
	
} 

function submit_form(frm) {	
	frm.submit();
}

img = new Array();

function preload_images() {	
	img['grondstoffen'] = new Image();
	img['grondstoffen'].src = "../_images/nl/menu/grondstoffen_on.gif";
	
	img['hulpstoffen'] = new Image();
	img['hulpstoffen'].src = "../_images/nl/menu/hulpstoffen_on.gif";

	img['halffabrikaten'] = new Image();
	img['halffabrikaten'].src = "../_images/nl/menu/halffabrikaten_on.gif";
	
	img['onderdelen'] = new Image();
	img['onderdelen'].src = "../_images/nl/menu/onderdelen_on.gif";

	img['eindproducten'] = new Image();
	img['eindproducten'].src = "../_images/nl/menu/eindproducten_on.gif";

	img['verpakking'] = new Image();
	img['verpakking'].src = "../_images/nl/menu/verpakking_on.gif";

	img['bewerkingen'] = new Image();
	img['bewerkingen'].src = "../_images/nl/menu/bewerkingen_on.gif";
}

function hide(id) {	
	// document.images['m_'+id].src = "../_images/nl/menu/"+id+".gif";
}

function hideNav() {	
	document.getElementById('grondstoffen').style.display="none";
	document.getElementById('hulpstoffen').style.display="none";
	
	document.getElementById('halffabrikaten').style.display="none";
	document.getElementById('onderdelen').style.display="none";
	document.getElementById('eindproducten').style.display="none"; 
	
	document.getElementById('verpakking').style.display="none";
	document.getElementById('bewerkingen').style.display="none";		
	
	document.images['m_grondstoffen'].src = "../_images/nl/menu/grondstoffen.gif";
	document.images['m_hulpstoffen'].src = "../_images/nl/menu/hulpstoffen.gif";
	document.images['m_halffabrikaten'].src = "../_images/nl/menu/halffabrikaten.gif";
	document.images['m_onderdelen'].src = "../_images/nl/menu/onderdelen.gif";	
	document.images['m_eindproducten'].src = "../_images/nl/menu/eindproducten.gif";
	document.images['m_verpakking'].src = "../_images/nl/menu/verpakking.gif";
	document.images['m_bewerkingen'].src = "../_images/nl/menu/bewerkingen.gif";
}

function showNav(id) {	
	hideNav();			
	document.images['m_'+id].src = img[id].src; 
	
	document.getElementById(id).style.display="block";		
	menuopen = false;
	/* if (document.all && document.getElementById(id).currentStyle) {  	
		document.getElementById(id).style.display="block";			
	} */
	
	
	
	// hide it after 10 seconds
	// setTimeout("hideNav()", 10000);	
}

menuopen = false;

// hide it after 1 seconds
function hideNav2(id) {	
	alert("ok?")
	if (menuopen)
	 setTimeout("hideNav()", 1000);	
}

// hide it after 1 seconds
function showNav2(id) {	
	menuopen = true;
}
  
function setCookie(name,value) {
setCookieExp(name, value, 31536000000);
}
function setCookieExp(name,value,Expires) {
var now = new Date();
var then = new Date(now.getTime()+Expires);
document.cookie = name+"="+escape(value) +"; expires="+then.toGMTString()+"; path=/";
}
function getCookie(name) {
var cookie = " "+document.cookie;
var search = " "+name+"=";
var setStr = null;
var offset = 0;
var end = 0;
if (cookie.length > 0) {
offset = cookie.indexOf(search);
if (offset != -1) {
offset += search.length;
end = cookie.indexOf(";", offset);
if (end == -1) {
end = cookie.length;
}
setStr = unescape(cookie.substring(offset,end));
}
}
return(setStr);
}
