function initCalculatrice(){			
	_calculatrice = new Calculatrice();
}

Calculatrice = function () {
	var meter1 							= null;
	var meter2 							= null;
	var meter3 							= null;
	
	var prestation 						= null;
	var date_depart 					= null; 
	var heure							= null; 
	var minutes 						= null; 
	var airport_depart 					= null;
	var airport_depart_company 			= null;
	var airport_depart_numvol 			= null;
	var airport_depart_provdest			= null;
	var airport_depart_heure			= null;
	var airport_depart_minute			= null;
	var restaurant_depart 				= null;
	var hotel_depart 					= null;
	var disney_hotel_depart				= null;
	var adresse_depart 					= null; 
	var cp_depart 						= null; 
	var ville_depart 					= null;
	var airport_arrivee 				= null;
	var airport_arrivee_company 		= null;
	var airport_arrivee_numvol 			= null;
	var airport_arrivee_provdest		= null;
	var airport_arrivee_heure			= null
	var airport_arrivee_minute			= null;
	var restaurant_arrivee 				= null;
	var hotel_arrivee 					= null;
	var disney_hotel_arrivee			= null;
	var adresse_arrivee 				= null; 
	var cp_arrivee 						= null; 
	var ville_arrivee 					= null;
	var num_jours 						= null;
	var num_mois 						= null;
	var nombre_passagers 				= null;
	//pour la prestation restaurant
	var restaurantName					= null;
	var restaurantAdress				= null;
	var restaurantZipcode				= null;
	//fin prestation restaurant
	var loader;
	var cpParisIntraMuros;
	var next;
	
	this.loader = '<img src="images/plateforme_reservations/loader.gif" alt="Calcul en cours" />';
	this.cpParisIntraMuros = '75001,75002,75003,75004,75005,75006,75007,75008,75009,75010,75011,75012,75013,75014,75015,75016,75017,75018,75019,75020,75116';
	
	this.setMeter1 = function(meter){
		this.meter1 = meter;
		this.meter1 = Math.ceil(this.meter1/1000);
	}
	this.setMeter2 = function(meter){
		this.meter2 = meter;
		this.meter2 = Math.ceil(this.meter2/1000);
	}
	this.setMeter3 = function(meter){
		this.meter3 = meter;
		this.meter3 = Math.ceil(this.meter3/1000);
	}
	
	this.makeCalcul = function(modalPrix){
		if (this.prestation == 'banlieue_paris' || this.prestation == 'paris_banlieue'){
			if (this.meter1 > 45){
				openModal('Erreur', '<p>La distance entre les deux adresses est sup&eacute;rieure &agrave; 45 km.</p><br /><p style="text-align:center;">Merci de nous contacter <br />au 01 39 56 18 48</p>');
			}
			else {
				var frais_approche = 0;
				if (this.meter1 < 11) frais_approche = 20; 
				else if (this.meter1 > 10 && this.meter1 < 16) frais_approche = 30;
				else if (this.meter1 > 15 && this.meter1 < 21) frais_approche = 40;
				else if (this.meter1 > 20 && this.meter1 < 46) frais_approche = 80;
				var prix = 170 + frais_approche;
				prix += this.getSupplementBoisson(); 
				if (modalPrix){
					openModal("Tarif de la prestation", '<p class="pCenter pTarif">'+prix+'&nbsp;&euro;</p>');
				}
				$('#tarifHidden').val(prix);
			}
		}
		else if (this.prestation == 'banlieue_banlieue'){
			var frais_aller   = 0;
			var frais_retour  = 0;
			var frais_liaison = 0;
			if (this.meter1 > 45 || this.meter2 > 45 || this.meter3 > 45){
				$('#tarifHidden').val('');
				openModal('Erreur', '<p>La distance est trop importante.</p><br /><p style="text-align:center;">Merci de nous contacter <br />au 01 39 56 18 48</p>');
			}
			else
			{
				if (this.meter1 < 11) frais_aller = 20; 
				else if (this.meter1 > 10 && this.meter1 < 21) frais_aller = 25;
				else if (this.meter1 > 20 && this.meter1 < 31) frais_aller = 30;
				else if (this.meter1 > 30 && this.meter1 < 46) frais_aller = 40;
				
				if (this.meter2 < 11) frais_liaison = 150; 
				else if (this.meter2 > 10 && this.meter2 < 21) frais_liaison = 170;
				else if (this.meter2 > 20 && this.meter2 < 31) frais_liaison = 190;
				else if (this.meter2 > 30 && this.meter2 < 46) frais_liaison = 210;
				
				if (this.meter3 < 11) frais_retour = 20; 
				else if (this.meter3 > 10 && this.meter3 < 21) frais_retour = 25;
				else if (this.meter3 > 20 && this.meter3 < 31) frais_retour = 30;
				else if (this.meter3 > 30 && this.meter3 < 46) frais_retour = 40;
				
				var prix = frais_aller + frais_retour + frais_liaison + this.getSupplementBoisson();
				if (modalPrix){
					$('#dialog').html('<p class="pCenter pTarif">'+prix+'&nbsp;&euro;</p>');
				}
				
				$('#tarifHidden').val(prix);
			}
		}
		else if (this.prestation == 'dispo2heures'){

			if (this.meter1 > 20 || this.meter2 > 20){
				$('#tarifHidden').val('');
				openModal('Erreur', '<p>La distance est trop importante.</p><br /><p style="text-align:center;">Merci de nous contacter <br />au 01 39 56 18 48</p>');
			}
			else
			{
				var prix = 300+this.getSupplementBoisson();
				if (modalPrix){
					openModal('Tarif de la prestation','<p class="pCenter pTarif">'+prix+'&nbsp;&euro;</p>');
				}
				$('#tarifHidden').val(prix);
			}
		}
		
		else if (this.prestation == 'mariage'){
			if (this.meter1 > 45 || this.meter2 > 45){
				$('#tarifHidden').val('');
				openModal('Erreur', '<p>La distance est trop importante.</p><br /><p style="text-align:center;">Merci de nous contacter <br />au 01 39 56 18 48</p>');
			}
			else
			{
				if (this.num_mois == 5 || this.num_mois == 6 || this.num_mois == 7) prix = 730;
				else prix = 650;
				prix += this.getSupplementBoisson();
				$('#tarifHidden').val(prix);
				if (modalPrix){
					openModal('Tarif de la prestation','<p class="pCenter pTarif">'+prix+'&nbsp;&euro;</p>');
				}
			}
		}
		else if (this.prestation == 'casino'){
			if (this.meter1 > 20 || this.meter2 > 20){
				$('#tarifHidden').val('');
				openModal('Erreur', '<p>La distance est trop importante.</p><br /><p style="text-align:center;">Merci de nous contacter <br />au 01 39 56 18 48</p>');
			}
			else
			{
				var prix = 500;
				prix += this.getSupplementBoisson();
				$('#tarifHidden').val(prix);
				if (modalPrix){
					openModal('Tarif de la prestation','<p class="pCenter pTarif">'+prix+'&nbsp;&euro;</p>');
				}
			}
		}
		else if (this.prestation == 'restaurant'){
			if (this.meter1 > 45 || this.meter2 > 45){
				$('#tarifHidden').val('');
				openModal('Erreur', '<p>La distance est trop importante.</p><br /><p style="text-align:center;">Merci de nous contacter <br />au 01 39 56 18 48</p>');
			}
			else
			{
				var prix = 400;
				prix += this.getSupplementBoisson();
				$('#tarifHidden').val(prix);
				if (modalPrix){
					openModal('Tarif de la prestation','<p class="pCenter pTarif">'+prix+'&nbsp;&euro;</p>');
				}
			}
		}
	}
	
	this.checkContraintes = function(modalPrix){
		var prix = null;
		var textError = '';
		
		//Prestation Transfert Paris Intra Muros
		if (this.prestation == 'intramuros'){		
			var regCpDepart=new RegExp(this.cp_depart,"gi");
			var regCpArrivee=new RegExp(this.cp_arrivee,"gi");

			//CP de départ
			if (!this.cpParisIntraMuros.match(regCpDepart)) {
				$("#prestation_start_zipcode").removeClass("inputBorder");
				$('#prestation_start_zipcode').addClass("fieldError");
				textError += '<p>Le code postal de d&eacute;part ne correspond pas &agrave; la ville de Paris</p>';
			} 
			else {
				$("#prestation_start_zipcode").removeClass("fieldError");
				$('#prestation_start_zipcode').addClass("inputBorder");
			}
			
			//CP d'arrivée
			if (!this.cpParisIntraMuros.match(regCpArrivee)) {
				$("#prestation_end_zipcode").removeClass("inputBorder");
				$('#prestation_end_zipcode').addClass("fieldError");
				textError += '<p>Le code postal d\'arriv&eacute;e ne correspond pas &agrave; la ville de Paris</p>';
			} 
			else {
				$("#prestation_end_zipcode").removeClass("fieldError");
				$('#prestation_end_zipcode').addClass("inputBorder");
			}
			
			//Verification de la contrainte horaire - No après 1 heure
			if ((this.heure > 01 && this.heure < 08) || (this.heure == 01 && this.minutes > 00)){
				$("#prestation_start_hour").removeClass("inputBorder");
				$('#prestation_start_hour').addClass("fieldError");
				$("#prestation_start_minut").removeClass("inputBorder");
				$('#prestation_start_minut').addClass("fieldError");
				textError += '<p>Le transfert Paris intramuros n\'est plus disponnible apr&egrave;s 1H du matin. <br />Repise du service &agrave; 8H du matin</p>';
			}
			else if (this.num_jours == 6 && this.heure > 10 && this.heure < 20){
				$("#prestation_start_hour").removeClass("inputBorder");
				$('#prestation_start_hour').addClass("fieldError");
				$("#prestation_start_minut").removeClass("inputBorder");
				$('#prestation_start_minut').addClass("fieldError");
				$("#datepicker").removeClass("inputBorder");
				$('#datepicker').addClass("fieldError");
				textError += '<p>Cette prestation n\'est pas disponible le samedi entre 11H et 20H.</p>';
			}
			else {
				$("#prestation_start_hour").removeClass("fieldError");
				$('#prestation_start_hour').addClass("inputBorder");
				$("#prestation_start_minut").removeClass("fieldError");
				$('#prestation_start_minut').addClass("inputBorder");
				$("#datepicker").removeClass("fieldError");
				$('#datepicker').addClass("inputBorder");
			}
			
			if (textError == ''){
				var prix = 170 + this.getSupplementBoisson();
				if (modalPrix){
					openModal("Tarif de la prestation", '<p class="pCenter pTarif">'+prix+'&nbsp;&euro;</p>');
				}
				$('#tarifHidden').val(prix);
			}
			else {
				$('#tarifHidden').val('');
				openModal('Erreur', textError);
			}
			
		}
		//Fin de presation paris intra muros
		
	
		
		//Prestation Transfert Paris <--> Banlieu
		else if (this.prestation == 'paris_banlieue' || this.prestation == 'banlieue_paris'){
			
			var regCpDepart=new RegExp(this.cp_depart,"gi");
			var regCpArrivee=new RegExp(this.cp_arrivee,"gi");
			var adressStart = null;
			var adressEnd = null;
			
			if (this.prestation == 'paris_banlieue'){
				//CP de départ
				if (!this.cpParisIntraMuros.match(regCpDepart)) {
					$("#prestation_start_zipcode").removeClass("inputBorder");
					$('#prestation_start_zipcode').addClass("fieldError");
					textError += '<p>Le code postal de d&eacute;part ne correspond pas &agrave; la ville de Paris</p>';
				} 
				else {
					$("#prestation_start_zipcode").removeClass("fieldError");
					$('#prestation_start_zipcode').addClass("inputBorder");
				}
				
				//CP d'arrivée
				if (this.cpParisIntraMuros.match(regCpArrivee)) {
					$("#prestation_end_zipcode").removeClass("inputBorder");
					$('#prestation_end_zipcode').addClass("fieldError");
					textError += '<p>Le code postal d\'arriv&eacute;e doit &ecirc;tre diff&eacute;rent de celui de Paris</p>';
				} 
				else {
					$("#prestation_end_zipcode").removeClass("fieldError");
					$('#prestation_end_zipcode').addClass("inputBorder");
				}
				
				if (textError == ''){
					adressStart = 'Place de la concorde, 75008 PARIS, FRANCE';
					adressEnd = this.cp_arrivee +' '+this.ville_arrivee +', FRANCE';
				}
			}
			else if (this.prestation == 'banlieue_paris') {
				if (this.cpParisIntraMuros.match(regCpDepart)) {
					$("#prestation_start_zipcode").removeClass("inputBorder");
					$('#prestation_start_zipcode').addClass("fieldError");
					textError += '<p>Le code postal de d&eacute;part doit &ecirc;tre diff&eacute;rent de celui de Paris</p>';
				} 
				else {
					$("#prestation_start_zipcode").removeClass("fieldError");
					$('#prestation_start_zipcode').addClass("inputBorder");
				}
				
				//CP d'arrivée
				if (!this.cpParisIntraMuros.match(regCpArrivee)) {
					$("#prestation_end_zipcode").removeClass("inputBorder");
					$('#prestation_end_zipcode').addClass("fieldError");
					textError += '<p>Le code postal d\'arriv&eacute;e ne correspond pas &agrave; la ville de Paris</p>';
				} 
				else {
					$("#prestation_end_zipcode").removeClass("fieldError");
					$('#prestation_end_zipcode').addClass("inputBorder");
				}
				
				if (textError == ''){
					adressStart = this.cp_depart+' '+this.ville_depart+', FRANCE';
					adressEnd = 'Place de la concorde, 75008 PARIS, FRANCE';
				}
			}

			//Verification de la contrainte horaire
			if (this.num_jours == 6 && this.heure > 10 && this.heure < 20){
				$("#prestation_start_hour").removeClass("inputBorder");
				$('#prestation_start_hour').addClass("fieldError");
				$("#prestation_start_minut").removeClass("inputBorder");
				$('#prestation_start_minut').addClass("fieldError");
				$("#datepicker").removeClass("inputBorder");
				$('#datepicker').addClass("fieldError");
				textError += '<p>Cette prestation n\'est pas disponible le samedi entre 11H et 20H.</p>';
			}
			else if ((this.heure > 01 && this.heure < 08) || (this.heure == 01 && this.minutes > 00)){
				$("#prestation_start_hour").removeClass("inputBorder");
				$('#prestation_start_hour').addClass("fieldError");
				$("#prestation_start_minut").removeClass("inputBorder");
				$('#prestation_start_minut').addClass("fieldError");
				textError += '<p>Cette prestation n\'est pas disponible apr&egrave;s 1H du matin.</p><p>Reprise du service &agrave; 8H du matin</p>';
			}
			else {
				$("#prestation_start_hour").removeClass("fieldError");
				$('#prestation_start_hour').addClass("inputBorder");
				$("#prestation_start_minut").removeClass("fieldError");
				$('#prestation_start_minut').addClass("inputBorder");
			}
			if (textError.length == 0)
			{
				if (GBrowserIsCompatible()) {  
					var gdir = new GDirections();
					GEvent.addListener(gdir, "load", function() {
		    			_calculatrice.setMeter1(gdir.getDistance().meters);
		    			_calculatrice.makeCalcul(modalPrix);
					});
					GEvent.addListener(gdir, "error", function(){
			        		if (gdir.getStatus().code == G_GEO_UNKNOWN_ADDRESS)
			        			openModal("Erreur", "<p>Aucune correspondance g&eacute;ographique trouv&eacute;e pour la ou les adresse(s) saisie(s).</p><p>Soit l\'adresse est relativement r&eacute;cente, soit elle est incorrecte</p>");
			        		else openModal("Erreur", "<p>Erreur lors de la g&eacute;olocalisation des adresses</p>");
				   		}
					);
					gdir.load("from: " + adressStart + " to: " + adressEnd,{"locale": 'fr'});
				}
			}
			else {
				$('#tarifHidden').val('');
				openModal('Erreur', textError);
			}
		}
		
		else if (this.prestation == 'banlieue_banlieue'){
			var regCpDepart=new RegExp(this.cp_depart,"gi");
			var regCpArrivee=new RegExp(this.cp_arrivee,"gi");
			
			//CP de départ
			if (this.cpParisIntraMuros.match(regCpDepart)) {
				$("#prestation_start_zipcode").removeClass("inputBorder");
				$('#prestation_start_zipcode').addClass("fieldError");
				textError += '<p>Le code postal de d&eacute;part doit &ecirc;tre diff&eacute;rent de celui de Paris</p>';
			} 
			else {
				$("#prestation_start_zipcode").removeClass("fieldError");
				$('#prestation_start_zipcode').addClass("inputBorder");
			}
			//CP d'arrivée
			if (this.cpParisIntraMuros.match(regCpArrivee)) {
				$("#prestation_end_zipcode").removeClass("inputBorder");
				$('#prestation_end_zipcode').addClass("fieldError");
				textError += '<p>Le code postal d\'arriv&eacute;e doit &ecirc;tre diff&eacute;rent de celui de Paris</p>';
			} 
			else {
				$("#prestation_end_zipcode").removeClass("fieldError");
				$('#prestation_end_zipcode').addClass("inputBorder");
			}

			
			if (this.num_jours == 6 && this.heure > 10 && this.heure < 20){
				$("#prestation_start_hour").removeClass("inputBorder");
				$('#prestation_start_hour').addClass("fieldError");
				$("#prestation_start_minut").removeClass("inputBorder");
				$('#prestation_start_minut').addClass("fieldError");
				$("#datepicker").removeClass("inputBorder");
				$('#datepicker').addClass("fieldError");
				textError += '<p>Cette prestation n\'est pas disponible le samedi entre 11H et 20H.</p>';
			}
			else if ((this.heure > 01 && this.heure < 08) || (this.heure == 01 && this.minutes > 00)){
					$("#prestation_start_hour").removeClass("inputBorder");
					$('#prestation_start_hour').addClass("fieldError");
					$("#prestation_start_minut").removeClass("inputBorder");
					$('#prestation_start_minut').addClass("fieldError");
					textError += '<p>Cette prestation n\'est pas disponible apr&egrave;s 22H.</p><p>Reprise du service &agrave; 8H du matin</p>';
			}
			else {
				$("#prestation_start_hour").removeClass("fieldError");
				$('#prestation_start_hour').addClass("inputBorder");
				$("#prestation_start_minut").removeClass("fieldError");
				$('#prestation_start_minut').addClass("inputBorder");
				$("#datepicker").removeClass("fieldError");
				$('#datepicker').addClass("inputBorder");
			}
			
			if (textError.length == 0){
				if (GBrowserIsCompatible()) {  
					var gdir = new GDirections();
					var gdir2 = new GDirections();
					var gdir3 = new GDirections();
					var adressConcorde = 'Place de la concorde, 75008 PARIS, FRANCE';
					var adressBanlieue1 = _calculatrice.cp_depart + ' ' + _calculatrice.ville_depart + ',FRANCE';
					var adressBanlieue2 = _calculatrice.cp_arrivee + ' ' + _calculatrice.ville_arrivee + ',FRANCE';
					
					GEvent.addListener(gdir, "load", function() {
			    		_calculatrice.setMeter1(gdir.getDistance().meters);
			    		gdir2.load("from: " + adressBanlieue1 + " to: " + adressBanlieue2,{"locale": 'fr'});
			    	});
					GEvent.addListener(gdir2, "load", function() {
		    			_calculatrice.setMeter2(gdir2.getDistance().meters);
		    			gdir3.load("from: " + adressBanlieue1 + " to: " + adressConcorde,{"locale": 'fr'});
					});
					GEvent.addListener(gdir3, "load", function() {
		    			_calculatrice.setMeter3(gdir3.getDistance().meters);
		    			_calculatrice.makeCalcul(modalPrix);
					});
					GEvent.addListener(gdir2, "error", function(){
						if (gdir2.getStatus().code == G_GEO_UNKNOWN_ADDRESS)
		        			openModal("Erreur", "<p>Aucune correspondance g&eacute;ographique trouv&eacute;e pour la ou les adresse(s) saisie(s).</p><p>Soit l\'adresse est relativement r&eacute;cente, soit elle est incorrecte</p>");
		        		else openModal("Erreur", "<p>Erreur lors de la g&eacute;olocalisation des adresses</p>");
				   	   }
					);
					openModal("Tarif de la prestation", '<p class="pCenter pTarif">'+this.loader+'<br />Calcul en cours</p>');
					gdir.load("from: " + adressConcorde + " to: " + adressBanlieue1,{"locale": 'fr'});
			    }
			}
			else 
			{
				$('#tarifHidden').val('');
				openModal('Erreur', textError);
			}
		}
		//Fin de presation Banlieue - Banlieu
		else if (this.prestation == 'dispo2heures'){
			if ((this.heure > 00 && this.heure < 08) || (this.heure == 00 && this.minutes > 00)){
				$("#prestation_start_hour").removeClass("inputBorder");
				$('#prestation_start_hour').addClass("fieldError");
				$("#prestation_start_minut").removeClass("inputBorder");
				$('#prestation_start_minut').addClass("fieldError");
				textError += '<p>Cette prestation n\'est pas disponible apr&egrave;s minuit.</p>';
			}
			
			else if (this.num_jours == 6 && this.heure > 10 && this.heure < 20){
				$("#prestation_start_hour").removeClass("inputBorder");
				$('#prestation_start_hour').addClass("fieldError");
				$("#prestation_start_minut").removeClass("inputBorder");
				$('#prestation_start_minut').addClass("fieldError");
				$("#datepicker").removeClass("inputBorder");
				$('#datepicker').addClass("fieldError");
				textError += '<p>Cette prestation n\'est pas disponible le samedi entre 11H et 20H.</p>';
			}
			else {
				$("#datepicker").removeClass("fieldError");
				$('#datepicker').addClass("inputBorder");
				$("#prestation_start_hour").removeClass("fieldError");
				$('#prestation_start_hour').addClass("inputBorder");
				$("#prestation_start_minut").removeClass("fieldError");
				$('#prestation_start_minut').addClass("inputBorder");
			}
			
			if (this.cp_depart == '75000'){
				$("#prestation_start_zipcode").removeClass("inputBorder");
				$('#prestation_start_zipcode').addClass("fieldError");
				textError += '<p>Le code postal de d&eacute;part ne correspond pas &agrave; un arrondissement de Paris</p>';
			}
			else {
				$("#prestation_start_zipcode").removeClass("fieldError");
				$('#prestation_start_zipcode').addClass("inputBorder");
			}
			
			if (this.cp_arrivee == '75000'){
				$("#prestation_end_zipcode").removeClass("inputBorder");
				$('#prestation_end_zipcode').addClass("fieldError");
				textError += '<p>Le code postal d\'arriv&eacute;e ne correspond pas &agrave; un arrondissement de Paris</p>';
			}
			else {
				$("#prestation_end_zipcode").removeClass("fieldError");
				$('#prestation_end_zipcode').addClass("inputBorder");
			}
			
			if (textError == ''){
				if (GBrowserIsCompatible()) {  
					var gdir = new GDirections();
					var gdir2 = new GDirections();
					var adressConcorde = 'Place de la concorde, 75008 PARIS, FRANCE';
					var adressStart;
					var adressEnd;
					
					if (_calculatrice.airport_depart == null){
						adressStart = _calculatrice.cp_depart + ' ' + _calculatrice.ville_depart + ',FRANCE';
					}
					else {
						adressStart = _calculatrice.getAirportAdress(_calculatrice.airport_depart);
					}
					
					if (_calculatrice.airport_arrivee == null){
						 adressEnd =_calculatrice.cp_arrivee + ' ' + _calculatrice.ville_arrivee + ',FRANCE';
					}
					else {
						 adressEnd = _calculatrice.getAirportAdress(_calculatrice.airport_arrivee);
					}
					
					GEvent.addListener(gdir, "load", function() {
			    		_calculatrice.setMeter1(gdir.getDistance().meters);
			    		gdir2.load("from: " + adressEnd + " to: " + adressConcorde,{"locale": 'fr'});
			    	});
					GEvent.addListener(gdir2, "load", function() {
		    			_calculatrice.setMeter2(gdir2.getDistance().meters);
		    			_calculatrice.makeCalcul(modalPrix);
					});
					GEvent.addListener(gdir, "error", function(){
		        		if (gdir.getStatus().code == G_GEO_UNKNOWN_ADDRESS)
		        			openModal("Erreur", "<p>Aucune correspondance g&eacute;ographique trouv&eacute;e pour la ou les adresse(s) saisie(s).</p><p>Soit l\'adresse est relativement r&eacute;cente, soit elle est incorrecte</p>");
		        		else openModal("Erreur", "<p>Erreur lors de la g&eacute;olocalisation des adresses</p>");
			   		});
					GEvent.addListener(gdir2, "error", function(){
		        		if (gdir2.getStatus().code == G_GEO_UNKNOWN_ADDRESS)
		        			openModal("Erreur", "<p>Aucune correspondance g&eacute;ographique trouv&eacute;e pour la ou les adresse(s) saisie(s).</p><p>Soit l\'adresse est relativement r&eacute;cente, soit elle est incorrecte</p>");
		        		else openModal("Erreur", "<p>Erreur lors de la g&eacute;olocalisation des adresses</p>");
			   		});
					if (modalPrix){
						openModal('Tarif de la prestation','<p class="pCenter pTarif">'+this.loader+'<br />Calcul en cours</p>');
					}
					gdir.load("from: " + adressConcorde + " to: " + adressStart,{"locale": 'fr'});
			    }
			}
			else 
			{
				$('#tarifHidden').val('');
				openModal('Erreur', textError);
			}
		}
		else if (this.prestation == 'mariage'){
			if (this.num_jours == 6 && ((this.heure > 16) || (this.heure == 16 && this.minutes > 00))){
				$("#prestation_start_hour").removeClass("inputBorder");
				$('#prestation_start_hour').addClass("fieldError");
				$("#prestation_start_minut").removeClass("inputBorder");
				$('#prestation_start_minut').addClass("fieldError");
				$("#datepicker").removeClass("inputBorder");
				$('#datepicker').addClass("fieldError");
				textError += '<p>Cette prestation n\'est pas disponible le samedi apr&egrave;s 16H.</p>';
			}
			if ((this.heure > 16 && this.heure < 24) || (this.heure > 00 && this.heure < 08) || (this.heure == 00) || (this.heure == 16 && this.minutes > 00)){
				$("#prestation_start_hour").removeClass("inputBorder");
				$('#prestation_start_hour').addClass("fieldError");
				$("#prestation_start_minut").removeClass("inputBorder");
				$('#prestation_start_minut').addClass("fieldError");
				$("#datepicker").removeClass("inputBorder");
				$('#datepicker').addClass("fieldError");
				textError += '<p>Cette prestation n\'est pas disponible apr&egrave;s 16H. <br />Reprise du service &agrave; 7H du matin</p>';
			}
			else {
				$("#prestation_start_hour").removeClass("fieldError");
				$('#prestation_start_hour').addClass("inputBorder");
				$("#prestation_start_minut").removeClass("fieldError");
				$('#prestation_start_minut').addClass("inputBorder");
				$("#datepicker").removeClass("fieldError");
				$('#datepicker').addClass("inputBorder");
			}
			
			if (this.cp_depart == '75000'){
				$("#prestation_start_zipcode").removeClass("inputBorder");
				$('#prestation_start_zipcode').addClass("fieldError");
				textError += '<p>Le code postal de d&eacute;part ne correspond pas &agrave; un arrondissement de Paris</p>';
			}
			else {
				$("#prestation_start_zipcode").removeClass("fieldError");
				$('#prestation_start_zipcode').addClass("inputBorder");
			}
			
			if (this.cp_arrivee == '75000'){
				$("#prestation_end_zipcode").removeClass("inputBorder");
				$('#prestation_end_zipcode').addClass("fieldError");
				textError += '<p>Le code postal d\'arriv&eacute;e ne correspond pas &agrave; un arrondissement de Paris</p>';
			}
			else {
				$("#prestation_end_zipcode").removeClass("fieldError");
				$('#prestation_end_zipcode').addClass("inputBorder");
			}
			
			if (textError == ''){
				if (GBrowserIsCompatible()) {  
					var gdir = new GDirections();
					var gdir2 = new GDirections();
					var adressConcorde = 'Place de la concorde, 75008 PARIS, FRANCE';
					var adressStart;
					var adressEnd;
					
					adressStart = _calculatrice.cp_depart + ' ' + _calculatrice.ville_depart + ',FRANCE';
					adressEnd =_calculatrice.cp_arrivee + ' ' + _calculatrice.ville_arrivee + ',FRANCE';
					
					GEvent.addListener(gdir, "load", function() {
			    		_calculatrice.setMeter1(gdir.getDistance().meters);
			    		gdir2.load("from: " + adressEnd + " to: " + adressConcorde,{"locale": 'fr'});
			    	});
					GEvent.addListener(gdir2, "load", function() {
		    			_calculatrice.setMeter2(gdir2.getDistance().meters);
		    			_calculatrice.makeCalcul(modalPrix);
					});
					GEvent.addListener(gdir, "error", function(){
		        		if (gdir.getStatus().code == G_GEO_UNKNOWN_ADDRESS)
		        			openModal("Erreur", "<p>Aucune correspondance g&eacute;ographique trouv&eacute;e pour la ou les adresse(s) saisie(s).</p><p>Soit l\'adresse est relativement r&eacute;cente, soit elle est incorrecte</p>");
		        		else openModal("Erreur", "<p>Erreur lors de la g&eacute;olocalisation des adresses</p>");
			   		});
					GEvent.addListener(gdir2, "error", function(){
		        		if (gdir2.getStatus().code == G_GEO_UNKNOWN_ADDRESS)
		        			openModal("Erreur", "<p>Aucune correspondance g&eacute;ographique trouv&eacute;e pour la ou les adresse(s) saisie(s).</p><p>Soit l\'adresse est relativement r&eacute;cente, soit elle est incorrecte</p>");
		        		else openModal("Erreur", "<p>Erreur lors de la g&eacute;olocalisation des adresses</p>");
			   		});
					if (modalPrix){
						openModal('Tarif de la prestation', '<p class="pCenter pTarif">'+this.loader+'<br />Calcul en cours</p>');
					}
					gdir.load("from: " + adressConcorde + " to: " + adressStart,{"locale": 'fr'});
			    }
			}
			else 
			{
				$('#tarifHidden').val('');
				openModal('Erreur', textError);
			}
		}
		else if (this.prestation == 'restaurant'){
			if (this.num_jours == 5 || this.num_jours == 6){
				$("#datepicker").removeClass("inputBorder");
				$('#datepicker').addClass("fieldError");
				textError += '<p>Cette prestation n\'est pas disponible le vendredi et le samedi.</p>';
			}
			else if ((this.heure !=  18  && this.heure != 19  && this.heure != 20  && this.heure != 21  && this.heure != 22) || (this.heure == 22 && this.minutes > 00)){
				$("#prestation_start_hour").removeClass("inputBorder");
				$('#prestation_start_hour').addClass("fieldError");
				$("#prestation_start_minut").removeClass("inputBorder");
				$('#prestation_start_minut').addClass("fieldError");
				textError += '<p>Cette prestation n\'est pas disponible avant 18H et apr&egrave;s 22H.</p>';
			}
			else {
				$("#datepicker").removeClass("fieldError");
				$('#datepicker').addClass("inputBorder");
				$("#prestation_start_hour").removeClass("fieldError");
				$('#prestation_start_hour').addClass("inputBorder");
				$("#prestation_start_minut").removeClass("fieldError");
				$('#prestation_start_minut').addClass("inputBorder");
			}
			
			if (this.cp_depart == '75000'){
				$("#prestation_start_zipcode").removeClass("inputBorder");
				$('#prestation_start_zipcode').addClass("fieldError");
				textError += '<p>Le code postal de d&eacute;part ne correspond pas &agrave; un arrondissement de Paris</p>';
			}
			else {
				$("#prestation_start_zipcode").removeClass("fieldError");
				$('#prestation_start_zipcode').addClass("inputBorder");
			}
			
			if (this.cp_arrivee == '75000'){
				$("#prestation_end_zipcode").removeClass("inputBorder");
				$('#prestation_end_zipcode').addClass("fieldError");
				textError += '<p>Le code postal d\'arriv&eacute;e ne correspond pas &agrave; un arrondissement de Paris</p>';
			}
			else {
				$("#prestation_end_zipcode").removeClass("fieldError");
				$('#prestation_end_zipcode').addClass("inputBorder");
			}
			
			var regCpRestaurant=new RegExp(this.restaurantZipcode,"gi");
			
			//CP de départ
			if (!this.cpParisIntraMuros.match(regCpRestaurant)) {
				$("#restaurant_zipcode").removeClass("inputBorder");
				$('#restaurant_zipcode').addClass("fieldError");
				textError += '<p>Le code postal du restaurant ne correspond pas &agrave; la ville de Paris</p>';
			}
			else if (this.restaurantZipcode == '75000') {
				$("#restaurant_zipcode").removeClass("inputBorder");
				$('#restaurant_zipcode').addClass("fieldError");
				textError += '<p>Le code postal d\'arriv&eacute;e ne correspond pas &agrave; un arrondissement de Paris</p>';
			} 
			else {
				$("#restaurant_zipcode").removeClass("fieldError");
				$('#restaurant_zipcode').addClass("inputBorder");
			}
			
			if (textError == ''){
				if (GBrowserIsCompatible()) {  
					var gdir = new GDirections();
					var gdir2 = new GDirections();
					var adressConcorde = 'Place de la concorde, 75008 PARIS, FRANCE';
					var adressStart;
					var adressEnd;
					
					adressStart = _calculatrice.cp_depart + ' ' + _calculatrice.ville_depart + ',FRANCE';
					adressEnd =_calculatrice.cp_arrivee + ' ' + _calculatrice.ville_arrivee + ',FRANCE';
					
					GEvent.addListener(gdir, "load", function() {
			    		_calculatrice.setMeter1(gdir.getDistance().meters);
			    		gdir2.load("from: " + adressEnd + " to: " + adressConcorde,{"locale": 'fr'});
			    	});
					GEvent.addListener(gdir2, "load", function() {
		    			_calculatrice.setMeter2(gdir2.getDistance().meters);
		    			_calculatrice.makeCalcul(modalPrix);
					});
					GEvent.addListener(gdir, "error", function(){
		        		if (gdir.getStatus().code == G_GEO_UNKNOWN_ADDRESS)
		        			openModal("Erreur", "<p>Aucune correspondance g&eacute;ographique trouv&eacute;e pour la ou les adresse(s) saisie(s).</p><p>Soit l\'adresse est relativement r&eacute;cente, soit elle est incorrecte</p>");
		        		else openModal("Erreur", "<p>Erreur lors de la g&eacute;olocalisation des adresses</p>");
			   		});
					GEvent.addListener(gdir2, "error", function(){
		        		if (gdir2.getStatus().code == G_GEO_UNKNOWN_ADDRESS)
		        			openModal("Erreur", "<p>Aucune correspondance g&eacute;ographique trouv&eacute;e pour la ou les adresse(s) saisie(s).</p><p>Soit l\'adresse est relativement r&eacute;cente, soit elle est incorrecte</p>");
		        		else openModal("Erreur", "<p>Erreur lors de la g&eacute;olocalisation des adresses</p>");
			   		});
					if (modalPrix){
						openModal('Tarif de la prestation', '<p class="pCenter pTarif">'+this.loader+'<br />Calcul en cours</p>');
					}
					gdir.load("from: " + adressConcorde + " to: " + adressStart,{"locale": 'fr'});
			    }
			}
			else 
			{
				$('#tarifHidden').val('');
				openModal('Erreur', textError);
			}
		}
		else if (this.prestation == 'casino'){
					
			if (this.cp_depart == '75000'){
				$("#prestation_start_zipcode").removeClass("inputBorder");
				$('#prestation_start_zipcode').addClass("fieldError");
				textError += '<p>Le code postal de d&eacute;part ne correspond pas &agrave; un arrondissement de Paris</p>';
			}
			else {
				$("#prestation_start_zipcode").removeClass("fieldError");
				$('#prestation_start_zipcode').addClass("inputBorder");
			}
			
			if (this.cp_arrivee == '75000'){
				$("#prestation_end_zipcode").removeClass("inputBorder");
				$('#prestation_end_zipcode').addClass("fieldError");
				textError += '<p>Le code postal d\'arriv&eacute;e ne correspond pas &agrave; un arrondissement de Paris</p>';
			}
			else {
				$("#prestation_end_zipcode").removeClass("fieldError");
				$('#prestation_end_zipcode').addClass("inputBorder");
			}
			
			if (this.num_jours == 6 && this.heure > 10 && this.heure < 20){
				$("#prestation_start_hour").removeClass("inputBorder");
				$('#prestation_start_hour').addClass("fieldError");
				$("#prestation_start_minut").removeClass("inputBorder");
				$('#prestation_start_minut').addClass("fieldError");
				$("#datepicker").removeClass("inputBorder");
				$('#datepicker').addClass("fieldError");
				textError += '<p>Cette prestation n\'est pas disponible le samedi entre 11H et 20H.</p>';
			}
			else if ((this.heure != 18 && this.heure != 19 && this.heure != 20 && this.heure != 21 && this.heure != 22) || (this.heure == 22 && this.minutes > 00)){
				$("#prestation_start_hour").removeClass("inputBorder");
				$('#prestation_start_hour').addClass("fieldError");
				$("#prestation_start_minut").removeClass("inputBorder");
				$('#prestation_start_minut').addClass("fieldError");
				textError += '<p>Cette prestation n\'est pas disponible avant 18H et apr&egrave;s 22H.</p>';
			}
			else {
				$("#prestation_start_hour").removeClass("fieldError");
				$('#prestation_start_hour').addClass("inputBorder");
				$("#prestation_start_minut").removeClass("fieldError");
				$('#prestation_start_minut').addClass("inputBorder");
				$("#datepicker").removeClass("fieldError");
				$('#datepicker').addClass("inputBorder");
			}
			
			if (textError == ''){
				if (GBrowserIsCompatible()) {  
					var gdir = new GDirections();
					var gdir2 = new GDirections();
					var adressConcorde = 'Place de la concorde, 75008 PARIS, FRANCE';
					var adressStart;
					var adressEnd;
					
					adressStart = _calculatrice.cp_depart + ' ' + _calculatrice.ville_depart + ',FRANCE';
					adressEnd =_calculatrice.cp_arrivee + ' ' + _calculatrice.ville_arrivee + ',FRANCE';
					
					GEvent.addListener(gdir, "load", function() {
			    		_calculatrice.setMeter1(gdir.getDistance().meters);
			    		gdir2.load("from: " + adressEnd + " to: " + adressConcorde,{"locale": 'fr'});
			    	});
					GEvent.addListener(gdir2, "load", function() {
		    			_calculatrice.setMeter2(gdir2.getDistance().meters);
		    			_calculatrice.makeCalcul(modalPrix);
					});
					GEvent.addListener(gdir, "error", function(){
		        		if (gdir.getStatus().code == G_GEO_UNKNOWN_ADDRESS)
		        			openModal("Erreur", "<p>Aucune correspondance g&eacute;ographique trouv&eacute;e pour la ou les adresse(s) saisie(s).</p><p>Soit l\'adresse est relativement r&eacute;cente, soit elle est incorrecte</p>");
		        		else openModal("Erreur", "<p>Erreur lors de la g&eacute;olocalisation des adresses</p>");
			   		});
					GEvent.addListener(gdir2, "error", function(){
		        		if (gdir2.getStatus().code == G_GEO_UNKNOWN_ADDRESS)
		        			openModal("Erreur", "<p>Aucune correspondance g&eacute;ographique trouv&eacute;e pour la ou les adresse(s) saisie(s).</p><p>Soit l\'adresse est relativement r&eacute;cente, soit elle est incorrecte</p>");
		        		else openModal("Erreur", "<p>Erreur lors de la g&eacute;olocalisation des adresses</p>");
			   		});
					if (modalPrix){
						openModal('Tarif de la prestation', '<p class="pCenter pTarif">'+this.loader+'<br />Calcul en cours</p>');
					}
					gdir.load("from: " + adressConcorde + " to: " + adressStart,{"locale": 'fr'});
			    }
			}
			else 
			{
				$('#tarifHidden').val('');
				openModal('Erreur', textError);
			}
		}
		else if (this.prestation == 'aeroport_paris' || this.prestation == 'paris_aeroport'){
			if (this.prestation == 'paris_aeroport'){
				var regCpDepart=new RegExp(this.cp_depart,"gi");
				if (!this.cpParisIntraMuros.match(regCpDepart)) {
					$("#prestation_start_zipcode").removeClass("inputBorder");
					$('#prestation_start_zipcode').addClass("fieldError");
					textError += '<p>Le code postal de d&eacute;part ne correspond pas &agrave; la ville de Paris</p>';
				}
				else {
					$("#prestation_start_zipcode").removeClass("fieldError");
					$('#prestation_start_zipcode').addClass("inputBorder");
				}
			}
			else if (this.prestation == 'aeroport_paris'){
				var regCpArrivee=new RegExp(this.cp_arrivee,"gi");
				if (!this.cpParisIntraMuros.match(regCpArrivee)) {
					$("#prestation_end_zipcode").removeClass("inputBorder");
					$('#prestation_end_zipcode').addClass("fieldError");
					textError += '<p>Le code postal d\'arriv&eacute;e ne correspondre pas &agrave; la ville de Paris</p>';
				}
				else {
					$("#prestation_end_zipcode").removeClass("fieldError");
					$('#prestation_end_zipcode').addClass("inputBorder");
				}
			}
			if (this.num_jours == 6 && this.heure > 10 && this.heure < 20){
				$("#prestation_start_hour").removeClass("inputBorder");
				$('#prestation_start_hour').addClass("fieldError");
				$("#prestation_start_minut").removeClass("inputBorder");
				$('#prestation_start_minut').addClass("fieldError");
				$("#datepicker").removeClass("inputBorder");
				$('#datepicker').addClass("fieldError");
				textError += '<p>Cette prestation n\'est pas disponible le samedi entre 11H et 20H.</p>';
			}
			else {
				$("#prestation_start_hour").removeClass("fieldError");
				$('#prestation_start_hour').addClass("inputBorder");
				$("#prestation_start_minut").removeClass("fieldError");
				$('#prestation_start_minut').addClass("inputBorder");
				$("#datepicker").removeClass("fieldError");
				$('#datepicker').addClass("inputBorder");
			}
			
			if (textError == ''){
				var prix = 210 + this.getSupplementBoisson();
				if (modalPrix){
					openModal("Tarif de la prestation", '<p class="pCenter pTarif">'+prix+'&nbsp;&euro;</p>');		
				}
				$('#tarifHidden').val(prix);
			}
			else {
				$('#tarifHidden').val('');
				openModal('Erreur', textError);
			}
			
		}
		else if (this.prestation == 'aeroport_disney' || this.prestation == 'disney_aeroport'){
			if (this.num_jours == 6 && (this.heure > 10 && this.heure < 21)){
				$("#prestation_start_hour").removeClass("inputBorder");
				$('#prestation_start_hour').addClass("fieldError");
				$("#prestation_start_minut").removeClass("inputBorder");
				$('#prestation_start_minut').addClass("fieldError");
				$("#datepicker").removeClass("inputBorder");
				$('#datepicker').addClass("fieldError");
				textError += '<p>Cette prestation n\'est pas disponible le samedi entre 11H et 20H.</p>';
			}
			else {
				$("#prestation_start_hour").removeClass("fieldError");
				$('#prestation_start_hour').addClass("inputBorder");
				$("#prestation_start_minut").removeClass("fieldError");
				$('#prestation_start_minut').addClass("inputBorder");
				$("#datepicker").removeClass("fieldError");
				$('#datepicker').addClass("inputBorder");
			}
			
			if (textError == ''){
				var prix = 250 + this.getSupplementBoisson();
				if (modalPrix){
					openModal('Tarif de la prestation', '<p class="pCenter pTarif">'+prix+'&nbsp;&euro;</p>');
				}
				$('#tarifHidden').val(prix);
			}
			else {
				$('#tarifHidden').val('');
				openModal('Erreur', textError);
			}
		}
		else if (this.prestation == 'bynight1h' || this.prestation == 'bynight1h30'){
			var regCpDepart  = new RegExp(this.cp_depart,"gi");
			var regCpArrivee = new RegExp(this.cp_arrivee,"gi");
			if (!this.cpParisIntraMuros.match(regCpDepart)) {
				$("#prestation_start_zipcode").removeClass("inputBorder");
				$('#prestation_start_zipcode').addClass("fieldError");
				textError += '<p>Le code postal de d&eacute;part ne correspond pas &agrave; la ville de Paris</p>';
			}
			else {
				$("#prestation_start_zipcode").removeClass("fieldError");
				$('#prestation_start_zipcode').addClass("inputBorder");
			}
			
			if (!this.cpParisIntraMuros.match(regCpArrivee)) {
				$("#prestation_end_zipcode").removeClass("inputBorder");
				$('#prestation_end_zipcode').addClass("fieldError");
				textError += '<p>Le code postal d\'arriv&eacute;e ne correspond pas &agrave; la ville de Paris</p>';
			}
			else {
				$("#prestation_start_zipcode").removeClass("fieldError");
				$('#prestation_start_zipcode').addClass("inputBorder");
			}
			
			//Verification de la contrainte horaire
			if ((this.heure > 01 && this.heure < 08) || (this.heure == 01 && this.minutes > 00)){
				$("#prestation_start_hour").removeClass("inputBorder");
				$('#prestation_start_hour').addClass("fieldError");
				$("#prestation_start_minut").removeClass("inputBorder");
				$('#prestation_start_minut').addClass("fieldError");
				textError += '<p>Cette prestation n\'est pas disponible apr&egrave;s 1H du matin.</p>';
			}
			else if (this.num_jours == 6 && this.heure > 10 && this.heure < 20){
				$("#prestation_start_hour").removeClass("inputBorder");
				$('#prestation_start_hour').addClass("fieldError");
				$("#prestation_start_minut").removeClass("inputBorder");
				$('#prestation_start_minut').addClass("fieldError");
				$("#datepicker").removeClass("inputBorder");
				$('#datepicker').addClass("fieldError");
				textError += '<p>Cette prestation n\'est pas disponible le samedi entre 11H et 20H.</p>';
			}
			else {
				$("#prestation_start_hour").removeClass("fieldError");
				$('#prestation_start_hour').addClass("inputBorder");
				$("#prestation_start_minut").removeClass("fieldError");
				$('#prestation_start_minut').addClass("inputBorder");
			}
			
			if (textError == ''){
				var tarif;
				if (this.prestation == 'bynight1h') tarif = 225;
				else tarif = 275;
				tarif += this.getSupplementBoisson();
				if (modalPrix){
					openModal("Tarif de la prestation", '<p class="pCenter pTarif">'+tarif+'&nbsp;&euro;</p>');
				}
				$('#tarifHidden').val(tarif);
			}
			else {
				$('#tarifHidden').val('');
				openModal('Erreur', textError);
			}	
		}
		else if (this.prestation == 'pinky_girly'){
			var regCpDepart  = new RegExp(this.cp_depart,"gi");
			var regCpArrivee = new RegExp(this.cp_arrivee,"gi");
			if (!this.cpParisIntraMuros.match(regCpDepart)) {
				$("#prestation_start_zipcode").removeClass("inputBorder");
				$('#prestation_start_zipcode').addClass("fieldError");
				textError += '<p>Le code postal de d&eacute;part ne correspond pas &agrave; la ville de Paris</p>';
			}
			else {
				$("#prestation_start_zipcode").removeClass("fieldError");
				$('#prestation_start_zipcode').addClass("inputBorder");
			}
			
			if (!this.cpParisIntraMuros.match(regCpArrivee)) {
				$("#prestation_end_zipcode").removeClass("inputBorder");
				$('#prestation_end_zipcode').addClass("fieldError");
				textError += '<p>Le code postal d\'arriv&eacute;e ne correspond pas &agrave; la ville de Paris</p>';
			}
			else {
				$("#prestation_start_zipcode").removeClass("fieldError");
				$('#prestation_start_zipcode').addClass("inputBorder");
			}
			
			//Verification de la contrainte horaire
			if ((this.heure > 01 && this.heure < 08) || (this.heure == 01 && this.minutes > 00)){
				$("#prestation_start_hour").removeClass("inputBorder");
				$('#prestation_start_hour').addClass("fieldError");
				$("#prestation_start_minut").removeClass("inputBorder");
				$('#prestation_start_minut').addClass("fieldError");
				textError += '<p>Cette prestation n\'est pas disponible apr&egrave;s 1H du matin.</p>';
			}
			else if (this.num_jours == 6 && this.heure > 10 && this.heure < 20){
				$("#prestation_start_hour").removeClass("inputBorder");
				$('#prestation_start_hour').addClass("fieldError");
				$("#prestation_start_minut").removeClass("inputBorder");
				$('#prestation_start_minut').addClass("fieldError");
				$("#datepicker").removeClass("inputBorder");
				$('#datepicker').addClass("fieldError");
				textError += '<p>Cette prestation n\'est pas disponible le samedi entre 11H et 20H.</p>';
			}
			else {
				$("#prestation_start_hour").removeClass("fieldError");
				$('#prestation_start_hour').addClass("inputBorder");
				$("#prestation_start_minut").removeClass("fieldError");
				$('#prestation_start_minut').addClass("inputBorder");
			}
			
			if (textError == ''){
				var tarif = 290;  
				tarif += this.getSupplementBoisson();
				if (modalPrix){
					openModal("Tarif de la prestation", '<p class="pCenter pTarif">'+tarif+'&nbsp;&euro;</p>');
				}
				$('#tarifHidden').val(tarif);
			}
			else {
				$('#tarifHidden').val('');
				openModal('Erreur', textError);
			}	
		}
		
		else if (this.prestation == 'paris_disney' || this.prestation == 'disney_paris'){
			
			if (this.prestation == 'paris_disney'){
				var regCpDepart  = new RegExp(this.cp_depart,"gi");
				if (!this.cpParisIntraMuros.match(regCpDepart)) {
					$("#prestation_start_zipcode").removeClass("inputBorder");
					$('#prestation_start_zipcode').addClass("fieldError");
					textError += '<p>Le code postal de d&eacute;part ne correspond pas &agrave; la ville de Paris</p>';
				}
				else {
					$("#prestation_start_zipcode").removeClass("fieldError");
					$('#prestation_start_zipcode').addClass("inputBorder");
				}
			}
			else {
				var regCpArrivee = new RegExp(this.cp_arrivee,"gi");
				if (!this.cpParisIntraMuros.match(regCpArrivee)) {
					$("#prestation_end_zipcode").removeClass("inputBorder");
					$('#prestation_end_zipcode').addClass("fieldError");
					textError += '<p>Le code postal d\'arriv&eacute;e ne correspond pas &agrave; la ville de Paris</p>';
				}
				else {
					$("#prestation_start_zipcode").removeClass("fieldError");
					$('#prestation_start_zipcode').addClass("inputBorder");
				}
			}
			
			//Verification de la contrainte horaire
			if ((this.heure > 01 && this.heure < 08) || (this.heure == 01 && this.minutes > 00)){
				$("#prestation_start_hour").removeClass("inputBorder");
				$('#prestation_start_hour').addClass("fieldError");
				$("#prestation_start_minut").removeClass("inputBorder");
				$('#prestation_start_minut').addClass("fieldError");
				textError += '<p>Cette prestation n\'est pas disponible apr&egrave;s 1H du matin.</p><p>Reprise du service &agrave; 8H du matin</p>';
			}
			else if (this.num_jours == 6 && this.heure > 10 && this.heure < 20){
				$("#prestation_start_hour").removeClass("inputBorder");
				$('#prestation_start_hour').addClass("fieldError");
				$("#prestation_start_minut").removeClass("inputBorder");
				$('#prestation_start_minut').addClass("fieldError");
				$("#datepicker").removeClass("inputBorder");
				$('#datepicker').addClass("fieldError");
				textError += '<p>Cette prestation n\'est pas disponible le samedi entre 11H et 20H.</p>';
			}
			else {
				$("#prestation_start_hour").removeClass("fieldError");
				$('#prestation_start_hour').addClass("inputBorder");
				$("#prestation_start_minut").removeClass("fieldError");
				$('#prestation_start_minut').addClass("inputBorder");
			}
			
			if (textError == ''){
				var tarif = 250 + this.getSupplementBoisson();
				if (modalPrix){
					openModal("Tarif de la prestation", '<p class="pCenter pTarif">'+tarif+'&nbsp;&euro;</p>');
				}
				$('#tarifHidden').val(tarif);
			}
			else {
				$('#tarifHidden').val('');
				openModal('Erreur', textError);
			}	
		}
		else if (this.prestation == 'happy_limo'){
			
			if (this.num_jours == 0 || this.num_jours == 5 || this.num_jours == 6)
			{
				$("#datepicker").removeClass("inputBorder");
				$('#datepicker').addClass("fieldError");
				if (this.num_jours == 0) textError += '<p>Cette prestation n\'est pas disponible le dimanche.</p>';
				else if (this.num_jours == 5) textError += '<p>Cette prestation n\'est pas disponible le vendredi.</p>';
				else if (this.num_jours == 6) textError += '<p>Cette prestation n\'est pas disponible le samedi.</p>';
			}
			else {
				$("#datepicker").removeClass("fieldError");
				$('#datepicker').addClass("inputBorder");
			}
			if (textError.length == 0){
				var tarif = 180 + this.getSupplementBoisson();;
				if (modalPrix){
					openModal("Tarif de la prestation", '<p class="pCenter pTarif">'+tarif+'&nbsp;&euro;</p>');
				}
				$('#tarifHidden').val(tarif);
			}
			else {
				$('#tarifHidden').val('');
				openModal("Erreur", textError);
			}
		}
		if (textError.length == 0) return true;
		else return false;

	}
	
	
	//Verification du formulaire
	this.checkFormulairePrestation = function(modalPrix){
		var error = false;
		var imgError = '<img src="images/plateforme_reservations/error.png" alt="Erreur" />';
		$('#tarif').html('');
		$('#tarifHidden').val('');
		
		//Recuperation des différentes valeurs
		this.prestation = $('#prestation_type').val();
		this.date_depart = $('#datepicker').val();
		this.heure = $('#prestation_start_hour').val();
		this.minutes = $('#prestation_start_minut').val();
		
		//départ
		if ($("#prestation_airport_start_name").length > 0){
			this.airport_depart = $('#prestation_airport_start_name').val();
			this.adresse_depart = null;
			this.cp_depart = null;
			this.ville_depart = null;
			
			this.airport_depart_company = $('#prestation_airport_start_company').val();
			this.airport_depart_numvol = $('#prestation_airport_start_numvol').val();
			this.airport_depart_provdest = $('#prestation_airport_start_provdest').val();
			this.airport_depart_heure = $('#prestation_airport_start_heure').val();
			this.airport_depart_minute = $('#prestation_airport_start_minute').val();
		}
		else {	
			this.airport_depart = null;
			this.adresse_depart = $('#prestation_start_adress').val();
			this.cp_depart 		= $('#prestation_start_zipcode').val();
			this.ville_depart 	= $('#prestation_start_city').val();
			
			if ($("#prestation_hotel_start_name").length > 0){
				this.hotel_depart = $('#prestation_hotel_start_name').val();
				this.restaurant_depart = null;
			}
			else if ($("#prestation_restaurant_start_name").length > 0){
				this.restaurant_depart = $('#prestation_restaurant_start_name').val();
				this.hotel_depart = null;
			}	
			else {
				this.hotel_depart = null;
				this.restaurant_depart = null;
			}
		}
		
		//arrivée
		if ($("#prestation_airport_end_name").length > 0){
			this.airport_arrivee = $('#prestation_airport_end_name').val();
			this.adresse_arrivee  = null;
			this.cp_arrivee = null;
			this.ville_arrivee = null;
			
			this.airport_arrivee_company = $('#prestation_airport_end_company').val();
			this.airport_arrivee_numvol = $('#prestation_airport_end_numvol').val();
			this.airport_arrivee_provdest = $('#prestation_airport_end_provdest').val();
			this.airport_arrivee_heure = $('#prestation_airport_end_heure').val();
			this.airport_arrivee_minute = $('#prestation_airport_end_minute').val();
		}
		else {
			this.airport_arrivee = null;
			this.adresse_arrivee = $('#prestation_end_adress').val();
			this.cp_arrivee 	 = $('#prestation_end_zipcode').val();
			this.ville_arrivee 	 = $('#prestation_end_city').val();
			
			if ($("#prestation_hotel_end_name").length > 0){
				this.hotel_arrivee = $('#prestation_hotel_end_name').val();
				this.restaurant_arrivee = null;
			}
			else if ($("#prestation_restaurant_end_name").length > 0){
				this.restaurant_arrivee = $('#prestation_restaurant_end_name').val();
				this.hotel_arrivee = null;
			}	
			else {
				this.restaurant_arrivee = null;
				this.hotel_arrivee = null;
			}
		}
				
		this.nombre_passagers = $('#prestation_passenger_number').val();
		
		if (this.prestation == 'restaurant'){
			this.restaurantName = $('#restaurant_name').val();
			this.restaurantAdress = $('#restaurant_adress').val();
			this.restaurantZipcode = $('#restaurant_zipcode').val();
		}
		//Verification du contenu des champs
		//Date
		if (this.date_depart.length == 0){
			error = true;
			$("#datepicker").removeClass("inputBorder");
			$('#datepicker').addClass("fieldError");
			$("#errorDate").html(imgError+'&nbsp;S&eacute;lectionner une date');
		}
		else if (this.date_depart.length < 10){
			error = true;
			$("#datepicker").removeClass("inputBorder");
			$('#datepicker').addClass("fieldError");
			$("#errorDate").html(imgError+'&nbsp;La date semble invalide');
		}
		else {
			$("#datepicker").removeClass("fieldError");
			$('#datepicker').addClass("inputBorder");
			//recupere le jour de la semaine
			var tmp = this.date_depart.split('/');
			date = new Date(tmp[2], tmp[1]-1, tmp[0]);
			this.num_jours = date.getDay();
			this.num_mois = tmp[1];
			$("#errorDate").html('');
		}
		
		//Heure départ
		if (this.heure == 'HH' || this.minutes == 'MM'){
			error = true;
			if (this.prestation == 'happy_limo'){
				$("#hourHappyLimo").removeClass("inputBorder");
				$('#hourHappyLimo').addClass("fieldError");
			}
			else {
				$("#prestation_start_hour").removeClass("inputBorder");
				$('#prestation_start_hour').addClass("fieldError");
				$("#prestation_start_minut").removeClass("inputBorder");
				$('#prestation_start_minut').addClass("fieldError");	
			}
			$("#errorHour").html(imgError+'&nbsp;S&eacute;lectionner un horaire');
		}
		else {
			if (this.prestation == 'happy_limo'){
				$("#hourHappyLimo").removeClass("fieldError");
				$('#hourHappyLimo').addClass("inputBorder");
			}
			else {
				$("#prestation_start_hour").removeClass("fieldError");
				$('#prestation_start_hour').addClass("inputBorder");
				$("#prestation_start_minut").removeClass("fieldError");
				$('#prestation_start_minut').addClass("inputBorder");
			}
			$("#errorHour").html('');
		}
		
		if (this.hotel_depart != null){
			if (this.hotel_depart.length == 0){
				error = true;
				$("#prestation_hotel_start_name").removeClass("inputBorder");
				$('#prestation_hotel_start_name').addClass("fieldError");
				$("#errorStartField").html(imgError+'&nbsp;Saisir un nom d\'h&ocirc;tel');
			}
			else {
				$("#prestation_hotel_start_name").removeClass("fieldError");
				$('#prestation_hotel_start_name').addClass("inputBorder");
				$("#errorStartField").html('');
			}
		}
		else if (this.restaurant_depart != null){
			if (this.restaurant_depart.length == 0){
				error = true;
				$("#prestation_restaurant_start_name").removeClass("inputBorder");
				$('#prestation_restaurant_start_name').addClass("fieldError");
				$("#errorStartField").html(imgError+'&nbsp;Saisir un nom de restaurant');
			}
			else {
				$("#prestation_restaurant_start_name").removeClass("fieldError");
				$('#prestation_restaurant_start_name').addClass("inputBorder");
				$("#errorStartField").html('');
			}
		}
		else if (this.airport_depart != null){
			if (this.airport_depart == 'sel'){
				error = true;
				$("#prestation_airport_start_name").removeClass("inputBorder");
				$('#prestation_airport_start_name').addClass("fieldError");
				$("#errorStartField").html(imgError+'&nbsp;S&eacute;lectionner un a&eacute;roport');
			}
			else {
				$("#prestation_airport_start_name").removeClass("fieldError");
				$('#prestation_airport_start_name').addClass("inputBorder");
				$("#errorStartField").html('');
			}
			
			if (this.airport_depart_company.length == 0){
				error = true;
				$("#prestation_airport_start_company").removeClass("inputBorder");
				$('#prestation_airport_start_company').addClass("fieldError");
				$("#errorStartField").html(imgError+'&nbsp;Saisir les informations concernant le vol');
			}
			else {
				$("#prestation_airport_start_company").removeClass("fieldError");
				$('#prestation_airport_start_company').addClass("inputBorder");
			}
			
			if (this.airport_depart_numvol.length == 0){
				$("#prestation_airport_start_numvol").removeClass("inputBorder");
				$('#prestation_airport_start_numvol').addClass("fieldError");
				$("#errorStartField").html(imgError+'&nbsp;Saisir les informations concernant le vol');
			}
			else {
				$("#prestation_airport_start_numvol").removeClass("fieldError");
				$('#prestation_airport_start_numvol').addClass("inputBorder");
			}
			
			if (this.airport_depart_provdest.length == 0){
				$("#prestation_airport_start_provdest").removeClass("inputBorder");
				$('#prestation_airport_start_provdest').addClass("fieldError");
				$("#errorStartField").html(imgError+'&nbsp;Saisir les informations concernant le vol');
			}
			else {
				$("#prestation_airport_start_provdest").removeClass("fieldError");
				$('#prestation_airport_start_provdest').addClass("inputBorder");
			}
			
			if (this.airport_depart_heure == 'HH'){
				$("#prestation_airport_start_heure").removeClass("inputBorder");
				$('#prestation_airport_start_heure').addClass("fieldError");
				$("#errorStartField").html(imgError+'&nbsp;Saisir les informations concernant le vol');
			}
			else {
				$("#prestation_airport_start_heure").removeClass("fieldError");
				$('#prestation_airport_start_heure').addClass("inputBorder");
			}
			if (this.airport_depart_minute == 'MM'){
				$("#prestation_airport_start_minute").removeClass("inputBorder");
				$('#prestation_airport_start_minute').addClass("fieldError");
				$("#errorStartField").html(imgError+'&nbsp;Saisir les informations concernant le vol');
			}
			else {
				$("#prestation_airport_start_minute").removeClass("fieldError");
				$('#prestation_airport_start_minute').addClass("inputBorder");
			}
		}
		
		//adresse depart
		if (this.adresse_depart != null && this.adresse_depart.length == 0){
			error = true;
			$("#prestation_start_adress").removeClass("inputBorder");
			$('#prestation_start_adress').addClass("fieldError");
			$("#errorStartAdress").html(imgError+'&nbsp;Saisir une adresse');
		}
		else {
			$("#prestation_start_adress").removeClass("fieldError");
			$('#prestation_start_adress').addClass("inputBorder");
			$("#errorStartAdress").html('');
		}
		
		//CP depart
		if (this.cp_depart != null && this.cp_depart.length == 0){
			error = true;
			$("#prestation_start_zipcode").removeClass("inputBorder");
			$('#prestation_start_zipcode').addClass("fieldError");
			$("#errorStartZipcode").html(imgError+'&nbsp;Saisir un code postal');
		}
		else if (this.cp_depart != null && this.cp_depart.length != 5){
			error = true;
			$("#prestation_start_zipcode").removeClass("inputBorder");
			$('#prestation_start_zipcode').addClass("fieldError");
			$("#errorStartZipcode").html(imgError+'&nbsp;Code postal invalide');
		}
		else {
			$("#prestation_start_zipcode").removeClass("fieldError");
			$('#prestation_start_zipcode').addClass("inputBorder");
			$("#errorStartZipcode").html('');
		}
		//Ville depart
		if (this.ville_depart != null && this.ville_depart.length == 0){
			error = true;
			$("#prestation_start_city").removeClass("inputBorder");
			$('#prestation_start_city').addClass("fieldError");
			$("#errorStartCity").html(imgError+'&nbsp;Saisir une ville');
		}
		else {
			$("#prestation_start_city").removeClass("fieldError");
			$('#prestation_start_city').addClass("inputBorder");
			$("#errorStartCity").html('');
		}
		
		
		if (this.hotel_arrivee != null){
			if (this.hotel_arrivee.length == 0){
				error = true;
				$("#prestation_hotel_end_name").removeClass("inputBorder");
				$('#prestation_hotel_end_name').addClass("fieldError");
				$("#errorEndField").html(imgError+'&nbsp;Saisir un nom d\'h&ocirc;tel');
			}
			else {
				$("#prestation_hotel_end_name").removeClass("fieldError");
				$('#prestation_hotel_end_name').addClass("inputBorder");
				$("#errorEndField").html('');
			}
		}
		else if (this.restaurant_arrivee != null){
			if (this.restaurant_arrivee.length == 0){
				error = true;
				$("#prestation_restaurant_end_name").removeClass("inputBorder");
				$('#prestation_restaurant_end_name').addClass("fieldError");
				$("#errorEndField").html(imgError+'&nbsp;Saisir un nom de restaurant');
			}
			else {
				$("#prestation_restaurant_end_name").removeClass("fieldError");
				$('#prestation_restaurant_end_name').addClass("inputBorder");
				$("#errorEndField").html('');
			}
		}
		else if (this.airport_arrivee != null){
			if (this.airport_arrivee == 'sel'){
				error = true;
				$("#prestation_airport_end_name").removeClass("inputBorder");
				$('#prestation_airport_end_name').addClass("fieldError");
				$("#errorEndField").html(imgError+'&nbsp;S&eacute;lectionner un a&eacute;roport');
			}
			else {
				$("#prestation_airport_end_name").removeClass("fieldError");
				$('#prestation_airport_end_name').addClass("inputBorder");
				$("#errorEndField").html('');
			}
			
			if (this.airport_arrivee_company.length == 0){
				error = true;
				$("#prestation_airport_end_company").removeClass("inputBorder");
				$('#prestation_airport_end_company').addClass("fieldError");
				$("#errorEndField").html(imgError+'&nbsp;Saisir les informations concernant le vol');
			}
			else {
				$("#prestation_airport_end_company").removeClass("fieldError");
				$('#prestation_airport_end_company').addClass("inputBorder");
			}
			
			if (this.airport_arrivee_numvol.length == 0){
				$("#prestation_airport_end_numvol").removeClass("inputBorder");
				$('#prestation_airport_end_numvol').addClass("fieldError");
				$("#errorEndField").html(imgError+'&nbsp;Saisir les informations concernant le vol');
			}
			else {
				$("#prestation_airport_end_numvol").removeClass("fieldError");
				$('#prestation_airport_end_numvol').addClass("inputBorder");
			}
			
			if (this.airport_arrivee_provdest.length == 0){
				$("#prestation_airport_end_provdest").removeClass("inputBorder");
				$('#prestation_airport_end_provdest').addClass("fieldError");
				$("#errorEndField").html(imgError+'&nbsp;Saisir les informations concernant le vol');
			}
			else {
				$("#prestation_airport_end_provdest").removeClass("fieldError");
				$('#prestation_airport_end_provdest').addClass("inputBorder");
			}
			
			if (this.airport_arrivee_heure == 'HH'){
				$("#prestation_airport_end_heure").removeClass("inputBorder");
				$('#prestation_airport_end_heure').addClass("fieldError");
				$("#errorEndField").html(imgError+'&nbsp;Saisir les informations concernant le vol');
			}
			else {
				$("#prestation_airport_end_heure").removeClass("fieldError");
				$('#prestation_airport_end_heure').addClass("inputBorder");
			}
			if (this.airport_arrivee_minute == 'MM'){
				$("#prestation_airport_end_minute").removeClass("inputBorder");
				$('#prestation_airport_end_minute').addClass("fieldError");
				$("#errorEndField").html(imgError+'&nbsp;Saisir les informations concernant le vol');
			}
			else {
				$("#prestation_airport_end_minute").removeClass("fieldError");
				$('#prestation_airport_end_minute').addClass("inputBorder");
			}
		}
		
		
		//adresse arrivée
		if (this.adresse_arrivee != null && this.adresse_arrivee.length == 0){
			error = true;
			$("#prestation_end_adress").removeClass("inputBorder");
			$('#prestation_end_adress').addClass("fieldError");
			$("#errorEndAdress").html(imgError+'&nbsp;Saisir une adresse');
		}
		else {
			$("#prestation_end_adress").removeClass("fieldError");
			$('#prestation_end_adress').addClass("inputBorder");
			$("#errorEndAdress").html('');
		}
		
		//CP arrivée
		if (this.cp_arrivee != null && this.cp_arrivee.length == 0){
			error = true;
			$("#prestation_end_zipcode").removeClass("inputBorder");
			$('#prestation_end_zipcode').addClass("fieldError");
			$("#errorEndZipcode").html(imgError+'&nbsp;Saisir un code postal');
		}
		else if (this.cp_arrivee != null && this.cp_arrivee.length != 5){
			error = true;
			$("#prestation_end_zipcode").removeClass("inputBorder");
			$('#prestation_end_zipcode').addClass("fieldError");
			$("#errorEndZipcode").html(imgError+'&nbsp;Code postal invalide');
		}
		else {
			$("#prestation_end_zipcode").removeClass("fieldError");
			$('#prestation_end_zipcode').addClass("inputBorder");
			$("#errorEndZipcode").html('');
		}

		//Ville arrivée
		if (this.ville_arrivee != null && this.ville_arrivee.length == 0){
			error = true;
			$("#prestation_end_city").removeClass("inputBorder");
			$('#prestation_end_city').addClass("fieldError");
			$("#errorEndCity").html(imgError+'&nbsp;Saisir une ville');
		}
		else {
			$("#prestation_end_city").removeClass("fieldError");
			$('#prestation_end_city').addClass("inputBorder");
			$("#errorEndCity").html('');
		}
		
		//Passager
		if (this.nombre_passagers == 'sel'){
			error = true;
			$("#prestation_passenger_number").removeClass("inputBorder");
			$('#prestation_passenger_number').addClass("fieldError");
			$("#errorPassager").html(imgError+'&nbsp;Nombre de passagers');
		}
		else {
			$("#prestation_passenger_number").removeClass("fieldError");
			$('#prestation_passenger_number').addClass("inputBorder");
			$("#errorPassager").html('');
		}

		if (this.prestation == 'restaurant'){
			if (this.restaurantName.length == 0){
				error = true;
				$("#restaurant_name").removeClass("inputBorder");
				$('#restaurant_name').addClass("fieldError");
				$("#errorRestaurantName").html(imgError+'&nbsp;Saisir le nom du restaurant');
			}
			else {
				$("#restaurant_name").removeClass("fieldError");
				$('#restaurant_name').addClass("inputBorder");
				$("#errorRestaurantName").html('');
			}
			if (this.restaurantAdress.length == 0){
				error = true;
				$("#restaurant_adress").removeClass("inputBorder");
				$('#restaurant_adress').addClass("fieldError");
				$("#errorRestaurantAdress").html(imgError+'&nbsp;Saisir l\'adresse du restaurant');
			}
			else {
				$("#restaurant_adress").removeClass("fieldError");
				$('#restaurant_adress').addClass("inputBorder");
				$("#errorRestaurantAdress").html('');
			}
			if (this.restaurantZipcode.length == 0){
				error = true;
				$("#restaurant_zipcode").removeClass("inputBorder");
				$('#restaurant_zipcode').addClass("fieldError");
				$("#errorRestaurantZipcode").html(imgError+'&nbsp;Saisir le code postal');
			}
			else {
				$("#restaurant_zipcode").removeClass("fieldError");
				$('#restaurant_zipcode').addClass("inputBorder");
				$("#errorRestaurantZipcode").html('');
			}
		}
		
		
		//Si tous les champs obligatoire ont été rempli
		if (error == false){
			return this.checkContraintes(modalPrix);
		}
		else {
			openModal("Erreur", '<p class="pCenter">Veuillez v&eacute;rifier les donn&eacute;es saisies dans le formulaire</p>');
			return false;
		}
	}
	
	this.getAirportAdress = function(name){
		var adress = null;
		switch (name) {
			case 'bourget' 	: 	adress = 'Aeroport de Paris le Bourget, Bourget, France';
								break;
			case 'degaulle' : 	adress = 'Aeroport Charles de Gaulle, Paris, FRANCE';
								break;
			case 'orly' 	: 	adress = 'Aeroport Orly, Paris, FRANCE';
								break;
			case 'toussus' 	: 	adress = 'Aeroport Toussus le noble, 78117 Toussus le noble, FRANCE';
								break;
		}
		
		return adress;
		
	}
	
	this.getSupplementBoisson = function(){
		var sup = 0;
		if ($("#supChampagne").attr('checked')) sup += 39;
		if ($("#supChampagneCacher").attr('checked')) sup += 39;
		if ($("#supNightOrient").attr('checked')) sup += 25;
		if ($("#supChampomy").attr('checked')) sup += 7;
		return sup;
	}
}