//Modification added by Peter Brandt http://www.tinCrow.co.za - june 2009

/* must react to delta being more/less than zero. */
function fnHandle(delta) {
	if (delta < 0){
		/* down */;
		setTimeout("fnStopScroll()",300);
		theScroll[count].scrollSouth(count);

	}else{
		/* up */;
		setTimeout("fnStopScroll()",300);
		theScroll[count].scrollNorth(count);
	}
}
//theScroll[count].endScroll();
function fnStopScroll(){
	theScroll[count].endScroll();
}


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){
		fnHandle(delta);
		//alert(delta);
        if (event.preventDefault){
         event.preventDefault();
        	event.returnValue = false;
      }
	}
}
/* Initialization code. */
if (window.addEventListener){
	window.addEventListener('DOMMouseScroll', wheel, false);
}
window.onmousewheel = document.onmousewheel = wheel;

