//script fuer die obere navigation und hilfe
var ns;
var ie;
var ns6;

arr2preset=-1;//pfeil 2 fuer fernsteuerung

loaded=false;
 
var merk1;
var merk2;

function contchange(layNr,layPt){
	merk1=layNr;
	merk2=layPt;
	
	if(navigator.platform.substring(0,1)=="M"){
		setTimeout("newhref()",3000);}//macintosh laufzeitproblem
	else
	{
		newhref();
	}
}
function newhref() {	
	location.href=hrefs[merk1][merk2];
}



//01 Verz&ouml;gerung f&uuml;r Netscape weiter initw()
function init(menEnd){
	if(parseFloat(navigator.appVersion)>=5){
		setTimeout("initw(menEnd)",100);//dies ist nur wegen ns 6 notwendig :-((
	}else{
    initw(menEnd);
	}
}


//011 Variablen, weiter: bilderInit() mouse() arrow() underlineIni()
function initw(menEnd){
	outs=new Array();
	outs[0]=new Array(0,300);
	outs[1]=new Array(300,400);
	outs[2]=new Array(400,500);
	outs[3]=new Array(500,600);
	outs[4]=new Array(600,700);
	//--mouseout werte bei 4 pulldowns

	ns=(document.layers)?true:false;
	ie=(document.all)?true:false;
    ns6=(parseFloat(navigator.appVersion)>=5)?true:false;//ns6
    
	bild=new Array();
	var menBild=new Array();
	obj=new Array();
	actLay=-1;
	ueberMain=-1;
	ueberSub=-1;
	oneDown=false;
	pullAnz=4;//anzahl der pulldowns
	speed=4;//scrolltempo
	ueberMain=0;
	ueberSub=0;//achtung! wird von frame 0 verwendet!!!
	menEnd=menEnd;//endwerte der pulldownmenues
	if(ie)var notUsed=document.all.l0.offsetLeft;//diese variable ist für ie notwendig zur initialisierung
	for(i=0;i<5;i++){	
		obj[i]=new layInit(i,1);
	}
	bilderInit();
	mouse=new mouse(1);
	arr=new Array();
	arr[0]=new arrow(0);
	}
	
function layInit(lnr,dir){
	if(ns){	
		this.obj=document.layers.clip.document.layers[("l"+lnr)];
		this.links=this.obj.left;
	}
	if(ie){	
		this.obj=document.all[("l"+lnr)].style;
		this.links=document.all[("l"+lnr)].offsetLeft;
	}
    if(ns6){
		this.obj=document.getElementById(("l"+lnr)).style;
		this.links=document.getElementById(("l"+lnr)).offsetLeft;
	}//ns6
	this.dir=speed*dir;
    this.td=(dir==1)? true:false;//unterscheidet zwischen layern, die von oben nach unten fahren und umgekehrt
	this.end=menEnd[lnr];
	this.start=(dir==1)? 0:90;
	this.posY=(this.td)?this.end:90;
	this.out=false;
	this.cont=false;
	this.lnr=lnr;
	this.time;
	this.move=move;
	this.scroll=scroll;
}
//0111 Mausposition
function mouse(dir){
	this.y=0;//mouseposition y
	this.x=0;this.old=-1;
	this.clicked=false;
	this.activated=true;
	if(dir==1){
		this.dir=true;
	}else{
		this.dir=false;
	}
}	


//0112 Pfeil weiter: move Arrow() moveLeft() move() aReset()
function arrow(lnr){
	this.nr=lnr;
	if(ns){	this.obj=document.layers.clip.document.layers[("arrow"+lnr)];}
   	if(ie){	this.obj=document.all[("arrow"+lnr)].style;}
    if(ns6){this.obj=document.getElementById(("arrow"+lnr)).style;}//ns6
    
	this.posY=-30;this.posX=-30;
	this.moveArrow=moveArrow;
	this.moveLeft=moveLeft;
	this.move=move;this.reset=aReset;
}
//-------------funktionen allgemein---------------
function refresh(){
	self.location.href=self.location.href;
} 
//Hintergrundbilder wechseln
function bilderInit(){
	for(i=0;i<6;i++){
		bild[i]=new Image();
		bild[i].src="../bilder/kom_"+i+".jpg";
	}
}

//----------------pulldowns-----------------------------------




//Startposition Pfeil weiter: move() moveleft()
function moveArrow(lnr){
	this.posY=lnr;
	if(this.nr==0&&actLay!=-1&&!obj[actLay].cont){
		this.posX=obj[actLay].links+0;
	}else{
		if(this.nr==0)this.reset();
	}
	this.posY-=0;
	this.posX+=0;//linie
	this.moveLeft();
	this.move();
}	

//??
function moveLeft(){
	if(ns||ns6){this.obj.left=this.posX;}//ns6
	if(ie){	this.obj.pixelLeft=this.posX;}
}

//?? move()
function aReset(){
	if(ns||ns6){this.obj.top=-30;}//ns6
	if(ie){this.obj.pixelTop=-30;}
	this.posY=-30;this.move();
}



//bewegung
function move(){
	if(ns||ns6){this.obj.top=this.posY;}//ns6
	if(ie){this.obj.pixelTop=this.posY;}
}

//weiter zu move()
function scroll(){
	this.posY+=this.dir;
	var dir=(this.dir>0)? true:false;
	this.out=false;
	var end=(dir)? this.start:this.end;
	this.cont=true;
	arr[0].reset();
	if(dir&&(this.posY < this.start)||(this.posY > end)&&!dir){
		this.move();
	}else{	
		this.posY=end;
		this.move();
		this.cont=false;
	}
	if(this.cont){	
		this.time=setTimeout("obj["+this.lnr+"].scroll()",1);
	}else{	
		var aus=(this.td)?this.start:this.end;
		this.out=(aus==this.posY)?true:false;
		this.dir*=-1;/*if(mouse.clicked){navChange();}*/;}
	}


//???
function subMen(lnr,ArrNr){
	arr[ArrNr].posX=obj[actLay].links+3;
	arr[ArrNr].moveArrow(lnr);
}

//-----programming walter eul----------------------------
function position(e){
if(mouse.activated){
	if(ns||ns6){	mouse.y=e.pageY;mouse.x=e.pageX;}//ns6
	if(ie){	mouse.y=window.event.y;mouse.x=window.event.x;}
	mouse.y-=16;
	layNr=-1;
	for(j=0;j<outs.length;j++){	if(mouse.x>outs[j][0]&&mouse.x<outs[j][1])layNr=j;	}
	if(mouse.old!=-1&&actLay!=layNr){
		if(obj[mouse.old].out&&!obj[mouse.old].cont){	obj[mouse.old].scroll();mouse.old=-1;}
		else{	if(mouse.dir){if(obj[mouse.old].cont&&obj[mouse.old].dir > 0){obj[mouse.old].dir*=-1;}}
				if(!mouse.dir){if(obj[mouse.old].cont&&obj[mouse.old].dir < 0){obj[mouse.old].dir*=-1;}}
				}
		arr[0].reset();
	}
}}
//kontrolliert die scroll()
function activateLay(lnr){
	if(loaded){//prueft ob alle layer vollstaendig geladen sind
		for(n=0;n<pullAnz;n++){	
			if(obj[n].out&&n!=lnr){
				obj[n].scroll();
			};
		}
		actLay=lnr;
		mouse.old=actLay;
		if(!obj[actLay].cont&&!obj[actLay].out){
			obj[actLay].scroll();
		}
	}
}
	
	//weiter scroll() und navChange()


	function layClose(lnr){
		//if(!oneDown){top.info.slideHelp();oneDown=true;}//faehrt marktinfo ein
		//oneDown=true;//wird nur beim ersten aufruf benötigt
		//unterstrich();zeigt die unterstreichung an --ok

		ueberSub=lnr;
		ueberMain=actLay;
		mouse.clicked=true;
		obj[actLay].scroll();

	}
	
	//weiter menImgChange() gibt den wechsel zu nav_left*.html an





