slideShowBox = {
			interval : 0,
			current : 0, 
			timeBeforeSwitch : 10000,
			timeEffect : 600,
			
			stopInterval : function(){
				clearInterval(this.interval);
				this.interval = 0;
			},
			startInterval : function(){
				this.interval =  setInterval(function(){
					var old = slideShowBox.current;
					
					slideShowBox.current++;
					var oldBox = $(".box").eq(old);
					if($(".box").length == slideShowBox.current){
						slideShowBox.current = 0;
					}
					var nextBox = $(".box").eq(slideShowBox.current);
					
					
					if(slideShowBox.current == 0){
						$(".box").not(':last').animate({
							marginLeft : '0px'
						},slideShowBox.timeEffect);
					}
					else
					{
						$(oldBox).animate({
							marginLeft : -($(oldBox).width()) +'px'
						},slideShowBox.timeEffect);
					}
					slideShowBox.currentView();
				},slideShowBox.timeBeforeSwitch);
				
			},
			setCurrent : function(a){
				$(a).each(function(){
					var eq = $(this).parents('div').find('a').index($(this));
					
					
					slideShowBox.stopInterval();
					
					var old = slideShowBox.current;
					slideShowBox.current = eq;
					
					if(old > eq){ // Si l'ancienne est apres, on doit reculer
					
						$(".box").each(function(){
							var boxEq = $(".box").index($(this));
							
							if(boxEq < old && boxEq  >= eq)
							{
								$(this).animate({
									marginLeft : '0px'
								},slideShowBox.timeEffect);
							}
							
						});
					}
					else // Si l'ancienne est avant, on avance l'effet
					{
						$(".box").each(function(){
							var boxEq = $(".box").index($(this));
							
							if(boxEq >= old && boxEq  < eq)
							{
								$(this).animate({
									marginLeft : -($(this).width()) +'px'
								},slideShowBox.timeEffect);
							}
							
						});
					}
					
					
					slideShowBox.currentView();
					slideShowBox.startInterval();
					
				});
			},
			currentView : function(){
				$("#downSlideshow img").css('opacity','0.5');
				$("#downSlideshow img").attr('src','theme/main/img/icons/grey.png');
				
				
				$("#downSlideshow img").eq(this.current).css('opacity','1');
				$("#downSlideshow img").eq(this.current).attr('src','theme/main/img/icons/orange.png');
			}
		};
