var boolScroll=false;
var boolStopScroll=false;
var x,x2;
var t,t2;
var omo=true;
var pause=false;

StopScroll = function(brute){
	if(omo){
		boolStopScroll=true;
		x=0;
		t=50;
		x2=brute?0:x2;
	}
}

Scroll = function( id, direction, vitesse ){
 var oObj = document.getElementById(id);
 boolStopScroll=false;
 x=(direction=='gauche'?'-':'')+(vitesse=='rapide'?10:1);
 t=(vitesse=='rapide'?15:15);
 if(!boolScroll){
 	boolScroll=true;
	x2=0;
	t2=50;
 	Scroll2(id);
 }
}

Scroll2 = function(id){
 var oObj = document.getElementById(id);
 if(!pause){
	 if(x2<x) x2++;
	 if(x2>x) x2--;
	 if(t2<t) t2=t2+5;
	 if(t2>t) t2=t2-5;
	 if(x2==0 && boolStopScroll==true){
	  boolScroll=false;
	 }else{
	  oObj.scrollLeft+=x2;
	  setTimeout("Scroll2('"+id+"')",t2);
	 }
 }else{
	setTimeout("Scroll2('"+id+"')",t2); 
 }
}