// JavaScript Document
timerLeft=""
timerRight=""
vis=1
unvis=-1

function left(id,w,wc,scrollStep){
	scrollStep=parseInt(scrollStep)
	document.getElementById(id+vis).style["color"]="#ff0000"	
	document.getElementById(id+unvis).style["color"]="#0000ff"	
	w=parseInt(w)
	wc=parseInt(wc)
  clearTimeout(timerRight)
  clearTimeout(timerLeft)
  
  zm=document.getElementById(id+vis).style["left"]
  zm2=document.getElementById(id+unvis).style["left"]
  zm.replace("px","")
  zm=parseInt(zm)
  zm2.replace("px","")
  zm2=parseInt(zm2)
  if(zm<=-1*w || zm>=wc){
	vis*=-1
	unvis*=-1
	zm=document.getElementById(id+vis).style["left"]
	zm2=document.getElementById(id+unvis).style["left"]
	zm.replace("px","")
	zm=parseInt(zm)
	zm2.replace("px","")
	zm2=parseInt(zm2)
	zm+=scrollStep
	zm2=wc+1
	//alert("1")

  }
  
  if(((zm>=0 && zm<=wc) || (zm<=0 && zm>=-1*w)) && ((zm2>=0 && zm2<=wc) || (zm2<=0 && zm2>=-1*w))){
	  //dwa widoczne
	zm+=scrollStep
	zm2+=scrollStep
		//alert("2")

  }
  if(zm<=0 && zm>=wc-w-scrollStep){
	//vis jest jedyny 
	zm+=scrollStep
	zm2=wc+1
		//alert("3")

  }
  if(zm>=(scrollStep*-1) && zm<=scrollStep){
	zm+=scrollStep
	zm2=-1*w+zm 
	//alert("4")
  }

  document.getElementById(id+vis).style["left"]=zm+"px"
  document.getElementById(id+unvis).style["left"]=zm2+"px"

timerRight=setTimeout("left('"+id+"','"+w+"','"+wc+"','"+scrollStep+"')",50)
}

function right(id,w,wc,scrollStep){
	scrollStep=parseInt(scrollStep)
	document.getElementById(id+vis).style["color"]="#ff0000"	
	document.getElementById(id+unvis).style["color"]="#0000ff"	
	w=parseInt(w)
	wc=parseInt(wc)
  clearTimeout(timerLeft)
  clearTimeout(timerRight)

zm=document.getElementById(id+vis).style["left"]
  zm2=document.getElementById(id+unvis).style["left"]
  zm.replace("px","")
  zm=parseInt(zm)
  zm2.replace("px","")
  zm2=parseInt(zm2)
  if(zm<=-1*w || zm>=wc){
	  //skok
	vis*=-1
	unvis*=-1
	zm=document.getElementById(id+vis).style["left"]
	zm2=document.getElementById(id+unvis).style["left"]
	zm.replace("px","")
	zm=parseInt(zm)
	zm2.replace("px","")
	zm2=parseInt(zm2)
	zm-=scrollStep
	zm2=wc-1
	//alert("skok")
  }
  
  if(((zm>=0 && zm<=wc) || (zm<=0 && zm>=-1*w)) && ((zm2>=0 && zm2<=wc) || (zm2<=0 && zm2>=-1*w))){
	  //dwa widoczne
	zm-=scrollStep
	zm2-=scrollStep
		//alert("dwa na ekranie")

  }
  if(zm<=0 && zm>=wc-w){
	//vis jest jedyny 
	zm-=scrollStep
	zm2=wc+1
		//alert("jedyny")

  }
  if(zm>=(scrollStep*-1) && zm<=scrollStep){
	zm-=scrollStep
	zm2=-1*w 
	//alert("krawedz1")

  }
  if(zm>=wc-w-scrollStep && zm<= wc-w+scrollStep){
	  zm-=scrollStep
	  zm2=wc-(wc-w-zm)
	//alert("krawedz2")

  }
  
  document.getElementById(id+vis).style["left"]=zm+"px"
  document.getElementById(id+unvis).style["left"]=zm2+"px"

timerLeft=setTimeout("right('"+id+"','"+w+"','"+wc+"','"+scrollStep+"')",10)
}

function stopMe(id,w,wc,scrollStep){
	scrollStep=parseInt(scrollStep)	
  clearTimeout(timerRight) 
  clearTimeout(timerLeft)
  timerRight=setTimeout("left('cont','"+w+"','"+wc+"','"+scrollStep+"')",10)

}

//w - szerokosc elementu div
widthOfDiv=850;
middleOfScreen=screen.width*0.5;
beginOfDiv=parseInt(middleOfScreen-parseInt(widthOfDiv*0.5));
endOfDiv=parseInt(parseInt(widthOfDiv*0.5)+middleOfScreen);



<!-- Begin
var IE = document.all?true:false;
if (!IE) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = getMouseXY;

var tempX = 0;
var tempY = 0;

function getMouseXY(e) {
	if (IE) { // grab the x-y pos.s if browser is IE
		tempX = event.clientX + document.body.scrollLeft;
		//tempY = event.clientY + document.body.scrollTop;
		tempY = event.clientY+ document.documentElement.scrollTop;
	}
	else {  // grab the x-y pos.s if browser is NS
		tempX = e.pageX;
		tempY = e.pageY;
	}  
	if (tempX < 0){tempX = 0;}
	if (tempY < 0){tempY = 0;}

	tempX=parseInt(tempX);
	tempy=parseInt(tempY);

	if((tempX>middleOfScreen) && (tempX<endOfDiv+10) && tempY>120 && tempY<254){
		wsp=parseInt((tempX-middleOfScreen)/(endOfDiv-middleOfScreen)*13);
		right('cont',scroler,'850',wsp)
	}else{
		
		if((tempX<middleOfScreen) && (tempX>beginOfDiv-10) && tempY>120 && tempY<254){
			wsp=parseInt((middleOfScreen-tempX)/(middleOfScreen-beginOfDiv)*13);
			left('cont',scroler,'850',wsp)
		}else{
		stopMe('cont',scroler,'850','2')
		}
	}
	return true;
}
//  End -->
