//#48904(
// QUICK'n dirty Übergangslösung als Absicherung
// Unterstützung vor R200306.03: NS größer gleich 7 und MSIE >= 5.5
// Per H200306.03: auch 5.1 erlauben (Mac MSIE 5.1) und alles mit 5 (win 5.0)
// Die funktion returniert, ob das gegeben ist
function relaunch2003Support()
{
	var lUserAgent = navigator.userAgent.toLowerCase();
	var ver = lUserAgent.indexOf("msie ");
	var bSupported = true;
	if(ver > -1)
	{
		var verstr = lUserAgent.substr(ver + 5);
		if(verstr < "5")
			bSupported = false;
 	}
	else
	{
		// netscape/7.02
		//#48904 neu:
		// netscape6/6.2
		// netscape6/6.0
		ver = lUserAgent.indexOf("netscape/");
		if(ver > -1)
		{
			var verstr = lUserAgent.substr(ver + 9);
			if(verstr < "6")
				bSupported = false;
		}
		else
		{
			bSupported = (lUserAgent.indexOf("netscape6") > -1);
		}
	}
	return(bSupported);
}

// Dynamische Dropdowns werden ab IE5.5 und NS7 unterstützt
// !!! ACHTUNG !!!
// Diese Funktion ist in iframe.js und create2.js analog deklariert (Sauhaufen bei Include-Files)
function dynamicDropdownSupport()
{
	var lUserAgent = navigator.userAgent.toLowerCase();
	var ver = lUserAgent.indexOf("msie ");
	var bSupported = true;
	if(ver > -1)
	{
		var verstr = lUserAgent.substr(ver + 5);
		if(verstr < "5.5")
			bSupported = false;
 	}
	else
	{
		ver = lUserAgent.indexOf("netscape/");
		if(ver > -1)
		{
			var verstr = lUserAgent.substr(ver + 9);
			if(verstr < "7")
				bSupported = false;
		}
		else
			bSupported = false;
	}
	return(bSupported);
}
//#48904)
function createPathNav(topSpace, path1div, path2div, path3div) {
  
  var myOfflineRoot = "";
  var myOnlineRoot = "";
  var imageRoot = "images/";
  
//#48904(
	if(dynamicDropdownSupport())
	{
		var srcDiv
		srcDiv = document.getElementById('navSelectBereich');
		if(srcDiv != null)
			srcDiv.style.display="none";
		srcDiv = document.getElementById('navSelectThema');
		if(srcDiv != null)
			srcDiv.style.display="none";
		srcDiv = document.getElementById('navSelectFormat');
		if(srcDiv != null)
			srcDiv.style.display="none";
	}
	else
		return;
//#48904)
  if(navigator.userAgent.indexOf("Netscape6")>=0 && navigator.platform.indexOf("Win")>=0) {
    arrowGif = imageRoot + "darr_FF6600.gif";
    arrowHeight = 14;
  }
  else {
    arrowGif = imageRoot + "darr_FF6600.gif";
    arrowHeight = 14;
  }
  
 // if(!topSpace) { topSpace = 48; }
  topSpace = 60;
  
  pathmenu1 = new makeCM("pathmenu1");
//  spacemenu1 = new makeCM("spacemenu1");
  pathmenu2 = new makeCM("pathmenu2");
//  spacemenu2 = new makeCM("spacemenu2");
  pathmenu3 = new makeCM("pathmenu3");

//  pathmenu4 = new makeCM("pathmenu4");

  pathmenu1.frames = 0;
  pathmenu1.pxBetween = 0;
//  pathmenu1.fromLeft = -46;
  pathmenu1.fromLeft = -59;
  pathmenu1.fromTop = topSpace;
  pathmenu1.rows = 1;
//  pathmenu1.menuPlacement = "center";
  pathmenu1.menuPlacement = "left";
  
  pathmenu1.offlineRoot = myOfflineRoot;
  pathmenu1.onlineRoot = myOnlineRoot;
//  pathmenu1.resizeCheck = 1;
  pathmenu1.resizeCheck = 0;
  pathmenu1.wait = 100;
  pathmenu1.fillImg = imageRoot + "1x1.gif";
  pathmenu1.zIndex = 0;
  
  pathmenu1.useBar = 0;
  pathmenu1.barWidth = "100%";
  pathmenu1.barHeight = "160px";
  pathmenu1.barClass = "";
  pathmenu1.barX = 0;
  pathmenu1.barY = 0;
  pathmenu1.barBorderX = 0;
  pathmenu1.barBorderY = 0;
  pathmenu1.barBorderClass = "";
  pathmenu1.closeOnClick = 0;
  
  //cm_makeLevel(width,height,regClass,overClass,borderX,borderY,borderClass,rows,align,offsetX,offsetY,arrow,arrowWidth,arrowHeight)
  //pathmenu1.level[0] = new cm_makeLevel('','','','','','','','','','','img/arrow_dark.gif', 10, 10);
  pathmenu1.level[0] = new cm_makeLevel();
  pathmenu1.level[0].width = 201;
  pathmenu1.level[0].height = 16;
  pathmenu1.level[0].regClass = "subNav";
  pathmenu1.level[0].overClass = "subNavOver";
  pathmenu1.level[0].borderX = 1;
  pathmenu1.level[0].borderY = 1;
  pathmenu1.level[0].borderClass = "subNavBorder";
  pathmenu1.level[0].offsetX = -1;
  pathmenu1.level[0].offsetY = -1;
  pathmenu1.level[0].rows = 0;
  pathmenu1.level[0].arrow = arrowGif;
  pathmenu1.level[0].arrowWidth = 0;
  pathmenu1.level[0].arrowHeight = 0;
  pathmenu1.level[0].align = "bottom";
  
  pathmenu1.level[1] = new cm_makeLevel();
  pathmenu1.level[1].width = 201;
  pathmenu1.level[1].height = 16;
  pathmenu1.level[1].regClass = "subNav";
  pathmenu1.level[1].overClass = "subNavOver";
  pathmenu1.level[1].borderX = 1;
  pathmenu1.level[1].borderY = 1;
  pathmenu1.level[1].borderClass = "subNavBorder";
  pathmenu1.level[1].offsetX = -1;
  pathmenu1.level[1].offsetY = -1;
  pathmenu1.level[1].rows = 0;
  pathmenu1.level[1].arrow = 0;
  pathmenu1.level[1].align = "left";
  
  //menu3
/*  spacemenu1.frames = 0;
  spacemenu1.pxBetween = 0;
  spacemenu1.fromLeft = 0;
  spacemenu1.fromTop = topSpace;
  spacemenu1.rows = 1;
  spacemenu1.menuPlacement = "center";
  
  spacemenu1.offlineRoot = myOfflineRoot;
  spacemenu1.onlineRoot = myOnlineRoot;
  spacemenu1.resizeCheck = 1;
  spacemenu1.wait = 30000;
  spacemenu1.fillImg = imageRoot + "1x1.gif";
  spacemenu1.zIndex = 0;
  
  spacemenu1.useBar = 0;
  spacemenu1.barWidth = "100%";
  spacemenu1.barHeight = "160px";
  spacemenu1.barClass = "";
  spacemenu1.barX = 0;
  spacemenu1.barY = 0;
  spacemenu1.barBorderX = 0;
  spacemenu1.barBorderY = 0;
  spacemenu1.barBorderClass = "";
  
  spacemenu1.level[0] = new cm_makeLevel();
  spacemenu1.level[0].width = 10;
  spacemenu1.level[0].height = 16;
  spacemenu1.level[0].regClass = "subNav";
  spacemenu1.level[0].overClass = "subNavOver";
  spacemenu1.level[0].borderX = 0;
  spacemenu1.level[0].borderY = 0;
  spacemenu1.level[0].borderClass = "subNavBorder";
  spacemenu1.level[0].offsetX = -1;
  spacemenu1.level[0].offsetY = -1;
  spacemenu1.level[0].rows = 1;
  spacemenu1.level[0].arrow = 0;
  spacemenu1.level[0].arrowWidth = 0;
  spacemenu1.level[0].arrowHeight = 0;
  spacemenu1.level[0].align = "bottom";
*/  
  // menu 4
  pathmenu2.frames = 0;
  pathmenu2.pxBetween = 0;
//  pathmenu2.fromLeft = -42;
  pathmenu2.fromLeft = -82;
  pathmenu2.fromTop = topSpace;
  pathmenu2.rows = 1;
//  pathmenu2.menuPlacement = "center";
  pathmenu2.menuPlacement = "left";
  pathmenu2.offlineRoot = "";
  pathmenu2.onlineRoot = "";
//  pathmenu2.resizeCheck = 1;
  pathmenu2.resizeCheck = 0;
  pathmenu2.wait = 100;	// #49235 Themendropdown soll nach 30 Sekunden geschlossen werden; ursprünglicher Wert: 900000 (900 Sekunden)
  pathmenu2.fillImg = imageRoot + "1x1.gif";
  pathmenu2.zIndex = 0;
  
  pathmenu2.useBar = 0;
  pathmenu2.barWidth = "100%";
  pathmenu2.barHeight = "160px";
  pathmenu2.barClass = "";
  pathmenu2.barX = 0;
  pathmenu2.barY = 0;
  pathmenu2.barBorderX = 0;
  pathmenu2.barBorderY = 0;
  pathmenu2.barBorderClass = "";
  
  pathmenu2.level[0] = new cm_makeLevel();
  pathmenu2.level[0].width = 201;
  pathmenu2.level[0].height = 16;
  pathmenu2.level[0].regClass = "subNav";
  pathmenu2.level[0].overClass = "subNavOver";
  pathmenu2.level[0].borderX = 1;
  pathmenu2.level[0].borderY = 1;
  pathmenu2.level[0].borderClass = "subNavBorder";
  pathmenu2.level[0].offsetX = -1;
  pathmenu2.level[0].offsetY = -1;
  pathmenu2.level[0].rows = 0;
  pathmenu2.level[0].arrow = arrowGif;
  pathmenu2.level[0].arrowWidth = 0;
  pathmenu2.level[0].arrowHeight = 0;
  pathmenu2.level[0].align = "bottom";
  
  pathmenu2.level[1] = new cm_makeLevel();
  pathmenu2.level[1].width = 201;
  pathmenu2.level[1].height = 16;
  pathmenu2.level[1].regClass = "subNav";
  pathmenu2.level[1].overClass = "subNavOver";
  pathmenu2.level[1].borderX = 1;
  pathmenu2.level[1].borderY = 1;
  pathmenu2.level[1].borderClass = "subNavBorder";
  pathmenu2.level[1].offsetX = 1;
  pathmenu2.level[1].offsetY = -1;
  pathmenu2.level[1].rows = 0;
  pathmenu2.level[1].arrow = 0;
//#49235(
  pathmenu2.level[1].arrow = imageRoot +  "ArrowRight.gif";
//  pathmenu2.level[1].arrowWidth = 16;
//  pathmenu2.level[1].arrowHeight = 14;
//#49235)
  pathmenu2.level[1].align = "left";
  
  //menu5
/*  spacemenu2.frames = 0;
  spacemenu2.pxBetween = 0;
  spacemenu2.fromLeft = 0;
  spacemenu2.fromTop = topSpace;
  spacemenu2.rows = 1;
  spacemenu2.menuPlacement = "center";
  
  spacemenu2.offlineRoot = myOfflineRoot;
  spacemenu2.onlineRoot = myOnlineRoot;
  spacemenu2.resizeCheck = 1;
  spacemenu2.wait = 200;
  spacemenu2.fillImg = imageRoot + "1x1.gif";
  spacemenu2.zIndex = 0;
  
  spacemenu2.useBar = 0;
  spacemenu2.barWidth = "100%";
  spacemenu2.barHeight = "160px";
  spacemenu2.barClass = "";
  spacemenu2.barX = 0;
  spacemenu2.barY = 0;
  spacemenu2.barBorderX = 0;
  spacemenu2.barBorderY = 0;
  spacemenu2.barBorderClass = "";
  
  spacemenu2.level[0] = new cm_makeLevel();
  spacemenu2.level[0].width = 10;
  spacemenu2.level[0].height = 16;
  spacemenu2.level[0].regClass = "subNav";
  spacemenu2.level[0].overClass = "subNavOver";
  spacemenu2.level[0].borderX = 0;
  spacemenu2.level[0].borderY = 0;
  spacemenu2.level[0].borderClass = "subNavBorder";
  spacemenu2.level[0].offsetX = -1;
  spacemenu2.level[0].offsetY = -1;
  spacemenu2.level[0].rows = 1;
  spacemenu2.level[0].arrow = 0;
  spacemenu2.level[0].arrowWidth = 0;
  spacemenu2.level[0].arrowHeight = 0;
  spacemenu2.level[0].align = "bottom";
*/  
  // menu 6
  pathmenu3.frames = 0;
  pathmenu3.pxBetween = 0;
//  pathmenu3.fromLeft = -51;
  pathmenu3.fromLeft = -104;
  pathmenu3.fromTop = topSpace;
  pathmenu3.rows = 1;
//  pathmenu3.menuPlacement = "center";
  pathmenu3.menuPlacement = "left";
  
  pathmenu3.offlineRoot = "";
  pathmenu3.onlineRoot = "";
//  pathmenu3.resizeCheck = 1;
  pathmenu3.resizeCheck = 0;
  pathmenu3.wait = 100;	//#49556 Formatdropdown soll nach 30 sec autom zuklappen (ursprünglich 90000, also 90 Sekunden)
  pathmenu3.fillImg = imageRoot + "1x1.gif";
  pathmenu3.zIndex = 0;
  
  pathmenu3.useBar = 0;
  pathmenu3.barWidth = "100%";
  pathmenu3.barHeight = "160px";
  pathmenu3.barClass = "";
  pathmenu3.barX = 0;
  pathmenu3.barY = 0;
  pathmenu3.barBorderX = 0;
  pathmenu3.barBorderY = 0;
  pathmenu3.barBorderClass = "";
  pathmenu3.closeOnClick = 0;
  
  pathmenu3.level[0] = new cm_makeLevel();
  pathmenu3.level[0].width = 203;
  pathmenu3.level[0].height = 16;
  pathmenu3.level[0].regClass = "subNav";
  pathmenu3.level[0].overClass = "subNavOver";
  pathmenu3.level[0].borderX = 1;
  pathmenu3.level[0].borderY = 1;
  pathmenu3.level[0].borderClass = "subNavBorder";
  pathmenu3.level[0].offsetX = -1;
  pathmenu3.level[0].offsetY = -1;
  pathmenu3.level[0].rows = 0;
  pathmenu3.level[0].arrow = arrowGif;
  pathmenu3.level[0].arrowWidth = 7;
  pathmenu3.level[0].arrowHeight = arrowHeight;
  pathmenu3.level[0].align = "bottom";
  
  pathmenu3.level[1] = new cm_makeLevel();
  pathmenu3.level[1].width = 203;
  pathmenu3.level[1].height = 16;
  pathmenu3.level[1].regClass = "subNav";
  pathmenu3.level[1].overClass = "subNavOver";
  pathmenu3.level[1].borderX = 1;
  pathmenu3.level[1].borderY = 1;
  pathmenu3.level[1].borderClass = "subNavBorder";
  pathmenu3.level[1].offsetX = 1;
  pathmenu3.level[1].offsetY = -1;
  pathmenu3.level[1].rows = 0;
  pathmenu3.level[1].arrow = 0;
  pathmenu3.level[1].align = "left";
  
/*
  // menu 7
  pathmenu4.frames = 0;
  pathmenu4.pxBetween = 0;
  pathmenu4.fromLeft = 385;
  pathmenu4.fromTop = topSpace;
  pathmenu4.rows = 1;
  pathmenu4.menuPlacement = "center";
  pathmenu4.offlineRoot = "";
  pathmenu4.onlineRoot = "";
  pathmenu4.resizeCheck = 1;
  pathmenu4.wait = 100;	// #49235 Themendropdown soll nach 30 Sekunden geschlossen werden; ursprünglicher Wert: 900000 (900 Sekunden)
  pathmenu4.fillImg = imageRoot + "1x1.gif";
  pathmenu4.zIndex = 0;
  
  pathmenu4.useBar = 0;
  pathmenu4.barWidth = "100%";
  pathmenu4.barHeight = "160px";
  pathmenu4.barClass = "";
  pathmenu4.barX = 0;
  pathmenu4.barY = 0;
  pathmenu4.barBorderX = 0;
  pathmenu4.barBorderY = 0;
  pathmenu4.barBorderClass = "";
  
  pathmenu4.level[0] = new cm_makeLevel();
  pathmenu4.level[0].width = 151;
  pathmenu4.level[0].height = 16;
  pathmenu4.level[0].regClass = "subNav";
  pathmenu4.level[0].overClass = "subNavOver";
  pathmenu4.level[0].borderX = 1;
  pathmenu4.level[0].borderY = 1;
  pathmenu4.level[0].borderClass = "subNavBorder";
  pathmenu4.level[0].offsetX = -1;
  pathmenu4.level[0].offsetY = -1;
  pathmenu4.level[0].rows = 0;
  pathmenu4.level[0].arrow = arrowGif;
  pathmenu4.level[0].arrowWidth = 7;
  pathmenu4.level[0].arrowHeight = arrowHeight;
  pathmenu4.level[0].align = "bottom";
  
  pathmenu4.level[1] = new cm_makeLevel();
  pathmenu4.level[1].width = 151;
  pathmenu4.level[1].height = 16;
  pathmenu4.level[1].regClass = "subNav";
  pathmenu4.level[1].overClass = "subNavOver";
  pathmenu4.level[1].borderX = 1;
  pathmenu4.level[1].borderY = 1;
  pathmenu4.level[1].borderClass = "subNavBorder";
  pathmenu4.level[1].offsetX = 1;
  pathmenu4.level[1].offsetY = -1;
  pathmenu4.level[1].rows = 0;
  pathmenu4.level[1].arrow = 0;
//#49235(
  pathmenu4.level[1].arrow = imageRoot +  "ArrowRight.gif";
  pathmenu4.level[1].arrowWidth = 16;
  pathmenu4.level[1].arrowHeight = 14;
//#49235)
  pathmenu4.level[1].align = "left";
*/


  pathmenu1.openOnClick = 1;
  pathmenu2.openOnClick = 1;
  pathmenu3.openOnClick = 1;
//  pathmenu4.openOnClick = 1;



  //spacemenu1.level[0].borderClass = "hidden";
  dummyMenu = false;
	var spacingGifTag1 = '<img src="' + imageRoot + '1x1.gif" width="1" height="1">';
	var rootClass = "subNavActive", rootClassOver = "subNavActiveOver";
	menuId = 1;
	var menuPraefix1 = "pn1", menuPraefix2 = "pn2", menuPraefix3 = "pn3", menuPraefix4 = "pn4";;  // the präfix for the menu names of the 1st levels of the path navigation
	
	// start building the path navigation here
	
	//------------------------------------------------------
	// here we build the first level of the path navigation
	//------------------------------------------------------
	if(path1div) {
		var srcDiv = document.getElementById(path1div);
		var rootDivs = getDivChildren(srcDiv);
		var divAttributes = new Array();
		
		// there should be only 1 div in the root level!!!
		if(rootDivs[0].attributes['text']) {
			divAttributes["text"] = rootDivs[0].attributes['text'].value;
			divAttributes["link"] = rootDivs[0].attributes['link'].value;
			divAttributes["targ"] = rootDivs[0].attributes['targ'].value;
			divAttributes["active"] = rootDivs[0].attributes['active'].value;
		}
		else {
			divAttributes["text"] = rootDivs[0].getAttribute("text");
			divAttributes["link"] = rootDivs[0].getAttribute("link");
			divAttributes["targ"] = rootDivs[0].getAttribute("targ");
			divAttributes["active"] = rootDivs[0].getAttribute("active");
		}
		
		
		if(bw.mac && bw.ie) {
			pathmenu1.makeMenu('a1', '', '&nbsp;', '', '', 36, -1, "", "", "hidden", "hidden")
			dummyMenu = true;
		}
		else {
			if (!bw.moz) {
				pathmenu1.makeMenu('a1', '', '&nbsp;', '', '', 22, -1, "", "", "hidden", "hidden")
				dummyMenu = true;
			}
		}
	
	
		
		// total width of every menu is 755 so that we can center it like the rest of the site
		// of course only the 'real' menu is visible
		pathmenu1.makeMenu('h1a', '', '&nbsp;', '', '', 169, -1, "", "", "hidden", "hidden")
		
		if(divAttributes["active"]=="yes")
			pathmenu1.makeMenu(menuPraefix1 , '', spacingGifTag1+divAttributes["text"], divAttributes["link"], divAttributes["targ"], 201, 16, '', '', rootClassOver, rootClassOver, '', '', '', 'pathmenu2.hidesub(); pathmenu3.hidesub();')
		else
			pathmenu1.makeMenu(menuPraefix1, '', spacingGifTag1+divAttributes["text"], divAttributes["link"], divAttributes["targ"], 201, 16, '', '', rootClass, rootClassOver, '', '', '', 'pathmenu2.hidesub(); pathmenu3.hidesub();')
		
//		pathmenu1.makeMenu('h1b', '', '&nbsp;', '', '', 373, -1, "", "", "hidden", "hidden")
		pathmenu1.makeMenu('h1b', '', '&nbsp;', '', '', 373, -1, "", "", "hidden", "hidden")		

		makeSubs(pathmenu1, menuPraefix1, rootDivs[0], 0, 1);
		
		pathmenu1.construct();
		
		// hide the stuff that only has been built for place holding reasons
		pathmenu1.m["h1a"].o.evnt.style.visibility = "hidden";
		pathmenu1.m["h1a"].b.evnt.style.visibility = "hidden";
		pathmenu1.m["h1b"].o.evnt.style.visibility = "hidden";
		pathmenu1.m["h1b"].b.evnt.style.visibility = "hidden";
		
		if(dummyMenu==true) {
			pathmenu1.m["a1"].o.evnt.style.visibility = "hidden";
			pathmenu1.m["a1"].b.evnt.style.visibility = "hidden";
		}
		
	}
	
	
	//------------------------------------------------------
	// here we build the second level of the path navigation
	//------------------------------------------------------
	if(path2div) {
		var srcDiv = document.getElementById(path2div);
		var rootDivs = getDivChildren(srcDiv);
		var divAttributes = new Array();
		
		// there should be only 1 div in the root level!!!
		if(rootDivs[0].attributes['text']) {
			divAttributes["text"] = rootDivs[0].attributes['text'].value;
			divAttributes["link"] = rootDivs[0].attributes['link'].value;
			divAttributes["targ"] = rootDivs[0].attributes['targ'].value;
			divAttributes["active"] = rootDivs[0].attributes['active'].value;
		}
		else {
			divAttributes["text"] = rootDivs[0].getAttribute("text");
			divAttributes["link"] = rootDivs[0].getAttribute("link");
			divAttributes["targ"] = rootDivs[0].getAttribute("targ");
			divAttributes["active"] = rootDivs[0].getAttribute("active");
		}
		
		
		if(bw.mac && bw.ie) {
			pathmenu2.makeMenu('a2', '', '&nbsp;', '', '', 36, -1, "", "", "hidden", "hidden")
			//spacemenu1.makeMenu('a2', '', '&nbsp;', '', '', 36, -1, "", "", "hidden", "hidden")
			dummyMenu = true;
		}
		else {
			if (!bw.moz) {
				pathmenu2.makeMenu('a2', '', '&nbsp;', '', '', 22, -1, "", "", "hidden", "hidden")
				//spacemenu1.makeMenu('a2', '', '&nbsp;', '', '', 22, -1, "", "", "hidden", "hidden")
				dummyMenu = true;
			}
		}
	
	
		
//	spacemenu1.makeMenu('s1a', '', '&nbsp;', '', '', 383, -1, "", "", "hidden", "hidden");
 // 	spacemenu1.makeMenu('s1', '', '>', '', '', 9, 13, "", "", "subNavSpacing", "subNavSpacing", '', '', 1);
//  	spacemenu1.makeMenu('s1b', '', '&nbsp;', '', '', 362, -1, "", "", "hidden", "hidden")
	
		// total width of every menu is 755 so that we can center it like the rest of the site
		// of course only the 'real' menu is visible
		pathmenu2.makeMenu('h2a', '', '&nbsp;', '', '', 394, -1, "", "", "hidden", "hidden")
		
		if(divAttributes["active"]=="yes")
			pathmenu2.makeMenu(menuPraefix2, '', spacingGifTag1+divAttributes["text"], divAttributes["link"], divAttributes["targ"], 201, 16, '', '', rootClassOver, rootClassOver, '', '', '', 'pathmenu1.hidesub(); pathmenu3.hidesub();')
		else
			pathmenu2.makeMenu(menuPraefix2, '', spacingGifTag1+divAttributes["text"], divAttributes["link"], divAttributes["targ"], 201, 16, '', '', rootClass, rootClassOver, '', '', '', 'pathmenu1.hidesub(); pathmenu3.hidesub();')
			
		pathmenu2.makeMenu('h2b', '', '&nbsp;', '', '', 201, -1, "", "", "hidden", "hidden")
		
		makeSubs(pathmenu2, menuPraefix2, rootDivs[0], 0, 2);
		
		pathmenu2.construct();
//		spacemenu1.construct();
		
		// hide the stuff that only has been built for place holding reasons
		pathmenu2.m["h2a"].o.evnt.style.visibility = "hidden";
		pathmenu2.m["h2a"].b.evnt.style.visibility = "hidden";
		pathmenu2.m["h2b"].o.evnt.style.visibility = "hidden";
		pathmenu2.m["h2b"].b.evnt.style.visibility = "hidden";
		
//		spacemenu1.m["s1a"].o.evnt.style.visibility = "hidden";
//		spacemenu1.m["s1a"].b.evnt.style.visibility = "hidden";
//		spacemenu1.m["s1b"].o.evnt.style.visibility = "hidden";
//		spacemenu1.m["s1b"].b.evnt.style.visibility = "hidden";
		
		if(dummyMenu==true) {
			pathmenu2.m["a2"].o.evnt.style.visibility = "hidden";
			pathmenu2.m["a2"].b.evnt.style.visibility = "hidden";
//			spacemenu1.m["a2"].o.evnt.style.visibility = "hidden";
//			spacemenu1.m["a2"].b.evnt.style.visibility = "hidden";
		}
		
	}
	
	
	
	//------------------------------------------------------
	// here we build the third level of the path navigation
	//------------------------------------------------------
	if(path3div) {
		var srcDiv = document.getElementById(path3div);
		var rootDivs = getDivChildren(srcDiv);
		var divAttributes = new Array();
		
		// there should be only 1 div in the root level!!!
		if(rootDivs[0].attributes['text']) {
			divAttributes["text"] = rootDivs[0].attributes['text'].value;
			divAttributes["link"] = rootDivs[0].attributes['link'].value;
			divAttributes["targ"] = rootDivs[0].attributes['targ'].value;
			divAttributes["active"] = rootDivs[0].attributes['active'].value;
		}
		else {
			divAttributes["text"] = rootDivs[0].getAttribute("text");
			divAttributes["link"] = rootDivs[0].getAttribute("link");
			divAttributes["targ"] = rootDivs[0].getAttribute("targ");
			divAttributes["active"] = rootDivs[0].getAttribute("active");
		}
		
		
		if(bw.mac && bw.ie) {
			pathmenu3.makeMenu('a3', '', '&nbsp;', '', '', 36, -1, "", "", "hidden", "hidden")
//			spacemenu2.makeMenu('a3', '', '&nbsp;', '', '', 36, -1, "", "", "hidden", "hidden")
			dummyMenu = true;
		}
		else {
			if (!bw.moz) {
				pathmenu3.makeMenu('a3', '', '&nbsp;', '', '', 22, -1, "", "", "hidden", "hidden")
//				spacemenu2.makeMenu('a3', '', '&nbsp;', '', '', 22, -1, "", "", "hidden", "hidden")
				dummyMenu = true;
			}
		}
	
	
/*		
	spacemenu2.makeMenu('s2a', '', '&nbsp;', '', '', 608, -1, "", "", "hidden", "hidden");
  	spacemenu2.makeMenu('s2', '', '>', '', '', 9, 13, "", "", "subNavSpacing", "subNavSpacing", '', '', 1);
  	spacemenu2.makeMenu('s2b', '', '&nbsp;', '', '', 151, -1, "", "", "hidden", "hidden")
*/	
		// total width of every menu is 755 so that we can center it like the rest of the site
		// of course only the 'real' menu is visible
		pathmenu3.makeMenu('h3a', '', '&nbsp;', '', '', 618, -1, "", "", "hidden", "hidden")
		
		if(divAttributes["active"]=="yes")
			pathmenu3.makeMenu(menuPraefix3, '', spacingGifTag1+divAttributes["text"], divAttributes["link"], divAttributes["targ"], 203, 16, '', '', rootClassOver, rootClassOver, '', '', '', 'pathmenu1.hidesub(); pathmenu2.hidesub();')
		else
			pathmenu3.makeMenu(menuPraefix3, '', spacingGifTag1+divAttributes["text"], divAttributes["link"], divAttributes["targ"], 203, 16, '', '', rootClass, rootClassOver, '', '', '', 'pathmenu1.hidesub(); pathmenu2.hidesub();')
			
		pathmenu3.makeMenu('h3b', '', '&nbsp;', '', '', 1, -1, "", "", "hidden", "hidden")
		
		makeSubs(pathmenu3, menuPraefix3, rootDivs[0], 0, 3 );
		
		pathmenu3.construct();
		// onclck bewirkt, daß das dropdown geöffnet bzw. sichtbar gesetzt wird
		// #49556: neuer Parameter autoOpen
// CBG: Drop-Down nicht autom. öffnen;
//		pathmenu3.onclck(menuPraefix3, true);


//		spacemenu2.construct();
		
		// hide the stuff that only has been built for place holding reasons
		pathmenu3.m["h3a"].o.evnt.style.visibility = "hidden";
		pathmenu3.m["h3a"].b.evnt.style.visibility = "hidden";
		pathmenu3.m["h3b"].o.evnt.style.visibility = "hidden";
		pathmenu3.m["h3b"].b.evnt.style.visibility = "hidden";
/*		
		spacemenu2.m["s2a"].o.evnt.style.visibility = "hidden";
		spacemenu2.m["s2a"].b.evnt.style.visibility = "hidden";
		spacemenu2.m["s2b"].o.evnt.style.visibility = "hidden";
		spacemenu2.m["s2b"].b.evnt.style.visibility = "hidden";
*/		
		if(dummyMenu==true) {
			pathmenu3.m["a3"].o.evnt.style.visibility = "hidden";
			pathmenu3.m["a3"].b.evnt.style.visibility = "hidden";
//			spacemenu2.m["a3"].o.evnt.style.visibility = "hidden";
//			spacemenu2.m["a3"].b.evnt.style.visibility = "hidden";
		}
		
	}
	
	
/*		
	//------------------------------------------------------
	// here we build the fourth level of the path navigation
	//------------------------------------------------------
	if(path4div) {
		var srcDiv = document.getElementById(path4div);
		var rootDivs = getDivChildren(srcDiv);
		var divAttributes = new Array();
		
		// there should be only 1 div in the root level!!!
		if(rootDivs[0].attributes['text']) {
			divAttributes["text"] = rootDivs[0].attributes['text'].value;
			divAttributes["link"] = rootDivs[0].attributes['link'].value;
			divAttributes["targ"] = rootDivs[0].attributes['targ'].value;
			divAttributes["active"] = rootDivs[0].attributes['active'].value;
		}
		else {
			divAttributes["text"] = rootDivs[0].getAttribute("text");
			divAttributes["link"] = rootDivs[0].getAttribute("link");
			divAttributes["targ"] = rootDivs[0].getAttribute("targ");
			divAttributes["active"] = rootDivs[0].getAttribute("active");
		}
		
		
		if(bw.mac && bw.ie) {
			pathmenu4.makeMenu('a4', '', '&nbsp;', '', '', 36, -1, "", "", "hidden", "hidden")
			dummyMenu = true;
		}
		else {
			if (!bw.moz) {
				pathmenu4.makeMenu('a4', '', '&nbsp;', '', '', 22, -1, "", "", "hidden", "hidden")
				dummyMenu = true;
			}
		}
	
	
		// total width of every menu is 755 so that we can center it like the rest of the site
		// of course only the 'real' menu is visible
		pathmenu4.makeMenu('h4a', '', '&nbsp;', '', '', 169, -1, "", "", "hidden", "hidden")
		
		if(divAttributes["active"]=="yes")
			pathmenu4.makeMenu(menuPraefix4 , '', spacingGifTag1+divAttributes["text"], divAttributes["link"], divAttributes["targ"], 201, 16, '', '', rootClassOver, rootClassOver, '', '', '', 'pathmenu3.hidesub(); pathmenu4.hidesub();')
		else
			pathmenu4.makeMenu(menuPraefix4, '', spacingGifTag1+divAttributes["text"], divAttributes["link"], divAttributes["targ"], 201, 16, '', '', rootClass, rootClassOver, '', '', '', 'pathmenu3.hidesub(); pathmenu4.hidesub();')
		
		pathmenu4.makeMenu('h4b', '', '&nbsp;', '', '', 373, -1, "", "", "hidden", "hidden")
		
		makeSubs(pathmenu4, menuPraefix4, rootDivs[0], 0, 4);
		
		pathmenu4.construct();
		
		// hide the stuff that only has been built for place holding reasons
		pathmenu4.m["h4a"].o.evnt.style.visibility = "hidden";
		pathmenu4.m["h4a"].b.evnt.style.visibility = "hidden";
		pathmenu4.m["h4b"].o.evnt.style.visibility = "hidden";
		pathmenu4.m["h4b"].b.evnt.style.visibility = "hidden";
		
		if(dummyMenu==true) {
			pathmenu4.m["a4"].o.evnt.style.visibility = "hidden";
			pathmenu4.m["a4"].b.evnt.style.visibility = "hidden";
		}
	}
*/		
	
	
}

// generate the dropdown menus for a rootmenu
function makeSubs(menuObj, parentMenuName, divObj, closeLine, mnupath) {
	var menuName, menuH;
	var subDivs = new Array();
	subDivs = getDivChildren(divObj);
	var spacingGifTag2 = '<img src="img/1x1.gif" width="4" height="1">';
	var divAttributes = new Array();
		
	for(var x=0; x<subDivs.length; x++) {
		menuName = parentMenuName + menuId++;
		
		if(subDivs[x].attributes['text']) {
			divAttributes["text"] = subDivs[x].attributes['text'].value;
			divAttributes["link"] = subDivs[x].attributes['link'].value;
			divAttributes["targ"] = subDivs[x].attributes['targ'].value;
		}
		else {
			divAttributes["text"] = subDivs[x].getAttribute("text");
			divAttributes["link"] = subDivs[x].getAttribute("link");
			divAttributes["targ"] = subDivs[x].getAttribute("targ");
		}
	
/*	if(divAttributes["text"].length > 44)
	{
      menuH = 45;
    }
    else
    {
      if(divAttributes["text"].length > 22)
      {
        menuH = 32;
      }
      else
      {
        menuH = 19;
      }
    }	*/

    var tmp = 0;
    var menuH = 19;
    var trenn = 30;	// @@	Anzahl Zeichen bis getrennt wird

	// quick and dirty solution to prevent script errors if a menu is null (one of the problems in 48865)
	// as a result, the menu will not be displayed but at least we won't get errors
	if(null == divAttributes["text"]) { divAttributes["text"] = "" } ;

    if (mnupath == 1 || mnupath == 2)
    { trenn = 31;
      tmp = trimchecker(divAttributes["text"], trenn);

      if (tmp != -1)
      { if (tmp == 1)
          menuH = 19;

        if (tmp == 2)
          menuH = 32;

        if (tmp == 3)
          menuH = 45;
      }
      else
      { if(divAttributes["text"].length > (trenn * 2))
        { menuH = 45;
        }
        else
        { if(divAttributes["text"].length > trenn+2)
            menuH = 32;
          else
            menuH = 19;
        }
      }
    }

    if (mnupath == 3)
    { trenn = 21;
      tmp = trimchecker(divAttributes["text"], trenn);

      if (tmp != -1)
      { if (tmp == 1)
          menuH = 19;

        if (tmp == 2)
          menuH = 32;

        if (tmp == 3)
          menuH = 45;
      }
      else
      { if(divAttributes["text"].length > (trenn * 2))
        { menuH = 45;
        }
        else
        { if(divAttributes["text"].length > trenn)
            menuH = 32;
          else
            menuH = 19;
        }
      }
    }


		menuObj.makeMenu(menuName, parentMenuName, trim(divAttributes["text"], trenn), divAttributes["link"], divAttributes["targ"], '', menuH)
		
		makeSubs(menuObj, menuName, subDivs[x], 0, mnupath);
	}

  // provide a last menu entry at the bottom that allows the user to close the menu by clicking.
  if(closeLine==1)
  {
    menuName = parentMenuName + menuId++;
    // der letzte hier übergebene Parameter ist Parameter 15 und bedeutet onclick
    menuObj.makeMenu(menuName, parentMenuName, spacingGifTag2+"<div style='font-size:9px; font-weight:bold;'>[x] Menü schließen</div>", '', '', '', 19, '', '', '', '', '', '', '', menuObj.name+".onclck('"+parentMenuName+"');");
  }
}


// this funciton hides the borders of the invisible part of a menu
function hideBorders(menuObj, nr, dummyBool) {
	var mid;

	menuObj.m["h"+nr+"a"].o.evnt.style.visibility = "hidden";
	menuObj.m["h"+nr+"a"].b.evnt.style.visibility = "hidden";
	menuObj.m["h"+nr+"b"].o.evnt.style.visibility = "hidden";
	menuObj.m["h"+nr+"b"].b.evnt.style.visibility = "hidden";
	
	if(dummyBool==true) {
		menuObj.m["a"+nr].o.evnt.style.visibility = "hidden";
		menuObj.m["a"+nr].b.evnt.style.visibility = "hidden";
	}
}

function trim(text, max)
{
  var words = text.split(" ");
  var finalStr = "";
  var temp = "";
  var splitter = "- <br />";

  for (var i = 0; i < words.length; i++)
  {
    temp = words[i];

    if (temp.length > max)
    {
      var t = "";

      //Wort ist länger als max, also trennen
      for (var j = 0; j < temp.length; j += max)
      {
        t += temp.substr(j, max) + splitter;
      }

      //letztes "- " abschneiden
      if (t.substr(t.length - 8, 8) == splitter)
      {
        t = t.substr(0, t.length - 8);
      }

      finalStr += t + " ";
      t = "";
    }
    else
      finalStr += temp + " ";
  }

  //letztes " " abschneiden
  if (finalStr.substr(finalStr.length - 1, 1) == " ")
    finalStr = finalStr.substr(0, finalStr.length - 1);

  // return finalStr;

  //return '<table border="0" cellpadding="0" cellspacing="0"><tr><td width="4"><img src="img/1x1.gif" width="4"></td><td><span class="subNavTemp">' + finalStr + '</span></td></tr></table>';
  //return finalStr;
  //return '<div class="subNavTemp" style="position: absolute;"><table class="subNavTemp" border="0" cellpadding="0" cellspacing="0"><tr><td width="4"><img src="img/1x1.gif" width="4"></td><td class="subNavTemp">' + finalStr + '</td></tr></table></div>';

  if (bw.moz)
    return '<table border="0" cellpadding="0" cellspacing="0"><tr><td width="4"><img src="img/1x1.gif" width="4"></td><td><span class="subNavTemp">' + finalStr + '</span></td></tr></table>';
  else
    return '<table class="subNavTemp" style="position: absolute;" border="0" cellpadding="0" cellspacing="0"><tr><td width="4"><img src="img/1x1.gif" width="4"></td><td class="subNavTemp">' + finalStr + '</td></tr></table>';
  
}


function trimchecker(text, max)
{
  var words = text.split(" ");
  var finalStr = "";
  var temp = "";
  var splitter = "- <br />";
  var splitcount = 0;
  var splitted = false;

  for (var i = 0; i < words.length; i++)
  {
    temp = words[i];

    if (temp.length > max)
    {
      var t = "";

      //Wort ist länger als max, also trennen
      for (var j = 0; j < temp.length; j += max)
      {
        t += temp.substr(j, max) + splitter;
        splitcount++;
        splitted = true;
      }

      //letztes "- " abschneiden
      if (t.substr(t.length - 8, 8) == splitter)
      {
        t = t.substr(0, t.length - 8);
      }

      finalStr += t + " ";
      t = "";
    }
    else
    { finalStr += temp + " ";
    }
  }

  //letztes " " abschneiden
  if (finalStr.substr(finalStr.length - 1, 1) == " ")
    finalStr = finalStr.substr(0, finalStr.length - 1);

  if (splitted == true)
    return splitcount;
  else
    return -1;
}
