/////////////////////////////////////////////////////////////////
/* JavaScript by KLIK! Klein Informatik | rklein@klik-info.ch */
////////////////////////////////////////////////////////////////

/////////////////////////////////
/* dhtml-Objekt-Werkzeugkasten */
/////////////////////////////////

function dObj(xpos,ypos,id,sicht) {
   if (document.documentElement) {
      this.el = document.getElementById(id);
      this.css = this.el.style;
   }
   else if (document.all) {
      this.el = document.all[id];
      this.css = this.el.style;
   }
   else if (document.layers) {
      this.el = document.layers[id];
      this.css = this.el;
   }
   this.x = xpos; this.css.left = xpos;
   this.y = ypos; this.css.top = ypos;
   this.zIndex = this.css.zIndex;
   this.sichtbar = sicht;
   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 = dObj_gehNach;
   this.zeige = dObj_zeige;
   this.verstecke = dObj_verstecke;
   if(id == "leer"){
   //this.el.onmouseout = menuOut;
   this.el.onmouseover = menuOver;
   }
}

function dObj_gehNach(x,y) {
   this.css.left = x;
   this.css.top = y;
   this.x = x;
   this.y = y;
}

function dObj_zeige() {
   this.css.visibility = "visible";
   this.sichtbar = true;
}

function dObj_verstecke() {
   this.css.visibility = "hidden";
   this.sichtbar = false;
}
///////////////////////////////////////
/* Ende dhtml-Objekt-Werkzeugkasten */
//////////////////////////////////////


window.onload = init;
var submen = new Array();
var starty=200;
var geladen = false;
var ally =200;

function absTop(Element) {
   abstop=0;
   while (Element) {
      abstop+=Element.offsetTop;
      Element=Element.offsetParent;
   }
   return abstop;
}

function pos(){
	if (document.all){
		starty=absTop(document.all.nav1);
	}
	else if (document.documentElement){   			
		starty=document.getElementById("nav1").y;
   	} 
	else if(document.layers){
		starty=document.nav1.y;
	}
	starty = starty-1;
}

function dummy(){
	return true;
}

function init(){
	window.scroll(0,0);
	pos();
	if(starty == 0)starty=200;
	for (i=1;i<=anz_menu;i++) {
		ypos = starty+((i-1)*23);
     	submen[i] = new dObj(166,200,"um"+i,false);
     	submen[i].gehNach(166,ypos);
	}
	dummy = new dObj(166,20,"leer",false);
	geladen = true;
	if(document.all && !document.documentElement && navigator.userAgent.indexOf("Opera",0)==-1)document.onmousemove = verfolgen;
}

function alleaus(){
if(geladen){
	for (j=1; j <= anz_menu; j++){
	if(submen[j].sichtbar){
			submen[j].verstecke();
	}
	}
}
}
function verfolgen(e){
ally = event.clientY;
}

function zeigMenu(nr,ok){
if(geladen){
	if(document.all && !document.documentElement && ok && navigator.userAgent.indexOf("Opera",0)==-1){
		submen[nr].gehNach(166,ally-20);
	}
	alleaus();
	submen[nr].zeige();
	dummy.zeige();
	}
}

function menuOver(){
   alleaus();
   dummy.verstecke();
}
	
function changeCol(Nr,tf) {
var farb1="#EBEBEB", farb2="#C7C7C7";

if (document.all && !document.documentElement){
	if (tf){
		Nr.bgColor = farb1;
	}
	else{
		Nr.bgColor = farb2;
	}
}

if (document.getElementById){
	if (tf){
		Nr.style.backgroundColor=farb1;
	}
	else{
		Nr.style.backgroundColor=farb2;
	}
}

if (document.layers){
	if (tf){
		Nr.bgColor=farb1;
	}
	else{
		Nr.bgColor=farb2;
	}
}
}