// JavaScript Document
var totIncrement,increment,maxRightIncrement,fx,autoslide;

window.addEvent('domready', function(){ 
	  totIncrement		= 0;
	  increment			= 438;
	  autoslide			= 1;
	  maxRightIncrement	= increment*(-2);
	  fx = new Fx.Style('myList', 'margin-left', {
				duration: 1000,
				transition: Fx.Transitions.Back.easeInOut,
				wait: true 
	   });
	   
//	   if (autoslide == 1) 
//			autoslide_timer = window.setTimeout("go();",3000) ;

		
	   //-------------------------------------
	  // EVENTS for the button "previous"
	  $('leftslide').addEvents({ 
          'click' : function(event){ 
		  if(totIncrement<0){
					totIncrement = totIncrement+increment;
					fx.stop()
					fx.start(totIncrement);
				}
			}			  	  
      }); 
	 
       //-------------------------------------
	  // EVENTS for the button "next"
  	  $('rightslide').addEvents({ 
          'click' : function(event){ 
			 if(totIncrement>maxRightIncrement){
				 totIncrement = totIncrement-increment;
		    	fx.stop()
				fx.start(totIncrement);
			}
			else  {
					totIncrement = 0;
					fx.stop()
					fx.start(totIncrement);	
			}
          }		  		  
      })

	 
});

function go()  {
	if(totIncrement>maxRightIncrement){
				 totIncrement = totIncrement-increment;
		    	fx.stop()
				fx.start(totIncrement);
			}
			else  {
					totIncrement = 0;
					fx.stop()
					fx.start(totIncrement);	
			}
	
}

 window.setInterval("go()", 5000);
 
 
 function selection(area)  {
	 
	$('ville').options[area].selected='selected';

 }

function verifierContact(form)  {
	if(form.nom.value=="") {
		form.nom.style.borderColor = "red";
		form.nom.style.backgroundColor = "#FFC6C6";
		var error = 1;
		
	}
	if(form.tel.value=="") {
		form.tel.style.borderColor = "red";
		form.tel.style.backgroundColor = "#FFC6C6";
		var error = 1;
	}
	
	if(error)
		return false;
	else
		return true;
	
}