/********************************************************************************
Copyright (C) 1999 Thomas Brattli
This script is made by and copyrighted to Thomas Brattli at www.bratta.com
Visit for more great scripts. This may be used freely as long as this msg is intact!
I will also appriciate any links you could give me.
********************************************************************************/
//Default browsercheck, added to all scripts!
function checkBrowser(){
	this.ver=navigator.appVersion
	this.dom=document.getElementById?1:0
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?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.ie4 || this.ns4 || this.ns5 ||this.ie6)
	return this
}
bw=new checkBrowser()
/********************************************************************************
Remeber to set the look of the divBottom layer in the stylesheet (if you wan't
another font or something)
********************************************************************************/

/*Set these values, gright for how much from the right you wan't the layer to go
and gbottom for how much from the bottom you want it*/
var gright=579
var gbottom=39


/********************************************************************************
Constructing the ChangeText object
********************************************************************************/
function makeObj(obj,nest){
	nest=(!nest) ? '':'document.'+nest+'.'										
   	this.css=bw.dom? document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+"document.layers." +obj):0;			
	this.moveIt=b_moveIt;
}
function b_moveIt(x,y){this.x=x; this.y=y; this.css.left=this.x; this.css.top=this.y}

/********************************************************************************
Initilizing the page, getting height and width to moveto and calls the 
object constructor
********************************************************************************/
function geoInit(){
	oGeo=new makeObj('divBottom')
	pageWidth=(bw.ie4 || bw.ie5 || bw.ie6)?document.body.offsetWidth-4:innerWidth;
	pageHeight=(bw.ie4 || bw.ie5 || bw.ie6)?document.body.offsetHeight-2:innerHeight;
	checkIt()
	//sets the resize handler.
	onresize=resized
	if(bw.ie4 || bw.ie5 || bw.ie6) window.onscroll=checkIt;
	//shows the div
	oGeo.css.visibility='visible'
}
/********************************************************************************
This function executes onscroll in ie and every 30 millisecond in ns
and checks if the user have scrolled, and if it has it moves the layer.
********************************************************************************/
function checkIt(){
	if(bw.ie4 || bw.ie5 || bw.ie6) oGeo.moveIt(document.body.scrollLeft +pageWidth-gright,document.body.scrollTop+pageHeight-gbottom)
	else if(bw.ns4){
		oGeo.moveIt(window.pageXOffset+pageWidth-gright, window.pageYOffset+pageHeight-gbottom+7)
		setTimeout('checkIt()',30)
	}
}
//Adds a onresize event handler to handle the resizing of the window.
function resized(){
	pageWidth=(bw.ie4 || bw.ie5)?document.body.offsetWidth-4:innerWidth;
	pageHeight=(bw.ie4 || bw.ie5 || bw.ie6)?document.body.offsetHeight-2:innerHeight;
	if(bw.ie4 || bw.ie5 || bw.ie6) checkIt()
}


//Calls the geoInit onload
if(bw.bw && !bw.ns5) onload=geoInit;

//Here we will write the div out so that lower browser won't see it.<a href="javascript:history.back()"></a>
if(bw.bw && !bw.ns5) document.write('<div id="divBottom"><a href="javascript:history.back()"><img src="img/menue/zurueck_aus.gif" width=31 height=34 alt="zur&uuml;ck" border=0></a></div>')


