
var PreREF =document.location.href
if (PreREF.search("nl")>1)
{
	PreREF = document.location.href.substring(0, document.location.href.lastIndexOf("nl/") +3);
	// var PreREF = parent.document.location.href.substring(0, parent.document.location.href.lastIndexOf("/") +1);
} else
{
	PreREF = "http://www.vertigo-klimtouw.nl/nl";
}
var br;
if(navigator.appName == 'Microsoft Internet Explorer'){br="IE"} else {br=null};

function showMenuButton()
{
	// args = showMenuButton.arguments;
	var menu=event.toElement.id;
	if (menu.search("button")>-1){menu = menu.substring(6)}
	//	theObj = eval("document.all[\'" + args[0]+ "\']");
	theObj = eval("document.all[\'" + menu + "\']");
	if (theObj)
	{
		theObj.style.top = event.toElement.offsetTop + event.toElement.offsetHeight;
		theObj.style.left = event.toElement.offsetLeft;
		theObj.style.visibility = 'visible';
	}
}

function hideMenu(menuToHide)
{
	// args=hideMenu.arguments;
	var menu=event.fromElement.id;
	if (menu.search("menu")>0){ menu = menu.substr(menu.search("menu"))}
	// theObjm = eval("document.all[\'" + args[0]+ "\']");
	// theObjb = eval("document.all[\'"+"button"+ args[0] + "\']");
	theObjm = eval("document.all[\'" + menu + "\']");
	theObjb = eval("document.all[\'"+"button"+ menu + "\']");
	if (event.toElement != theObjm && event.toElement!= theObjb && theObjm.contains(event.toElement) == false)
	{
		theObjm.style.visibility = 'hidden';
	}
}


// highlight menuitem
function divOver(){
	args = divOver.arguments;
	if(br=="IE"){
		theObj=eval('document.'+ args[0]);
		if(theObj.style.backgroundColor= "#800000"){
			theObj.style.backgroundColor="#D00000";
		}
	}
}

// highlight off menuitem
function divOut(){
	args = divOut.arguments;
	if(br=="IE")
	{
		theObj=eval('document.'+ args[0]);
		if(theObj.style.backgroundColor="#D00000"){theObj.style.backgroundColor="800000";}
	}
}


function openURL()
{
	args=openURL.arguments;
	var openstr ="";
	openstr= PreREF + menuData[args[0]][args[1]][1];
	location.href = openstr;
}


// build the divs for IE

var tdID = 0
function makeMenu(){
	args = makeMenu.arguments;
	var divID = args[0];
	var x = args[1];
 	var calcWidth = 130;
	//button waaruit wordt aangeroepen  
	var divTop =  -100;
	var divLeft = -100;

 		objDiv = "<div id=\"" + divID + "\" style=\"position:absolute; left:"+ divLeft +"px; top:"+ divTop +"px; width:135px; z-index:300; background-color:#662015; visibility:hidden; padding-left:3;\"  onMouseout=\"hideMenu('" + divID + "')\">";
		objDiv += "<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 ID=\"table" + divID + "\">";
		for (y=0;y<menuData[x].length; y++)
		{
	    		if(menuData[x][y][0]!=null)
	    		{
				// Tussen lijn
				objDiv +="<TR><TD>"; 
				objDiv += "<img ID =\"im" + tdID + divID + "\" src=\"" + PreREF + "../images/Header/Tussenlijn.gif\" width=130 height=2>";
				// Veld met verwijzing
				if (document.location.href.search("nl/"+menuData[x][y][1])>1)
					{   //actieve pagina
					objDiv += "<div id=\"x" + tdID +divID + "\" class=\"jmenuact\" > " + menuData[x][y][0]+ "</div>";
					}
					else
					{
					objDiv += "<div id=\"x" + tdID + divID + "\" class=\"jmenu\" onMouseover=\"divOver('all[\\'x" + tdID + divID + "\\']'" + ")\" onMouseout=\"divOut('all[\\'x" + tdID + divID + "\\']'" + ")\" onClick=\"openURL("+x+","+y+ ")\"> " + menuData[x][y][0]+ "</div>";
					};
    			objDiv +="</TD></TR>";
				tdID = tdID +1; 
			}
		}
		objDiv +="<TR><TD>";
    		objDiv +="<div id=\"line" + divID + "\" style=\"position:relative; background-color:#662015; width:130px; height:3px;\"><IMG ID=\"img" + divID + "\" src=\""+ PreREF + "../images/Header/Tussenlijn.gif\" width=130 height=2></div>";
    		objDiv +="</TD></TR></TABLE>";
    		objDiv +="</div>";
		document.body.insertAdjacentHTML('afterBegin',objDiv);
}



function LoadMenu()
{
	if(br=="IE")
	{
		makeMenu('menuvertigo',0 );
		makeMenu('menuproducts',1);
		makeMenu('menucustomers',2);
		makeMenu('menureferences',3);
		makeMenu('menunews',4);
		makeMenu('menubergsport',5);
		makeMenu('menuveiligheid',6);
	}
}


menuData = new Array();
// Menu van Vertigo
menuData[0] = new Array(
	["&nbsp;Home","index.html"],
	["&nbsp;Overzicht","company/index.html"],
	["&nbsp;Het bedrijf","company/vertigo.html"],
	["&nbsp;Adres gegevens","company/hoofdk.html"],
	["&nbsp;Scholing","company/scholing.html"],
	["&nbsp;Distributeurs","company/distributers.html"]);
	
//Menu van producten
menuData[1] = new Array(
	["&nbsp;Overzicht","products/index.html"],
	["&nbsp;Klimgrepen","products/holds/index.html"],
        ["&nbsp;Klimmuur","references/outdoor/uithof.html"],
	["&nbsp;Klimwanden","products/walls/index.html"],
	["&nbsp;Wandverfraaiingen","products/wallspecials/index.html"]);
	
		
//Menu voor klanten
menuData[2] = new Array(
	["&nbsp;Overzicht","customers/index.html"],
	["&nbsp;Scholen","customers/schools/index.html"],
	["&nbsp;Particulieren","customers/part/index.html"]);

	//Menu voor referenties
menuData[3] = new Array(
	["&nbsp;Distributeurschap","references/distributie.htm"],
	["&nbsp;Overzicht","references/index.html"],
	["&nbsp;Klimhallen","references/walls/index.html"],
	["&nbsp;Buitenwanden","references/outdoor/index.html"],
	["&nbsp;Boulderwanden","references/bouldering/index.html"],
	["&nbsp;Demontabele wanden","references/mobile/index.html"],
	["&nbsp;Tijdelijke wanden","references/tempwalls/index.html"],
	["&nbsp;Scholen","references/schools/index.html"],
	["&nbsp;Verbouwingen","references/rebuild/index.html"],
	["&nbsp;Grepen","references/holds/index.html"],
	["&nbsp;Zekeringsapparaten","references/security/index.html"],
	["&nbsp;Adventure parcoursen","references/adventure/index.html"]);

//Menu voor nieuws
menuData[4] = new Array(
	["&nbsp;Overzicht","news/index.html"],
	["&nbsp;Nieuws","news/Nieuws/news.html"],
	["&nbsp;Persberichten","news/pers/Persberichten.htm"],
	["&nbsp;Mailing list","news/maillist.html"],
        ["&nbsp;Links","news/links.html"]);
	


//Menu voor bergsport
menuData[5] = new Array(
	["&nbsp;Bergsport","Bergsport/index.htm"],
	["&nbsp;Alu nuts","Bergsport/Alu Nuts/Alu nuts1.htm"],
	["&nbsp;Klimgordels","Bergsport/Klim Gordels/Klimgordels.htm"],
        ["&nbsp;Industriegordels","Bergsport/Industriegordels/IndustrieGordels.htm"]);


//Menu voor veiligheid
menuData[6] = new Array(
	["&nbsp;Veiligheid","Veiligheid/index.html"],
	["&nbsp;Rescue","Veiligheid/bedrijfsveiligheid/Rescue.htm"],
	["&nbsp;Adventure","Veiligheid/adventure/adventure.html"],
	["&nbsp;Easytech","Veiligheid/easytech/easytech.html"],
	["&nbsp;TopPas","Veiligheid/toppas/toppas.html"]); 

