var speed=30;
var laufobj=document.getElementById("inhalt");
var inhalthoehe=laufobj.offsetHeight;

function nachuntenscrollen(){
 if (parseInt(laufobj.style.top)>=(inhalthoehe*(-1)+435) && (inhalthoehe>435))  {
  laufobj.style.top=parseInt(laufobj.style.top)-speed+'px';
 }
 nachuntenscrollenvar=setTimeout("nachuntenscrollen()",100);
}

function nachobenscrollen(){
 if (parseInt(laufobj.style.top)<0) {
  laufobj.style.top=parseInt(laufobj.style.top)+speed+'px';
 }
 nachobenscrollenvar=setTimeout("nachobenscrollen()",100);
}

function getinhalt_hoehe(){
 inhalthoehe=laufobj.offsetHeight;
}

function handle(delta) {
 if ((delta < 0) && (parseInt(laufobj.style.top)>=(inhalthoehe*(-1)+435) && (inhalthoehe>435)))  {
    laufobj.style.top=parseInt(laufobj.style.top)-40+'px';
 } else if (parseInt(laufobj.style.top)<0 && delta>0) {
   laufobj.style.top=parseInt(laufobj.style.top)+40+'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;
}

function wheelstart() {
 if (window.addEventListener) {
  window.addEventListener('DOMMouseScroll', wheel, false);
 }
 window.onmousewheel = document.onmousewheel = wheel;      
}

function wheelstop(wheely) {
  if (window.removeEventListener) {
   window.removeEventListener('DOMMouseScroll', wheel, false);
  }      
  if (!wheely.contains(event.toElement)) window.onmousewheel = document.onmousewheel = null;     
}

window.onload=getinhalt_hoehe;
