hauptMenuPunkte = 10;
menuY = 40;
menuX = 10;

function init() {
   hauptMenu = new Array();
   subMenu = new Array();
   for (i=1;i<=hauptMenuPunkte;i++) {
      hauptMenu[i] = new XElement("menu"+i);
      subMenu[i] = new XElement("menu"+i+"sub");
      subMenu[i].verstecke();
   }
   	ordnen();
   	if(document.getElementById)
	document.getElementById("navi").style.visibility="visible"
	else if(document.layers)
	document.layers["navi"].visibility="visible"
}

/*---------------------------------*/
function XElement(id) 
{
   //W3C-konform, Netscape 6
   if (document.getElementById) 
   {
      this.el = document.getElementById(id);
      this.css = this.el.style;
   }
   //Internet Explorer 
   else if (document.all) 
   {
      this.el = document.all[id];
      this.css = this.el.style;
   }
   //Netscape Navigator 4
   else if (document.layers) 
   {
      this.el = document.layers[id];
      this.css = this.el;
   }
   this.x = parseInt(this.css.left);
   this.y = parseInt(this.css.top);
   this.zIndex = this.css.zIndex;
   this.sichtbar = true;
   
   if (document.layers) 
   {
      this.breite = this.el.document.width;
      this.hoehe = this.el.document.height;
   }
   else 
   {
      this.breite = this.el.offsetWidth;
      this.hoehe = this.el.offsetHeight;
   }
   this.gehNach = XElement_gehNach;
   this.zeige = XElement_zeige;
   this.verstecke = XElement_verstecke;
}
/*---------------------------------*/
function klapp(nr) 
{
	/*Falls das Untermenu bereits sichtbar, wieder verstecken*/
   if (subMenu[nr].sichtbar) subMenu[nr].verstecke();
   /*Das Untermenu sichtbar machen*/
   else subMenu[nr].zeige();
   ordnen();
}
/*---------------------------------*/
function oeffne(nr) 
{
   /*Das Untermenu sichtbar machen*/
   subMenu[nr].zeige();
   ordnen();
}
/*---------------------------------*/
function schliess(nr) 
{
	/*Falls das Untermenu bereits sichtbar, wieder verstecken*/
   if (subMenu[nr].sichtbar) subMenu[nr].verstecke();
   ordnen();
}
/*---------------------------------*/
function XElement_verstecke() 
{
   this.css.visibility = "hidden";
   this.sichtbar = false;
}
/*---------------------------------*/
function XElement_zeige() 
{
   this.css.visibility = "visible";
   this.sichtbar = true;
}
/*---------------------------------*/
function ordnen() 
{
   var posY = menuY;
   for (i=1;i<=hauptMenuPunkte;i++) 
   {
      hauptMenu[i].gehNach(menuX,posY);
      posY+=hauptMenu[i].hoehe;
      if (subMenu[i].sichtbar) 
	  {
         subMenu[i].gehNach(menuX+20,posY);
         posY+=subMenu[i].hoehe;
      }
   }   
}

function XElement_gehNach(x,y) {
   this.css.left = x;
   this.css.top = y;
   this.x = x;
   this.y = y;
}

function zeige(url){
	//location.href=url;
   alert("zeige  URL :\n"+url);
}

function openBabe(file,name)
{
        win = window.open (file, name,'resizable=no,scrollBars=no,height=350,width=470,top=80,left=180');
}

function openfenster(file,name)
{
        win = window.open (file, name,'resizable=no,scrollBars=no,height=300,width=285,top=100,left=150');
}

function ZeitAnzeigen() 
{
	var Wochentagname =  new Array("Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag");

	var Jetzt = new Date();
	var Tag = Jetzt.getDate();
	var Monat = Jetzt.getMonth() + 1;
	var Jahr = Jetzt.getYear();
	if(Jahr < 999) Jahr += 1900;
	var Stunden = Jetzt.getHours();
	var Minuten = Jetzt.getMinutes();
	var Sekunden = Jetzt.getSeconds();
	var WoTag = Jetzt.getDay();
	var Vortag  = ((Tag < 10) ? "0" : "");
	var Vormon  = ((Monat < 10) ? ".0" : ".");
	var Vorstd  = ((Stunden < 10) ? "0" : "");
	var Vormin  = ((Minuten < 10) ? ":0" : ":");
	var Vorsek  = ((Sekunden < 10) ? ":0" : ":");
	var Datum = Vortag + Tag + Vormon + Monat  + "." + Jahr;
	var Uhrzeit = Vorstd + Stunden + Vormin + Minuten + Vorsek + Sekunden;
	var Gesamt = Wochentagname[WoTag] + ", " + Datum + " " + Uhrzeit + " Uhr";

 if(DHTML) 
 {
   	if(NS) setCont("id","Uhr",null,"<div class=\"Uhr\">" + Gesamt + "<\/div>");
   	else   setCont("id","Uhr",null,Gesamt);
 }
 else return;

 window.setTimeout("ZeitAnzeigen()",1000);
}

 
var win = "";
function fenster(Grafik,width,height,name,titel)
 {
 	/*Dafür sorgen, dass immer nur ein Fenster geöffnet ist*/
	if (win != "")
 	{ 
 		/*Falls ein Fenster geöffnet ist, dieses erst schliessen*/
		win.close();
	}
   	win=window.open("",name,"width="+width+",height="+(height+60)+",left=150,top=50"); 
   	win.document.open("text/html");
   	win.document.write("<BODY leftmargin='0' topmargin='0' marginheight='0' marginwidth='0'>");
   	win.document.bgColor="#C8C8C8";
   		
		/*Stylesheets für das neue Fenster*/
   		win.document.write("<style type= text/css>" +
		"a{color:red; text-decoration:none; font-size:11px;font-family:Verdana,Arial,sans-serif; }" +
		"a:link { color:red; text-decoration:none; font-size:11px;font-family:Verdana,Arial,sans-serif; }" +
		"a:visited { text-decoration:none; color: red; font-size:11px;font-family:Verdana,Arial,sans-serif; }" +
		"a:hover { color: blue; text-decoration:none; font-size:11px;font-family:Verdana,Arial,sans-serif; }" +
		"a:active { color: red; text-decoration:none; font-size:11px;font-family:Verdana,Arial,sans-serif; }" +
		"</style>");
	win.focus();
   	win.document.linkColor="red";
   	win.document.vlinkColor="red";
   	win.document.write("<TITLE>" +titel +"</title>");
   	win.document.write("<IMG src='"+Grafik+"'>");
   	win.document.write("<div align=center>&nbsp;</div>");
   	win.document.write("<div align=center><a href='javascript:window.print()'>Seite drucken</a></div>");
   	win.document.write("<div align=center><a href='javascript:self.close()'>Fenster schlie&szlig;en</a></div>");
   	win = "";
}
 

var win = "";
function fenster_mit_text(Grafik,b,h,n,titel,text,zugabe)
{
 	/*Dafür sorgen, dass immer nur ein Fenster geöffnet ist*/
	if (win != ""&&win.closed==false)
 	{ 
 		/*Falls ein Fenster geöffnet ist, dieses erst schliessen*/
		win.close();
	}
   	win=window.open("",n,"width="+b+",height="+(h+zugabe)+",left=50,top=20"); 
   	win.document.open("text/html");
   	win.document.write("<BODY leftmargin='0' topmargin='0' marginheight='0' marginwidth='0'>");
   	win.document.bgColor="#C8C8C8";
   		
		/*Stylesheets für das neue Fenster*/
   		win.document.write("<style type= text/css>" +
		"a{color:red; text-decoration:none; font-size:11px;font-family:Verdana,Arial,sans-serif; }" +
		"a:link { color:red; text-decoration:none; font-size:11px;font-family:Verdana,Arial,sans-serif; }" +
		"a:visited { text-decoration:none; color: red; font-size:11px;font-family:Verdana,Arial,sans-serif; }" +
		"a:hover { color: blue; text-decoration:none; font-size:11px;font-family:Verdana,Arial,sans-serif; }" +
		"a:active { color: red; text-decoration:none; font-size:11px;font-family:Verdana,Arial,sans-serif; }" +
		"</style>");
	
	win.focus();
   	win.document.linkColor="red";
   	win.document.vlinkColor="red";
   	win.document.write("<TITLE>" +titel +"</title>");
   	win.document.write("<IMG src='"+Grafik+"'>");
   	win.document.write("<div align=center>" +text+ "</div>");
   	win.document.write("<div align=center>&nbsp;</div>");
   	win.document.write("<div align=center><a href='javascript:window.print()'>Seite drucken</a></div>");
   	win.document.write("<div align=center><a href='javascript:self.close()'>Fenster schlie&szlig;en</a></div>");
   	win = "";
}

var win = "";
function fenster_mit_scrollbalken(Grafik,width,height,name,titel)
 	{
 		/*Dafür sorgen, dass immer nur ein Fenster geöffnet ist*/
		if (win != "")
 	{ 
 		/*Falls ein Fenster geöffnet ist, dieses erst schliessen*/
		win.close();
	}
   win=window.open("",name,"width="+(width+60)+",height=550,left=150,top=50"); 

   win.document.open("text/html");
   win.document.write("<BODY leftmargin='0' topmargin='0' marginheight='0' marginwidth='0'>");
   win.document.bgColor="#C8C8C8";
   		
		/*Stylesheets für das neue Fenster*/
   		win.document.write("<style type= text/css>" +
		"a{color:red; text-decoration:none; font-size:11px;font-family:Verdana,Arial,sans-serif; }" +
		"a:link { color:red; text-decoration:none; font-size:11px;font-family:Verdana,Arial,sans-serif; }" +
		"a:visited { text-decoration:none; color: red; font-size:11px;font-family:Verdana,Arial,sans-serif; }" +
		"a:hover { color: blue; text-decoration:none; font-size:11px;font-family:Verdana,Arial,sans-serif; }" +
		"a:active { color: red; text-decoration:none; font-size:11px;font-family:Verdana,Arial,sans-serif; }" +
		"</style>");
		
   win.document.linkColor="red";
   win.document.vlinkColor="red";
   win.document.write("<TITLE>" +titel +"</title>");
   win.document.write("<div style='position:absolute;z-index:1;text-align:center;background-color:#none;left:20px;top:20px;height:490px;overflow:auto;width:"+(width+20)+"px;'><IMG src='"+Grafik+"'></div>");
   win.document.write("<div align=center>&nbsp;</div>");
   win.document.write("<div style='position:absolute;z-index:1;background-color:#none;text-align:center;width:"+(width+60)+"px;top:520px;'><a class='link_standard' href='javascript:window.print()'>Seite drucken</a> | <a class='link_standard' href='javascript:self.close()'>Fenster schlie&szlig;en</a></div>");
   win.document.close();
   win = "";
 }

 
function lade_Bilder() 
{
    if (document.images) 
    {
    	var allebilder = new Array ( 
		"images/dampf.gif",
		"images/schnipsel1.gif",
		"images/schnipsel2.gif",
		"images/schnipsel3.gif",
		"images/schnipsel4.gif",
		"images/schnipsel5.gif",
		"images/schnipsel6.gif",
		"images/schnipsel7.gif",
		"images/schnipsel8.gif",
		"images/logomaster.gif",
		"images/kottenmaster.gif",
		"images/schrift1master.gif",
		"images/schrift2master.gif",
		"images/prasisimon.gif");
    }
    bilderliste = new Array();
    for (zaehler in allebilder){
    bilderliste[zaehler] = new Image();
    bilderliste[zaehler].src = allebilder[zaehler];
    }
}


function resetIfBlank(pulldown) 
{
 	possiblenewlocation = pulldown[pulldown.selectedIndex].value;
	if (possiblenewlocation == "")
		pulldown.selectedIndex = 0;
}

function redirect(pulldown)
{
	newlocation = pulldown[pulldown.selectedIndex].value;
	if (newlocation != "")
	self.location = newlocation;
}