// JavaScript Document

window.addEvent('domready', function(){
					
					/*boxes*/
				
					var el_eco = $('eco');
					var el_av_1 = $('avantage');
					var el_av_2 = $('avantage_1');
					var el_av_3 = $('avantage_2');
					var el_mens = $('mensuel');
					
					/*data*/
		
	

/*gestion des offres commerciaux*/	
	 el_eco.set({
				'events':{
					      'click':function(){
							  
							 $('choix_forfait').empty();
							 $('kilo').empty();
							 $('tarif').empty();
							 
							  $('eco_name').clone().inject($('choix_forfait'));
							  $('eco_kilo').clone().inject($('kilo'));
							  $('eco_tarif').clone().inject($('tarif'));
							  
							 
							  }
						 }
				});
	 
	 el_av_1.set({
				'events':{
					      'click':function(){
							 
							 /*vider les box*/
							 $('choix_forfait').empty();
							 $('kilo').empty();
							 $('tarif').empty();
							 
							 /*assigner les contenus*/
							  $('avantage_name_1').clone().inject($('choix_forfait'));
							  $('avantage_kilo').clone().inject($('kilo'));
							  $('avantage_tarif_1').clone().inject($('tarif'));
							  }
						 }
				});
	 
	 
	 el_av_2.set({
				'events':{
					      'click':function(){
							  
							 /*vider les box*/
							 $('choix_forfait').empty();
							 $('kilo').empty();
							 $('tarif').empty();
							 
							 /*assigner les contenus*/
							  $('avantage_name_2').clone().inject($('choix_forfait'));
							  $('avantage_kilo').clone().inject($('kilo'));
							  $('avantage_tarif_2').clone().inject($('tarif'));
							  }
						 }
				});
	 
	 el_av_3.set({
				'events':{
					      'click':function(){
							  
							 /*vider les box*/
							 $('choix_forfait').empty();
							 $('kilo').empty();
							 $('tarif').empty();
							 
							 /*assigner les contenus ie chercher les données du databox et les envoyer à info*/
							  $('avantage_name_3').clone().inject($('choix_forfait'));
							  $('avantage_kilo').clone().inject($('kilo'));
							  $('avantage_tarif_3').clone().inject($('tarif'));
							  }
						 }
				});
	 
	 el_mens.set({
				'events':{
					      'click':function(){
							  
							 /*vider les box*/
							 $('choix_forfait').empty();
							 $('kilo').empty();
							 $('tarif').empty();
							 
							 /*assigner les contenus*/
							  $('mensuel_name').clone().inject($('choix_forfait'));
							  $('mensuel_kilo').clone().inject($('kilo'));
							  $('mensuel_tarif').clone().inject($('tarif'));
							  }
						 }
				});
	 
	 
	 /**********
	 gestion des affichages des images de véhicules
	 ***********/
		 $('nom_0').set({
						 
						 'events':{
							      'click':function(){
									  $('image_large').empty();
									  $('image_0').clone().inject($('image_large'));
									  }
							 }
						 });
		 
		 $('nom_1').set({
						 
						 'events':{
							      'click':function(){
									  $('image_large').empty();
									  $('image_1').clone().inject($('image_large'));
									  }
							 }
						 });
		 
		 $('nom_2').set({
						 
						 'events':{
							      'click':function(){
									  $('image_large').empty();
									  $('image_2').clone().inject($('image_large'));
									  }
							 }
						 });
		 
		 
		 
		 
		 
		 /************
		 gestion du menu déroulant
		 *************/
		 $('scrolled').addEvents({
		'mouseenter': function(){
			// Always sets the duration of the tween to 1000 ms and a bouncing transition
			// And then tweens the height of the element
			this.set('tween', {
				duration: 1000,
				transition: Fx.Transitions.Bounce.easeOut // This could have been also 'bounce:out'
			}).tween('height', '190px');
		},
		'mouseleave': function(){
			// Resets the tween and changes the element back to its original size
			this.set('tween', {}).tween('height', '18px');
		
		}
	});
		 	 
 });
	 
	 