	var mouseDown = false;
	var move=0;
	var Init=false;
	function scr_Init()
	{
		if(!Init)
		{
			//habillage
			var Asc = $('affDetail').nextSiblings()[3];
			var Contenu = "<table cellpadding='0' cellspacing='0' id='tableContenu'>"+Asc.innerHTML+"</table>";
			Asc.replace('<table id="paneConteneur" cellpadding="0" cellspacing="0"><tbody><tr><td><div id="paneContenu">'+Contenu+'</div></td></tr><tr><td id="paneScroll"><div id="scrollBar"></div></td></tr></tbody><table>');
			setAction();
			
			Init=true;
		}
	}
	
	function setAction()
	{
		if($('paneContenu')!=undefined)
		{
			$('paneContenu').style.width=$('paneConteneur').style.width;
			$('paneScroll').style.width=$('paneConteneur').style.width;
			Event.observe($('paneScroll'),'click',function(event){
				calculScroll(event,this);
			});
			Event.observe($('scrollBar'),'mousedown',function(event){
				startfollow(event);
			});
			Event.observe(document,'mouseup',function(event){
				stopfollow(event);
			});
			Event.observe(document,'mousemove',function(event){
				follow(event);
			});
		}
		else
			setTimeout("setAction()",200);
	}
	
	function scroll(ratio,instant)
	{
		if(instant==undefined)
			instant=false;
		var el = $('tableContenu');
		
		var val1 = parseInt($('paneConteneur').offsetWidth,10);
		var val2 = parseInt((el.offsetWidth*ratio),10);
		var val=(el.offsetWidth-val1)*ratio;
		
		val = Math.round(parseInt(val*100,10)/100);
		
		if(parseInt($('paneConteneur').offsetWidth,10)+parseInt((el.offsetWidth-val1)*ratio,10)>el.offsetWidth)
			val = el.offsetWidth-$('paneConteneur').offsetWidth;
		if(instant)
			el.style.left = -val;
		else
			new Effect.Move(el,{x:-val,y:0,mode:'absolute'});
	}
	
	function calculScroll(event,el)
	{
		if(!mouseDown)
		{
			var left = ds_getleft(el);
			var width = el.offsetWidth;
			var click = Event.pointerX(event);
			var ratio = (click-left)/width;
			var pos = Math.round(ratio*width);
			if(pos-$('scrollBar').offsetWidth<0)
				pos=0;
			else if(pos+$('scrollBar').offsetWidth>el.offsetWidth)
				pos = el.offsetWidth-$('scrollBar').offsetWidth;
			else
				pos-=$('scrollBar').offsetWidth/2;
			new Effect.Move($('scrollBar'),{x:pos,y:0,mode:'absolute'});
			scroll(pos/($('paneScroll').offsetWidth-$('scrollBar').offsetWidth));
			
		}
	}
	
	function ds_getleft(el) {
	var tmp = el.offsetLeft;
	el = el.offsetParent
	while(el) {
		tmp += el.offsetLeft;
		el = el.offsetParent;
	}
	return tmp;
}
	
	function startfollow(event)
	{
		mouseDown = true;
		mouseX = Event.pointerX(event);
	}
	
	function stopfollow()
	{
		mouseDown = false;
	}
	
	function follow(event)
	{
		if(mouseDown && move%4==0)
		{
			var pos = Event.pointerX(event)-ds_getleft($('paneScroll'));
			
			var el = $('paneScroll');			
			if(pos-$('scrollBar').offsetWidth/2<0)
				pos=0;
			else if(pos+$('scrollBar').offsetWidth/2>el.offsetWidth)
				pos = el.offsetWidth-$('scrollBar').offsetWidth;
			else
				pos -=$('scrollBar').offsetWidth/2;
			
			scroll(pos/($('paneScroll').offsetWidth-$('scrollBar').offsetWidth),true);
			$('scrollBar').style.left = pos;
		}
		move++;
	}
