var sourceHTML = "content.shtml"
var stdTarget = "_self"
var DivMarginControl = -86

currentMenu = ""
nextpos=0;
maxMenuDepth = 0
var Menu = new Array();
var theColors = new Array("E6F3E6","E6F3E6","F3F3F3","F3F3F3","F3F3F3")
for (var currentItem in NAV){
	tempArray = currentItem.split("/")
	if (tempArray.length > maxMenuDepth){maxMenuDepth = tempArray.length}
	menulevel = tempArray.length-1
	tempArray = NAV[currentItem].split("*")
	if ( NAV[currentItem] != ""){
		if ((tempArray[1].indexOf("javascript:") != -1) || (tempArray[1].indexOf(".") != -1)){
			HREF = tempArray[1] // wenn kein Std-Pfad dann Pfadangabe nicht modifizieren
		} else {
			HREF= WEBROOT+"/sites"+tempArray[1]+"/"+sourceHTML
		}
		if (tempArray[2] != "") {NAV[currentItem] = "<tr><td bgcolor=#"+tempArray[2]+">"
		} else { NAV[currentItem] = "<tr><td bgcolor=#"+theColors[menulevel]+">"}
		NAV[currentItem]  += "<a href='"+HREF+"' "
		if (NAV[currentItem+"/10001"]){
			NAV[currentItem]  += "onmouseover='javascript:changemenu(\""+currentItem+"\",this)' "
			NAV[currentItem]  += "style=\"background-image: url('"+WEBROOT+"/layout/images/lable/arr_submen.gif'); background-repeat: no-repeat; background-position:100%;\""
		} else {
			NAV[currentItem]  += "onmouseover='javascript:closeMenu("+menulevel+",this)' "
		}
		if (tempArray[3] != "") {
			NAV[currentItem] += " target='"+tempArray[3]+"'";
		} else { 
			NAV[currentItem] += " target='"+stdTarget+"'";
		}
		NAV[currentItem] += ">"+tempArray[0]+"</a>"
		NAV[currentItem] +="</td></tr>"
	}
}	
for (var currentItem in NAV){
	if (currentItem.indexOf("/") != -1){
		menulable = currentItem.slice(0,currentItem.lastIndexOf("/"))
		if (!Menu[menulable]) {Menu[menulable] = ""}
		Menu[menulable] += NAV[currentItem] 
	} 
}
for (var currentItem in Menu){
	Menu[currentItem]  = "<table width=100% height=100% cellspacing=0 cellpadding=0 class='menu'>"+Menu[currentItem]+"</table>"
}

