//determine browser
var iens6=document.all||document.getElementById
var ns4=document.layers



//pixels per step
var speed=3
//milliseconds between two steps
var rate=10

function scrollDown(){
	scrollBy(speed);
	scrollTimout=setTimeout("scrollDown()",rate)
}

function scrollBy(amount){
	if (iens6) {
		var oldTop = getContent().style.top
		var oldTopInt = parseInt(getContent().style.top)
		var newTop = parseInt(getContent().style.top) - amount
		var cropped = crop(parseInt(getContent().style.top) - amount)
		var croppedString = cropped+"px"
  	getContent().style.top = croppedString
  }
	
}

function crop(newValue){
	return Math.max(Math.min(newValue,0), -getContentHeight()+250)
}

function scrollUp(){
	scrollBy(-speed)
	scrollTimout=setTimeout("scrollUp()",rate)
}

function stopScrolling(){
	clearTimeout(scrollTimout);
}	

function getContent(){
	if (iens6)
 		return document.getElementById? document.getElementById("content") : document.all.content
	else if (ns4)
		return document.nskasten.document.nsinhalt
}

function getContentHeight(){
	if (iens6)
 		return getContent().offsetHeight
	else if (ns4)
		return getContent().clip.height
	
}



function handle(delta) {
	scrollBy(-delta*speed*10)
}
 
function wheel(event){
        var delta = 0;
        if (!event) 
			event=window.event;
        if (event.wheelDelta) {
                delta = event.wheelDelta/150;
        } else if (event.detail) {
                delta = -event.detail/5;
        }

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




