var scrollerSpeed=6;
var pauseScroller=1;

// Change nothing below!
scrollerSpeed=(document.all)? scrollerSpeed : Math.max(1, scrollerSpeed-1); //slow speed down by 1 for NS
var copySpeed = scrollerSpeed;
var scroller, frame, scrollerHeight, frameHeight;
var pauseSpeed=(pauseScroller==0)? copySpeed: 0;

function initScroller(){
	frame = document.getElementById("scrollerFrame");
	scroller = document.getElementById("scrollerContent");
	buttonUp = document.getElementById("scrollUp");
	buttonDown = document.getElementById("scrollDown");
	
	if(frame && scroller && buttonUp && buttonDown) {
		
		buttonUp.onclick = function () {
			return false;
		}
		buttonUp.onmouseover = function () {
			leftTimeUp=setInterval('scrollUp()',20);
		}
		buttonUp.onmouseout = function () {
			clearTimeout(leftTimeUp);
		}
	
		buttonDown.onclick = function () {
			return false;
		}
		buttonDown.onmouseover = function () {
			leftTimeDown=setInterval('scrollDown()',20);
		}
		buttonDown.onmouseout = function () {
			clearTimeout(leftTimeDown);
		}

		
		scrollerHeight = scroller.offsetHeight;
		frameHeight = frame.offsetHeight;
		scroller.style.top="0px";
		
		klasse = frame.className;
		if (klasse != "topstart") {
			scroller.style.top = klasse;
		}
	}	
	
}

function scrollDown(){
	scrollerHeight=scroller.offsetHeight; // nodig voor Safari
	
/*	alert(frameHeight);
	alert(scrollerHeight);
	alert(parseInt(scroller.style.top));
*/	
	if (parseInt(scroller.style.top) > (frameHeight-scrollerHeight)) {
		scroller.style.top=parseInt(scroller.style.top)-copySpeed+"px"
	}		
}

function scrollUp(){
	if (parseInt(scroller.style.top) < 0) {
			scroller.style.top=parseInt(scroller.style.top)+copySpeed+"px"
	} 
}
	
addLoadEvent(initScroller);
