var ie = document.all?1:0;
var ns4 = document.layers?1:0;
var ns6 = document.getElementById&&!ie?1:0;

var current = 0;
var currentButton = 0;
var currentLayer = 0;
var previous = 0;
var previousButton = 0;
var previousLayer = 0;
var TimerID;
var height=120

curr = null;
var btn_on = new Array();
var btn_off = new Array();
var menus = new Array();


btn_on[1] = new Image();
btn_on[1].src = "images/aHome.gif";
btn_off[1] = new Image();
btn_off[1].src = "images/Home.gif";
	
menus[1] = new Array();

btn_on[2] = new Image();
btn_on[2].src = "images/aOntwerpen.gif";
btn_off[2] = new Image();
btn_off[2].src = "images/Ontwerpen.gif";
	
menus[2] = new Array();

menus[2][1] = "Kinderhoeden||Kinderhoeden.html";
menus[2][2] = "Zomerhoeden||Zomerhoeden.html";
menus[2][3] = "Winterhoeden||Winterhoeden.html";
menus[2][4] = "Slide show||Slideshow.html";
 
btn_on[3] = new Image();
btn_on[3].src = "images/aMaterialen.gif";
btn_off[3] = new Image();
btn_off[3].src = "images/Materialen.gif";
	
menus[3] = new Array();

menus[3][1] = "Hoed maken||Hoeden_maken.html";
<!--menus[3][2] = "Bewerking";-->
 
btn_on[4] = new Image();
btn_on[4].src = "images/aWorkshops.gif";
btn_off[4] = new Image();
btn_off[4].src = "images/Workshops.gif";
	
menus[4] = new Array();

menus[4][1] = "1 dag||eenDag.html";
menus[4][2] = "6 avonden||Workshops.html";
 
btn_on[5] = new Image();
btn_on[5].src = "images/aLinks.gif";
btn_off[5] = new Image();
btn_off[5].src = "images/Links.gif";
	
menus[5] = new Array();

<!--menus[5][1] = "Trouwerijen||Trouwerijen.html";-->
menus[5][1] = "Contact||Contact.html";
menus[5][2] = "Hoeden in het nieuws||Nieuws.html";
menus[5][3] = "Radiointerview||Radio.html";


var s = "";
var l = 0;

if (ie) { l = 89; }
else if (ns4) { l = 88; }
else if (ns6) { l = 87; }

for(i=1;i<menus.length;i++){
	if(menus[i].length>0){
		w = document.images["i"+i].width;
		if(ns4){
			s += '<layer z-index="3" name="l'+i+'" top="120" left='+(l-3)+' onMouseOver="current='+i+'; currentLayer='+i+'; mouseAction(1,'+i+')" onMouseOut="current=0; currentLayer=0;mouseAction(0,'+i+')" visibility="hide">';
		} else if(ns6) {
			s += '<div id="l'+i+'" style="position:absolute;top:120px;left:'+(l-2)+';visibility:hidden;" onMouseOver="current='+i+'; currentLayer='+i+'; mouseAction(1,'+i+')" onMouseOut="current=0; currentLayer=0;mouseAction(0,'+i+')">';
		} else if(ie) {
			s += '<div id="l'+i+'" style="position:absolute;top:120px;left:'+(l-3)+';visibility:hidden;" onMouseOver="current='+i+'; currentLayer='+i+'; mouseAction(1,'+i+')" onMouseOut="current=0; currentLayer=0;mouseAction(0,'+i+')">';
		}

		s += '<table cellpadding="0" cellspacing="0" border="0">';
		s += '<tr><td colspan="3" bgcolor="White" height="1"><img src="images/spacer.gif" height="1" border="0"></td></tr>';
		for(j=1;j<menus[i].length;j++){
			menuItem = menus[i][j].split("||");
			if (ns4) { s += '<tr><td><img src="images/pxlFFFFFF.gif" border="0" width="1" height="16"></td><td valign="middle" class="nav_td" onmouseover="if(this.style) this.style.background=\'#FCDFFF\'" onmouseout="if(this.style) this.style.background=\'#FCDFFF\'">'; }
			else { s += '<tr><td><img src="images/pxlFFFFFF.gif" border="0" width="1" height="18"></td><td valign="middle" class="nav_td" onmouseover="if(this.style) this.style.background=\'#FCDFFF\'" onmouseout="if(this.style) this.style.background=\'#FCDFFF\'" style="background-color: #FCDFFF;">'; }
			s += '<ilayer z-index="3"><layer width="145" height="16" background="images/pxl6699CC.gif" onmouseover="this.background.src=\'images/pxl3366CC.gif\'" onmouseout="this.background.src=\'images/pxl6699CC.gif\'">';
			if (ns4) { s += '<img src="images/spacer.gif" height="2" width="1" border="0"><br>'; }
			s += '<nobr><img src="images/spacer.gif" height="1" width="7" border="0"><a href="'+menuItem[1]+'" class="nav">'+menuItem[0]+'</a><img src="images/spacer.gif" height="1" width="7" border="0"></nobr>';
			s += '</layer></ilayer>';
			s += '</td><td><img src="images/pxlFFFFFF.gif" border="0" width="1" height="18"></td></tr>'
			s += '<tr><td colspan="3" bgcolor="white" height="1"><img src="images/spacer.gif" height="1" border="0"></td></tr>';
		}
		s += '</table>';
		s += ns4?'</layer>':'</div>';
	}
			l = l + document.images["i"+i].width;
}

document.write(s);

function actionHandler(show,index) {
	if (show) {
		if (ie) { 
			if (document.images["i"+index]) { document.images["i"+index].src = btn_on[index].src; }
			if (document.all["l"+index]) { document.all["l"+index].style.visibility = "visible"; }
		}
		else if (ns6) { 
			if (document.images["i"+index]) { document.images["i"+index].src = btn_on[index].src; }
			if (document.getElementById("l"+index)) { document.getElementById("l"+index).style.visibility = "visible"; }
		}
		else if(ns4) { 
			if (btn_on[index] != undefined) { document.images["i"+index].src = btn_on[index].src; }
			if (document.layers["l"+index] != undefined) { document.layers["l"+index].visibility = "show"; }
		}
	}
	else {
		if (ie) { 
			if (document.images["i"+index]) { document.images["i"+index].src = btn_off[index].src; }
			if (document.all["l"+index]) { document.all["l"+index].style.visibility = "hidden"; }
		}
		else if (ns6) {
			if (document.images["i"+index]) { document.images["i"+index].src = btn_off[index].src; }
			if (document.getElementById("l"+index)) { document.getElementById("l"+index).style.visibility = "hidden"; }
		}
		else if(ns4) { 
			if (btn_off[index] != undefined) { document.images["i"+index].src = btn_off[index].src; }
			if (document.layers["l"+index] != undefined ) { document.layers["l"+index].visibility = "hide"; }
		}
	}
}

function mouseAction(mouseOn,index) {
	if (mouseOn) { 		
		actionHandler(mouseOn,index);
		if (previous != 0 && previous != current) {
			actionHandler(0,previous);
			clearTimeout(TimerID);
		}
		previous = current;
		previousButton = currentButton;
		previousLayer = currentLayer;
	}
	else {
	    TimerID = setTimeout("if (currentButton != "+index+" && currentLayer != "+index+") { actionHandler(0,"+index+") }", 1000);
	}
}

blnLoaded = true;
