function scrollrunter(){
	hoehe_scrollcontent=document.getElementById("scrollcontent").offsetHeight;	
	if(parseInt(document.getElementById("scroller").style.top)+document.getElementById("scroller").offsetHeight<hoehe_anzeiger){
		document.getElementById("scroller").style.top=parseInt(document.getElementById("scroller").style.top)+5+"px";
		scrolleroben=((parseInt(document.getElementById("scroller").style.top)/hoehe_anzeiger)*hoehe_scrollcontent)*-1;
		document.getElementById("scrollcontent").style.top=scrolleroben+"px";
	}
}
function scrollhoch(){
	hoehe_scrollcontent=document.getElementById("scrollcontent").offsetHeight;
	if(parseInt(document.getElementById("scroller").style.top)>0){
		document.getElementById("scroller").style.top=parseInt(document.getElementById("scroller").style.top)-5+"px";
		scrolleroben=((parseInt(document.getElementById("scroller").style.top)/hoehe_anzeiger)*hoehe_scrollcontent)*-1;
		document.getElementById("scrollcontent").style.top=scrolleroben+"px";
	}
}





function Mausklick (Ereignis) {
	hoehe_scrollcontent=document.getElementById("scrollcontent").offsetHeight;	
	if(!Ereignis){
		Ereignis = window.event;
	}
	startziehung=Ereignis.clientY;
	document.onmousemove = Ziehe;
	document.onmouseup = Mausklickschluss
}

function Ziehe (ZieheEreignis) {
	hoehe_scrollcontent=document.getElementById("scrollcontent").offsetHeight;	
	if(!ZieheEreignis){
		ZieheEreignis = window.event;
	}
	ziehziel=ZieheEreignis.clientY-startziehung;
	if(ziehziel<=0){
		ziehziel=0;
	}
	ziehmax=hoehe_anzeiger-document.getElementById("scroller").offsetHeight;
	if(ziehziel>ziehmax){
		ziehziel=ziehmax;
	}
	document.getElementById("scroller").style.top=ziehziel+"px";

	
	scrolleroben=((parseInt(document.getElementById("scroller").style.top)/hoehe_anzeiger)*hoehe_scrollcontent)*-1;
	document.getElementById("scrollcontent").style.top=scrolleroben+"px";

	
	
}

function Mausklickschluss(Ereignisschluss){
	hoehe_scrollcontent=document.getElementById("scrollcontent").offsetHeight;	
	if(!Ereignisschluss){
		Ereignisschluss = window.event;
	}
	//delete document.onmousemove;
	document.onmousemove = Zieheaus;
}


function Zieheaus (ZieheEreignis) {
}




function rad (delta) {
	ziehziel=parseInt(document.getElementById("scroller").style.top)+parseInt(delta*-5);
	hoehe_scrollcontent=document.getElementById("scrollcontent").offsetHeight;	

	if(ziehziel<=0){
		ziehziel=0;
	}
	ziehmax=hoehe_anzeiger-document.getElementById("scroller").offsetHeight;
	if(ziehziel>ziehmax){
		ziehziel=ziehmax;
	}
	
	document.getElementById("scroller").style.top=ziehziel+"px";	
	scrolleroben=((parseInt(document.getElementById("scroller").style.top)/hoehe_anzeiger)*hoehe_scrollcontent)*-1;
	document.getElementById("scrollcontent").style.top=scrolleroben+"px";

	
}








/** This is high-level function.
 * It must react to delta being more/less than zero.
 */
istdarueber=0;
function handle(delta) {
        //if (delta < 0)
		//alert(delta);
        //else
		//alert("kkk");
		if(istdarueber==1){	
			rad(delta);
		}
}

/** Event handler for mouse wheel event.
 */
function wheel(event){
        var delta = 0;
        if (!event) /* For IE. */
                event = window.event;
        if (event.wheelDelta) { /* IE/Opera. */
                delta = event.wheelDelta/120;
                /** In Opera 9, delta differs in sign as compared to IE.
                 */
                if (window.opera)
                        delta = -delta;
        } else if (event.detail) { /** Mozilla case. */
                /** In Mozilla, sign of delta is different than in IE.
                 * Also, delta is multiple of 3.
                 */
                delta = -event.detail/3;
        }
        /** If delta is nonzero, handle it.
         * Basically, delta is now positive if wheel was scrolled up,
         * and negative, if wheel was scrolled down.
         */
        if (delta)
                handle(delta);
        /** Prevent default actions caused by mouse wheel.
         * That might be ugly, but we handle scrolls somehow
         * anyway, so don't bother here..
         */
        if (event.preventDefault)
                event.preventDefault();
	event.returnValue = false;
}

/** Initialization code. 
 * If you use your own event management code, change it as required.
 */
if (window.addEventListener)
        /** DOMMouseScroll is for mozilla. */
        window.addEventListener('DOMMouseScroll', wheel, false);
/** IE/Opera. */
window.onmousewheel = document.onmousewheel = wheel;






function scrollerdev(){
	//alert(document.getElementById("scrollcontent").offsetHeight);
	document.getElementById("scrollcontent").style.height=document.getElementById("scrollcontent").offsetHeight+40+"px";
	hoehe_anzeiger=document.getElementById("linksbreit").offsetHeight;
	hoehe_scrollcontent=document.getElementById("scrollcontent").offsetHeight;
	scrollerhoehe_neu=(hoehe_anzeiger/hoehe_scrollcontent)*hoehe_anzeiger;
	if(scrollerhoehe_neu<hoehe_anzeiger){
		document.getElementById("scroller").style.height=scrollerhoehe_neu+"px";
		document.getElementById("scrollmiddle").style.height=scrollerhoehe_neu-28+"px";
		
		document.getElementById("scrollunten").style.top=scrollerhoehe_neu-14+"px";
		
	}
	else{
		document.getElementById("scroller").style.visibility="hidden";
	}
}