// JavaScript Document
if (!textuebergr) {var textuebergr=true;}
userAgent = window.navigator.userAgent; browserVers = parseInt(userAgent.charAt(userAgent.indexOf("/")+1),10);
function newImage(arg) { if (document.images) { rslt = new Image(); rslt.src = arg; return rslt; } }
function findElement(n,ly) { if (browserVers < 4) return document[n]; var curDoc = ly ? ly.document : document; var elem = curDoc[n]; if (!elem) { for (var i=0;i<curDoc.layers.length;i++) { elem = findElement(n,curDoc.layers[i]); if (elem) return elem; } } return elem; } 
function changeImages() { if (document.images && (preloadFlag == true)) { var img; for (var i=0; i<changeImages.arguments.length; i+=2) { img = null; if (document.layers) { img = findElement(changeImages.arguments[i],0); } else { img = document.images[changeImages.arguments[i]]; } if (img) { img.src = changeImages.arguments[i+1]; } } } } var preloadFlag = false;
function preloadImages() { if (document.images) { preloadFlag = true; } } 
var deltamax = 3;
var win1;

/**** 
ScrollText 
*   Copyright (C) 2001 <a href="/dhtmlcentral/thomas_brattli.asp">Thomas Brattli</a>
*   This script was released at DHTMLCentral.com
*   Made by <a href="/dhtmlcentral/thomas_brattli.asp">Thomas Brattli</a> 
*******/
function lib_bwcheck(){ //Browsercheck (needed)
	this.ver=navigator.appVersion;
	this.agent=navigator.userAgent;
	this.dom=document.getElementById?1:0;
	this.opera5=this.agent.indexOf("Opera 5")>-1
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie7=(this.ver.indexOf("MSIE 7")>-1 && this.dom && !this.opera5)?1:0;
	this.ie7=(this.ver.indexOf("MSIE 8")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6||this.ie7;
	this.mac=this.agent.indexOf("Mac")>-1;
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie8 || this.ie7 || this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5);
	return this;
}
var bw=new lib_bwcheck();
var speed = 35;
var basismove = 5;
var aktmove;
var aktspeed;
var speedz = 0;
var maxmove=14;
var maxspeed = 75;
var mvsintervall = 50;
var speedsetup = (maxspeed - speed)/mvsintervall;
var movesetup = (maxmove - basismove)/mvsintervall;
var loop, timer;
function makeObj(obj,nest){
    nest=(!nest) ? "":'document.'+nest+'.'
	this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;
  	this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0;
	this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight;
	this.clipHeight=bw.ns4?this.css.clip.height:this.el.offsetHeight;
	this.up=goUp;
	this.down=goDown;
	this.scrolldown = scrolldown;
	this.scrollup = scrollup;
	this.moveIt=moveIt;
	//this.x=0;
	//this.y=0;
    this.obj = obj + "Object";
    eval(this.obj + "=this");
    return this;
}
var px = bw.ns4||window.opera?"":"px";

function moveIt(x,y){
	//alert(y);
	this.x = x;
	this.y = y;
	this.css.left = this.x+px;
	this.css.top = this.y+px;
}

function goDown(move){
	if (speedz < 5) {
		aktspeed=speed;
		aktmove=move;
		}
	else {
		aktspeed = Math.min(maxspeed,(aktspeed+speedsetup));
		aktmove = Math.min(maxmove,(move+movesetup));
	}
	speedz++;
	if (timer) clearTimeout(timer);
	if (this.y >-this.scrollHeight+oCont.clipHeight){
		this.moveIt(0,this.y-aktmove);
			if (loop) {timer = setTimeout(this.obj+".down("+aktmove+")",aktspeed);}
	}
}
function scrolldown(move){
	if (this.y >-this.scrollHeight+oCont.clipHeight){
		this.moveIt(0,this.y-move);
	}
}
function goUp(move){
	if (speedz < 5) {
		aktspeed=speed;
		aktmove=move;
		}
	else {
		aktspeed = Math.min(maxspeed,(aktspeed+speedsetup));
		aktmove = Math.max(-maxmove,(move+movesetup));
	}
	speedz++;
	if (timer) clearTimeout(timer);
	if (this.y < 0){
		this.moveIt(0,this.y-aktmove);
		if (loop) {timer = setTimeout(this.obj+".up("+aktmove+")",aktspeed);}
	}
}
function scrollup(move){
	if (this.y < 0){
		this.moveIt(0,this.y-move);
	}
}
function scroll(speed){
	if (scrolltextLoaded){
		//alert("scroll-");
		loop = true;
		if (speed>0) {
			movesetup = (maxmove - speed)/mvsintervall;
			oScroll.down(speed);
		}
		else {
			movesetup = (speed -maxmove)/mvsintervall;	
			oScroll.up(speed);
		}
	}
}
function zumJahr(linkziel) {
	if (scrolltextLoaded){
		loop = false;
		oScroll.moveIt(0,0);
		//alert("scrollhoehe"+oScroll.scrollHeight);
		//alert("ckiphoehe"+oScroll.clipHeight);
	}
	window.location.href = linkziel;
}
function mousescroll(speed){
	//alert("scroll");
	if (scrolltextLoaded){
		loop = true;
		if (speed>0) oScroll.scrolldown(speed);
		else oScroll.scrollup(speed);
	}
}
function noScroll(){
  // alert("aktspeed: "+aktspeed);
  // alert("aktmove: "+aktmove);
   aktspeed=speed;
   aktmove=0;
	speedz=0;
	loop = false;
	if (timer) clearTimeout(timer);
}

var scrolltextLoaded = false;
function scrolltextInit(){
	oCont = new makeObj('maincontent');
	oScroll = new makeObj('contenttext','maincontent');
	oScroll.moveIt(0,0);
	oCont.css.visibility = "visible";
	scrolltextLoaded = true;
	//alert("scrolltextLoaded"+scrolltextLoaded);
}
if (bw.bw) onload = scrolltextInit;

function oeffnefenster(neueadresse,fenstername,b,h,eigenschaften) 
{
  if(screen.width){
  var fensterl_pos = (screen.width-b)/2;
  var fenster_o_pos = (screen.height-h)/2;
  }
  else{fensterl_pos = 0;fenster_o_pos =0;}
  if (fensterl_pos < 0) fensterl_pos = 0;
  if (fenster_o_pos < 0) fenster_o_pos = 0;
  var fenstereinstell = 'height=' + h + ', ';
  fenstereinstell += 'width=' + b + ', ';
  fenstereinstell += 'top=' + fenster_o_pos + ', ';
  fenstereinstell += 'left=' + fensterl_pos;
  if (eigenschaften != undefined) {fenstereinstell += ', ' + eigenschaften;}
  //alert(fenstereinstell);
  //alert("--");
   win1 = window.open(neueadresse, fenstername, fenstereinstell);
  //winold=window;
  win1.focus();
  //winold.href='';
}


/** This is high-level function.
 * It must react to delta being more/less than zero.
 */
function handle(delta) {
        if (delta < 0)
		{
			if (delta < (-deltamax)) {delta = -deltamax;}
			mousescroll(delta*(-8));
		}
        else 
		{   
		    if (delta > deltamax) {delta = deltamax;}
			mousescroll(delta*(-8));
		}
}

/** Event handler for mouse wheel event.
 */
function wheel(event){
        var delta = 0;
        if (!event) /* For IE. */
                event = window.event;
        if (event.wheelDelta) { /* IE/Opera. */
                delta = event.wheelDelta/120;
                /** In Opera 9, delta differs in sign as compared to IE.
                 */
                if (window.opera)
                        delta = -delta;
        } else if (event.detail) { /** Mozilla case. */
                /** In Mozilla, sign of delta is different than in IE.
                 * Also, delta is multiple of 3.
                 */
                delta = -event.detail/3;
        }
        /** If delta is nonzero, handle it.
         * Basically, delta is now positive if wheel was scrolled up,
         * and negative, if wheel was scrolled down.
         */
        if (delta) {
                if (timer) clearTimeout(timer);
				loop=false;
				handle(delta);
		}
        /** Prevent default actions caused by mouse wheel.
         * That might be ugly, but we handle scrolls somehow
         * anyway, so don't bother here..
         */
        if (event.preventDefault)
                event.preventDefault();
	event.returnValue = false;
}

/** Initialization code. 
 * If you use your own event management code, change it as required.
 */
function aktivierewheel() {
if (window.addEventListener)         /** DOMMouseScroll is for mozilla. */
        window.addEventListener('DOMMouseScroll', wheel, false);
/** IE/Opera. */
window.onmousewheel = document.onmousewheel = wheel;
}
