window.addEvent('domready', function() {

	if($('editions_list')) {
	  var totIncrement		= 0;
	  var increment			= ($('editions_list').getElements('li').length * 235) - ($('editions_overflow').getCoordinates().width) - 20;
	  var maxRightIncrement	= increment*(-1);
	  var fx = new Fx.Style('editions_list', 'margin-left', {
				duration: 1000,
				transition: Fx.Transitions.Back.easeInOut,
				wait: true
	   });
	   
	   //-------------------------------------
	  // EVENTS for the button "previous"
	  $('previous_editions').addEvents({ 
		  'click' : function(event){ 
		  event = new Event(event).stop();
		  if(totIncrement<0){
					totIncrement = totIncrement+increment;
					fx.stop()
					fx.start(totIncrement);
					this.style.visibility = 'hidden';
					$('next_editions').style.visibility = 'visible';
				}
			}			  	  
	  }); 
	 
	   //-------------------------------------
	  // EVENTS for the button "next"
	  $('next_editions').addEvents({ 
		  'click' : function(event){ 
		   event = new Event(event).stop();
			 if(totIncrement>maxRightIncrement){
				 totIncrement = totIncrement-increment;
				fx.stop()
				fx.start(totIncrement);
					this.style.visibility = 'hidden';
					$('previous_editions').style.visibility = 'visible';
			}
		  }		  		  
	  });
	}
});
