/**********************************************************************************   
ScrollText 
*   Copyright (C) 2001 <a href="/dhtmlcentral/thomas_brattli.asp">Thomas Brattli</a>
*   This script was released at DHTMLCentral.com
*   Visit for more great scripts!
*   This may be used and changed freely as long as this msg is intact!
*   We will also appreciate any links you could give us.
*
*   Made by <a href="/dhtmlcentral/thomas_brattli.asp">Thomas Brattli</a> 
*********************************************************************************/

//Sets variables to keep track of what's happening
var loop2, timer2

function makeObj2(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=goUp2;this.down=goDown2;
	this.moveIt=moveIt; this.x=0; this.y=0;
    this.obj = obj + "Object"
    eval(this.obj + "=this")
    return this
}

//Makes the object go up
function goDown2(move){
	if (this.y>-this.scrollHeight+oCont2.clipHeight){
		scrollLeft2.css.visibility = "visible";
		this.moveIt(0,this.y-move)
			if (loop2) setTimeout(this.obj+".down("+move+")",speed)
	}else{
		scrollRight2.css.visibility = "hidden";
	}
}
//Makes the object go down
function goUp2(move){
	if (this.y<0){
		scrollRight2.css.visibility = "visible";
		this.moveIt(0,this.y-move)
		if (loop2) setTimeout(this.obj+".up("+move+")",speed)
	}else{
		scrollLeft2.css.visibility = "hidden";
	}
}

//Calls the scrolling functions. Also checks whether the page is loaded or not.
function scroll2(speed){
	if (scrolltext2Loaded){
		loop2 = true;
		if (speed>0) oScroll2.down(speed)
		else oScroll2.up(speed)
	}
}

//Stops the scrolling (called on mouseout)
function noScroll2(){
	loop2 = false
	if (timer2) clearTimeout(timer2)
}
//Makes the object
var scrolltext2Loaded = false
function scrolltext2Init(){
	oCont2 = new makeObj2('divScrollText2Cont')
	oScroll2 = new makeObj2('divText2','divScrollText2Cont')
	oScroll2.moveIt(0,0)
	oCont2.css.visibility = "visible"
	scrollLeft2  = new makeObj('divLeft2');
	scrollRight2 = new makeObj('divRight2');
	if (oScroll2.clipHeight > scrollbereich2_height){
		//scrollLeft2.css.visibility = "visible";
		scrollRight2.css.visibility = "visible";
	}
	scrolltext2Loaded = true
}

