var ie = document.all ? true : false;
var ns6 = (document.getElementById)? true:false;
var ns4 = (document.layers)? true:false;

var anz_mainmenu = 4;

function printMenus() {
//anz_mainmenu defeiniert in menu_show.js
  if(anz_mainmenu < 1 || anz_mainmenu > menuLinks.length) {
    anz_mainmenu = menuLinks.length;
    }
 for (var i=0;i<anz_mainmenu;i++) {
	//print menurahmen anfang
	if(is.ns4){
		document.write("<layer name=\"m"+ (i+1) +"\" position=\"absolute\" left=\"0\" top=\"0\" width=\"179\" z-index=\"11\" visibility=\"hidden\" >")
	} else {
	//if(ie || ns6)
		document.write("<div id=\"m"+ (i+1) +"\" style=\"position:absolute; left:0; top:0; width:179; z-index:11; visibility: hidden\" >")
	}
	document.write("<table  border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"179\">");
	var header=true;
         var linecount = 1;
	for (var text in menuLinks[i]) {
	         //print Menuzeile
	         if(header) {
	                 //Beim ersten Eintrag Menuüberschrift
	                  document.write("<tr>");
	                  document.write("  <td colspan=\"3\"><a href=\""+menuLinks[i][text]+"\" ><img src=\"designelemente/1t.gif\" width=\"179\" height=\"140\" border=\"0\"></a><\/td>");
	                  document.write("<\/tr><tr>");
	                  document.write("  <td bgcolor=\"#ffffff\"><img src=\"designelemente/1t.gif\" width=\"15\" height=\"1\" border=\"0\"><\/td>");
	                  document.write("  <td bgcolor=\"#ffffff\"><img src=\"designelemente/1t.gif\" width=\"15\" height=\"1\" border=\"0\"><\/td>");
	                  document.write("  <td bgcolor=\"#ffffff\"><img src=\"designelemente/1t.gif\" width=\"149\" height=\"1\" border=\"0\"><\/td>");
	                  document.write("<\/tr><tr>");
	                  document.write("  <td bgcolor=\"#F2F1E7\"><a href=\""+menuLinks[i][text]+"\" class=\"hp-navi-1\"><img src=\"designelemente/pf_r_lo.gif\" width=\"15\" height=\"19\" border=\"0\"><\/a><\/td>");
	                  document.write("  <td bgcolor=\"#F2F1E7\" colspan=\"2\" valign=\"middle\" class=\"hp-navi-1\"><a href=\""+menuLinks[i][text]+"\" class=\"hp-navi-1\">"+text+"<\/a><\/td>");
	                  document.write("<\/tr>");
	                  header=false;
	         } else {
	                  //normale Menuzeile
	                  document.write("<tr>");
	                  document.write("  <td colspan=\"3\" bgcolor=\"#98A92A\"><img src=\"designelemente/1t.gif\" width=\"2\" height=\"1\" border=\"0\"><\/td>");
	                  document.write("<\/tr><tr>");
	                  document.write("  <td bgcolor=\"#E3E1CC\"><img src=\"designelemente/1t.gif\" width=\"15\" height=\"1\" border=\"0\"><\/td>");
	                  document.write("  <td bgcolor=\"#E3E1CC\"><a href=\""+menuLinks[i][text]+"\"  onmouseout=\"MM_swapImgRestore()\" onmouseover=\"MM_swapImage('Image"+i+linecount+"','','designelemente/pf_r_hi.gif',1)\"  onmouseout=\"MM_swapImgRestore()\" onmouseover=\"MM_swapImage('Image"+i+linecount+"','','designelemente/i_quadr_gruen_hp2_r.gif',1)\" class=\"hp-navi-2\"><img name=\"Image"+i+linecount+"\" src=\"designelemente/pf_r_lo.gif\" width=\"15\" height=\"19\" border=\"0\"></a><\/td>");
	                  document.write("  <td bgcolor=\"#E3E1CC\" valign=\"middle\"><a href=\""+menuLinks[i][text]+"\"  onmouseout=\"MM_swapImgRestore()\" onmouseover=\"MM_swapImage('Image"+i+linecount+"','','designelemente/pf_r_hi.gif',1)\"  onmouseout=\"MM_swapImgRestore()\" onmouseover=\"MM_swapImage('Image"+i+linecount+"','','designelemente/i_quadr_gruen_hp2_r.gif',1)\" class=\"hp-navi-2\">"+text+"<\/a><\/td>");
	                  document.write("<\/tr>");
	          }
         linecount++;
         }
	//print menurahmen ende
	document.write("<tr>");
	document.write("  <td colspan=\"3\" bgcolor=\"#ffffff\"><img src=\"designelemente/1t.gif\" width=\"2\" height=\"2\" border=\"0\"><\/td>");
	document.write("<\/tr></table>");
	document.write("");
	if(is.ns4){
		document.write("<\/layer>")
	}else {
		document.write("<\/div>")
	}
 }//end for menus
}

function printCleanRahmen()
  {
  document.write("<div id=\"cleanLeft\" style=\"position:absolute; left:0; top:0; z-index:1; visibility: visible\"><a href=\"#\" onmouseover=\"clean()\" onmouseout=\"clean()\"><img src=\"designelemente/1t.gif\" height=\"260\" width=\"100\" border=\"0\"><\/a><\/div>");
  document.write("<div id=\"cleanRight\" style=\"position:absolute; left:0; top:0; z-index:2; visibility: visible\"><a href=\"#\" onmouseover=\"clean()\" onmouseout=\"clean()\"><img src=\"designelemente/1t.gif\" height=\"260\" width=\"100\" border=\"0\"><\/a><\/div>");
  document.write("<div id=\"cleanTop\" style=\"position:absolute; left:0; top:0; z-index:3; visibility: visible\"><a href=\"#\" onmouseover=\"clean()\" onmouseout=\"clean()\"><img src=\"designelemente/1t.gif\" width=\"1200\" height=\"100\" border=\"0\"><\/a><\/div>");
  document.write("<div id=\"cleanBottom\" style=\"position:absolute; left:0; top:0; z-index:4; visibility: visible\"><a href=\"#\" onmouseover=\"clean()\" onmouseout=\"clean()\"><img src=\"designelemente/1t.gif\" width=\"1600\" height=\"100\" border=\"0\"><\/a><\/div>");
  }

function printMetaMenus()
  {
 for (var i=anz_mainmenu;i<menuLinks.length;i++) {
	//print menurahmen anfang
	if(is.ns4){
		document.write("<layer name=\"m"+ (i+1) +"\" position=\"absolute\" left=\"0\" top=\"0\"    z-index=\"41\" visibility=\"hidden\" >")
	} else {
	//if(ie || ns6)
		document.write("<div id=\"m"+ (i+1) +"\" style=\"position:absolute; left:0; top:0; visibility: hidden\" >")
	}
	document.write("<table width=\"100%\"  border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
	document.write("<tr>");
	document.write("<td align=\"left\">");
	document.write("<table  border=\"0\" cellspacing=\"0\" cellpadding=\"0\"  bgcolor=\"#E3E1CC\">");

         var linecount = 1;
	for (var text in menuLinks[i]) {
	         //1. Eintrag überspringen, da Metamanus nur die Entraege 2ter Ebene darstellen
                  if (linecount == 1) {
                     linecount++;
                     continue;
                  }
                  //normale Menuzeile
	         document.write("<tr>");
	         document.write("  <td bgcolor=\"#98A92A\"><img src=\"designelemente/1t.gif\" width=\"15\" height=\"1\" border=\"0\"><\/td>");
	         document.write("  <td bgcolor=\"#98A92A\"><img src=\"designelemente/1t.gif\" width=\"105\" height=\"1\" border=\"0\"><\/td>");
	         document.write("<\/tr>");
	         document.write("<tr>");
	         document.write("  <td><img name=\"Image10" + linecount + "\" src=\"designelemente/pf_r_lo.gif\" width=\"15\" height=\"19\" border=\"0\"><\/td>");
	         document.write("  <td valign=\"middle\"><a href=\""+menuLinks[i][text]+"\" class=\"hp-navi-2\" onmouseout=\"MM_swapImgRestore()\" onmouseover=\"MM_swapImage('Image10" + linecount + "','','designelemente/pf_r_hi.gif',1)\">" + text + "&nbsp;<\/a><\/td>");
	         document.write("<\/tr>");
	         linecount++;
         }
	//print menurahmen ende
	document.write("<tr>");
	document.write("  <td colspan=\"2\" bgcolor=\"#98A92A\"><img src=\"designelemente/1t.gif\" width=\"120\" height=\"1\" border=\"0\"><\/td>");
	document.write("<\/tr>");
	document.write("<\/table>");
	document.write("<\/td><\/tr>");
	document.write("<\/table>");
	if(is.ns4){
		document.write("<\/layer>")
	}else {
		document.write("<\/div>")
	}
   }
}