window.addEvent('domready', function(){ 
	  var totIncrement		= 0;
	  var increment			= 500;
	  var maxRightIncrement	= increment*(-4);
	  var fx = new Fx.Style('loadShop_shop', 'margin-left', {
				duration: 1000,
				transition: Fx.Transitions.Back.easeInOut,
				wait: true
	   });
	   

	   //-------------------------------------
	  // EVENTS for the button "previous"
	  $('previous').addEvents({ 
          'click' : function(event){
		if(totIncrement>=0)                             
                totIncrement = maxRightIncrement-increment;
		  if(totIncrement<0){
					totIncrement = totIncrement+increment;
					fx.stop()
					fx.start(totIncrement);
				}
			}			  	  
      }); 	 
	  
	  
       //-------------------------------------
	  // EVENTS for the button "next"

  	  $('next').addEvents({ 
          'click' : function(event){
			  
			 if(totIncrement<=maxRightIncrement)          
                totIncrement = increment;  
			 if(totIncrement>maxRightIncrement){
				 totIncrement = totIncrement-increment;
		    	fx.stop()
				fx.start(totIncrement);
			}
          }		  		  
      })


    var timer = 0;
    $('stage_shop').addEvents({'mouseout' : function() {
        timer = setInterval(function() {
            $('next').fireEvent('click');
        }, 5000)
    }});
    $('stage_shop').addEvents({'mouseover' : function() {
        clearInterval(timer);
    }});
    $('stage_shop').fireEvent('mouseout');


	  	 
});
	

