function a42wait(T) { setTimeout("a42go()", T); }
function close_window() { window.close(); }
function MM_findObj(n, d) { 
  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 shl() {
  var i,p,v,obj,args=shl.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=='s')?'visible':(v='h')?'hidden':v; }
    obj.visibility=v; }
}
function full(theURL) {
  var xx=screen.availWidth; 
	var yy=screen.availHeight;
  window.open(theURL,"Fenster1","left=0,top=0,scrollbars=no,toolbar=no,width="+xx+",height="+yy+",menubar=no,resizable=no,location=no");
}

catchedLayer=baseLayer=0;
oldLayer=-1;
move=new Array();
maxdwn=new Array();
var layerNum, timeslide, posY, move, tdown, tup, pic, picsrc, picnest,over,source,h;
drop=0;
var menuADivs=5; //anzahl der menüpunkte
//Default browsercheck, (v. bratta.com)
basenHoehe=new Array;
scrollyes=true;
pf=parent.frames

function checkBrowser(){	
	this.ver=navigator.appVersion
	this.name=navigator.appName;
	this.agent=navigator.userAgent
	this.op5=this.agent.indexOf("Opera 5")>-1||this.agent.indexOf("Opera/5")>-1
	this.dom=document.getElementById?1:0
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
	this.ie5=(this.ie6||(this.ver.indexOf("MSIE 5")||this.ver.indexOf("MSIE 6"))>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ie=(this.ie4||this.ie5||this.ie6)?1:0;
	this.mac=(this.ver.indexOf("Mac")>-1)?1:0;
	this.ns5=(this.dom && parseInt(this.ver)>=5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
 	this.bw=(this.ie5 ||this.ie6|| this.ie4 || this.ns4 || this.ns5 ||this.op5)
	FensterBreite=(this.ie4||this.ie5)?screen.availWidth:top.window.innerWidth;
	FensterHoehe=(this.ie4||this.ie5)?screen.availHeight:top.window.innerHeight;
	if(this.op5&&!(this.name.indexOf("Internet Explorer")>-1)) alertChangeId()
	if(this.ns4)alert('Netscape 4 ist kein Browser. Damit die Seiten richtig angezeigt werden bitte Mozilla, Netscape 6, Opera5+ oder IE 5+ benutzen.')
	return FensterBreite,FensterHoehe,this
}
bw=new checkBrowser();


function alertChangeId(){
alert('Sie benutzen Opera 5 \ndamit diese Seite korrekt angezeigt wird, müssen Sie als Browseridentifikation \n\"Identify as MSIE5\"\neinstellen. \n(File/Preferences/Connections/)');
}



/************** Objektkonstrukter *******************/


function divObj(obj){
	//alert(obj)
  this.evnt=this.docu=bw.dom? document.getElementById(obj):bw.ie4?document.all[obj]:0;
	this.css=bw.dom? document.getElementById(obj).style:bw.ie4?document.all[obj].style:0;		
  this.moveBy=doMoveBy;
	this.hoehe=((bw.ie4||bw.ie5||bw.ns5)&&!bw.op5)?this.docu.offsetHeight:this.css.pixelHeight; 
	this.breite=((bw.ie4||bw.ie5||bw.ns5)&&!bw.op5)?this.docu.offsetWidth:this.css.pixelWidth;
	this.x=parseInt(this.css.left);
	this.y=parseInt(this.css.top);			
	this.moveIt=b_moveIt;
	this.startX=this.x;
	this.startY=this.y;
	this.vis=sichtbarkeit;
	if (this.docu.id.substring(0,6)=='scroll'){
 		this.drag=false;
		this.clickedX=0; this.clickedY=0	
		this.isOver=false;
		this.size=getSize;
		this.size(this.docu);
		this.movequot=getMove;
		this.movequot();
	}
	return this
}

/*********************************************************************************
bilderladen
*********************************************************************************/
function bilderladen(){
 bilder=new Array;
 for(i=0;i<arguments.length;i++){
  bilder[i]=new Image;
  bilder[i].src='../www/grafix/'+arguments[i];
  }
}
function bilderChg(name,src){
   	this.pic=eval('document.images.'+name);
  this.pic.src='img/'+src;
}
/***********************************************************************************************
scrollbalken grösse ermitteln
***********************************************************************************************/
function scrollsizer(num){
	scrollbar[num].size();
}
function getSize(){ 
	nr=this.docu.id.substr(this.docu.id.length-1);
	direct=this.docu.id.charAt(this.docu.id.length-2);
							//direct=X => horizontaler scrollbalken, y=vertikaler scrollbalken, entsprechend werden grössenangaben auf höhen bzw. breiten bezogen.
	scrollSize=(direct=='X')?parseInt((containerDiv[nr].breite/contentDiv[nr].breite)*baseDiv[nr].breite):parseInt((containerDiv[nr].hoehe/contentDiv[nr].hoehe)*baseDiv[nr].hoehe);
	if (scrollSize<5) scrollSize=5;
	if(direct=='X'){ 
		if(contentDiv[nr].breite<=containerDiv[nr].breite){
			scrollSize=baseDiv[nr].hoehe-1;
			scrollyes=false;
			//this.css.visibility='hidden';
			//baseDiv[nr].css.visibility='hidden'
			//pfeilDiv[nr].css.visibility='hidden'	
		}
	}
	else{
	if(contentDiv[nr].hoehe<=containerDiv[nr].hoehe){
			scrollSize=baseDiv[nr].hoehe-1;
			scrollyes=false;
			//this.css.visibility='hidden';
			//baseDiv[nr].css.visibility='hidden'
			//pfeilDiv[nr].vis(0)
		}
	}
	if (direct=='X'){
			this.css.width=scrollSize;
			if(bw.op5) this.css.pixelWidth=scrollSize;
			this.css.clip='rect(0 '+scrollSize+' 16  0)'
			this.breite=scrollSize
			BorderScrY[nr].css.left=this.breite;
	}
		else {
			this.css.height=scrollSize
			if(bw.op5) this.css.pixelHeight=scrollSize;
			this.css.clip='rect(0 16 '+scrollSize+' 0)'
			this.hoehe=scrollSize
			BorderScrY[nr].css.top=this.hoehe;
		}
		if(bw.mac&&bw.ie4)this.moveBy(0,0); //BugFix f. ie.4 mac
	
}
/***************************fenstergrösse ermitteln*************************************/
function screenSize(){
	screenWidth=(bw.ie4||bw.ie5)?document.all.body.offsetWidth:window.innerWidth; //browserfensterbreite
	screenHeight=(bw.ie4||bw.ie5)?document.all.body.offsetHeight:window.innerHeight; // browserfensterhoehe;
/*	if(screenHeight<557&&closeDiv){
	closeDiv.moveBy(-3,-3);
	alert(bgBildDiv)
	bgBildDiv.moveBy(-3,-3);
	}*/
	return screenWidth, screenHeight;
}
/**********************scrollquotienten ermitteln*****************************/
function getMove(){
nr=this.docu.id.charAt(this.docu.id.length-1);
dir=this.docu.id.charAt(this.docu.id.length-2);
if(dir=='X'){
	maxdwn[nr]=baseDiv[nr].breite-this.breite-2;//baseDiv`=hintergrund d.scrollbalkens
	move[nr]=(contentDiv[nr].breite-containerDiv[nr].breite)/(maxdwn[nr]);// verhältnis von zu scrollender fläche und vorhandener scrollfläche der scrollbar
}
else{
	maxdwn[nr]=baseDiv[nr].hoehe-this.hoehe-2;//baseDiv`=hintergrund d.scrollbalkens
	move[nr]=(contentDiv[nr].hoehe-containerDiv[nr].hoehe)/(maxdwn[nr]);// verhältnis von zu scrollender fläche und vorhandener scrollfläche der scrollbar
}
return move;maxdwn;
}
/***********************************************************************************************
Event-Handler-Aktionen
************************************************************************************************/
function mmover(e){ //über scrollbalken?
	layerNum=(bw.ns4||bw.ns5)?e.target.id.charAt(e.target.id.length-1):window.event.srcElement.id.charAt(window.event.srcElement.id.length-1);
	catchedLayer=scrollbar[layerNum];
	direct=scrollbar[layerNum].docu.id.charAt(scrollbar[layerNum].docu.id.length-2)
	catchedLayer.isOver=true;
	baseLayer=baseDiv[layerNum]
	if(baseLayer.isOver==true){baseLayer.isOver=false;over=1}
	return layerNum,direct;
}
function mdown(e){ 
    if (catchedLayer.isOver==true && scrollyes){ //in die scrollbar gecklickt?
	  clickedX=(bw.ns4 || bw.ns5)?e.pageX-parseInt(catchedLayer.css.left):event.x-catchedLayer.css.pixelLeft;
	  clickedY=(bw.ns4 || bw.ns5)?e.pageY-parseInt(catchedLayer.css.top):event.y-catchedLayer.css.pixelTop;
	  catchedLayer.isClicked=true
	  stopalt=true;
		return clickedY,clickedX,stopalt;
    }
}
function mmout(e){
	catchedLayer=scrollbar[layerNum];
	catchedLayer.isOver=false;
	if(over) baseLayer.isOver=true;
}
function mup(e){
	catchedLayer.isClicked=false
	if(timeslide)clearTimeout(timeslide)
	}
/**********************funktionsaufruf drag&drop layer (scrollbar)+contentverschiebung + altTexte bei bilderOnmouseover*************************/
function mmove(e){
	if (catchedLayer.isClicked==true){
		layerPosTop=(bw.ns4 || bw.ns5)?e.pageY-clickedY:window.event.y-clickedY; 
		layerPosLeft=(bw.ns4 || bw.ns5)?e.pageX-clickedX:window.event.x-clickedX; 
		(direct=='X')?moveitX(layerPosLeft):moveitY(layerPosTop);
		return false;  // Aufruf in eine weitere Funktion und 'return false' verhindern, dass bilder im ie markiert werden bei onmousedown+move
	}
}

/**************** //Bewegen des scrollbalkens *******************/
function moveitY(y){
	if (catchedLayer.isClicked==true){
		maxoben=0
		if ((y>maxoben)&&(y<maxdwn[layerNum])){//nur innerhalb des scrollbalkenhintergrundes darf gescrollt werden 
			goDown=y
			scrollbar[layerNum].moveIt(scrollbar[layerNum].x,goDown);
			BorderScrY[layerNum].moveIt(scrollbar[layerNum].x,goDown+scrollbar[layerNum].hoehe); 
			contentDiv[layerNum].moveIt(contentDiv[layerNum].x,-(scrollbar[layerNum].y*move[layerNum]))
		}
 		else if(y<maxoben){
			scrollbar[layerNum].css.top=maxoben;
			BorderScrY[layerNum].css.top=maxoben+scrollbar[layerNum].hoehe;
			contentDiv[layerNum].css.top=0
 		}
 		else if(y>maxdwn[layerNum]){
			scrollbar[layerNum].css.top=maxdwn[layerNum];
			BorderScrY[layerNum].css.top=maxdwn[layerNum]+scrollbar[layerNum].hoehe;
			contentDiv[layerNum].css.top=-(contentDiv[layerNum].hoehe-containerDiv[layerNum].hoehe);
		}
	}
}

function moveitX(x){  
	if (catchedLayer.isClicked==true){
		maxleft=0
		if ((x>maxleft)&&(x<maxdwn[layerNum])){
			//nur innerhalb des scrollbalkenhintergrundes darf gescrollt werden 
			goDown=x;
			scrollbar[layerNum].moveIt(goDown,scrollbar[layerNum].y);
			BorderScrY[layerNum].moveIt(goDown+scrollbar[layerNum].breite,scrollbar[layerNum].y); 
			contentDiv[layerNum].moveIt(-((scrollbar[layerNum].x)*move[layerNum]),contentDiv[layerNum].y)
		}
 		else if(x<maxleft){
			scrollbar[layerNum].css.left=maxleft;
			BorderScrY[layerNum].css.left=maxleft+scrollbar[layerNum].breite;
			contentDiv[layerNum].css.left=0
 		}
 		else if(x>maxdwn[layerNum]){
			scrollbar[layerNum].css.left=maxdwn[layerNum];
			BorderScrY[layerNum].css.left=maxdwn[layerNum]+scrollbar[layerNum].breite;
			contentDiv[layerNum].css.left=-(contentDiv[layerNum].breite-containerDiv[layerNum].breite);
		}
	}
}
/************* scrollPfeil-Funktionen ****************/
function up(laynr,direction, speed){
	num=laynr; mve=speed; dir=direction;
	maxup=0
	if (direction=='x'){
		if(parseInt(contentDiv[num].css.left)<maxup){
			step=(-parseInt(contentDiv[num].css.left)>mve)?mve:-(parseInt(contentDiv[num].css.left));
			contentDiv[num].moveBy(step,0);
			cleft=parseInt(contentDiv[num].css.left);
			x=cleft/move[num]
			scrollbar[num].moveIt(-x,scrollbar[num].y)
			BorderScrY[num].moveIt(-(x-scrollbar[num].breite),scrollbar[num].y)
			tdown=setTimeout("up(num,dir,mve)",20)
			}
		else if (tdown) clearTimeout(tdown)
	}
	else{
	if(parseInt(contentDiv[num].css.top)<maxup){
			step=(-parseInt(contentDiv[num].css.top)>mve)?mve:-(parseInt(contentDiv[num].css.top));
			contentDiv[num].moveBy(0,step);
			ctop=parseInt(contentDiv[num].css.top);
			y=ctop/move[num]
			scrollbar[num].moveIt(scrollbar[num].x,-y)
			BorderScrY[num].moveIt(scrollbar[num].x,-(y-scrollbar[num].hoehe))
			tdown=setTimeout("up(num,dir,mve)",20)
			}
	else if (tdown) clearTimeout(tdown)
	}
}
function dwn(laynr,direction, speed){
	num=laynr; mve=speed; dir=direction;
	if (direction=='x'){
		maxdown=maxdwn[nr]*move[num];
//		maxdown=contentDiv[num].breite-containerDiv[num].breite;
		if(parseInt(contentDiv[nr].css.left)>-maxdown){
			step=(maxdown+parseInt(contentDiv[num].css.left)>mve)?mve:maxdown+parseInt(contentDiv[num].css.left);
			contentDiv[num].moveBy(-mve,0);
			cleft=parseInt(contentDiv[num].css.left);
			x=cleft/move[num]
			scrollbar[num].moveIt(-x+1,scrollbar[num].y)
			BorderScrY[num].moveIt(-(x-scrollbar[num].breite),scrollbar[num].y)
			tdown=setTimeout("dwn(num,dir,mve)",20)
			}
		else if (tdown) clearTimeout(tdown)
	}
	else{
		maxdown=contentDiv[num].hoehe-containerDiv[num].hoehe;
		if(parseInt(contentDiv[num].css.top)>-maxdown){
			step=(maxdown+parseInt(contentDiv[num].css.top)>mve)?mve:maxdown+parseInt(contentDiv[num].css.top);
			contentDiv[num].moveBy(0,-mve);
			ctop=parseInt(contentDiv[num].css.top);
			y=ctop/move[num]
			scrollbar[num].moveIt(scrollbar[num].x,-y) 
			BorderScrY[num].moveIt(scrollbar[num].x,-(y-scrollbar[num].hoehe))
			tdown=setTimeout("dwn(num,dir,mve)",20)
		}
		else if (tdown) clearTimeout(tdown)
	}
}
function stopIt(){
if (tdown) clearTimeout(tdown);
if (tup) clearTimeout(tup);
}



/*****************************************************************************************************************
Allgemeine Funktionen für den Hausgebrauch
******************************************************************************************************************/
function doMoveBy(x,y){ //schelbsterklärend
	if(x!=0) {
		this.css.left=parseInt(this.css.left)+x;
		this.x=parseInt(this.css.left);
	
		}
	if(y!=0){
		this.css.top=parseInt(this.css.top)+y
		this.y=parseInt(this.css.top)
	}
}
function b_moveIt(x,y){

	this.x=x; this.y=y;
	this.css.left=this.x
	this.css.top=this.y
}
function sichtbarkeit(status){ //visibility aufruf/änderung
	sicht=status?'visible':'hidden';
	this.css.visibility=sicht
}	
function showHide(ebene,vis){  //einfacher showHide
	ebene.vis(vis)
}
function shHideFenster(nr,vis){ //showHide für ein komplettes fenster 
	for (j=0;j<fensterDiv[nr].length;j++){
			fensterDiv[nr][j].vis(vis)
	}
}
function chgVis(){ //showHide-switcher
	for(i=0;i<arguments.length;i++){
		(arguments[i].css.visibility.toLowerCase()=='visible'||arguments[i].css.visibility=='show')?arguments[i].vis(0):arguments[i].vis(1)
	}
}
function fensterChgVis(nr){ //showHide-switcher
	for (i=0;i<fensterDiv[nr].length;i++){
			(fensterDiv[nr][i].css.visibility.toLowerCase()=='visible'||fensterDiv[nr][i].css.visibility=='show')?fensterDiv[nr][i].vis(0):fensterDiv[nr][i].vis(1)
	}
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

