var hmenu=new Array();
var umenu=new Array();

// Menüs im Body erzeugen
/*
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
menu_create();
//-->
</SCRIPT>
*/

function hauptmenue(hname,urlm,target){
        this.hname=hname;
        this.jumpto=urlm;
        if (target == null) target = "_self";
        this.target=target;
        hdazu(this);
}

function hdazu(objekt){
        hmenu[hmenu.length]=objekt;
}

function udazu(objekt){
        umenu[umenu.length]=objekt;
}

function untermenue(von,uname,urlm,target){
        this.von=von;
        this.uname=uname;
        this.jumpto=urlm;
        if (target == null) target = "_self";
        this.target=target;
        udazu(this);
}

function menu_create(){
	var lpos1=220;
	var tpos1=110;
	
	for (var i=0; i<hmenu.length; i++){
		if (i < 4) {
			if (i == 0) {
				document.write("<div class=\"navtop1\" style=\"z-index:1000;position: absolute; left: "+(lpos1)+"px; top: "+tpos1+"px;\" id=\""+ hmenu[i].hname + "\" onClick=\"hidemenue();\" onMouseover=\"showmenue('_"+hmenu[i].hname + "');\"><a target='" + hmenu[i].target + "' href='" + hmenu[i].jumpto + "'>" + hmenu[i].hname + "</a></div>");
			}
			else {
				document.write("<div class=\"navtop1\" style=\"z-index:1000;position: absolute; left: "+(lpos1+=200)+"px; top: "+tpos1+"px;\" id=\""+ hmenu[i].hname + "\" onClick=\"hidemenue();\" onMouseover=\"showmenue('_"+hmenu[i].hname + "');\"><a target='" + hmenu[i].target + "' href='" + hmenu[i].jumpto + "'>" + hmenu[i].hname + "</a></div>");
			}
			document.write("<div class=\"navsub1\" style=\"z-index:1000;position: absolute; left: "+(lpos1)+"px; top: "+tpos1+"px;\" id=\"_" + hmenu[i].hname + "\" onClick=\"hidemenue();\">");
			for (var j=0; j<umenu.length; j++){
				if (umenu[j].von==hmenu[i].hname){
					document.write("<a target='" + umenu[j].target + "' href='" + umenu[j].jumpto + "' onMouseover=\"this.style.color='#FFF7E5';\" onMouseout=\"this.style.color='#15294D';\">" + umenu[j].uname + "</a><br>");
				}
			}
			document.write("</div>");
		}
	}
	
	var lpos2=0;
	var tpostop2=295;
	var tpossub2=295;
	
	document.write("<div id=\"left_menu\" style=\"position:absolute; left:0px; top:300px; width:455px; height:250px;\">");
		document.write("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
			for (var i=4; i<hmenu.length; i++){
				document.write("<tr>");
					document.write("<td class=\"navtop2\" valign=\"top\" width=\"195\" height=\"40\" id=\""+ hmenu[i].hname + "\" onClick=\"hidemenue();\" onMouseover=\"showmenue('_"+hmenu[i].hname + "');showpic("+i+");\" onMouseout=\"hidepic("+i+");\"><a target='" + hmenu[i].target + "' href='" + hmenu[i].jumpto + "'>" + hmenu[i].hname + "</a></td>");
					document.write("<td class=\"navtop2\" valign=\"top\" width=\"25\" height=\"40\"><img src=\"3_resource/gaphics/0.gif\" width=\"1\" height=\"40\"></td>");
					document.write("<td class=\"navsub2\" valign=\"top\" width=\"235\" height=\"40\" id=\"_" + hmenu[i].hname + "\" onClick=\"hidemenue();\">");
						for (var j=0; j<umenu.length; j++){
							if (umenu[j].von==hmenu[i].hname){
								document.write("<a target='" + umenu[j].target + "' href='" + umenu[j].jumpto + "' onMouseover=\"this.style.color='#FFF7E5';\" onMouseout=\"this.style.color='#15294D';\">" + umenu[j].uname + "</a><br>");
							}
						}
					document.write("</td>");
				document.write("</tr>");
			}
		document.write("</table>");
	document.write("</div>");
	
	
	
}

function showpic(i){
	document.getElementById("pic"+i).style.visibility="inherit";
}

function hidepic(i){
	document.getElementById("pic"+i).style.visibility="hidden";
}

function showmenue(dasda){
    hidemenue();
	if (document.getElementById(dasda).firstChild != null){
		document.getElementById(dasda).style.visibility="inherit";
		document.getElementById('left_menu').style.zIndex=1000;
	}
}

function hidemenue(){   // NS + MSIE
	for (var i=0; i<hmenu.length; i++) {
  		document.getElementById("_"+hmenu[i].hname).style.visibility="hidden";
  		document.getElementById('left_menu').style.zIndex=0;
	}
}

