var all_layers = Array();

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}


// Hauptmen¸s ////////////////////
//////////////////////////////////
//////////////////////////////////
function makemenu(layerdirection, layers, layername, cellwidth, cellheight, layerleft, layertop, layerwidth, layerheight, zindex, visible)
{
if (layername != "kon" && layername != "hauptmenu") all_layers[all_layers.length] = layername;
// layerhead
	// style
	

	document.writeln("<style type=text/css>");
	document.writeln(".layerstyle"+zindex+" {");
	document.writeln("position:absolute;");
	document.writeln("left:"+layerleft+"px;");
	document.writeln("top:"+layertop+"px;");
	//document.writeln("width:"+layerwidth+"px;");
	//document.writeln("height:"+layerheight+"px;");
	document.writeln("z-index:"+zindex+";");
	document.writeln(" visibility:"+visible+";");
	document.writeln("}</style>");

	document.writeln('<div id='+layername+' class="layerstyle'+zindex+'">\n\r');

// Horizontales Men¸
if (layerdirection == 'hor') 
	{
		//tablehead
		document.writeln('<table height="20" border="0" cellpadding="0" cellspacing="0"><tr>\n\r');
			
			// Tabellenzellen
			for (cell=0; cell<layers.length; cell++)
			{
			 document.writeln('<td width="'+cellwidth+'" height="'+cellheight+'" align="left" bgcolor="FFF300" nowrap>');   //navi hintergrund
			 document.writeln('<a href="'+layers[cell][1]+'" class="menutext2"');
			 document.writeln(" onmouseOver=\"showlayer('"+layers[cell][2]+"');\"");
			 document.writeln('>&nbsp;'+layers[cell][0]+'</a></td>\n\r');
				if (cell<layers.length-1)
					 {document.writeln('<td width="2" bgcolor="white"><img src="images/spacer.gif" width="2" height="20"></td>\n\r');}
			}

		// tablebottom
		document.writeln('</tr></table>\n\r');
}

// Horizontales Men¸
if (layerdirection == 'kon') 
	{
		//tablehead
		document.writeln('<table height="20" border="0" cellpadding="0" cellspacing="0"><tr>\n\r');
			
			// Tabellenzellen
			for (cell=0; cell<layers.length; cell++)
			{
			 document.writeln('<td width="'+cellwidth+'" height="'+cellheight+'" align="left" bgcolor="white" nowrap>');
			 document.writeln('<a href="'+layers[cell][1]+'" class="menutext2"');
			 document.writeln(" onmouseOver=\"showlayer('"+layers[cell][2]+"');\"");
			 document.writeln('>&nbsp;'+layers[cell][0]+'</a></td>\n\r');
				if (cell<layers.length-1)
					 {document.writeln('<td width="2" bgcolor="white"><img src="images/spacer.gif" width="2" height="15"></td>\n\r');}
			}

		// tablebottom
		document.writeln('</tr></table>\n\r');
}




// Vertikales Men¸
if (layerdirection == 'ver')
	{
		//tablehead
		document.writeln('<table border="0" cellpadding="0" cellspacing="0">\n\r');
			
			// Tabellenzellen
			for (cell=0; cell<layers.length; cell++)
			{
			 document.writeln('<tr><td width="'+cellwidth+'" height="'+cellheight+'" align="left" bgcolor="#FFFF99" nowrap>');
			 document.writeln('<a onmouseOver="setCloseTime();"');
			 document.writeln(' href="'+layers[cell][1]+'" class="menutext2">&nbsp;'+layers[cell][0]+'</a></td></tr>\n\r');
			if (cell<layers.length-1)
			 {document.writeln('<tr><td height="2" bgcolor="#FFFF99" align=center><img src="images/white.gif" height="1" width="129"></td></tr>\n\r');}
			}

		// tablebottom
		document.writeln('</table>\n\r');
}


//layerbottom
document.writeln('</div>\n\r');
}

//////////////////////////////////////////
//////////////////////////////////////////
//////////////////////////////////////////




// Contentmen¸s /////////////////////////
//////////////////////////////////////////
//////////////////////////////////////////

function makemenu2(layers,layername, menutext, visible, zindex)
{
// layerhead style
	var cellwidth = 139;
	var cellheight = 15;
	var cellheight2 = cellheight + 2;
	var rahmenlinks = 4;
	document.writeln("<style type=text/css>");
	document.writeln(".layer2style"+zindex+" {");
	document.writeln("position:absolute;");
	document.writeln("left:4px;");
	document.writeln("top:190px;");
	document.writeln("width:"+cellwidth+"px;");
	document.writeln("height:300px;");
	document.writeln("z-index:"+zindex+";");
	document.writeln(" visibility:"+visible+";");
	document.writeln("}</style>");

document.writeln('<div id='+layername+' class="layer2style'+zindex+'">\n\r');

		//tablehead
		document.writeln('<table border="0" width="'+cellwidth+'" cellpadding="0" cellspacing="0">\n\r');
		document.writeln('<tr><td bgcolor="#FFF300" height="'+cellheight+'">');        //navi hintergrund
		document.writeln('<img src="images/spacer.gif" width='+rahmenlinks+' height="'+cellheight+'">');
		document.writeln('</td><td bgcolor="#FFF300" nowrap class="menutext2" align="left" colspan="2">'+menutext2+'</td></tr>\n\r');  //navi hintergrund
		document.writeln('<tr><td height="3" colspan="3"><img src="images/spacer.gif" height="15" width="14"></td></tr>\n\r')
		
			// Tabellenzellen Navi links
			for (cell=0; cell<layers.length; cell++)
			{
				document.writeln('<tr><td><img src="images/spacer.gif" width='+rahmenlinks+'></td>');
				if (menupunkt_nr == (cell+1))
				{
				document.writeln('<td valign="top"><img src="images/spacer.gif" hspace=1 vspace=1></td>');
				document.writeln('<td width="'+cellwidth+'" height="'+cellheight2+'" align="left" valign="middle" nowrap>');
			 	document.writeln('<a href="'+layers[cell][1]+'" class="menutext2">'+layers[cell][0]+'</a></td></tr>\n\r');
				}
				else
				{
				document.writeln('<td valign="top"s><img src="images/spacer.gif" hspace=1 vspace=1></td>');
				document.writeln('<td width="'+cellwidth+'" height="'+cellheight2+'" align="left" valign="middle" nowrap>');
			 	document.writeln('<a href="'+layers[cell][1]+'" class="menuContentText">'+layers[cell][0]+'</a></td></tr>\n\r');
				}
			 	if (cell<layers.length-1)
			 		{document.writeln('<tr><td height="5" colspan="3"><img src="images/spacer.gif" height="5" width="14"></td></tr>\n\r');}
			}

		// tablebottom
		document.writeln('</table>\n\r');

//layerbottom
document.writeln('</div>\n\r');
}

//////////////////////////////////////////
//////////////////////////////////////////
//////////////////////////////////////////


function showlayer(layerid)
{
  for (layer_i=0;layer_i<all_layers.length;layer_i++)
  {
   MM_showHideLayers(all_layers[layer_i],'','hide');
  }
  MM_showHideLayers(layerid,'','show');
  setCloseTime();
}

function hideAll()
{
  for (layer_i=0;layer_i<all_layers.length;layer_i++)
  {
   MM_showHideLayers(all_layers[layer_i],'','hide');
  }
}

var aktiv = "nothing"; 
function setCloseTime()
{
	if (aktiv!="nothing") window.clearTimeout(aktiv);
	aktiv = window.setTimeout("hideAll()",2000);
}




//////////////////////////////////////////
//////////////////////////////////////////
//////////////////////////////////////////

function druckVersion()
{
	window.open('druckVersion.html','druckVersion','menubar=yes,scrollbars=yes,resizable=yes,width=800,height=600');
}
