var imgSelect = {
	
	verrou : false,
	imgSize : 234,
	myFx : null,
	
	ScrollDroit : function(scr){
		if(imgSelect.verrou){ return(true);}
		
		var scroller = $(scr);
		var limit = (($$('#'+scr+' img').length)*imgSelect.imgSize )-(3*imgSelect.imgSize);
		var pos = ( scroller.getScrollLeft() >= limit ) ? 0 : scroller.getScrollLeft()+imgSelect.imgSize;
		
		/*console.log('scrollLeft = '+scroller.getScrollLeft()+', pos = '+pos+', limit = '+limit);*/
		
		var myFx = new Fx.Scroll(scroller, {
						wait: false
						, duration: 500
						, transition: Fx.Transitions.Circ.easeInOut
						, onComplete : function() {
						imgSelect.DeverrouillerScroll();
						}
					});
					
		myFx.start(pos,0);
		imgSelect.VerrouillerScroll();
	},
	
	ScrollGauche : function(scr){
		if(imgSelect.verrou){ return(true);}
		
		var scroller = $(scr);
		var limit = (($$('#'+scr+' img').length)*imgSelect.imgSize )-(3*imgSelect.imgSize);
		var pos = ( scroller.getScrollLeft() <= 0 ) ? limit : scroller.getScrollLeft()-imgSelect.imgSize;
		
		/*console.log('scrollLeft = '+scroller.getScrollLeft()+', pos = '+pos+', limit = '+limit);*/
		
		var myFx = new Fx.Scroll(scroller, {
						wait: false
						, duration: 500
						, transition: Fx.Transitions.Circ.easeInOut
						, onComplete : function() {
						imgSelect.DeverrouillerScroll();
						}
					});
					
		myFx.start(pos,0);
		imgSelect.VerrouillerScroll();
	},
	
	VerrouillerScroll : function(){
		imgSelect.verrou = true;
	},
	
	DeverrouillerScroll : function(){
		imgSelect.verrou = false;
	}	
	
}// JavaScript Document