var timeoutID1 = null;
var scrollFlag = true;
var tempMove = 0;
var cSpeed = 6;
var iSpeed = cSpeed;
var iClipWidth = 111;
var iWindowWidth = 850;
var oSlider1;
var oSlider2;

function fnLeft(){
	scrollFlag = true;
	cSpeed = 6;
	iSpeed = cSpeed;
	doSlide();
}
function fnRight(){
	scrollFlag = true;
	cSpeed = -6;
	iSpeed = cSpeed;
	doSlide();
}
function fnLoad(){
	oSlider1 = document.getElementById("slider1");
	oSlider2 = document.getElementById("slider2");
	oSlider1.style.width = iSliderWidth+"px";
	oSlider1.style.left = "0px";
	oSlider1.style.top = 0+"px";
	oSlider2.style.width = iSliderWidth+"px";
	oSlider2.style.left = (iSliderWidth)+"px";
	oSlider2.style.top = 0+"px";
}
function doSlide(){
	oSlider1 = document.getElementById("slider1");
	oSlider2 = document.getElementById("slider2");
	if(scrollFlag){
		if(cSpeed>0){
			tempMove+=iSpeed;
			if(Math.abs(tempMove)>=iClipWidth){
				scrollFlag = false;
				tempMove=0;
			}
			if (parseInt(oSlider1.style.left)>(iSliderWidth*(-1))){
				oSlider1.style.left=parseInt(oSlider1.style.left)-iSpeed+"px";
			}else{
				oSlider1.style.left=parseInt(oSlider2.style.left)+iSliderWidth-iSpeed+"px";
			}
			if (parseInt(oSlider2.style.left)>(iSliderWidth*(-1))){
				oSlider2.style.left=parseInt(oSlider2.style.left)-iSpeed+"px";
			}else{
				oSlider2.style.left=parseInt(oSlider1.style.left)+iSliderWidth+"px";
			}
			
		}else{
			tempMove+=iSpeed;
			if(Math.abs(tempMove)>=iClipWidth){
				scrollFlag = false;
				tempMove=0;
			}
			if (parseInt(oSlider1.style.left)>iWindowWidth){
				oSlider1.style.left=(parseInt(oSlider2.style.left)-iSliderWidth)-iSpeed+"px";				
			}else{
				oSlider1.style.left=parseInt(oSlider1.style.left)-iSpeed+"px";				
			}
			if (parseInt(oSlider2.style.left)>=iSliderWidth){
				oSlider2.style.left=(parseInt(oSlider1.style.left)-iSliderWidth)+"px";
			}else{
				oSlider2.style.left=parseInt(oSlider2.style.left)-iSpeed+"px";				
			}	
		}
		timeoutID1 = setTimeout("doSlide()",10);
	}
}

//window.onload = function(){
	//fnLoad();
//}

