//scroll snelheid
var speed=3
var speedwheel=20

var crossobj=document.getElementById("content")
var contentheight=crossobj.offsetHeight

function movedown(){
if (window.moveupvar) clearTimeout(moveupvar)
if (parseInt(crossobj.style.top)>(contentheight*(-1)+420))
crossobj.style.top=parseInt(crossobj.style.top)-speed+"px"
movedownvar=setTimeout("movedown()",20)
}

function moveup(){
if (window.movedownvar) clearTimeout(movedownvar)
if (parseInt(crossobj.style.top)<0)
crossobj.style.top=parseInt(crossobj.style.top)+speed+"px"
moveupvar=setTimeout("moveup()",20)
}

function stopscroll(){
if (window.moveupvar) clearTimeout(moveupvar)
if (window.movedownvar) clearTimeout(movedownvar)
}

function getcontent_height(apage){
contentheight=crossobj.offsetHeight
active(apage)
}

function handle(delta) {
	if (delta < 0){
		if (parseInt(crossobj.style.top)>(contentheight*(-1)+420))
		crossobj.style.top=parseInt(crossobj.style.top)-speedwheel+"px"
	}else{
		if (parseInt(crossobj.style.top)<0)
		crossobj.style.top=parseInt(crossobj.style.top)+speedwheel+"px"
	}
}

function wheel(event){
	var delta = 0;
	if (!event) event = window.event;
	if (event.wheelDelta) {
		delta = event.wheelDelta/120; 
		if (window.opera){ delta = -delta;}
	} else if (event.detail) {
		delta = -event.detail/3;
	}
	if (delta)
		handle(delta);
        if (event.preventDefault)
                event.preventDefault();
        event.returnValue = false;
}

/* Initialization code. */
if (window.addEventListener)
	window.addEventListener('DOMMouseScroll', wheel, false);
window.onmousewheel = document.onmousewheel = wheel;