var speed_1 = 10; //速度(毫秒)
var space_1 = 10; //每次移动(px)
var fill_1 = 0; //整体移位
var moveLock_1 = false;
var moveTimeObj_1;
var moveWay_1 = "right";
var comp_1 = 0;

//GetObj("List2_1").innerHTML=GetObj("Out1").innerHTML;
//GetObj('Out1').scrollLeft=fill_1>=0?fill_1:GetObj('Out1').scrollWidth-Math.abs(fill_1);


function GetObj(objName){
	if(document.getElementById){return eval('document.getElementById("'+objName+'")')}else{return eval('document.all.'+objName)}
}


function ISL_GoUp_1(){
    //alert(moveLock_1)
	if(moveLock_1)return;
	moveLock_1=true;
	moveWay_1="left";
	moveTimeObj_1=setInterval('ISL_ScrUp_1();',speed_1);
}

function ISL_StopUp_1(){
if(moveWay_1 == "right"){return};
clearInterval(moveTimeObj_1);
if((GetObj('Out1').scrollLeft-fill_1)%PageWidth_1!=0){
comp_1=fill_1-(GetObj('Out1').scrollLeft%PageWidth_1);
CompScr_1()}
}

function ISL_ScrUp_1(){
//alert(GetObj('Out1').offsetWidth)
GetObj('Out1').scrollLeft-=space_1
if(GetObj('Out1').scrollLeft<=0){
    //GetObj('Out1').scrollLeft=GetObj('Out1').scrollLeft+GetObj('Out1').offsetWidth
	GetObj('Out1').scrollLeft=0
	moveLock_1=false;
}

}

function ISL_GoDown_1(){
    //GetObj("test1").innerHTML=moveLock_1;
	clearInterval(moveTimeObj_1);
	if(moveLock_1)return;
	moveLock_1=true;
	moveWay_1="right";
	ISL_ScrDown_1();
	moveTimeObj_1=setInterval('ISL_ScrDown_1()',speed_1)
}

function ISL_StopDown_1(){
	if(moveWay_1 == "left"){return};
	clearInterval(moveTimeObj_1);
	if(GetObj('Out1').scrollLeft%PageWidth_1-(fill_1>=0?fill_1:fill_1+1)!=0){
		comp_1=PageWidth_1-GetObj('Out1').scrollLeft%PageWidth_1+fill_1;
		CompScr_1()
	}
}

function ISL_ScrDown_1(){
GetObj('Out1').scrollLeft+=space_1
//GetObj('test').innerHTML=GetObj('Out1').scrollLeft+" ---------"+(GetObj('Out1').scrollWidth);
if(GetObj('Out1').scrollLeft>(GetObj('Out1').scrollWidth))
{
   //GetObj('Out1').scrollLeft=(GetObj('Out1').scrollWidth);
   GetObj('Out1').scrollLeft=GetObj('Out1').scrollLeft-GetObj('Out1').scrollWidth
   //GetObj('Out1').scrollLeft=GetObj('Out1').scrollWidth;
}

}

function CompScr_1(){
	if(comp_1==0){moveLock_1=false;return}
	var num,TempSpeed=speed_1,TempSpace=space_1;
	if(Math.abs(comp_1)<PageWidth_1){
		TempSpace=Math.round(Math.abs(comp_1/space_1));
		if(TempSpace<1){TempSpace=1}
	}
	if(comp_1<0){
		if(comp_1<-TempSpace){
			comp_1+=TempSpace;
			num=TempSpace
		}
		else{num=-comp_1;comp_1=0}
		GetObj('Out1').scrollLeft-=num;
		setTimeout('CompScr_1()',TempSpeed)
	}	
	else{if(comp_1>TempSpace){comp_1-=TempSpace;num=TempSpace}
	else{num=comp_1;
	comp_1=0}
	GetObj('Out1').scrollLeft+=num;
	setTimeout('CompScr_1()',TempSpeed)}
}