var bw2=new lib_bwcheck()

var speed2 = 30

//Sets variables to keep track of what's happening
var loop2, timer2
var oCont2, oScroll2, oOmhoog2, oOmlaag2

//Object constructor
function makeObj2(obj2,nest2){
    nest2=(!nest2) ? "":'document.'+nest2+'.'
	this.el=bw2.dom?document.getElementById(obj2):bw2.ie4?document.all[obj2]:bw2.ns4?eval(nest2+'document.'+obj2):0;
  	this.css=bw2.dom?document.getElementById(obj2).style:bw2.ie4?document.all[obj2].style:bw2.ns4?eval(nest2+'document.'+obj2):0;
	this.scrollHeight=bw2.ns4?this.css.document.height:this.el.offsetHeight
	this.clipHeight=bw2.ns4?this.css.clip.height:this.el.offsetHeight
	this.up2=goUp2;
	this.down2=goDown2;
	this.moveIt2=moveIt2;
	this.x=0;
	this.y=0;
   this.obj2 = obj2 + "Object"
   eval(this.obj2 + "=this")
   return this
}

// A unit of measure that will be added when setting the position of a layer.
var px = bw2.ns4||window.opera?"":"px";

function moveIt2(x,y){
	this.x = x
	this.y = y
	this.css.left = this.x+px
	this.css.top = this.y+px
	//alert("moveit2: "+x+" "+y)
}

//Makes the object go up
function goDown2(move2){
	if (this.y>-this.scrollHeight+oCont.clipHeight){
		this.moveIt2(0,this.y-move2)
			if (loop2) setTimeout(this.obj2+".down2("+move2+")",speed2)
	}
}
//Makes the object go down
function goUp2(move2){
	if (this.y<0){
		this.moveIt2(0,this.y-move2)
		if (loop2) setTimeout(this.obj2+".up2("+move2+")",speed2)
	}
}

//Calls the scrolling functions. Also checks whether the page is loaded or not.
function scroll2(speed2){
	if (scrolltextLoaded2){
		loop2 = true;
		if (speed2>0) oScroll2.down2(speed2)
		else oScroll2.up2(speed2)
	}
}

//Stops the scrolling (called on mouseout)
function noScroll2(){
	loop2 = false
	if (timer2) clearTimeout(timer2)
}
//Makes the object
var scrolltextLoaded2 = false
function scrolltextInit2(){
//kleine tekstvak
	oCont2 = new makeObj2('txtkolom2')
	oScroll2 = new makeObj2('divtxt2','txtkolom2')
	oScroll2.moveIt2(0,0)
	oCont2.css.overflow = "hidden"	
	oCont2.css.visibility = "visible"
//Pijlen omhoog en omlaag alleen tonen als er overflow is
	oOmhoog2 = new makeObj2('divUp2')
	oOmhoog2.css.visibility = "hidden"
	oOmlaag2 = new makeObj2('divDown2')
	oOmlaag2.css.visibility = "hidden"
	if (oScroll2.scrollHeight > oCont2.clipHeight) {
		oOmhoog2.css.visibility = "visible"
		oOmlaag2.css.visibility = "visible"
	}
//Scroll tekst is geladen	
	scrolltextLoaded2 = true
}
//Call the init on page load if the browser is ok...
if (bw2.bw) onload = scrolltextInit2

