function movethis(lay1,lay2,x) {
	x=Math.round(x);
	cup1+=x;
	moveLayerBy(lay1, x, 0);

	if (cup1>lay1wide)
		{moveLayerBy(lay1,-totalwide, 0); cup1-=totalwide;}
	else if (cup1<-lay1wide)
		{moveLayerBy(lay1,totalwide, 0); cup1+=totalwide;}

	if (cup1>0)
		moveLayerTo(lay2, cup1-lay2wide,scrTop);
	else
		moveLayerTo(lay2, cup1+(totalwide-lay2wide),scrTop);
}

function init(num) {
	if (ns4) {
		lay1wide = document.layers['stufe01'].document.width;
        	lay2wide = document.layers['stufe02'].document.width;
	}
	if (ie4up) {
		lay1wide=document.all['stufe01'].offsetWidth;
		lay2wide=document.all['stufe02'].offsetWidth;
	}
	cup1 = 0;
	cliphw=num;
	totalwide = lay1wide+lay2wide;
	scrTop    = getTop('stufe01');
	scrHeight = getHeight('stufe01');
}

function going() {
	if (mX<100) {ty = 8;}
	else  if (mX<200) {ty = 4;}
	else  if (mX<300) {ty = 2;}
	else  if (mX<500) {ty = 0;}
	else  if (mX<600) {ty = -2;}
	else  if (mX<700) {ty = -4;}
	else  if (mX<800) {ty = -8;}
	else {ty = 0;}

	//Checking that the mouse is over the scroller, otherwise don't move it.
	if (mY<81 && mY > 7 && ty != 0 && stopAnim == false) {movethis('stufe01','stufe02',ty);}

	setTimeout('going()',50);
}
