// JavaScript Document
var intervallGo=0;

function doScrollDown(){
	intervallGo=2;
	scrollDown();
}
function scrollDown(){ //scrollLength muss in Dokument definiert sein! Ist die zu scrollende Länge
	var top =parseInt(document.getElementById("labels").style.top);
	var clipOben,clipUnten,clip;
	
	if(isNaN(top)){
		document.getElementById("labels").style.top="0px";
		document.getElementById("labels").style.clip="rect(0px, auto, 600px, auto)";
	}
	if(top > -scrollLength){
		clip=document.getElementById("labels").style.clip;
//		document.getElementById("txt").firstChild.nodeValue=clip;
		clipOben=(parseInt(clip.match(/[0-9]*px/)));
		clip=clip.replace(/\([0-9]*px/,"");
		clipOben++;
		clipUnten=parseInt(clip.match(/[0-9]*px/));	//Achtung! Firefox hat intern "," als Trennung, IE nicht! Daher das "?"					
		clipUnten++;
		clip="rect("+clipOben+"px, auto, "+clipUnten+"px"+", auto)";
		document.getElementById("labels").style.clip=clip;
		document.getElementById("labels").style.top=(top-1)+"px";		
	}
	if(intervallGo==2) timer= window.setTimeout("scrollDown()", 10);
}

function doScrollUp(){
	intervallGo=1;
	scrollUp();
}
function scrollUp(){
	var top =parseInt(document.getElementById("labels").style.top);
	if(isNaN(top)){
		document.getElementById("labels").style.top="0px";
		document.getElementById("labels").style.clip="rect(0px, auto, 600px, auto)";
	}
	if(top<0){
		clip=document.getElementById("labels").style.clip;
//		document.getElementById("txt").firstChild.nodeValue=clip;
		clipOben=(parseInt(clip.match(/[0-9]*px/)));
		clip=clip.replace(/\([0-9]*px/,"");
		clipOben--;
		clipUnten=parseInt(clip.match(/[0-9]*px/));	//Achtung! Firefox hat intern "," als Trennung, IE nicht! Daher das "?"					
		clipUnten--;
		clip="rect("+clipOben+"px, auto, "+clipUnten+"px"+", auto)";
		document.getElementById("labels").style.clip=clip;
		document.getElementById("labels").style.top=(top+1)+"px";
	}	
	if(intervallGo==1) timer= window.setTimeout("scrollUp()", 10);
}

function stopScrolling(){
	intervallGo=0;
}
