
$(document).ready(function() {

	//-------------------------------------------// Effacer le champ de recherche de ville ou de pays----------------------------------

	$('#recherche').click(function() {
		if($(this).attr('value') == "une ville, un pays")
			$(this).attr('value', '')
	});

	//--------------------------------------------// Effacer le champ recherche d'hotel------------------------------------------------

	$('#recherche_hotel').click(function() {
		if($(this).attr('value') == "un hotel, une référence")
			$(this).attr('value', '')
	});

	//----------------------------------------------// Effacer le champ identifiant----------------------------------------------------

	$('#identifiant').click(function() {
		$(this).attr('value', '')
	});

	//---------------------------------------------// Effacer le champ mot de passe ---------------------------------------------------

	$('#mot_de_passe').click(function() {
		$(this).attr('value', '')
	});

	//---------------------------------------------// Chargement de la boite de dialogue "Bientot disponible"--------------------------

	/*$(this).ready(function() {
  		$('#dialog').jqm();
	});*/

	//----------------------------------------------- variables globales --------------------------------------------------------------

	var nom_continent = "a votre agence Alloa";// ##here
	var nom_pays = "";// ##here
	var nom_region = "" ;// ##here
	var choix_menu = "voyages";
	var menu = "voyages";
	var id_localisation = "0";// ##here
	var refcontinent = "0";// ##here
	var choix_sous_menu = "";
	var ref_region = "";
	var ref_pays = "";
	var date_depart = "";
	var date_cbo_box = new Date();
	//pour la gestion du menu/sous menu
	var over_menu = false;
	//-------------------------------------------------

	var tab_menu = Array();
	tab_menu["voyages"] = "Séjours";
	tab_menu["circuits"] = "Circuits";
	tab_menu["croisieres"] = "Croisières";
	tab_menu["locations"] = "Locations";
	tab_menu["alacarte"] = "A La Carte";
	tab_menu["mesure"] = "Sur Mesure";

	var tab_mois = Array();
	tab_mois["1"]="Janvier";
	tab_mois["2"]="Février";
	tab_mois["3"]="Mars";
	tab_mois["4"]="Avril";
	tab_mois["5"]="Mai";
	tab_mois["6"]="Juin";
	tab_mois["7"]="Juillet";
	tab_mois["8"]="Aout";
	tab_mois["9"]="Septembre";
	tab_mois["10"]="Octobre";
	tab_mois["11"]="Novembre";
	tab_mois["12"]="Décembre";

	var tab_s_menu = Array();
	tab_s_menu["coeur"]="Nos Favoris";
	tab_s_menu["club"]="Club";
	tab_s_menu["famille"]="Famille";
	tab_s_menu["thalasso"]="Bien-être";
	tab_s_menu["romance"]="Romance";
	tab_s_menu["sejour"]="Week-end";

	tab_s_menu["prestige"]="Prestige";
	tab_s_menu["circuit"]="Découverte";
	tab_s_menu["culturel"]="Culturel";
	tab_s_menu["aventure"]="Nomade / Aventure";
	tab_s_menu["fluviale"]="Fluviale";
	tab_s_menu["maritime"]="Maritîme";

	tab_s_menu["studio"]="Studios-Appartements";
	tab_s_menu["villa"]="Chalets-Villas de luxe";
	tab_s_menu["maritime"]="Maritîme";

	tab_s_menu["alle"]="Toutes";
	tab_s_menu["all"]="Tous";

	//-------------------------------------------------

							/* ========================= FONCTIONS POUR LE CALENDRIER ========================================= */

	$.datepicker.regional['fr'] = {clearText: 'Effacer', clearStatus: '',
		closeText: 'Fermer', closeStatus: 'Fermer sans modifier',
		prevText: '&lt;Préc', prevStatus: 'Voir le mois précédent',
		nextText: 'Suiv&gt;', nextStatus: 'Voir le mois suivant',
		currentText: 'Courant', currentStatus: 'Voir le mois courant',
		monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin',
		'Juillet','Août','Septembre','Octobre','Novembre','Décembre'],
		monthNamesShort: ['Jan','Fév','Mar','Avr','Mai','Jun',
		'Jul','Aoû','Sep','Oct','Nov','Déc'],
		monthStatus: 'Voir un autre mois', yearStatus: 'Voir un autre année',
		weekHeader: 'Sm', weekStatus: '',
		dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],
		dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'],
		dayNamesMin: ['Di','Lu','Ma','Me','Je','Ve','Sa'],
		dayStatus: 'Utiliser DD comme premier jour de la semaine', dateStatus: 'Choisir le DD, MM d',
		dateFormat: 'dd/mm/yy', firstDay: 0,
		initStatus: 'Choisir la date', isRTL: false};
	$.datepicker.setDefaults($.datepicker.regional['fr']);

			//--------------------------------------------------------A definir-------------------------------------------------------//

	$("#datepicker").datepicker({
	    onSelect: function(date) {

			date_depart = date;
			alert("hello datepicker");
			//recherche les hotels à afficher
			if (!document.getElementById('loadingMain')) {
				if (id_localisation != "") {
					$('#main').empty()
					jQuery('<img id="loadingMain" src="../images/ajax-loader.gif" alt="Chargement en cours..." title="Chargement en cours..." />').appendTo("#main")
					var vecteur = $("#periode_select").attr('value').toString().split(" ");
					var mois_debut = vecteur[0]
					var annee_debut = vecteur[1]

					alert("hello");

					if (choix_menu == "voyages") {
						urlFonction = "/Alloa/get_liste_hotels?r=" + id_localisation + "&sm=" +choix_sous_menu + "&date=" + date_depart + "&mois=" + mois_debut +"&annee=" + annee_debut
					}
					else {
						//rechercher les croisières et non les hotels
						urlFonction = "/Alloa/get_liste_croisieres?r=" + id_localisation + "&sm=" + choix_sous_menu + "&date=" + date_depart + "&mois=" + mois_debut +"&annee=" + annee_debut
					}
					//permet d'executer une fonction du controlleur et d'en recuperer la valeur de retour
					$.ajax({
						type: "GET",
						url: urlFonction,
						success: function(retour){
							$("#main #loadingMain").remove()
							$("#main").append(retour)
							tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox (module jquery pour les images)
							click_article()
						}
					})
				}else{
					$("#main").append("<div class='article'>Choisissez une destination</div>")
				}
			}
	    }
	});

						/* ================================================================================================ */

														/* FONCTIONS POUR LA CARTE */

	$('area').click(function() {

		if (!document.getElementById('loading')) {
			//requete = "get_liste_pays?c=" + $(this).attr('href')

			requete = "/Alloa/get_liste_destinations?c=" + $(this).attr('href')
			chaineSituation = "<span  class='situation_continent'>"
			if($(this).attr('href') == "europe"){
				chaineSituation += "en Europe"
				nom_continent= "Europe"
				refcontinent = "1"
			}else if($(this).attr('href') == "am_nord"){

				chaineSituation += "en Amérique du nord"
				nom_continent = 'Amérique du nord'
				refcontinent = "3"
			}else if($(this).attr('href') == "asie"){
				chaineSituation += "en Asie"
				nom_continent = 'Asie'
				refcontinent = "9"
			}else if($(this).attr('href') == "am_sud"){
				chaineSituation += "en Amérique du sud"
				nom_continent = 'Amérique du sud'
				refcontinent = "4"
			}else if($(this).attr('href') == "asie_se"){
				chaineSituation += "en Asie du sud est"
				nom_continent = 'Asie du sud est'
				refcontinent = "8"
			}else if ($(this).attr('href') == "afrique") {
				chaineSituation += "en Afrique"
				nom_continent = 'Afrique'
				refcontinent = "2"
			}else if($(this).attr('href') == "moy_orient"){
				chaineSituation += "en Moyen orient"
				nom_continent = 'Moyen orient'
				refcontinent = "6"
			}else if ($(this).attr('href') == "poles") {
				chaineSituation += "en Groenland"
				nom_continent = 'Groenland'
				refcontinent = "11"
			}else if ($(this).attr('href') == "am_centre") {
				chaineSituation += "en Amérique centrale"
				nom_continent = 'Amérique centrale'
				refcontinent = "5"
			}else{
				chaineSituation += "en Océanie"
				nom_continent = 'Océanie'
				refcontinent = "7"
			}
			chaineSituation += "</span>"
			$("#situation").empty()
			$("#situation").append(chaineSituation)

			id_localisation = ""
			/*$("#rightbar #pays").remove()
			$('#rightbar #regions').remove()
			jQuery('<img id="loading" src="../images/ajax-loader.gif" alt="Chargement en cours..." />').appendTo("#rightbar")
			//alert(requete)
			jQuery('<div id="pays" style="line-height: 12pt"></div>').load(requete, {}, function(res, stat, xml) {
				$("#rightbar #loading").remove()
				$(this).appendTo("#rightbar").show("normal")
				click_pays()
			})*/

			$("#country #pays").remove()
			$('#reg #regions').remove()
			jQuery('<img id="loading" src="../images/ajax-loader.gif" alt="Chargement en cours..." />').appendTo("#country")
			//alert(requete)
			jQuery('<div id="pays" style="line-height: 12pt"></div>').load(requete, {}, function(res, stat, xml) {
				$("#country #loading").remove()
				$(this).appendTo("#country").show("normal")
				click_pays()
			})


			var vecteur = $("#periode_select").attr('value').toString().split(" ");
			var mois_debut = vecteur[0]
			var annee_debut = vecteur[1]

			//correspond au dt "ayant le focus"
			$("#menuTmp2 dt").each(function(i){
				if($(this).css('text-decoration') == 'underline')
					dt_clique = $(this);
					return;
				return;
			})
			//charge les hotels, circuits ou croisieres preferes du continent

			var urlFonction = "/Continent/getPageContinent?c=" + refcontinent + "&mois=" + mois_debut +"&annee=" + annee_debut
			urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase() + "&sm=" + dt_clique.attr('id')
			//alert(urlFonction)
			$.ajax({
				type: "GET",
				url: urlFonction,
				success: function(retour){
					$("#main").empty()
					$("#main").append(retour)
					tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox (module jquery pour les images)
					click_article()
				}
			})
			nom_pays = ""
			//$("#menu").empty()
			var menu = $("#menu")
			urlFonction = "/Continent/getDescContinent?c=" + refcontinent
			$.ajax({
				type: "GET",
				url: urlFonction,
				success: function(retour){
					$("#situation").append(retour)
				}
			})
			//click_element_menu()
		}
		return false
	});

/***************************************************************************************************************************************/

/* ================================================================================================ */

														/* FONCTIONS POUR LES LIENS modifier */

	$("#menu_rapide_cont a").click(function() {
		if (!document.getElementById('loading')) {
			//requete = "get_liste_pays?c=" + $(this).attr('href')

			requete = "/Alloa/get_liste_destinations?c=" + $(this).attr('href')
			chaineSituation = "<span  class='situation_continent'>"
			if($(this).attr('href') == "europe"){
				chaineSituation += "en Europe"
				nom_continent= "Europe"
				refcontinent = "1"
			}else if($(this).attr('href') == "am_nord"){

				chaineSituation += "en Amérique du nord"
				nom_continent = 'Amérique du nord'
				refcontinent = "3"
			}else if($(this).attr('href') == "asie"){
				chaineSituation += "en Asie"
				nom_continent = 'Asie'
				refcontinent = "9"
			}else if($(this).attr('href') == "am_sud"){
				chaineSituation += "en Amérique du sud"
				nom_continent = 'Amérique du sud'
				refcontinent = "4"
			}else if($(this).attr('href') == "asie_se"){
				chaineSituation += "en Asie du sud est"
				nom_continent = 'Asie du sud est'
				refcontinent = "8"
			}else if ($(this).attr('href') == "afrique") {
				chaineSituation += "en Afrique"
				nom_continent = 'Afrique'
				refcontinent = "2"
			}else if($(this).attr('href') == "moy_orient"){
				chaineSituation += "en Moyen orient"
				nom_continent = 'Moyen orient'
				refcontinent = "6"
			}else if ($(this).attr('href') == "poles") {
				chaineSituation += "en Groenland"
				nom_continent = 'Groenland'
				refcontinent = "11"
			}else if ($(this).attr('href') == "am_centre") {
				chaineSituation += "en Amérique centrale"
				nom_continent = 'Amérique centrale'
				refcontinent = "5"
			}else{
				chaineSituation += "en Océanie"
				nom_continent = 'Océanie'
				refcontinent = "7"
			}
			chaineSituation += "</span>"
			$("#situation").empty()
			$("#situation").append(chaineSituation)

			id_localisation = ""


			$("#country #pays").remove()
			$('#reg #regions').remove()
			jQuery('<img id="loading" src="../images/ajax-loader.gif" alt="Chargement en cours..." />').appendTo("#country")
			//alert(requete)
			jQuery('<div id="pays" style="line-height: 12pt"></div>').load(requete, {}, function(res, stat, xml) {
				$("#country #loading").remove()
				$(this).appendTo("#country").show("normal")
				click_pays()
			})


			var vecteur = $("#periode_select").attr('value').toString().split(" ");
			var mois_debut = vecteur[0]
			var annee_debut = vecteur[1]

			//correspond au dt "ayant le focus"
			$("#menuTmp2 dt").each(function(i){
				if($(this).css('text-decoration') == 'underline')
					dt_clique = $(this);
					return;
				return;
			})
			//charge les hotels, circuits ou croisieres preferes du continent

			var urlFonction = "/Continent/getPageContinent?c=" + refcontinent + "&mois=" + mois_debut +"&annee=" + annee_debut
			urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase() + "&sm=" + dt_clique.attr('id')
			//alert(urlFonction)
			$.ajax({
				type: "GET",
				url: urlFonction,
				success: function(retour){
					$("#main").empty()
					$("#main").append(retour)
					tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox (module jquery pour les images)
					click_article()
				}
			})
			nom_pays = ""
			//$("#menu").empty()
			var menu = $("#menu")
			urlFonction = "/Continent/getDescContinent?c=" + refcontinent
			$.ajax({
				type: "GET",
				url: urlFonction,
				success: function(retour){
					$("#situation").append(retour)
				}
			})
			//click_element_menu()
		}
		return false
	});

	/*************************************************************************************************************************************/
	//----------------------------------------// on charge l'image correspondant à la zone sélectionnée sur la carte--------------------------------

	$('#carte area').mouseover(function() {
		var nom_image = $(this).attr('href')
		$('#img_carte').attr('src', '../images/map_monde/' + nom_image + '.png')
	})


	//--------------------------------------on affiche la carte du monde "simple" quand la souris quitte la zone de la carte------------------------

	$('#carte_map').mouseout(function(){
		var nom_image = $(this).attr('href')
		$('#img_carte').attr('src', '../images/map_monde/monde.png')
	})

	//----------------------------------------- FONCTIONS POUR LES LIENS SOUS LA CARTE -------------------------------------------------------------

	$("#menu_rapide a").click(function() {

	//a1	mediterrannee
	//a2	ocean indien
	//a3	plage paradisiaque
		if (!document.getElementById('loading')) {
			//requete = "get_liste_pays?c=" + $(this).attr('href')
			requete = "/Alloa/get_liste_destinations?c=" + $(this).attr('id')

			chaineSituation = "<span class='situation_continent'>en "
			chaineSituation += $(this).html()
			nom_continent= $(this).html()

			chaineSituation += "</span>"
			$("#situation").empty()
			$("#situation").append(chaineSituation)

			id_localisation = ""
			/*$("#rightbar #pays").remove()
			$('#rightbar #regions').remove()*/
			$("#country #pays").remove()
			$('#reg #regions').remove()

			jQuery('<img id="loading" src="../images/ajax-loader.gif" alt="Chargement en cours..." />').appendTo("#country")
			//alert(requete)
			jQuery('<div id="pays" style="line-height: 12pt"></div>').load(requete, {}, function(res, stat, xml) {
				$("#country #loading").remove()
				$(this).appendTo("#country").show("normal")
				click_pays()
			})

			var vecteur = $("#periode_select").attr('value').toString().split(" ");
			var mois_debut = vecteur[0]
			var annee_debut = vecteur[1]
			refcontinent = $(this).attr('id')

			//correspond au dt "ayant le focus"
			$("#menuTmp2 dt").each(function(i){
				if($(this).css('text-decoration') == 'underline')
					dt_clique = $(this);
					return;
				return;
			})
			//charge les hotels, circuits ou croisieres preferes du continent
			var urlFonction = "/Continent/getPageContinent?c=" + $(this).attr('id') + "&mois=" + mois_debut + "&annee=" + annee_debut
			urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase() + "&sm=" + dt_clique.attr('id')

			$.ajax({
				type: "GET",
				url: urlFonction,
				success: function(retour){
					$("#main").empty()
					$("#main").append(retour)
					//alert(retour)
					tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox (module jquery pour les images)
					click_article()
				}
			})
			nom_pays = ""

			var menu = $("#menu")
			urlFonction = "/Continent/getDescContinent?c=" + refcontinent
			//alert(urlFonction)
			$.ajax({
				type: "GET",
				url: urlFonction,
				success: function(retour){
					$("#situation").append(retour)
					//alert(retour)
				}
			})
		}
		return false
	})


	//--------------------------------------------------FONCTIONS POUR LES PAYS ET REGIONS----------------------------------------------------------


	//-----------------------------------------------click_pays concerne les liens des pays en dessous de la carte pays ----------------------------
	function click_pays() {
		$("#pays a").click(function() {

			if (!document.getElementById('loading')) {
				$("#pays a").css('font-weight', 'normal')
				$(this).css('font-weight', 'bold')
				//alert("clic pays: " + $(this).attr('id').toString())
				id_localisation = $(this).attr('id').toString()

				nom_pays = $(this).html()
				//alert(nom_pays)
				chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span></b>"
				//chaineSituation += "<div id='hello'><a href='' id='"+$(this).attr('id').toString()+"'>(" + nom_pays + ")</a></div>"
				$("#situation").empty()
				$("#situation").append(chaineSituation)
				click_situation()
				$('#reg #regions').remove()
				$('#reg #pays').remove()
				$('#main').empty()
				//requete = "get_liste_regions?p=" + $(this).attr('id')

				requete = "/Alloa/get_liste_sous_destinations?p=" + $(this).attr('id')
				//alert(requete)
				jQuery('<img id="loading" src="../images/ajax-loader.gif" alt="Chargement en cours..." />').appendTo("#reg")
				jQuery('<img id="loadingMain" src="../images/ajax-loader.gif" alt="Chargement en cours..." />').appendTo("#main")
				jQuery('<div id="regions"></div>').load(requete, {}, function(res, stat, xml){
					$("#reg #loading").remove()
					$(this).appendTo("#reg").show("normal")
					click_region()
				})
				var vecteur = $("#periode_select").attr('value').toString().split(" ");
				var mois_debut = vecteur[0]
				var annee_debut = vecteur[1]

				if (choix_menu == "voyages") {
					//alert("voyages")
					urlFonction = "/Alloa/get_liste_hotels?r=" + $(this).attr('id').toString() + "&sm=" + choix_sous_menu + "&mois=" + mois_debut + "&annee=" + annee_debut
					urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
				}
				else if (choix_menu == "croisieres") {
					//alert("croisieres")
					//rechercher les croisières et non les hotels
					urlFonction = "/Alloa/get_liste_croisieres?r=" + $(this).attr('id').toString() + "&sm=" + choix_sous_menu + "&mois=" + mois_debut + "&annee=" + annee_debut
					urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
				}
				else if (choix_menu == "circuits") {
					//alert("circuits")
					//rechercher les circuits
					urlFonction = "/Alloa/get_liste_circuits?r=" + $(this).attr('id').toString() + "&sm=" + choix_sous_menu + "&mois=" + mois_debut + "&annee=" + annee_debut
					urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
				}
				else{
					//rechercher les locations
					urlFonction = "/Alloa/get_liste_locations?r=" + $(this).attr('id').toString() + "&sm=" + choix_sous_menu + "&mois=" + mois_debut + "&annee=" + annee_debut
					urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
				}
				//alert(urlFonction)
				//urlFonction = urlFonction.replace(/-/,"")
 				//alert(urlFonction)

				$.ajax({
					type : "GET",
					url: urlFonction ,
					success:function(retour){
						//alert("fffffffffffff")
						$('#main').empty()
						$("#main").append(retour)
						tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
						click_article()
					}
				})

					//-----------------description pays ###ac ----------------------
				urlFonction = "/Continent/getaccreg?n=" + nom_pays.toLowerCase() + "&d=" + id_localisation.toLowerCase()+"***"
				//alert(urlFonction)
					$.ajax({
							type: "GET",
							url: urlFonction,
							success: function(retour)
								{
									$("#situation").append(retour)
								}
							})
					//-------------------------------------------------------

			}
			return false
		})

	}

	//--------------------------------------------------------------adefinir-------------------------------------------------------------------------

	function click_region() {
		$("#regions a").click(function() {
			if (!document.getElementById('loadingMain')) {
				$("#regions a").css('font-weight', 'normal')
				$(this).css('font-weight', 'bold')
				$('#main').empty()

				var vecteur = $("#periode_select").attr('value').toString().split(" ");
				var mois_debut = vecteur[0]
				var annee_debut = vecteur[1]

				id_localisation = $(this).attr('id').toString()
				jQuery('<img id="loadingMain" src="../images/ajax-loader.gif" alt="Chargement en cours..." title="Chargement en cours..." />').appendTo("#main")

				//construit l'url en fonction du menu
				if (choix_menu == "voyages") {
					//alert("voyages")
					urlFonction = "/Alloa/get_liste_hotels?r=" + $(this).attr('id').toString() + "&sm=" + choix_sous_menu + "&mois=" + mois_debut + "&annee=" + annee_debut
					urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()

				}
				else if (choix_menu == "croisieres") {
					//rechercher les croisières
					urlFonction = "/Alloa/get_liste_croisieres?r=" + $(this).attr('id').toString() + "&sm=" + choix_sous_menu + "&mois=" + mois_debut + "&annee=" + annee_debut
					urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
				}
				else if (choix_menu == "circuits") {
					//rechercher les circuits
					urlFonction = "/Alloa/get_liste_circuits?r=" + $(this).attr('id').toString() + "&sm=" + choix_sous_menu + "&mois=" + mois_debut + "&annee=" + annee_debut
					urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
				}
				else{
					//rechercher les locations
					urlFonction = "/Alloa/get_liste_locations?r=" + $(this).attr('id').toString() + "&sm=" + choix_sous_menu + "&mois=" + mois_debut + "&annee=" + annee_debut
					urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
				}

				ref_destination = $(this).attr('id').toString()
				nom_region = $(this).html()
				chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span> &rarr; <span id='nom_region_situation'>" + nom_region + "</span></b>"
				//chaineSituation+="<div id='hello'><a href='' id='"+$(this).attr('id').toString()+"'>(" + nom_pays + ")</a></div>"
				$("#situation").empty()
				$("#situation").append(chaineSituation)
				click_situation()

				//urlFonction="/Alloa/get_liste_hotels?r=TN&sm=&mois=5&annee=2009&ville=lille_paris_bruxelles"
				//alert(urlFonction)
				$.ajax({
					type : "GET",
					url: urlFonction ,
					success:function(retour){

						$("#main #loadingMain").remove()
						$("#main").append(retour)
						tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
						click_article()
					}
				})

				//-----------------description region ###ac ----------------------
				urlFonction = "/Continent/getaccreg?n=" + nom_pays.toLowerCase() + "&d=" + ref_destination.toLowerCase()
				//alert(urlFonction)
					$.ajax({
							type: "GET",
							url: urlFonction,
							success: function(retour)
								{
									$("#situation").append(retour)
								}
							})
				//-------------------------------------------------------

			}
			return false
		})
	}

	//------------------------------------------------clic pour connaitre la definition d'un pays ou d'une region-------------------------------------

	function click_situation(){

		$("#nom_pays_situation").click(function(){
			var refpay = id_localisation.split('-') // ###ac
			urlFonction = "/Continent/getDefPays?n=" + nom_pays.toLowerCase() + "&d=" + refpay[0].toLowerCase()+"-" // ###ac
			mywindow = window.open(urlFonction, '', 'location=no, width=800, height=400, status=no, scrollbars=yes, resizable=yes, fullscreen=no')
			mywindow.moveTo(250,200);
			return false;
		})

		$("#nom_region_situation").click(function(){
			if (isNaN(refcontinent)) {
				//refcontinent n'est pas un nombre, donc nom_region correspond en fait a un pays
				refDestPays = id_localisation.split("-")[1].toLowerCase()
				urlFonction = "/Continent/getDefPays?n=" + nom_region.toLowerCase() + "&d=" + refDestPays
			}
			else
				urlFonction = "/Continent/getDefRegion?d=" + ref_destination + "&n=" + nom_region.toLowerCase()
			mywindow = window.open(urlFonction, '', 'location=no, width=800, height=400, status=no, scrollbars=yes, resizable=yes, fullscreen=no')
			mywindow.moveTo(250,200);
			return false;
		})

		//-------------------------------
		/*$("#hello a").click(function()
	{
				//alert("hello")
				id_localisation = $(this).attr('id').toString()

				nom_pays = $(this).html()
				//alert(nom_pays)
				chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span></b>"
				chaineSituation +="<div id='hello'><a href='' id='"+$(this).attr('id').toString()+"'>(" + nom_pays + ")</a></div>"
				$("#situation").empty()
				$("#situation").append(chaineSituation)
				click_situation()
				$('#country #regions').remove()
				$('#country #pays').remove()
				$('#main').empty()
				//requete = "get_liste_regions?p=" + $(this).attr('id')

				requete = "/Alloa/get_liste_sous_destinations?p=" + $(this).attr('id')
				jQuery('<img id="loading" src="../images/ajax-loader.gif" alt="Chargement en cours..." />').appendTo("#country")
				jQuery('<img id="loadingMain" src="../images/ajax-loader.gif" alt="Chargement en cours..." />').appendTo("#main")
				jQuery('<div id="regions"></div>').load(requete, {}, function(res, stat, xml){
					$("#country #loading").remove()
					$(this).appendTo("#country").show("normal")
					click_region()
				})
				var vecteur = $("#periode_select").attr('value').toString().split(" ");
				var mois_debut = vecteur[0]
				var annee_debut = vecteur[1]

				if (choix_menu == "voyages") {
					//alert("voyages")
					urlFonction = "/Alloa/get_liste_hotels?r=" + $(this).attr('id').toString() + "&sm=" + choix_sous_menu + "&mois=" + mois_debut + "&annee=" + annee_debut
					urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
				}
				else if (choix_menu == "croisieres") {
					//alert("croisieres")
					//rechercher les croisières et non les hotels
					urlFonction = "/Alloa/get_liste_croisieres?r=" + $(this).attr('id').toString() + "&sm=" + choix_sous_menu + "&mois=" + mois_debut + "&annee=" + annee_debut
					urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
				}
				else if (choix_menu == "circuits") {
					//alert("circuits")
					//rechercher les circuits
					urlFonction = "/Alloa/get_liste_circuits?r=" + $(this).attr('id').toString() + "&sm=" + choix_sous_menu + "&mois=" + mois_debut + "&annee=" + annee_debut
					urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
				}
				else{
					//rechercher les locations
					urlFonction = "/Alloa/get_liste_locations?r=" + $(this).attr('id').toString() + "&sm=" + choix_sous_menu + "&mois=" + mois_debut + "&annee=" + annee_debut
					urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
				}
				//alert(urlFonction)
				//urlFonction = urlFonction.replace(/-/,"")
 				//alert(urlFonction)

				$.ajax({
					type : "GET",
					url: urlFonction ,
					success:function(retour){
						//alert("fffffffffffff")
						$('#main').empty()
						$("#main").append(retour)
						tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
						click_article()
					}
				})
				return false
			})*/
		//-------------------------------


	}

						/* ==================================== FONCTIONS POUR LA DATE ==================================== */

	$("#periode_select").change(function() {
		if (!document.getElementById('loadingMain')) {
			$('#main').empty()
			var vecteur = $("#periode_select").attr('value').toString().split(" ");
			var mois_debut = vecteur[0]
			var annee_debut = vecteur[1]

		//------------------------------------------------------
			if (choix_sous_menu == "")
				{
					choix_sous_menu = "coeur"
					//alert(choix_sous_menu)
				}
			$("#vos_rech").empty()
			$("#vos_rech").append(tab_menu[choix_menu])
			$("#s_choix").empty()
			$("#s_choix").append(" > "+ tab_s_menu[choix_sous_menu] +" ,  pour un départ de "+$("#depart_ville_select").attr('value'))
			var vect = $("#periode_select").attr('value').toString().split(" ");
			$("#s_choix").append(" dans la pèriode "+tab_mois[vecteur[0]]+" - "+vecteur[1])

		//------------------------------------------------------

			if (choix_menu == "voyages") {
				urlFonction = "/Alloa/get_liste_hotels?r=" + id_localisation + "&sm=" + choix_sous_menu + "&mois=" + mois_debut + "&annee=" + annee_debut
				urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
			}
			else if (choix_menu == "croisieres") {
				//rechercher les croisières et non les hotels
				urlFonction = "/Alloa/get_liste_croisieres?r=" + id_localisation + "&sm=" + choix_sous_menu + "&mois=" + mois_debut + "&annee=" + annee_debut
				urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
			}
			else if (choix_menu == "circuits") {
				//rechercher les circuits
				urlFonction = "/Alloa/get_liste_circuits?r=" + id_localisation + "&sm=" + choix_sous_menu + "&mois=" + mois_debut + "&annee=" + annee_debut
				urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
			}
			else {
				//rechercher les locations
				urlFonction = "/Alloa/get_liste_locations?r=" + id_localisation + "&sm=" + choix_sous_menu + "&mois=" + mois_debut + "&annee=" + annee_debut
				urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
			}

			$.ajax({
				type : "GET",
				url: urlFonction ,
				success:function(retour){
					$("#main #loadingMain").remove()
					$("#main").append(retour)
					tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
					click_article()
				}
			})
		}
		return false
	})

	/* ==================== FONCTIONS POUR LE CHANGEMENT DE VILLE ======================================== */

	$("#depart_ville_select").change(function() {
		if (!document.getElementById('loadingMain')) {
			$('#main').empty()
			var vecteur = $("#periode_select").attr('value').toString().split(" ");
			var mois_debut = vecteur[0]
			var annee_debut = vecteur[1]

		//------------------------------------------------------
			if (choix_sous_menu == "")
				{
					choix_sous_menu = "coeur"
					//alert(choix_sous_menu)
				}
			$("#vos_rech").empty()
			$("#vos_rech").append(tab_menu[choix_menu])
			$("#s_choix").empty()
			$("#s_choix").append(" > "+ tab_s_menu[choix_sous_menu] +" ,  pour un départ de "+$("#depart_ville_select").attr('value'))
			var vect = $("#periode_select").attr('value').toString().split(" ");
			$("#s_choix").append(" dans la pèriode "+tab_mois[vecteur[0]]+" - "+vecteur[1])

		//------------------------------------------------------

			if (choix_menu == "voyages") {
				urlFonction = "/Alloa/get_liste_hotels?r=" + id_localisation + "&sm=" + choix_sous_menu + "&mois=" + mois_debut + "&annee=" + annee_debut
				urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
			}
			else if (choix_menu == "croisieres") {
				//rechercher les croisières
				urlFonction = "/Alloa/get_liste_croisieres?r=" + id_localisation + "&sm=" + choix_sous_menu + "&mois=" + mois_debut + "&annee=" + annee_debut
				urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
			}
			else if (choix_menu == "circuits") {
				//rechercher les circuits
				urlFonction = "/Alloa/get_liste_circuits?r=" + id_localisation + "&sm=" + choix_sous_menu + "&mois=" + mois_debut + "&annee=" + annee_debut
				urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
			}
			else {
				//rechercher les locations
				urlFonction = "/Alloa/get_liste_locations?r=" + id_localisation + "&sm=" + choix_sous_menu + "&mois=" + mois_debut + "&annee=" + annee_debut
				urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
			}
			$.ajax({
				type : "GET",
				url: urlFonction ,
				success:function(retour){
					$("#main #loadingMain").remove()
					$("#main").append(retour)
					tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
					click_article()
				}
			})
		}
		return false
	})
	/* ============================ FONCTIONS POUR LA RECHERCHE DE DESTINATIONS ET VILLES ============================================ */


	$("#recherche").keypress(function (e) {
		if (e.which == 13) {	//appui sur la touche "entrée", validation du formulaire
			var mot = $("#recherche").attr('value').toLowerCase()
			if (mot == ""){
				$('#main').empty()
				$('#main').append("<div class='article'>Il faut entrer un nom de ville ou de destination pour faire une recherche</div>")
				return false
			}
			if (!document.getElementById('loadingMain')) {
				//var main = $('#main')
				$('#main').empty()
				//jQuery('<img id="loadingMain" src="../images/ajax-loader.gif" alt="Chargement en cours..." title="Chargement en cours..." />').appendTo("#main")

				var vecteur = $("#periode_select").attr('value').toString().split(" ");
				var mois_debut = vecteur[0]
				var annee_debut = vecteur[1]

				var requete = "/Alloa/get_id_search?w=" + mot +"&m="+ choix_menu +"&sm=" + choix_sous_menu + "&mois=" + mois_debut +"&annee=" + annee_debut
				requete += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
				$.ajax({
					type: "GET",
					url: requete,
					success: function(retour){
						//alert("succes, retour= " + retour)
						var index_pointvirgule = retour.indexOf(";", 0)
						//si il n'y a pas de point virgule, pas d'hotel trouves
						if (index_pointvirgule == -1) {
							$("#situation").empty()
							$("#main").append("<div class='article'>Aucune destination trouvée pour le nom <b>" + mot + "</b></div>")
							return false
						}
						else {

							id_localisation = retour.substring(0, index_pointvirgule)
							index_pointvirgule2 = retour.indexOf(";", index_pointvirgule + 1)
							var codezone = retour.substring(index_pointvirgule + 1, index_pointvirgule2 - 1)

							if (codezone == "1 ") {
								id = "europe"
								nom_continent = "Europe"
							}else  if (codezone == "3 ") {
								id = "am_nord"
								nom_continent = 'Amérique du nord'
							}else if (codezone == "9 ") {
								id = "asie"
								nom_continent = 'Asie'
							}else if (codezone == "4 ") {
								id = "am_sud"
								nom_continent = 'Amérique du sud'
							}else if (codezone == "8 ") {
								id = "asie_se"
								nom_continent = 'Asie du sud est'
							}else if (codezone == "2 ") {
								id = "afrique"
								nom_continent = 'Afrique'
							}else if (codezone == "6 ") {
								id = "moy_orient"
								nom_continent = 'Moyen orient'
							}else if (codezone == "10 ") {
								id = "poles"
								nom_continent = 'Groenland'
							}else if (codezone == "5 ") {
								id = "am_centre"
								nom_continent = 'Amérique centrale'
							}else if (codezone == "7") {
								id = "australie"
								nom_continent = 'Océanie'
							}else {
								id = codezone
								nom_continent = ""
							}
							index_pointvirgule3 = retour.indexOf(";", index_pointvirgule2 + 1)
							nom_region = retour.substring(index_pointvirgule2 + 1, index_pointvirgule3)
							index_pointvirgule4 = retour.indexOf(";", index_pointvirgule3 + 1)
							nom_pays = retour.substring(index_pointvirgule3 + 1, index_pointvirgule4)
							if (nom_pays == nom_region)
								nom_region = ""

							requete = "/Alloa/get_liste_destinations?c=" + id
							$("#rightbar #pays").remove()
							$('#rightbar #regions').remove()
							jQuery('<img id="loading" src="../images/ajax-loader.gif" alt="Chargement en cours..." />').appendTo("#rightbar")

							jQuery('<div id="pays" style="line-height: 12pt"></div>').load(requete, {}, function(res, stat, xml){
								$("#rightbar #loading").remove()
								$(this).appendTo("#rightbar").show("normal")
								click_pays()
							})

							chaineSituation = ""
							if (nom_continent != "") {
								if (nom_pays != "") {
									if (nom_region != "")
										chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span> &rarr; <span id='nom_region_situation'>" + nom_region + "</span></b>"
									else
										chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span>"
								}
								else
									chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span>"
							}

							$("#situation").empty()
							$("#situation").append(chaineSituation)
							click_situation()
							articles = retour.substring(index_pointvirgule4 + 1, retour.lastIndexOf(">"))
							//articles = retour
							$("#main #loadingMain").remove()

							$("#main").empty()
							$("#main").append(articles)
							tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
							click_article()
							return false
						}
					}
				})
			}
			return false
		}
	})

	$("#valid_recherche").click(function () {
		if (!document.getElementById('loadingMain')) {
			var mot = $("#recherche").attr('value').toLowerCase()
			if (mot == ""){
				$('#main').empty()
				$('#main').append("<div class='article'>Il faut entrer un nom de ville ou de destination pour faire une recherche</div>")
				return false
			}
			if (!document.getElementById('loadingMain')) {
				//var main = $('#main')
				$('#main').empty()
				//jQuery('<img id="loadingMain" src="../images/ajax-loader.gif" alt="Chargement en cours..." title="Chargement en cours..." />').appendTo("#main")

				var vecteur = $("#periode_select").attr('value').toString().split(" ");
				var mois_debut = vecteur[0]
				var annee_debut = vecteur[1]

				var requete = "/Alloa/get_id_search?w=" + mot +"&m="+ choix_menu +"&sm=" + choix_sous_menu + "&mois=" + mois_debut +"&annee=" + annee_debut
				requete += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
				$.ajax({
					type: "GET",
					url: requete,
					success: function(retour){
						//alert("succes, retour= " + retour)
						var index_pointvirgule = retour.indexOf(";", 0)
						//si il n'y a pas de point virgule, pas d'hotel trouves
						if (index_pointvirgule == -1) {
							$("#situation").empty()
							$("#main").append("<div class='article'>Aucune destination trouvée pour le nom <b>" + mot + "</b></div>")
							return false
						}
						else {

							id_localisation = retour.substring(0, index_pointvirgule)
							index_pointvirgule2 = retour.indexOf(";", index_pointvirgule + 1)
							var codezone = retour.substring(index_pointvirgule + 1, index_pointvirgule2 - 1)

							if (codezone == "1 ") {
								id = "europe"
								nom_continent = "Europe"
							}else  if (codezone == "3 ") {
								id = "am_nord"
								nom_continent = 'Amérique du nord'
							}else if (codezone == "9 ") {
								id = "asie"
								nom_continent = 'Asie'
							}else if (codezone == "4 ") {
								id = "am_sud"
								nom_continent = 'Amérique du sud'
							}else if (codezone == "8 ") {
								id = "asie_se"
								nom_continent = 'Asie du sud est'
							}else if (codezone == "2 ") {
								id = "afrique"
								nom_continent = 'Afrique'
							}else if (codezone == "6 ") {
								id = "moy_orient"
								nom_continent = 'Moyen orient'
							}else if (codezone == "10 ") {
								id = "poles"
								nom_continent = 'Groenland'
							}else if (codezone == "5 ") {
								id = "am_centre"
								nom_continent = 'Amérique centrale'
							}else if (codezone == "7") {
								id = "australie"
								nom_continent = 'Océanie'
							}else {
								nom_continent = ""
							}

							index_pointvirgule3 = retour.indexOf(";", index_pointvirgule2 + 1)
							nom_region = retour.substring(index_pointvirgule2 + 1, index_pointvirgule3)
							index_pointvirgule4 = retour.indexOf(";", index_pointvirgule3 + 1)
							nom_pays = retour.substring(index_pointvirgule3 + 1, index_pointvirgule4)
							if (nom_pays == nom_region)
								nom_region = ""

							requete = "/Alloa/get_liste_destinations?c=" + id
							$("#rightbar #pays").remove()
							$('#rightbar #regions').remove()
							jQuery('<img id="loading" src="../images/ajax-loader.gif" alt="Chargement en cours..." />').appendTo("#rightbar")

							jQuery('<div id="pays" style="line-height: 12pt"></div>').load(requete, {}, function(res, stat, xml){
								$("#rightbar #loading").remove()
								$(this).appendTo("#rightbar").show("normal")
								click_pays()
							})

							chaineSituation = ""
							if (nom_continent != "") {
								if (nom_pays != "") {
									if (nom_region != "")
										chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span> &rarr; <span id='nom_region_situation'>" + nom_region + "</span></b>"
									else
										chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span>"
								}
								else
									chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span>"
							}

							$("#situation").empty()
							$("#situation").append(chaineSituation)
							click_situation()
							//alert(codezone)
							articles = retour.substring(index_pointvirgule4 + 1, retour.lastIndexOf(">"))
							//articles = retour
							$("#main #loadingMain").remove()

							$("#main").empty()
							$("#main").append(articles)
							tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
							click_article()
							return false
						}
					}
				})
			}
			return false
		}
	})


	/* ================================================================================================ */
	/* FONCTIONS POUR LA RECHERCHE D'HOTEL, CIRCUIT ET CROISIERE */

	//retour sur le menu voyage lors d'une recherche d'un hotel, circuit ou croisiere
	$("#recherche_hotel").keypress(function (e) {
		if (e.which == 13) { //appui sur la touche "entrée", validation du formulaire
			if (!document.getElementById('loadingMain')) {
				//si le menu est voyage
				if (choix_menu == "voyages") {
					$('#main').empty()
					var mot = $("#recherche_hotel").attr('value').toLowerCase()
					if (mot == "") {
						$('#main').append("<div class='article'>Il faut entrer un nom d'hotel, de circuit ou une référence pour faire une recherche</div>")
						return false
					}
					jQuery('<img id="loadingMain" src="../images/ajax-loader.gif" alt="Chargement en cours..." title="Chargement en cours..." />').appendTo("#main")

					var vecteur = $("#periode_select").attr('value').toString().split(" ");
					var mois_debut = vecteur[0]
					var annee_debut = vecteur[1]

					var requete = "/Alloa/get_hotel_search?w=" + mot + "&mois=" + mois_debut + "&annee=" + annee_debut
					requete += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase() + "&sm=" + choix_sous_menu
					$.ajax({
						type: "GET",
						url: requete,
						success: function(retour){
							//alert("succes, retour= " + retour)
							index_pointvirgule = retour.indexOf(";", 0)
							//si il n'y a pas de point virgule, pas d'hotel ni de circuit trouves, recherche par index
							if (index_pointvirgule == -1) {
								requeteId = "/Alloa/get_idhotel_search?w=" + mot + "&mois=" + mois_debut + "&annee=" + annee_debut
								requeteId += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase() + "&sm=" + choix_sous_menu
								$.ajax({
									type: "GET",
									url: requeteId,
									success: function(retourId){
										index_pointvirgule = retourId.indexOf(";", 0)
										//si il n'y a pas de point virgule, pas d'hotel trouves
										if (index_pointvirgule == -1) {
											$("#main").empty()
											$("#main").append("<div class='article'>Aucun hotel trouvé s'appelant <b>" + mot + "</b></div>")
											return false
										}
										//a trouve un hotel ou circuit grace a son id
										else {

											//alert("index point virgule 1 trouve a: " + index_pointvirgule)
											id_localisation = retourId.substring(0, index_pointvirgule)
											index_pointvirgule2 = retourId.indexOf(";", index_pointvirgule + 1)
											codezone = retourId.substring(index_pointvirgule + 1, index_pointvirgule2 - 1)

											if (codezone == "1 ") {
												id = "europe"
												nom_continent = "Europe"
											}
											else  if (codezone == "3 ") {
												id = "am_nord"
												nom_continent = 'Amérique du nord'
											}else if (codezone == "9 ") {
												id = "asie"
												nom_continent = 'Asie'
											}else if (codezone == "4 ") {
												id = "am_sud"
												nom_continent = 'Amérique du sud'
											}else if (codezone == "8 ") {
												id = "asie_se"
												nom_continent = 'Asie du sud est'
											}else if (codezone == "2 ") {
												id = "afrique"
												nom_continent = 'Afrique'
											}else if (codezone == "6 ") {
												id = "moy_orient"
												nom_continent = 'Moyen orient'
											}else if (codezone == "10 ") {
												id = "poles"
												nom_continent = 'Groenland'
											}else if (codezone == "5 ") {
												id = "am_centre"
												nom_continent = 'Amérique centrale'
											}else if (codezone == "7") {
												id = "australie"
												nom_continent = 'Océanie'
											}else {
												id = ""
												nom_continent = ""
											}

											index_pointvirgule3 = retourId.indexOf(";", index_pointvirgule2 + 1)
											nom_region = retourId.substring(index_pointvirgule2 + 1, index_pointvirgule3)
											index_pointvirgule4 = retourId.indexOf(";", index_pointvirgule3 + 1)
											nom_pays = retourId.substring(index_pointvirgule3 + 1, index_pointvirgule4)
											if (nom_pays == nom_region)
												nom_region = ""

											requete = "/Alloa/get_liste_destinations?c=" + id
											$("#rightbar #pays").remove()
											$('#rightbar #regions').remove()

											jQuery('<img id="loading" src="../images/ajax-loader.gif" alt="Chargement en cours..." />').appendTo("#rightbar")

											jQuery('<div id="pays" style="line-height: 12pt"></div>').load(requete, {}, function(res, stat, xml){
												$("#rightbar #loading").remove()
												$(this).appendTo("#rightbar").show("normal")
												click_pays()
											})

											chaineSituation = ""
											if (nom_continent != "") {
												if (nom_pays != "") {
													//alert("pays != ''")
													//alert("nom_region" +nom_region)
													if (nom_region != "")
														chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span> &rarr; <span id='nom_region_situation'>" + nom_region + "</span></b>"
													else
														chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span>"
												}
												else
													chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span>"
											}

											$("#situation").empty()
											$("#situation").append(chaineSituation)
											click_situation()
											articles = retourId.substring(index_pointvirgule4 + 1, retourId.lastIndexOf(">"))

											$("#main #loadingMain").remove()

											$("#main").append(articles)
											choix_menu = "voyages"
											choix_sous_menu = "coeur"
											tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
											//click_element_menu()
											click_article()
											return false
										}
									}
								})
							}
							//a trouve un hotel ou un circuit grace a son nom
							else {

								//alert("index point virgule 1 trouve a: " + index_pointvirgule)
								id_localisation = retour.substring(0, index_pointvirgule)
								index_pointvirgule2 = retour.indexOf(";", index_pointvirgule + 1)
								codezone = retour.substring(index_pointvirgule + 1, index_pointvirgule2 - 1)

								if (codezone == "1 ") {
									id = "europe"
									nom_continent = "Europe"
								}else  if (codezone == "3 ") {
									id = "am_nord"
									nom_continent = 'Amérique du nord'
								}else if (codezone == "9 ") {
									id = "asie"
									nom_continent = 'Asie'
								}else if (codezone == "4 ") {
									id = "am_sud"
									nom_continent = 'Amérique du sud'
								}else if (codezone == "8 ") {
									id = "asie_se"
									nom_continent = 'Asie du sud est'
								}else if (codezone == "2 ") {
									id = "afrique"
									nom_continent = 'Afrique'
								}else if (codezone == "6 ") {
									id = "moy_orient"
									nom_continent = 'Moyen orient'
								}else if (codezone == "10 ") {
									id = "poles"
									nom_continent = 'Groenland'
								}else if (codezone == "5 ") {
									id = "am_centre"
									nom_continent = 'Amérique centrale'
								}else if (codezone == "7") {
									id = "australie"
									nom_continent = 'Océanie'
								}else {
									id = ""
									nom_continent = ""
								}

								index_pointvirgule3 = retour.indexOf(";", index_pointvirgule2 + 1)
								nom_region = retour.substring(index_pointvirgule2 + 1, index_pointvirgule3)
								index_pointvirgule4 = retour.indexOf(";", index_pointvirgule3 + 1)
								nom_pays = retour.substring(index_pointvirgule3 + 1, index_pointvirgule4)
								if (nom_pays == nom_region)
									nom_region = ""

								requete = "/Alloa/get_liste_destinations?c=" + id
								$("#rightbar #pays").remove()
								$('#rightbar #regions').remove()
								jQuery('<img id="loading" src="../images/ajax-loader.gif" alt="Chargement en cours..." />').appendTo("#rightbar")

								jQuery('<div id="pays" style="line-height: 12pt"></div>').load(requete, {}, function(res, stat, xml){
									$("#rightbar #loading").remove()
									$(this).appendTo("#rightbar").show("normal")
									click_pays()
								})

								chaineSituation = ""
								if (nom_continent != "") {
									if (nom_pays != "") {
										if (nom_region != "")
											chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span> &rarr; <span id='nom_region_situation'>" + nom_region + "</span></b>"
										else
											chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span>"
									}
									else
										chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span>"
								}

								$("#situation").empty()
								$("#situation").append(chaineSituation)
								click_situation()
								articles = retour.substring(index_pointvirgule4 + 1, retour.lastIndexOf(">"))

								$("#main #loadingMain").remove()
								$("#main").append(articles)
								tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
								//click_element_menu()
								click_article()
								return false
							}
						}
					})
				//dans le menu croisiere, on cherche apres une croisiere
				}else if (choix_menu == "croisieres"){
					//var main = $('#main')
					$('#main').empty()
					var mot = $("#recherche_hotel").attr('value').toLowerCase()
					if (mot == "") {
						$('#main').append("<div class='article'>Il faut entrer un nom de croisiere ou une référence pour faire une recherche</div>")
						return false
					}
					jQuery('<img id="loadingMain" src="../images/ajax-loader.gif" alt="Chargement en cours..." title="Chargement en cours..." />').appendTo("#main")

					var vecteur = $("#periode_select").attr('value').toString().split(" ");
					var mois_debut = vecteur[0]
					var annee_debut = vecteur[1]

					requete = "/Alloa/get_croisiere_search?w=" + mot + "&mois=" + mois_debut + "&annee=" + annee_debut
					requete += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
					//alert("avant la fonction ajax")
					$.ajax({
						type: "GET",
						url: requete,
						success: function(retour){
							//alert("succes, retour= " + retour)
							index_pointvirgule = retour.indexOf(";", 0)
							//si il n'y a pas de point virgule, pas de croisiere trouves, recherche par index
							if (index_pointvirgule == -1) {
								requeteId = "/Alloa/get_idcroisiere_search?w=" + mot + "&mois=" + mois_debut + "&annee=" + annee_debut
								requeteId += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
								$.ajax({
									type: "GET",
									url: requeteId,
									success: function(retourId){
										index_pointvirgule = retourId.indexOf(";", 0)
										//si il n'y a pas de point virgule, pas d'hotel trouves
										if (index_pointvirgule == -1) {
											$("#main").empty()
											$("#main").append("<div class='article'>Aucune croisière trouvée s'appelant <b>" + mot + "</b></div>")
											return false
										}

										//a trouve une croisiere grace a son id
										else {
											//alert("index point virgule 1 trouve a: " + index_pointvirgule)
											id_localisation = retourId.substring(0, index_pointvirgule)
											index_pointvirgule2 = retourId.indexOf(";", index_pointvirgule + 1)
											codezone = retourId.substring(index_pointvirgule + 1, index_pointvirgule2 - 1)

											if (codezone == "1 ") {
												id = "europe"
												nom_continent = "Europe"
											}else  if (codezone == "3 ") {
												id = "am_nord"
												nom_continent = 'Amérique du nord'
											}else if (codezone == "9 ") {
												id = "asie"
												nom_continent = 'Asie'
											}else if (codezone == "4 ") {
												id = "am_sud"
												nom_continent = 'Amérique du sud'
											}else if (codezone == "8 ") {
												id = "asie_se"
												nom_continent = 'Asie du sud est'
											}else if (codezone == "2 ") {
												id = "afrique"
												nom_continent = 'Afrique'
											}else if (codezone == "6 ") {
												id = "moy_orient"
												nom_continent = 'Moyen orient'
											}else if (codezone == "10 ") {
												id = "poles"
												nom_continent = 'Groenland'
											}else if (codezone == "5 ") {
												id = "am_centre"
												nom_continent = 'Amérique centrale'
											}else if (codezone == "7") {
												id = "australie"
												nom_continent = 'Océanie'
											}else {
												id = ""
												nom_continent = ""
											}

											index_pointvirgule3 = retourId.indexOf(";", index_pointvirgule2 + 1)
											nom_region = retourId.substring(index_pointvirgule2 + 1, index_pointvirgule3)
											index_pointvirgule4 = retourId.indexOf(";", index_pointvirgule3 + 1)
											nom_pays = retourId.substring(index_pointvirgule3 + 1, index_pointvirgule4)
											if (nom_pays == nom_region)
												nom_region = ""

											requete = "/Alloa/get_liste_destinations?c=" + id
											$("#rightbar #pays").remove()
											$('#rightbar #regions').remove()
											jQuery('<img id="loading" src="../images/ajax-loader.gif" alt="Chargement en cours..." />').appendTo("#rightbar")

											jQuery('<div id="pays" style="line-height: 12pt"></div>').load(requete, {}, function(res, stat, xml){
												$("#rightbar #loading").remove()
												$(this).appendTo("#rightbar").show("normal")
												click_pays()
											})

											chaineSituation = ""
											if (nom_continent != "") {
												if (nom_pays != "") {
													if (nom_region != "")
														chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span> &rarr; <span id='nom_region_situation'>" + nom_region + "</span></b>"
													else
														chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span>"
												}
												else
													chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span>"
											}

											$("#situation").empty()
											$("#situation").append(chaineSituation)
											click_situation()
											articles = retourId.substring(index_pointvirgule4 + 1, retourId.lastIndexOf(">"))

											$("#main #loadingMain").remove()

											$("#main").append(articles)
											tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
											//click_element_menu()
											click_article()
											return false
										}
									}
								})
							//a trouve une croisiere grace a son nom
							}else{
								//alert("index point virgule 1 trouve a: " + index_pointvirgule)
								id_localisation = retour.substring(0, index_pointvirgule)
								index_pointvirgule2 = retour.indexOf(";", index_pointvirgule + 1)
								codezone = retour.substring(index_pointvirgule + 1, index_pointvirgule2 - 1)

								if (codezone == "1 ") {
									id = "europe"
									nom_continent = "Europe"
								}else  if (codezone == "3 ") {
									id = "am_nord"
									nom_continent = 'Amérique du nord'
								}else if (codezone == "9 ") {
									id = "asie"
									nom_continent = 'Asie'
								}else if (codezone == "4 ") {
									id = "am_sud"
									nom_continent = 'Amérique du sud'
								}else if (codezone == "8 ") {
									id = "asie_se"
									nom_continent = 'Asie du sud est'
								}else if (codezone == "2 ") {
									id = "afrique"
									nom_continent = 'Afrique'
								}else if (codezone == "6 ") {
									id = "moy_orient"
									nom_continent = 'Moyen orient'
								}else if (codezone == "10 ") {
									id = "poles"
									nom_continent = 'Groenland'
								}else if (codezone == "5 ") {
									id = "am_centre"
									nom_continent = 'Amérique centrale'
								}else if (codezone == "7") {
									id = "australie"
									nom_continent = 'Océanie'
								}else {
									id = ""
									nom_continent = ""
								}

								index_pointvirgule3 = retour.indexOf(";", index_pointvirgule2 + 1)
								nom_region = retour.substring(index_pointvirgule2 + 1, index_pointvirgule3)
								index_pointvirgule4 = retour.indexOf(";", index_pointvirgule3 + 1)
								nom_pays = retour.substring(index_pointvirgule3 + 1, index_pointvirgule4)
								if (nom_pays == nom_region)
									nom_region = ""

								requete = "/Alloa/get_liste_destinations?c=" + id
								$("#rightbar #pays").remove()
								$('#rightbar #regions').remove()
								jQuery('<img id="loading" src="../images/ajax-loader.gif" alt="Chargement en cours..." />').appendTo("#rightbar")

								jQuery('<div id="pays" style="line-height: 12pt"></div>').load(requete, {}, function(res, stat, xml){
									$("#rightbar #loading").remove()
									$(this).appendTo("#rightbar").show("normal")
									click_pays()
								})

								chaineSituation = ""
								if (nom_continent != "") {
									if (nom_pays != "") {
										if (nom_region != "")
											chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span> &rarr; <span id='nom_region_situation'>" + nom_region + "</span></b>"
										else
											chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span>"
									}
									else
										chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span>"
								}

								$("#situation").empty()
								$("#situation").append(chaineSituation)
								click_situation()
								articles = retour.substring(index_pointvirgule4 + 1, retour.lastIndexOf(">"))

								$("#main #loadingMain").remove()
								$("#main").empty()
								$("#main").append(articles)
								tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
								//click_element_menu()
								click_article()
								return false
							}
						}
					})
					//dans le menu circuit, cherche un circuit
				}else if (choix_menu == "circuits"){
					//var main = $('#main')
					$('#main').empty()
					var mot = $("#recherche_hotel").attr('value').toLowerCase()
					if (mot == "") {
						$('#main').append("<div class='article'>Il faut entrer un nom de circuit ou une référence pour faire une recherche</div>")
						return false
					}
					jQuery('<img id="loadingMain" src="../images/ajax-loader.gif" alt="Chargement en cours..." title="Chargement en cours..." />').appendTo("#main")

					var vecteur = $("#periode_select").attr('value').toString().split(" ");
					var mois_debut = vecteur[0]
					var annee_debut = vecteur[1]

					requete = "/Alloa/get_circuit_search?w=" + mot + "&mois=" + mois_debut + "&annee=" + annee_debut
					requete += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
					//alert("avant la fonction ajax")
					$.ajax({
						type: "GET",
						url: requete,
						success: function(retour){
							//alert("succes, retour= " + retour)
							index_pointvirgule = retour.indexOf(";", 0)
							//si il n'y a pas de point virgule, pas de croisiere trouves, recherche par index
							if (index_pointvirgule == -1) {
								requeteId = "/Alloa/get_idcircuit_search?w=" + mot + "&mois=" + mois_debut + "&annee=" + annee_debut
								requeteId += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
								$.ajax({
									type: "GET",
									url: requeteId,
									success: function(retourId){
										index_pointvirgule = retourId.indexOf(";", 0)
										//si il n'y a pas de point virgule, pas d'hotel trouves
										if (index_pointvirgule == -1) {
											$("#main").empty()
											$("#main").append("<div class='article'>Aucun circuit trouvé s'appelant <b>" + mot + "</b></div>")
											return false
										}

										//a trouve un circuit grace a son id
										else {
											//alert("index point virgule 1 trouve a: " + index_pointvirgule)
											id_localisation = retourId.substring(0, index_pointvirgule)
											index_pointvirgule2 = retourId.indexOf(";", index_pointvirgule + 1)
											codezone = retourId.substring(index_pointvirgule + 1, index_pointvirgule2 - 1)

											if (codezone == "1 ") {
												id = "europe"
												nom_continent = "Europe"
											}else  if (codezone == "3 ") {
												id = "am_nord"
												nom_continent = 'Amérique du nord'
											}else if (codezone == "9 ") {
												id = "asie"
												nom_continent = 'Asie'
											}else if (codezone == "4 ") {
												id = "am_sud"
												nom_continent = 'Amérique du sud'
											}else if (codezone == "8 ") {
												id = "asie_se"
												nom_continent = 'Asie du sud est'
											}else if (codezone == "2 ") {
												id = "afrique"
												nom_continent = 'Afrique'
											}else if (codezone == "6 ") {
												id = "moy_orient"
												nom_continent = 'Moyen orient'
											}else if (codezone == "10 ") {
												id = "poles"
												nom_continent = 'Groenland'
											}else if (codezone == "5 ") {
												id = "am_centre"
												nom_continent = 'Amérique centrale'
											}else if (codezone == "7") {
												id = "australie"
												nom_continent = 'Océanie'
											}else {
												id = ""
												nom_continent = ""
											}

											index_pointvirgule3 = retourId.indexOf(";", index_pointvirgule2 + 1)
											nom_region = retourId.substring(index_pointvirgule2 + 1, index_pointvirgule3)
											index_pointvirgule4 = retourId.indexOf(";", index_pointvirgule3 + 1)
											nom_pays = retourId.substring(index_pointvirgule3 + 1, index_pointvirgule4)
											if (nom_pays == nom_region)
												nom_region = ""

											requete = "/Alloa/get_liste_destinations?c=" + id
											$("#rightbar #pays").remove()
											$('#rightbar #regions').remove()
											jQuery('<img id="loading" src="../images/ajax-loader.gif" alt="Chargement en cours..." />').appendTo("#rightbar")

											jQuery('<div id="pays" style="line-height: 12pt"></div>').load(requete, {}, function(res, stat, xml){
												$("#rightbar #loading").remove()
												$(this).appendTo("#rightbar").show("normal")
												click_pays()
											})

											chaineSituation = ""
											if (nom_continent != "") {
												if (nom_pays != "") {
													if (nom_region != "")
														chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span> &rarr; <span id='nom_region_situation'>" + nom_region + "</span></b>"
													else
														chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span>"
												}
												else
													chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span>"
											}

											$("#situation").empty()
											$("#situation").append(chaineSituation)
											click_situation()
											articles = retourId.substring(index_pointvirgule4 + 1, retourId.lastIndexOf(">"))

											$("#main #loadingMain").remove()

											$("#main").append(articles)
											tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
											//click_element_menu()
											click_article()
											return false
										}
									}
								})
							}
							//a trouve un circuit grace a son nom
							else {

								//alert("index point virgule 1 trouve a: " + index_pointvirgule)
								id_localisation = retour.substring(0, index_pointvirgule)
								index_pointvirgule2 = retour.indexOf(";", index_pointvirgule + 1)
								codezone = retour.substring(index_pointvirgule + 1, index_pointvirgule2 - 1)

								if (codezone == "1 ") {
									id = "europe"
									nom_continent = "Europe"
								}else  if (codezone == "3 ") {
									id = "am_nord"
									nom_continent = 'Amérique du nord'
								}else if (codezone == "9 ") {
									id = "asie"
									nom_continent = 'Asie'
								}else if (codezone == "4 ") {
									id = "am_sud"
									nom_continent = 'Amérique du sud'
								}else if (codezone == "8 ") {
									id = "asie_se"
									nom_continent = 'Asie du sud est'
								}else if (codezone == "2 ") {
									id = "afrique"
									nom_continent = 'Afrique'
								}else if (codezone == "6 ") {
									id = "moy_orient"
									nom_continent = 'Moyen orient'
								}else if (codezone == "10 ") {
									id = "poles"
									nom_continent = 'Groenland'
								}else if (codezone == "5 ") {
									id = "am_centre"
									nom_continent = 'Amérique centrale'
								}else if (codezone == "7") {
									id = "australie"
									nom_continent = 'Océanie'
								}else {
									id = ""
									nom_continent = ""
								}

								index_pointvirgule3 = retour.indexOf(";", index_pointvirgule2 + 1)
								nom_region = retour.substring(index_pointvirgule2 + 1, index_pointvirgule3)
								index_pointvirgule4 = retour.indexOf(";", index_pointvirgule3 + 1)
								nom_pays = retour.substring(index_pointvirgule3 + 1, index_pointvirgule4)
								if (nom_pays == nom_region)
									nom_region = ""

								requete = "/Alloa/get_liste_destinations?c=" + id
								$("#rightbar #pays").remove()
								$('#rightbar #regions').remove()
								jQuery('<img id="loading" src="../images/ajax-loader.gif" alt="Chargement en cours..." />').appendTo("#rightbar")

								jQuery('<div id="pays" style="line-height: 12pt"></div>').load(requete, {}, function(res, stat, xml){
									$("#rightbar #loading").remove()
									$(this).appendTo("#rightbar").show("normal")
									click_pays()
								})

								chaineSituation = ""
								if (nom_continent != "") {
									if (nom_pays != "") {
										if (nom_region != "")
											chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span> &rarr; <span id='nom_region_situation'>" + nom_region + "</span></b>"
										else
											chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span>"
									}
									else
										chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span>"
								}

								$("#situation").empty()
								$("#situation").append(chaineSituation)
								click_situation()
								articles = retour.substring(index_pointvirgule4 + 1, retour.lastIndexOf(">"))

								$("#main #loadingMain").remove()
								$("#main").append(articles)
								tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
								//click_element_menu()
								click_article()
								return false
							}
						}
					})
				}else if (choix_menu == "locations"){
					//var main = $('#main')
					$('#main').empty()
					var mot = $("#recherche_hotel").attr('value').toLowerCase()
					if (mot == "") {
						$('#main').append("<div class='article'>Il faut entrer un nom de location ou une référence pour faire une recherche</div>")
						return false
					}
					jQuery('<img id="loadingMain" src="../images/ajax-loader.gif" alt="Chargement en cours..." title="Chargement en cours..." />').appendTo("#main")

					var vecteur = $("#periode_select").attr('value').toString().split(" ");
					var mois_debut = vecteur[0]
					var annee_debut = vecteur[1]

					requete = "/Alloa/get_location_search?w=" + mot + "&mois=" + mois_debut + "&annee=" + annee_debut
					requete += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
					$.ajax({
						type: "GET",
						url: requete,
						success: function(retour){
							//alert("succes, retour= " + retour)
							index_pointvirgule = retour.indexOf(";", 0)
							//si il n'y a pas de point virgule, pas de location trouves, recherche par index
							if (index_pointvirgule == -1) {
								requeteId = "/Alloa/get_idlocation_search?w=" + mot + "&mois=" + mois_debut + "&annee=" + annee_debut
								requeteId += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
								$.ajax({
									type: "GET",
									url: requeteId,
									success: function(retourId){
										index_pointvirgule = retourId.indexOf(";", 0)
										//si il n'y a pas de point virgule, pas d'hotel trouves
										if (index_pointvirgule == -1) {
											$("#main").empty()
											$("#main").append("<div class='article'>Aucune location trouvée s'appelant <b>" + mot + "</b></div>")
											return false
										}

										//a trouve une location grace a son id
										else {
											//alert("index point virgule 1 trouve a: " + index_pointvirgule)
											id_localisation = retourId.substring(0, index_pointvirgule)
											index_pointvirgule2 = retourId.indexOf(";", index_pointvirgule + 1)
											codezone = retourId.substring(index_pointvirgule + 1, index_pointvirgule2 - 1)

											if (codezone == "1 ") {
												id = "europe"
												nom_continent = "Europe"
											}else  if (codezone == "3 ") {
												id = "am_nord"
												nom_continent = 'Amérique du nord'
											}else if (codezone == "9 ") {
												id = "asie"
												nom_continent = 'Asie'
											}else if (codezone == "4 ") {
												id = "am_sud"
												nom_continent = 'Amérique du sud'
											}else if (codezone == "8 ") {
												id = "asie_se"
												nom_continent = 'Asie du sud est'
											}else if (codezone == "2 ") {
												id = "afrique"
												nom_continent = 'Afrique'
											}else if (codezone == "6 ") {
												id = "moy_orient"
												nom_continent = 'Moyen orient'
											}else if (codezone == "10 ") {
												id = "poles"
												nom_continent = 'Groenland'
											}else if (codezone == "5 ") {
												id = "am_centre"
												nom_continent = 'Amérique centrale'
											}else if (codezone == "7") {
												id = "australie"
												nom_continent = 'Océanie'
											}else {
												id = ""
												nom_continent = ""
											}

											index_pointvirgule3 = retourId.indexOf(";", index_pointvirgule2 + 1)
											nom_region = retourId.substring(index_pointvirgule2 + 1, index_pointvirgule3)
											index_pointvirgule4 = retourId.indexOf(";", index_pointvirgule3 + 1)
											nom_pays = retourId.substring(index_pointvirgule3 + 1, index_pointvirgule4)
											if (nom_pays == nom_region)
												nom_region = ""

											requete = "/Alloa/get_liste_destinations?c=" + id
											$("#rightbar #pays").remove()
											$('#rightbar #regions').remove()
											jQuery('<img id="loading" src="../images/ajax-loader.gif" alt="Chargement en cours..." />').appendTo("#rightbar")

											jQuery('<div id="pays" style="line-height: 12pt"></div>').load(requete, {}, function(res, stat, xml){
												$("#rightbar #loading").remove()
												$(this).appendTo("#rightbar").show("normal")
												click_pays()
											})

											chaineSituation = ""
											if (nom_continent != "") {
												if (nom_pays != "") {
													if (nom_region != "")
														chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span> &rarr; <span id='nom_region_situation'>" + nom_region + "</span></b>"
													else
														chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span>"
												}
												else
													chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span>"
											}

											$("#situation").empty()
											$("#situation").append(chaineSituation)
											click_situation()
											articles = retourId.substring(index_pointvirgule4 + 1, retourId.lastIndexOf(">"))

											$("#main #loadingMain").remove()

											$("#main").append(articles)
											tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
											//click_element_menu()
											click_article()
											return false
										}
									}
								})
							}
							//a trouve une location grace a son nom
							else {

								//alert("index point virgule 1 trouve a: " + index_pointvirgule)
								id_localisation = retour.substring(0, index_pointvirgule)
								index_pointvirgule2 = retour.indexOf(";", index_pointvirgule + 1)
								codezone = retour.substring(index_pointvirgule + 1, index_pointvirgule2 - 1)

								if (codezone == "1 ") {
									id = "europe"
									nom_continent = "Europe"
								}else  if (codezone == "3 ") {
									id = "am_nord"
									nom_continent = 'Amérique du nord'
								}else if (codezone == "9 ") {
									id = "asie"
									nom_continent = 'Asie'
								}else if (codezone == "4 ") {
									id = "am_sud"
									nom_continent = 'Amérique du sud'
								}else if (codezone == "8 ") {
									id = "asie_se"
									nom_continent = 'Asie du sud est'
								}else if (codezone == "2 ") {
									id = "afrique"
									nom_continent = 'Afrique'
								}else if (codezone == "6 ") {
									id = "moy_orient"
									nom_continent = 'Moyen orient'
								}else if (codezone == "10 ") {
									id = "poles"
									nom_continent = 'Groenland'
								}else if (codezone == "5 ") {
									id = "am_centre"
									nom_continent = 'Amérique centrale'
								}else if (codezone == "7") {
									id = "australie"
									nom_continent = 'Océanie'
								}else {
									id = ""
									nom_continent = ""
								}

								index_pointvirgule3 = retour.indexOf(";", index_pointvirgule2 + 1)
								nom_region = retour.substring(index_pointvirgule2 + 1, index_pointvirgule3)
								index_pointvirgule4 = retour.indexOf(";", index_pointvirgule3 + 1)
								nom_pays = retour.substring(index_pointvirgule3 + 1, index_pointvirgule4)
								if (nom_pays == nom_region)
									nom_region = ""

								requete = "/Alloa/get_liste_destinations?c=" + id
								$("#rightbar #pays").remove()
								$('#rightbar #regions').remove()
								jQuery('<img id="loading" src="../images/ajax-loader.gif" alt="Chargement en cours..." />').appendTo("#rightbar")

								jQuery('<div id="pays" style="line-height: 12pt"></div>').load(requete, {}, function(res, stat, xml){
									$("#rightbar #loading").remove()
									$(this).appendTo("#rightbar").show("normal")
									click_pays()
								})

								chaineSituation = ""
								if (nom_continent != "") {
									if (nom_pays != "") {
										if (nom_region != "")
											chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span> &rarr; <span id='nom_region_situation'>" + nom_region + "</span></b>"
										else
											chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span>"
									}
									else
										chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span>"
								}

								$("#situation").empty()
								$("#situation").append(chaineSituation)
								click_situation()
								articles = retour.substring(index_pointvirgule4 + 1, retour.lastIndexOf(">"))

								$("#main #loadingMain").remove()
								$("#main").append(articles)
								tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
								//click_element_menu()
								click_article()
								return false
							}
						}
					})
				}
				return false
			}
		}
	})

	$("#valid_recherche_hotel").click(function () {
		//alert("la fonction de 1000 lignes")
			if (!document.getElementById('loadingMain')) {
				//si le menu est voyage
				if (choix_menu == "voyages") {
					$('#main').empty()
					var mot = $("#recherche_hotel").attr('value').toLowerCase()
					if (mot == "") {
						$('#main').append("<div class='article'>Il faut entrer un nom d'hotel, de circuit ou une référence pour faire une recherche</div>")
						return false
					}
					jQuery('<img id="loadingMain" src="../images/ajax-loader.gif" alt="Chargement en cours..." title="Chargement en cours..." />').appendTo("#main")

					var vecteur = $("#periode_select").attr('value').toString().split(" ");
					var mois_debut = vecteur[0]
					var annee_debut = vecteur[1]

					requete = "/Alloa/get_hotel_search?w=" + mot + "&mois=" + mois_debut + "&annee=" + annee_debut
					requete += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase() + "&sm=" + choix_sous_menu
					alert(requete)
					$.ajax({
						type: "GET",
						url: requete,
						success: function(retour){
							//alert("succes, retour= " + retour)
							index_pointvirgule = retour.indexOf(";", 0)
							//si il n'y a pas de point virgule, pas d'hotel ni de circuit trouves, recherche par index
							if (index_pointvirgule == -1) {
								requeteId = "/Alloa/get_idhotel_search?w=" + mot + "&mois=" + mois_debut + "&annee=" + annee_debut
								requeteId += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase() + "&sm=" + choix_sous_menu
								$.ajax({
									type: "GET",
									url: requeteId,
									success: function(retourId){
										index_pointvirgule = retourId.indexOf(";", 0)
										//si il n'y a pas de point virgule, pas d'hotel trouves
										if (index_pointvirgule == -1) {
											$("#main").empty()
											$("#main").append("<div class='article'>Aucun hotel trouvé s'appelant <b>" + mot + "</b></div>")
											return false
										}
										//a trouve un hotel ou circuit grace a son id
										else {

											//alert("index point virgule 1 trouve a: " + index_pointvirgule)
											id_localisation = retourId.substring(0, index_pointvirgule)
											index_pointvirgule2 = retourId.indexOf(";", index_pointvirgule + 1)
											codezone = retourId.substring(index_pointvirgule + 1, index_pointvirgule2 - 1)

											if (codezone == "1 ") {
												id = "europe"
												nom_continent = "Europe"
											}
											else  if (codezone == "3 ") {
												id = "am_nord"
												nom_continent = 'Amérique du nord'
											}else if (codezone == "9 ") {
												id = "asie"
												nom_continent = 'Asie'
											}else if (codezone == "4 ") {
												id = "am_sud"
												nom_continent = 'Amérique du sud'
											}else if (codezone == "8 ") {
												id = "asie_se"
												nom_continent = 'Asie du sud est'
											}else if (codezone == "2 ") {
												id = "afrique"
												nom_continent = 'Afrique'
											}else if (codezone == "6 ") {
												id = "moy_orient"
												nom_continent = 'Moyen orient'
											}else if (codezone == "10 ") {
												id = "poles"
												nom_continent = 'Groenland'
											}else if (codezone == "5 ") {
												id = "am_centre"
												nom_continent = 'Amérique centrale'
											}else if (codezone == "7") {
												id = "australie"
												nom_continent = 'Océanie'
											}else {
												id = ""
												nom_continent = ""
											}

											index_pointvirgule3 = retourId.indexOf(";", index_pointvirgule2 + 1)
											nom_region = retourId.substring(index_pointvirgule2 + 1, index_pointvirgule3)
											index_pointvirgule4 = retourId.indexOf(";", index_pointvirgule3 + 1)
											nom_pays = retourId.substring(index_pointvirgule3 + 1, index_pointvirgule4)
											if (nom_pays == nom_region)
												nom_region = ""

											requete = "/Alloa/get_liste_destinations?c=" + id
											$("#rightbar #pays").remove()
											$('#rightbar #regions').remove()
											jQuery('<img id="loading" src="../images/ajax-loader.gif" alt="Chargement en cours..." />').appendTo("#rightbar")

											jQuery('<div id="pays" style="line-height: 12pt"></div>').load(requete, {}, function(res, stat, xml){
												$("#rightbar #loading").remove()
												$(this).appendTo("#rightbar").show("normal")
												click_pays()
											})

											chaineSituation = ""
											if (nom_continent != "") {
												if (nom_pays != "") {
													if (nom_region != "")
														chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span> &rarr; <span id='nom_region_situation'>" + nom_region + "</span></b>"
													else
														chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span>"
												}
												else
													chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span>"
											}

											$("#situation").empty()
											$("#situation").append(chaineSituation)
											click_situation()
											articles = retourId.substring(index_pointvirgule4 + 1, retourId.lastIndexOf(">"))

											$("#main #loadingMain").remove()

											$("#main").append(articles)
											choix_menu = "voyages"
											choix_sous_menu = "coeur"
											tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
											//click_element_menu()
											click_article()
											return false
										}
									}
								})
							}
							//a trouve un hotel ou un circuit grace a son nom
							else {

								//alert("index point virgule 1 trouve a: " + index_pointvirgule)
								id_localisation = retour.substring(0, index_pointvirgule)
								index_pointvirgule2 = retour.indexOf(";", index_pointvirgule + 1)
								codezone = retour.substring(index_pointvirgule + 1, index_pointvirgule2 - 1)

								if (codezone == "1 ") {
									id = "europe"
									nom_continent = "Europe"
								}else  if (codezone == "3 ") {
									id = "am_nord"
									nom_continent = 'Amérique du nord'
								}else if (codezone == "9 ") {
									id = "asie"
									nom_continent = 'Asie'
								}else if (codezone == "4 ") {
									id = "am_sud"
									nom_continent = 'Amérique du sud'
								}else if (codezone == "8 ") {
									id = "asie_se"
									nom_continent = 'Asie du sud est'
								}else if (codezone == "2 ") {
									id = "afrique"
									nom_continent = 'Afrique'
								}else if (codezone == "6 ") {
									id = "moy_orient"
									nom_continent = 'Moyen orient'
								}else if (codezone == "10 ") {
									id = "poles"
									nom_continent = 'Groenland'
								}else if (codezone == "5 ") {
									id = "am_centre"
									nom_continent = 'Amérique centrale'
								}else if (codezone == "7") {
									id = "australie"
									nom_continent = 'Océanie'
								}else {
									id = ""
									nom_continent = ""
								}

								index_pointvirgule3 = retour.indexOf(";", index_pointvirgule2 + 1)
								nom_region = retour.substring(index_pointvirgule2 + 1, index_pointvirgule3)
								index_pointvirgule4 = retour.indexOf(";", index_pointvirgule3 + 1)
								nom_pays = retour.substring(index_pointvirgule3 + 1, index_pointvirgule4)
								if (nom_pays == nom_region)
									nom_region = ""

								requete = "/Alloa/get_liste_destinations?c=" + id
								$("#rightbar #pays").remove()
								$('#rightbar #regions').remove()
								jQuery('<img id="loading" src="../images/ajax-loader.gif" alt="Chargement en cours..." />').appendTo("#rightbar")

								jQuery('<div id="pays" style="line-height: 12pt"></div>').load(requete, {}, function(res, stat, xml){
									$("#rightbar #loading").remove()
									$(this).appendTo("#rightbar").show("normal")
									click_pays()
								})

								chaineSituation = ""
								if (nom_continent != "") {
									if (nom_pays != "") {
										if (nom_region != "")
											chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span> &rarr; <span id='nom_region_situation'>" + nom_region + "</span></b>"
										else
											chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span>"
									}
									else
										chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span>"
								}

								$("#situation").empty()
								$("#situation").append(chaineSituation)
								click_situation()
								articles = retour.substring(index_pointvirgule4 + 1, retour.lastIndexOf(">"))

								$("#main #loadingMain").remove()
								$("#main").append(articles)
								tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
								//click_element_menu()
								click_article()
								return false
							}
						}
					})
				//dans le menu croisiere, on cherche apres une croisiere
				}else if (choix_menu == "croisieres"){
					//var main = $('#main')
					$('#main').empty()
					var mot = $("#recherche_hotel").attr('value').toLowerCase()
					if (mot == "") {
						$('#main').append("<div class='article'>Il faut entrer un nom de croisiere ou une référence pour faire une recherche</div>")
						return false
					}
					jQuery('<img id="loadingMain" src="../images/ajax-loader.gif" alt="Chargement en cours..." title="Chargement en cours..." />').appendTo("#main")

					var vecteur = $("#periode_select").attr('value').toString().split(" ");
					var mois_debut = vecteur[0]
					var annee_debut = vecteur[1]

					requete = "/Alloa/get_croisiere_search?w=" + mot + "&mois=" + mois_debut + "&annee=" + annee_debut
					requete += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
					//alert("avant la fonction ajax")
					$.ajax({
						type: "GET",
						url: requete,
						success: function(retour){
							//alert("succes, retour= " + retour)
							index_pointvirgule = retour.indexOf(";", 0)
							//si il n'y a pas de point virgule, pas de croisiere trouves, recherche par index
							if (index_pointvirgule == -1) {
								requeteId = "/Alloa/get_idcroisiere_search?w=" + mot + "&mois=" + mois_debut + "&annee=" + annee_debut
								requeteId += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
								$.ajax({
									type: "GET",
									url: requeteId,
									success: function(retourId){
										index_pointvirgule = retourId.indexOf(";", 0)
										//si il n'y a pas de point virgule, pas d'hotel trouves
										if (index_pointvirgule == -1) {
											$("#main").empty()
											$("#main").append("<div class='article'>Aucune croisière trouvée s'appelant <b>" + mot + "</b></div>")
											return false
										}

										//a trouve une croisiere grace a son id
										else {
											//alert("index point virgule 1 trouve a: " + index_pointvirgule)
											id_localisation = retourId.substring(0, index_pointvirgule)
											index_pointvirgule2 = retourId.indexOf(";", index_pointvirgule + 1)
											codezone = retourId.substring(index_pointvirgule + 1, index_pointvirgule2 - 1)

											if (codezone == "1 ") {
												id = "europe"
												nom_continent = "Europe"
											}else  if (codezone == "3 ") {
												id = "am_nord"
												nom_continent = 'Amérique du nord'
											}else if (codezone == "9 ") {
												id = "asie"
												nom_continent = 'Asie'
											}else if (codezone == "4 ") {
												id = "am_sud"
												nom_continent = 'Amérique du sud'
											}else if (codezone == "8 ") {
												id = "asie_se"
												nom_continent = 'Asie du sud est'
											}else if (codezone == "2 ") {
												id = "afrique"
												nom_continent = 'Afrique'
											}else if (codezone == "6 ") {
												id = "moy_orient"
												nom_continent = 'Moyen orient'
											}else if (codezone == "10 ") {
												id = "poles"
												nom_continent = 'Groenland'
											}else if (codezone == "5 ") {
												id = "am_centre"
												nom_continent = 'Amérique centrale'
											}else if (codezone == "7") {
												id = "australie"
												nom_continent = 'Océanie'
											}else {
												id = ""
												nom_continent = ""
											}

											index_pointvirgule3 = retourId.indexOf(";", index_pointvirgule2 + 1)
											nom_region = retourId.substring(index_pointvirgule2 + 1, index_pointvirgule3)
											index_pointvirgule4 = retourId.indexOf(";", index_pointvirgule3 + 1)
											nom_pays = retourId.substring(index_pointvirgule3 + 1, index_pointvirgule4)
											if (nom_pays == nom_region)
												nom_region = ""

											requete = "/Alloa/get_liste_destinations?c=" + id
											$("#rightbar #pays").remove()
											$('#rightbar #regions').remove()
											jQuery('<img id="loading" src="../images/ajax-loader.gif" alt="Chargement en cours..." />').appendTo("#rightbar")

											jQuery('<div id="pays" style="line-height: 12pt"></div>').load(requete, {}, function(res, stat, xml){
												$("#rightbar #loading").remove()
												$(this).appendTo("#rightbar").show("normal")
												click_pays()
											})

											chaineSituation = ""
											if (nom_continent != "") {
												if (nom_pays != "") {
													if (nom_region != "")
														chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span> &rarr; <span id='nom_region_situation'>" + nom_region + "</span></b>"
													else
														chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span>"
												}
												else
													chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span>"
											}

											$("#situation").empty()
											$("#situation").append(chaineSituation)
											click_situation()
											articles = retourId.substring(index_pointvirgule4 + 1, retourId.lastIndexOf(">"))

											$("#main #loadingMain").remove()

											$("#main").append(articles)
											tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
											//click_element_menu()
											click_article()
											return false
										}
									}
								})
							//a trouve une croisiere grace a son nom
							}else{
								//alert("index point virgule 1 trouve a: " + index_pointvirgule)
								id_localisation = retour.substring(0, index_pointvirgule)
								index_pointvirgule2 = retour.indexOf(";", index_pointvirgule + 1)
								codezone = retour.substring(index_pointvirgule + 1, index_pointvirgule2 - 1)

								if (codezone == "1 ") {
									id = "europe"
									nom_continent = "Europe"
								}else  if (codezone == "3 ") {
									id = "am_nord"
									nom_continent = 'Amérique du nord'
								}else if (codezone == "9 ") {
									id = "asie"
									nom_continent = 'Asie'
								}else if (codezone == "4 ") {
									id = "am_sud"
									nom_continent = 'Amérique du sud'
								}else if (codezone == "8 ") {
									id = "asie_se"
									nom_continent = 'Asie du sud est'
								}else if (codezone == "2 ") {
									id = "afrique"
									nom_continent = 'Afrique'
								}else if (codezone == "6 ") {
									id = "moy_orient"
									nom_continent = 'Moyen orient'
								}else if (codezone == "10 ") {
									id = "poles"
									nom_continent = 'Groenland'
								}else if (codezone == "5 ") {
									id = "am_centre"
									nom_continent = 'Amérique centrale'
								}else if (codezone == "7") {
									id = "australie"
									nom_continent = 'Océanie'
								}else {
									id = ""
									nom_continent = ""
								}

								index_pointvirgule3 = retour.indexOf(";", index_pointvirgule2 + 1)
								nom_region = retour.substring(index_pointvirgule2 + 1, index_pointvirgule3)
								index_pointvirgule4 = retour.indexOf(";", index_pointvirgule3 + 1)
								nom_pays = retour.substring(index_pointvirgule3 + 1, index_pointvirgule4)
								if (nom_pays == nom_region)
									nom_region = ""

								requete = "/Alloa/get_liste_destinations?c=" + id
								$("#rightbar #pays").remove()
								$('#rightbar #regions').remove()
								jQuery('<img id="loading" src="../images/ajax-loader.gif" alt="Chargement en cours..." />').appendTo("#rightbar")

								jQuery('<div id="pays" style="line-height: 12pt"></div>').load(requete, {}, function(res, stat, xml){
									$("#rightbar #loading").remove()
									$(this).appendTo("#rightbar").show("normal")
									click_pays()
								})

								chaineSituation = ""
								if (nom_continent != "") {
									if (nom_pays != "") {
										if (nom_region != "")
											chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span> &rarr; <span id='nom_region_situation'>" + nom_region + "</span></b>"
										else
											chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span>"
									}
									else
										chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span>"
								}

								$("#situation").empty()
								$("#situation").append(chaineSituation)
								click_situation()
								articles = retour.substring(index_pointvirgule4 + 1, retour.lastIndexOf(">"))

								$("#main #loadingMain").remove()
								$("#main").empty()
								$("#main").append(articles)
								tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
								//click_element_menu()
								click_article()
								return false
							}
						}
					})
					//dans le menu circuit, cherche un circuit
				}else if (choix_menu == "circuits"){
					//var main = $('#main')
					$('#main').empty()
					var mot = $("#recherche_hotel").attr('value').toLowerCase()
					if (mot == "") {
						$('#main').append("<div class='article'>Il faut entrer un nom de circuit ou une référence pour faire une recherche</div>")
						return false
					}
					jQuery('<img id="loadingMain" src="../images/ajax-loader.gif" alt="Chargement en cours..." title="Chargement en cours..." />').appendTo("#main")

					var vecteur = $("#periode_select").attr('value').toString().split(" ");
					var mois_debut = vecteur[0]
					var annee_debut = vecteur[1]

					requete = "/Alloa/get_circuit_search?w=" + mot + "&mois=" + mois_debut + "&annee=" + annee_debut
					requete += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
					//alert("avant la fonction ajax")
					$.ajax({
						type: "GET",
						url: requete,
						success: function(retour){
							//alert("succes, retour= " + retour)
							index_pointvirgule = retour.indexOf(";", 0)
							//si il n'y a pas de point virgule, pas de croisiere trouves, recherche par index
							if (index_pointvirgule == -1) {
								requeteId = "/Alloa/get_idcircuit_search?w=" + mot + "&mois=" + mois_debut + "&annee=" + annee_debut
								requeteId += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
								$.ajax({
									type: "GET",
									url: requeteId,
									success: function(retourId){
										index_pointvirgule = retourId.indexOf(";", 0)
										//si il n'y a pas de point virgule, pas d'hotel trouves
										if (index_pointvirgule == -1) {
											$("#main").empty()
											$("#main").append("<div class='article'>Aucun circuit trouvé s'appelant <b>" + mot + "</b></div>")
											return false
										}

										//a trouve une croisiere grace a son id
										else {
											//alert("index point virgule 1 trouve a: " + index_pointvirgule)
											id_localisation = retourId.substring(0, index_pointvirgule)
											index_pointvirgule2 = retourId.indexOf(";", index_pointvirgule + 1)
											codezone = retourId.substring(index_pointvirgule + 1, index_pointvirgule2 - 1)

											if (codezone == "1 ") {
												id = "europe"
												nom_continent = "Europe"
											}else  if (codezone == "3 ") {
												id = "am_nord"
												nom_continent = 'Amérique du nord'
											}else if (codezone == "9 ") {
												id = "asie"
												nom_continent = 'Asie'
											}else if (codezone == "4 ") {
												id = "am_sud"
												nom_continent = 'Amérique du sud'
											}else if (codezone == "8 ") {
												id = "asie_se"
												nom_continent = 'Asie du sud est'
											}else if (codezone == "2 ") {
												id = "afrique"
												nom_continent = 'Afrique'
											}else if (codezone == "6 ") {
												id = "moy_orient"
												nom_continent = 'Moyen orient'
											}else if (codezone == "10 ") {
												id = "poles"
												nom_continent = 'Groenland'
											}else if (codezone == "5 ") {
												id = "am_centre"
												nom_continent = 'Amérique centrale'
											}else if (codezone == "7") {
												id = "australie"
												nom_continent = 'Océanie'
											}else {
												id = ""
												nom_continent = ""
											}

											index_pointvirgule3 = retourId.indexOf(";", index_pointvirgule2 + 1)
											nom_region = retourId.substring(index_pointvirgule2 + 1, index_pointvirgule3)
											index_pointvirgule4 = retourId.indexOf(";", index_pointvirgule3 + 1)
											nom_pays = retourId.substring(index_pointvirgule3 + 1, index_pointvirgule4)
											if (nom_pays == nom_region)
												nom_region = ""

											requete = "/Alloa/get_liste_destinations?c=" + id
											$("#rightbar #pays").remove()
											$('#rightbar #regions').remove()
											jQuery('<img id="loading" src="../images/ajax-loader.gif" alt="Chargement en cours..." />').appendTo("#rightbar")

											jQuery('<div id="pays" style="line-height: 12pt"></div>').load(requete, {}, function(res, stat, xml){
												$("#rightbar #loading").remove()
												$(this).appendTo("#rightbar").show("normal")
												click_pays()
											})

											chaineSituation = ""
											if (nom_continent != "") {
												if (nom_pays != "") {
													if (nom_region != "")
														chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span> &rarr; <span id='nom_region_situation'>" + nom_region + "</span></b>"
													else
														chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span>"
												}
												else
													chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span>"
											}

											$("#situation").empty()
											$("#situation").append(chaineSituation)
											click_situation()
											articles = retourId.substring(index_pointvirgule4 + 1, retourId.lastIndexOf(">"))

											$("#main #loadingMain").remove()

											$("#main").append(articles)
											tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
											//click_element_menu()
											click_article()
											return false
										}
									}
								})
							}
							//a trouve une croisiere grace a son nom
							else {

								//alert("index point virgule 1 trouve a: " + index_pointvirgule)
								id_localisation = retour.substring(0, index_pointvirgule)
								index_pointvirgule2 = retour.indexOf(";", index_pointvirgule + 1)
								codezone = retour.substring(index_pointvirgule + 1, index_pointvirgule2 - 1)

								if (codezone == "1 ") {
									id = "europe"
									nom_continent = "Europe"
								}else  if (codezone == "3 ") {
									id = "am_nord"
									nom_continent = 'Amérique du nord'
								}else if (codezone == "9 ") {
									id = "asie"
									nom_continent = 'Asie'
								}else if (codezone == "4 ") {
									id = "am_sud"
									nom_continent = 'Amérique du sud'
								}else if (codezone == "8 ") {
									id = "asie_se"
									nom_continent = 'Asie du sud est'
								}else if (codezone == "2 ") {
									id = "afrique"
									nom_continent = 'Afrique'
								}else if (codezone == "6 ") {
									id = "moy_orient"
									nom_continent = 'Moyen orient'
								}else if (codezone == "10 ") {
									id = "poles"
									nom_continent = 'Groenland'
								}else if (codezone == "5 ") {
									id = "am_centre"
									nom_continent = 'Amérique centrale'
								}else if (codezone == "7") {
									id = "australie"
									nom_continent = 'Océanie'
								}else {
									id = ""
									nom_continent = ""
								}

								index_pointvirgule3 = retour.indexOf(";", index_pointvirgule2 + 1)
								nom_region = retour.substring(index_pointvirgule2 + 1, index_pointvirgule3)
								index_pointvirgule4 = retour.indexOf(";", index_pointvirgule3 + 1)
								nom_pays = retour.substring(index_pointvirgule3 + 1, index_pointvirgule4)
								if (nom_pays == nom_region)
									nom_region = ""

								requete = "/Alloa/get_liste_destinations?c=" + id
								$("#rightbar #pays").remove()
								$('#rightbar #regions').remove()
								jQuery('<img id="loading" src="../images/ajax-loader.gif" alt="Chargement en cours..." />').appendTo("#rightbar")

								jQuery('<div id="pays" style="line-height: 12pt"></div>').load(requete, {}, function(res, stat, xml){
									$("#rightbar #loading").remove()
									$(this).appendTo("#rightbar").show("normal")
									click_pays()
								})

								chaineSituation = ""
								if (nom_continent != "") {
									if (nom_pays != "") {
										if (nom_region != "")
											chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span> &rarr; <span id='nom_region_situation'>" + nom_region + "</span></b>"
										else
											chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span>"
									}
									else
										chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span>"
								}

								$("#situation").empty()
								$("#situation").append(chaineSituation)
								click_situation()
								articles = retour.substring(index_pointvirgule4 + 1, retour.lastIndexOf(">"))

								$("#main #loadingMain").remove()
								$("#main").append(articles)
								tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
								//click_element_menu()
								click_article()
								return false
							}
						}
					})
				}else if (choix_menu == "locations"){
					//var main = $('#main')
					$('#main').empty()
					var mot = $("#recherche_hotel").attr('value').toLowerCase()
					if (mot == "") {
						$('#main').append("<div class='article'>Il faut entrer un nom de location ou une référence pour faire une recherche</div>")
						return false
					}
					jQuery('<img id="loadingMain" src="../images/ajax-loader.gif" alt="Chargement en cours..." title="Chargement en cours..." />').appendTo("#main")

					var vecteur = $("#periode_select").attr('value').toString().split(" ");
					var mois_debut = vecteur[0]
					var annee_debut = vecteur[1]

					requete = "/Alloa/get_location_search?w=" + mot + "&mois=" + mois_debut + "&annee=" + annee_debut
					requete += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
					$.ajax({
						type: "GET",
						url: requete,
						success: function(retour){
							//alert("succes, retour= " + retour)
							index_pointvirgule = retour.indexOf(";", 0)
							//si il n'y a pas de point virgule, pas de location trouves, recherche par index
							if (index_pointvirgule == -1) {
								requeteId = "/Alloa/get_idlocation_search?w=" + mot + "&mois=" + mois_debut + "&annee=" + annee_debut
								requeteId += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
								$.ajax({
									type: "GET",
									url: requeteId,
									success: function(retourId){
										index_pointvirgule = retourId.indexOf(";", 0)
										//si il n'y a pas de point virgule, pas d'hotel trouves
										if (index_pointvirgule == -1) {
											$("#main").empty()
											$("#main").append("<div class='article'>Aucune location trouvée s'appelant <b>" + mot + "</b></div>")
											return false
										}

										//a trouve une location grace a son id
										else {
											//alert("index point virgule 1 trouve a: " + index_pointvirgule)
											id_localisation = retourId.substring(0, index_pointvirgule)
											index_pointvirgule2 = retourId.indexOf(";", index_pointvirgule + 1)
											codezone = retourId.substring(index_pointvirgule + 1, index_pointvirgule2 - 1)

											if (codezone == "1 ") {
												id = "europe"
												nom_continent = "Europe"
											}else  if (codezone == "3 ") {
												id = "am_nord"
												nom_continent = 'Amérique du nord'
											}else if (codezone == "9 ") {
												id = "asie"
												nom_continent = 'Asie'
											}else if (codezone == "4 ") {
												id = "am_sud"
												nom_continent = 'Amérique du sud'
											}else if (codezone == "8 ") {
												id = "asie_se"
												nom_continent = 'Asie du sud est'
											}else if (codezone == "2 ") {
												id = "afrique"
												nom_continent = 'Afrique'
											}else if (codezone == "6 ") {
												id = "moy_orient"
												nom_continent = 'Moyen orient'
											}else if (codezone == "10 ") {
												id = "poles"
												nom_continent = 'Groenland'
											}else if (codezone == "5 ") {
												id = "am_centre"
												nom_continent = 'Amérique centrale'
											}else if (codezone == "7") {
												id = "australie"
												nom_continent = 'Océanie'
											}else {
												id = ""
												nom_continent = ""
											}

											index_pointvirgule3 = retourId.indexOf(";", index_pointvirgule2 + 1)
											nom_region = retourId.substring(index_pointvirgule2 + 1, index_pointvirgule3)
											index_pointvirgule4 = retourId.indexOf(";", index_pointvirgule3 + 1)
											nom_pays = retourId.substring(index_pointvirgule3 + 1, index_pointvirgule4)
											if (nom_pays == nom_region)
												nom_region = ""

											requete = "/Alloa/get_liste_destinations?c=" + id
											$("#rightbar #pays").remove()
											$('#rightbar #regions').remove()
											jQuery('<img id="loading" src="../images/ajax-loader.gif" alt="Chargement en cours..." />').appendTo("#rightbar")

											jQuery('<div id="pays" style="line-height: 12pt"></div>').load(requete, {}, function(res, stat, xml){
												$("#rightbar #loading").remove()
												$(this).appendTo("#rightbar").show("normal")
												click_pays()
											})

											chaineSituation = ""
											if (nom_continent != "") {
												if (nom_pays != "") {
													if (nom_region != "")
														chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span> &rarr; <span id='nom_region_situation'>" + nom_region + "</span></b>"
													else
														chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span>"
												}
												else
													chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span>"
											}

											$("#situation").empty()
											$("#situation").append(chaineSituation)
											click_situation()
											articles = retourId.substring(index_pointvirgule4 + 1, retourId.lastIndexOf(">"))

											$("#main #loadingMain").remove()

											$("#main").append(articles)
											tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
											//click_element_menu()
											click_article()
											return false
										}
									}
								})
							}
							//a trouve une location grace a son nom
							else {

								//alert("index point virgule 1 trouve a: " + index_pointvirgule)
								id_localisation = retour.substring(0, index_pointvirgule)
								index_pointvirgule2 = retour.indexOf(";", index_pointvirgule + 1)
								codezone = retour.substring(index_pointvirgule + 1, index_pointvirgule2 - 1)

								if (codezone == "1 ") {
									id = "europe"
									nom_continent = "Europe"
								}else  if (codezone == "3 ") {
									id = "am_nord"
									nom_continent = 'Amérique du nord'
								}else if (codezone == "9 ") {
									id = "asie"
									nom_continent = 'Asie'
								}else if (codezone == "4 ") {
									id = "am_sud"
									nom_continent = 'Amérique du sud'
								}else if (codezone == "8 ") {
									id = "asie_se"
									nom_continent = 'Asie du sud est'
								}else if (codezone == "2 ") {
									id = "afrique"
									nom_continent = 'Afrique'
								}else if (codezone == "6 ") {
									id = "moy_orient"
									nom_continent = 'Moyen orient'
								}else if (codezone == "10 ") {
									id = "poles"
									nom_continent = 'Groenland'
								}else if (codezone == "5 ") {
									id = "am_centre"
									nom_continent = 'Amérique centrale'
								}else if (codezone == "7") {
									id = "australie"
									nom_continent = 'Océanie'
								}else {
									id = ""
									nom_continent = ""
								}

								index_pointvirgule3 = retour.indexOf(";", index_pointvirgule2 + 1)
								nom_region = retour.substring(index_pointvirgule2 + 1, index_pointvirgule3)
								index_pointvirgule4 = retour.indexOf(";", index_pointvirgule3 + 1)
								nom_pays = retour.substring(index_pointvirgule3 + 1, index_pointvirgule4)
								if (nom_pays == nom_region)
									nom_region = ""

								requete = "/Alloa/get_liste_destinations?c=" + id
								$("#rightbar #pays").remove()
								$('#rightbar #regions').remove()
								jQuery('<img id="loading" src="../images/ajax-loader.gif" alt="Chargement en cours..." />').appendTo("#rightbar")

								jQuery('<div id="pays" style="line-height: 12pt"></div>').load(requete, {}, function(res, stat, xml){
									$("#rightbar #loading").remove()
									$(this).appendTo("#rightbar").show("normal")
									click_pays()
								})

								chaineSituation = ""
								if (nom_continent != "") {
									if (nom_pays != "") {
										if (nom_region != "")
											chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span> &rarr; <span id='nom_region_situation'>" + nom_region + "</span></b>"
										else
											chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span>"
									}
									else
										chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span>"
								}

								$("#situation").empty()
								$("#situation").append(chaineSituation)
								click_situation()
								articles = retour.substring(index_pointvirgule4 + 1, retour.lastIndexOf(">"))

								$("#main #loadingMain").remove()
								$("#main").append(articles)
								tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
								//click_element_menu()
								click_article()
								return false
							}
						}
					})
				}
				return false
			}
	})


	/* ================================================================================================ */
	/* FONCTIONS ONGLET */

	/* mise en place des info-bulles  */
	$('#croisieres').hover(
		function() {
			$("#bulle_croisieres").css('visibility','visible');
		},
		function () {
		    $("#bulle_croisieres").css('visibility','hidden');
		}
	);
	$('#evenement').hover(
		function() {
			$("#bulle_evenement").css('visibility','visible');
		},
		function () {
		    $("#bulle_evenement").css('visibility','hidden');
		}
	);
	$('#transport').hover(
		function() {
			$("#bulle_transport").css('visibility','visible');
		},
		function () {
		    $("#bulle_transport").css('visibility','hidden');
		}
	);

	/* coloration de l'onglet actif */
	/*
	$('#onglets a').click(function() {
		if ($(this).attr('id') != "lien_externe") {
			// on enlève la coloration sur tous les onglets
			$('#onglets a').attr('class', 'passive')

			// on colorie l'onglet actif
			$(this).attr('class', 'active')
		}
	})
	*/

	// Cliques sur le menu croisières
	/*
	$('#croisieres').click(function() {
		var menu = $('#menu')
		menu.empty()
		$("#main").empty()

		jQuery('<ul><li><a class="element_menu" href="" id="coeur">Nos favoris</a></li>').appendTo(menu).css('font-weight', 'bold').css('text-decoration', 'underline')
		jQuery('<li><a class="element_menu" href="" id="fluviale">Fluviale</a></li>').appendTo(menu)
		jQuery('<li><a class="element_menu" href="" id="maritime">Maritîme</a></li>').appendTo(menu)
		jQuery('<li><a class="element_menu" href="" id="alle">Toutes</a></li></ul>').appendTo(menu)


		//remet la localisation au pourtour méditerraneen, comme la page d'accueil
		nom_continent = "Pourtour méditerranéen";
		nom_pays = "Méditerrannée";
		nom_region = "" ;
		id_localisation = "1a";
		choix_menu = "croisieres"
		choix_sous_menu = "coeur"

		chaineSituation = "<span class='situation_continent'>" + nom_continent + "</span><b> &rarr; <span id='nom_pays_situation'>" + nom_pays + "</span></b>"
		$("#situation").empty()
		$("#situation").append(chaineSituation)
		click_situation()
		$("#rightbar #pays").remove()
		$('#rightbar #regions').remove()
		requete = "/Alloa/get_liste_destinations?c=a1"		//en mediterrannee
		jQuery('<div id="pays" style="line-height: 12pt"></div>').load(requete, {}, function(res, stat, xml) {
					$("#rightbar #loading").remove()
					$(this).appendTo("#rightbar").show("normal")
					$("#1a").css('font-weight', 'bold')
					click_pays()
		})

		//***  Affiche les régions mediterraneennes
		requete = "/Alloa/get_liste_sous_destinations?p=1a"
		jQuery('<div id="regions"></div>').load(requete, {}, function(res, stat, xml){
			$("#rightbar #loading").remove()
			$(this).appendTo("#rightbar").show("normal")
			click_region()
		})

				//recherche les croisieres à afficher
		if (!document.getElementById('loadingMain')) {
			if (id_localisation != "") {
				$('#main').empty()
				//$('#rightbar').empty()
				jQuery('<img id="loadingMain" src="../images/ajax-loader.gif" alt="Chargement en cours..." title="Chargement en cours..." />').appendTo("#main")

				var vecteur = $("#periode_select").attr('value').toString().split(" ");
				var mois_debut = vecteur[0]
				var annee_debut = vecteur[1]
				urlFonction = "/Alloa/get_liste_croisieres?r=" + id_localisation + "&sm=coeur" + "&mois=" + mois_debut + "&annee=" + annee_debut
				urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
				$.ajax({
					type: "GET",
					url: urlFonction,
					success: function(retour){
						$("#main #loadingMain").remove()
						$("#main").append(retour)
						tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
						click_article()
					}
				})
				//$('#rightbar').empty()
			}else{
				$("#main").append("<div class='article'>Choisissez une destination</div>")
			}
		}
		// on recharge les événements liés aux clics sur un élément du menu que l'on vient de mettre en place (obligatoire)
		click_element_menu()
		return false
	})
*/

	// Cliques sur un élément du sous-menu (ex:favoris, club, etc...)
	function click_element_menu() {
		$('#menuTmp2 a').click(function() {
			if ($(this).attr('class') != "jqModal" ) {
				var main = $('#main')
				main.empty()
				//choix du menu
				menu = $(this).parent().parent().parent().attr("class")
				choix_menu = menu

				//choix du sous_menu, decoupe la concatenation de l'id
				vectTmp = $(this).attr('id').split("_")
				sousmenu = vectTmp[1]
				choix_sous_menu = sousmenu

				//------------------------------------------------------

				$("#vos_rech").empty()
				$("#vos_rech").append(tab_menu[menu])
				$("#s_choix").empty()
				$("#s_choix").append(" > "+ tab_s_menu[choix_sous_menu] +" ,  pour un départ de "+$("#depart_ville_select").attr('value'))
				var vect = $("#periode_select").attr('value').toString().split(" ");
				$("#s_choix").append(" dans la pèriode "+tab_mois[vect[0]]+" - "+vect[1])

				//------------------------------------------------------


				//remet les proprietes css du menu a "0"
				$('#menuTmp2 dt').css('font-weight', 'normal').css('text-decoration', 'none')
				$('#menuTmp2 a').css('font-weight', 'normal').css('text-decoration', 'none')

				//met en gras et souligne le menu et sous-menu concercnes
				$(this).css('font-weight', 'bold').css('text-decoration', 'underline')
				//correspond au dt concerne par le clic
				var dt_concerne = $(this).parent().parent().parent().parent().children().filter("dt")
				dt_concerne.css('font-weight', 'bold').css('text-decoration', 'underline')

				var vecteur = $("#periode_select").attr('value').toString().split(" ");
				var mois_debut = vecteur[0]
				var annee_debut = vecteur[1]

				//recherche les hotels à afficher
				if (!document.getElementById('loadingMain')) {
					if (id_localisation != "") {
						//si nous sommes au moins au niveau d'un pays
						if (nom_pays != "") {
							jQuery('<img id="loadingMain" src="../images/ajax-loader.gif" alt="Chargement en cours..." title="Chargement en cours..." />').appendTo("#main")

							if (choix_menu == "voyages") {
								//alert("voyages")
								urlFonction = "/Alloa/get_liste_hotels?r=" + id_localisation + "&sm=" + choix_sous_menu + "&mois=" + mois_debut + "&annee=" + annee_debut
								urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
								//alert(urlFonction)
							}
							else if (choix_menu == "croisieres") {
								//alert("croisieres")
								//rechercher les croisières et non les hotels
								urlFonction = "/Alloa/get_liste_croisieres?r=" + id_localisation + "&sm=" + choix_sous_menu + "&mois=" + mois_debut + "&annee=" + annee_debut
								urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
							}
							else if (choix_menu == "circuits")  {
								//alert("circuits")
								//rechercher les circuits
								urlFonction = "/Alloa/get_liste_circuits?r=" + id_localisation + "&sm=" + choix_sous_menu + "&mois=" + mois_debut + "&annee=" + annee_debut
								urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
							}
							else  {
								//alert("circuits")
								//rechercher les circuits
								urlFonction = "/Alloa/get_liste_locations?r=" + id_localisation + "&sm=" + choix_sous_menu + "&mois=" + mois_debut + "&annee=" + annee_debut
								urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
							}
							//urlFonction = urlFonction.replace(/-/,"")
							//alert(urlFonction+' 1')
							$.ajax({
								type: "GET",
								url: urlFonction,
								success: function(retour){
									//alert(urlFonction)
									$("#main #loadingMain").remove()
									$('#main').empty()
									$("#main").append(retour)
									tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
									click_article()
									res()
								}
							})
						//si nous sommes au niveau d'un continent
						}
						else {
							var urlFonction = "/Continent/getPageContinent?c=" + refcontinent + "&mois=" + mois_debut + "&annee=" + annee_debut
							urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase() + "&sm=" + $(this).attr('id')
							//alert(urlFonction+' 2')
							$.ajax({
								type: "GET",
								url: urlFonction,
								success: function(retour){
									$('#main').empty()
									$("#main").append(retour)
									tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
									click_article()
									res()
								}
							})
						}
					}
					else {
						var urlFonction = "/Continent/getPageContinent?c=" + refcontinent + "&mois=" + mois_debut + "&annee=" + annee_debut
						urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase() + "&sm=" + $(this).attr('id')
						//alert(urlFonction+' 3')
						$.ajax({
							type: "GET",
							url: urlFonction,
							success: function(retour){
								$('#main').empty()
								$("#main").append(retour)
								tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
								click_article()
								res()
							}
						})
					}
				}
				return false
			}
		})

		//fonctions pour la gestion du retour du menu a son point d'origine
		$("#menuTmp2 dl").hover(
		  function () {
		  	over_menu = true;
		  },
		  function () {
		  }
		);
		$("#menuTmp2 dd").hover(
		  function () {
		  	over_menu = true;
		  },
		  function () {
			replaceDd($(this));
		  }
		);
		$("#menuTmp2 dt").hover(
		  function () {
		  	over_menu = true;
		  },
		  function () {
			replaceDt($(this));
		  }
		);
		$("#menuTmp2").hover(
		  function () {
		  },
		  function () {
		  	over_menu = false;
			replace()
		  }
		);
	//------------------------------------- fonction se declanchant lors du click sur les liens principaux du menu deroulant ---------------------
		$("#menuTmp2 dt").click(function(){

			if ($(this).attr('class') != "jqModal" && $(this).parent().children().find("a").attr('class') != "jqModal") {
				//alert("sejouuur ou circuit ....")
				var main = $('#main');
				main.empty();
				//choix du menu, decoupe la concatenation de l'id
				dd_concerne = $(this).parent().children().filter("dd");

				menu = dd_concerne.attr('class');

				//----------------------------------------------------------------------------

				$("#vos_rech").empty()
				$("#vos_rech").append(tab_menu[menu])
				$("#s_choix").empty()
				$("#s_choix").append(" > Nos Favoris ,  pour un départ de "+$("#depart_ville_select").attr('value'))
				var vect = $("#periode_select").attr('value').toString().split(" ");
				$("#s_choix").append(" dans la pèriode "+tab_mois[vect[0]]+" - "+vect[1])

				//----------------------------------------------------------------------------

				choix_menu = menu;
				//met "coeur" en sous menu
				sousmenu = "coeur";
				choix_sous_menu = sousmenu;
				//remet les proprietes css du menu a "0"
				$('#menuTmp2 dt').css('font-weight', 'normal').css('text-decoration', 'none')
				$('#menuTmp2 a').css('font-weight', 'normal').css('text-decoration', 'none')

				//met en gras et souligne le menu et sous-menu concercnes
				$(this).css('font-weight', 'bold').css('text-decoration', 'underline')

				//correspond au dt concerne par le clic
				idLien = dd_concerne.attr('id') + "_coeur"
				dd_concerne.find("a").each(function(i){
					if($(this).attr('id') == idLien)
						$(this).css('font-weight', 'bold').css('text-decoration', 'underline');
					return;
				})
				var a_concerne = $(this).children().filter("a")
				a_concerne.css('font-weight', 'bold').css('text-decoration', 'underline')

				var vecteur = $("#periode_select").attr('value').toString().split(" ");
				var mois_debut = vecteur[0]
				var annee_debut = vecteur[1]

				//recherche les hotels à afficher
				if (!document.getElementById('loadingMain')) {
					if (id_localisation != "") {
						//si nous sommes au moins au niveau d'un pays
						if (nom_pays != "") {
							//jQuery('<img id="loadingMain" src="../images/ajax-loader.gif" alt="Chargement en cours..." title="Chargement en cours..." />').appendTo("#main")
							//document.write(choix_menu);
							if (choix_menu == "voyages") {

								urlFonction = "/Alloa/get_liste_hotels?r=" + id_localisation + "&sm=" + choix_sous_menu
								urlFonction += "&mois=" + mois_debut + "&annee=" + annee_debut
								urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()

								//urlFonction = "/Alloa/get_liste_hotels";

							}
							else if (choix_menu == "croisieres") {
								//alert("croisieres")
								//rechercher les croisières et non les hotels
								urlFonction = "/Alloa/get_liste_croisieres?r=" + id_localisation + "&sm=" + choix_sous_menu + "&mois=" + mois_debut + "&annee=" + annee_debut
								urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
							}
							else if (choix_menu == "circuits") {
								//alert("circuits")
								//rechercher les circuits
								urlFonction = "/Alloa/get_liste_circuits?r=" + id_localisation + "&sm=" + choix_sous_menu + "&mois=" + mois_debut + "&annee=" + annee_debut
								urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
							}
							else {
								//alert("locations")
								//rechercher les locations
								urlFonction = "/Alloa/get_liste_locations?r=" + id_localisation + "&sm=" + choix_sous_menu + "&mois=" + mois_debut + "&annee=" + annee_debut
								urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
							}

							//var urlFonction = "/Alloa/get_liste_hotels?r=MT&sm=&mois=5&annee=2009&ville=lille_paris_bruxelles"
							//urlFonction = urlFonction.replace(/-/,"")

							//alert(urlFonction+' 1')
							$.ajax({
								type: "GET",
								url: urlFonction,
								success: function(retour){
									//$("#main #loadingMain").remove()
									$('#main').empty()
									$("#main").append(retour)
									tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
									click_article()
								}
							})
						//si nous sommes au niveau d'un continent
						}
						else {
							var urlFonction = "/Continent/getPageContinent?c=" + refcontinent + "&mois=" + mois_debut + "&annee=" + annee_debut
							urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase() + "&sm=" + $(this).attr('id')
							//alert(urlFonction+' 2')
							$.ajax({
								type: "GET",
								url: urlFonction,
								success: function(retour){
									$('#main').empty()
									$("#main").append(retour)
									tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
									click_article()
								}
							})
						}
					}
					else {
						var urlFonction = "/Continent/getPageContinent?c=" + refcontinent + "&mois=" + mois_debut + "&annee=" + annee_debut
						urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase() + "&sm=" + $(this).attr('id')
						//alert(urlFonction+' 3')
						$.ajax({
							type: "GET",
							url: urlFonction,
							success: function(retour){
								$('#main').empty()
								$("#main").append(retour)
								tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
								click_article()
							}
						})
					}
				}
				return false
			}
		})

	}

	//fonctions pour remettre en place le menu lorsque la souris ne le survole plus
	function replace() {
		//la souris a quitte le menu selectionne qui est deja affiche
	  	if (over_menu)
		 	return false;

		$("#menuTmp2").find("dd").each(function(i){
			tmp_dt = $(this).parent().children().filter("dt");

			if (tmp_dt.css('text-decoration') == "underline") {
				$(this).css('display', 'block');
				//alert("class_tmpdd display: " + $(this).attr('class'));
			}
			else {
				//alert("class_tmpdd pas display: " + $(this).attr('class'));
				$(this).css('display', 'none');
			}
		})
		return false;
	}
	function replaceDt(Object) {
	  	var dt = Object;
		//la souris a quitte le menu selectionne qui est deja affiche
	  	if (dt.css('text-decoration') == "underline" || over_menu)
		 	return false;

		$("#menuTmp2").find("dd").each(function(i){
			tmp_dt = $(this).parent().children().filter("dt");

			if (tmp_dt.css('text-decoration') == "underline") {
				$(this).css('display', 'block');
			}
			else {
				$(this).css('display', 'none');
			}
		})
		return false;
	}
	function replaceDd(Object) {
	  	var dd = Object;
		var dt = dd.parent().children().filter("dt")
		//la souris a quitte le menu selectionne qui est deja affiche
	  	if (dt.css('text-decoration') == "underline" || over_menu)
		 	return false;

		$("#menuTmp2").find("dd").each(function(i){
			tmp_dt = $(this).parent().children().filter("dt");

			if (tmp_dt.css('text-decoration') == "underline") {
				$(this).css('display', 'block');
			}
			else {
				$(this).css('display', 'none');
			}
		})
		return false;
	}


	/* DIFFERENTES FONCTIONS POUR LES ARTICLES OU PAGES */
	function click_article(){

		//fonction pour le survol du prix
		$(".divPrix").hover(
		  function () {
			//recupere l'objet parent jquery article commun a divPrix et survolPrix
			article = $(this).parent().parent()
			//recupere l'objet enfant ayant pour class css survolPrix
			survolPrix = article.children().children().filter(".survolPrix")
			//le rend visible
			survolPrix.css('visibility','visible');

		  },
		  function () {
		  	//rend invisible tous les div de class survolPrix
		    $(".survolPrix").css('visibility','hidden');
		  }
		);

		$(".lire_suite").click(function(){
			article = $(this).parent().parent()
			descriptif = article.children().filter(".descriptif")
			accroche = article.children().filter(".accroche")
			lien = article.children().filter(".lire_suite")
			display = descriptif.css('display')
			if (display == 'none') {
				accroche.hide()
				descriptif.show("normal")
				$(this).html('&lt;&lt; Fermer')
			}
			else {
				setTimeout("accroche.show()", 400)
				descriptif.hide("normal")
				//descriptif.hide()
				//accroche.show()
				$(this).html('Lire la suite &gt;&gt;')
			}
			return false
		})

		$(".lienTableauPrix").click(function(){
			var vecteur = $("#periode_select").attr('value').toString().split(" ");
			var lien = "/User/getTableauPrix?h=" + $(this).attr('name')
			window.open(lien, "Prix", 'location=0, width=800, height=400, status=no, scrollbars=yes, menubar=no, fullscreen=no')
			return false
		})

		$(".lienTableauPrixCirc").click(function(){
			var vecteur = $("#periode_select").attr('value').toString().split(" ");
			var lien = "/User/getTableauPrix?circ=" + $(this).attr('name')
			window.open(lien, "Prix", 'location=0, width=800, height=400, status=no, scrollbars=yes, menubar=no, fullscreen=no')
			return false
		})

		$(".lienTableauPrixCrois").click(function(){
			var vecteur = $("#periode_select").attr('value').toString().split(" ");
			var lien = "/User/getTableauPrix?crois=" + $(this).attr('name')
			window.open(lien, "Prix", 'location=0, width=800, height=400, status=no, scrollbars=yes, menubar=no, fullscreen=no')
			return false
		})

		$(".lienTableauPrixLoc").click(function(){
			var vecteur = $("#periode_select").attr('value').toString().split(" ");
			var lien = "/User/getTableauPrix?loc=" + $(this).attr('name')
			window.open(lien, "Prix", 'location=0, width=800, height=400, status=no, scrollbars=yes, menubar=no, fullscreen=no')
			return false
		})

		//clic pour changer de page si il y en a plusieurs
		$("#lienPages a").click(function() {
			requete = $(this).attr('name')
			$("#main").empty()
			jQuery('<img id="loadingMain" src="../images/ajax-loader.gif" alt="Chargement en cours..." title="Chargement en cours..." />').appendTo("#main")
			$.ajax({
				type : "GET",
				url: requete ,
				success:function(retour){
					$("#main #loadingMain").remove()
					$("#main").append(retour)
					tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
					click_article()
				}
			})
			return false
		})

		//clic pour avoir la definition d'une ville (en haut a droite de l'article)
		$(".localisation").click(function(){
			urlFonction = "/Continent/getDefVille?r=" + $(this).attr('id') + "&n=" + $(this).html()
			mywindow = window.open(urlFonction, '', 'location=no, width=800, height=400, status=no, scrollbars=yes, menubar=no, fullscreen=no')
			mywindow.moveTo(250,200);
			return false;
		})
	}


	/* rempli le contenu de la boite jqmodal affichee */
	$(".jqModal").click(function(){
		//clic sur le lien de la demande de renseignement de contact du header
		if ($(this).attr('id') == $("#lienContactHeader").attr('id')) {
			$("#contenu_jqmodal").empty()
			$("#contenu_jqmodal").append('<p align="CENTER" style="background:#ffffff; font-size:14px;"><font color="#0000ff"><font size="4" style="font-size:10pt"><b><span style="background:#ffffcc">Un conseil, Une réservation : 0 820 42 15 15 ( Prix d\'un appel)')
			$("#contenu_jqmodal").append('</span></b></font></font></p><p align="CENTER" style="background:#ffffff"><font color="#0000ff"><font size="4" style="font-size:10pt"><b><span style="background:#ffffcc">Les Nordistes préféreront le 03 59 57 15 15</span></b></font></font></p>')
			$("#contenu_jqmodal").append('<p align="CENTER" style="background:#ffffff"><font color="#0000ff"><font size="3" style="font-size:10pt"><b><span style="background:#ffffff">Du lundi au vendredi de 10h à 13h et de 14h à 19h</span></b></font></font></p>')
			$("#contenu_jqmodal").append('<p align="CENTER" style="margin-bottom:0cm"><font color="#0000ff">Samedi de 10h00 à 12h00 à 14h00 à 18h00</font></p>')
			$("#contenu_jqmodal").append('<p align="CENTER" style="margin-bottom:0cm">Par mail : alloa@alloa.fr</p>')
			$("#contenu_jqmodal").append('<p align="CENTER" style="margin-bottom:0cm">Groupe : groupe@alloa.fr  -  Direction : manager@alloa.fr</p>')

			$(".jqmWindow").css("top", "15%")
		}
		//clic sur un autre lien qui doit afficher la boite jqmodal
		else {
			$("#contenu_jqmodal").empty()
			$("#contenu_jqmodal").append("Cette fonctionnalité sera bientôt disponible")
			$(".jqmWindow").css("top", "20%")
		}

		return false
	})

	//clic sur un des liens du footer
	$(".lienfooter").click(function() {
		if ($(this).attr('id') == 'qui' || $(this).attr('id') == 'conditions' || $(this).attr('id') == 'assurances' || $(this).attr('id') == 'mentions') {

			lien = "../web_page/" + $(this).attr('id') + '.html'
			mywindow = window.open(lien, '', 'location=no, width=800, height=400, status=no, scrollbars=yes, menubar=no, fullscreen=no')
			mywindow.moveTo(200,150);
		}else if($(this).attr('id') == 'tourdumonde')
		{
			lien = "../web_page/" + $(this).attr('id') + '.html'
			mywindow = window.open(lien, '', 'location=no, width=780, height=500, status=no, scrollbars=yes, menubar=no, fullscreen=no')
			mywindow.moveTo(200,150);
		}else if($(this).attr('id') == 'contacts')
		{
			lien = "../web_page/" + $(this).attr('id') + '.html'
			mywindow = window.open(lien, '', 'location=no, width=600, height=700, status=no, scrollbars=yes, menubar=no, fullscreen=no')
			mywindow.moveTo(200,150);
		}
		else {
			$('#main').empty()
			requete = "set_main_footer?l=" + $(this).attr('id')
			$.ajax({
				type: "GET",
				url: requete,
				success: function(retour){
					$("#main").append(retour)
					tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
					click_plan()
				}
			})
		}
		return false

	})

		//clic sur le lien de la demande de prix express du header
	$("#lienDemandeHeader").click(function() {
		lien = '../demandeExpress.html'
		//mywindow = window.open(lien, '', 'location=no, width=800, height=400, status=no, scrollbars=yes, menubar=no, fullscreen=no')
		//mywindow.moveTo(200,150);
		return false
	})

	//aide_bienvenue
	$("#lienAideBienvenue").click(function() {
		lien = '../bienvenue.html'
		mywindow = window.open(lien, '', 'location=no, width=800, height=400, status=no, scrollbars=yes, menubar=no, fullscreen=no')
		mywindow.moveTo(200,150);
		return false
	})


	//évènements déclenchés par un clic sur le plan du site (du footer)
	//redirection vers la page concernée
	/*
	function click_plan(){

		$("#lienVoyagesCoeur").click(function() {
			var menu = $('#menu')
			menu.empty()
			//alert("voyage coeur")
			jQuery('<ul><li><a class="element_menu" href="" id="coeur">Nos favoris</a></li>').appendTo(menu).css('font-weight', 'bold').css('text-decoration', 'underline')
			jQuery('<li><a class="element_menu" href="" id="club">Club</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="famille">Famille</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="thalasso">Bien-être</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="romance">Romance</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="circuit">Découverte</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="sejour" style="margin-left:10px">Week-end</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="prestige">Prestige</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="all" style="margin-left:10px">Tous</a></li></ul>').appendTo(menu)

			choix_menu = "voyages"
			choix_sous_menu = "coeur"

			$("#main").empty()
			if (id_localisation != "") {

				$('#main').empty()
				jQuery('<img id="loadingMain" src="../images/ajax-loader.gif" alt="Chargement en cours..." title="Chargement en cours..." />').appendTo("#main")
				var vecteur = $("#periode_select").attr('value').toString().split(" ");
				var mois_debut = vecteur[0]
				var annee_debut = vecteur[1]

				urlFonction = "/Alloa/get_liste_hotels?r=" + id_localisation + "&sm=" + choix_sous_menu + "&mois=" + mois_debut +"&annee=" + annee_debut
				urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
				$.ajax({
					type: "GET",
					url: urlFonction,
					success: function(retour){
						$("#main #loadingMain").remove()
						$("#main").append(retour)
						tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
						click_article()
					}
				})
			}else{
				$("#main").append("<div class='article'>Choisissez une destination</div>")
			}
			// on enlève la coloration sur tous les onglets
			$('#onglets a.active').attr('class', 'passive')
			// on colorie l'onglet actif
			$("a#voyages").attr('class', 'active')
			click_element_menu()
			return false
		})

		$("#lienVoyagesClub").click(function() {
			var menu = $('#menu')
			menu.empty()
			jQuery('<ul><li><a class="element_menu" href="" id="coeur">Nos favoris</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="club">Club</a></li>').appendTo(menu).css('font-weight', 'bold').css('text-decoration', 'underline')
			jQuery('<li><a class="element_menu" href="" id="famille">Famille</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="thalasso">Bien-être</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="romance">Romance</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="circuit">Découverte</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="sejour" style="margin-left:10px">Week-end</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="prestige">Prestige</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="all" style="margin-left:10px">Tous</a></li></ul>').appendTo(menu)


			choix_menu = "voyages"
			choix_sous_menu = "sejour"


			$("#main").empty()
			if (id_localisation != "") {
				$('#main').empty()
				jQuery('<img id="loadingMain" src="../images/ajax-loader.gif" alt="Chargement en cours..." title="Chargement en cours..." />').appendTo("#main")
				var vecteur = $("#periode_select").attr('value').toString().split(" ");
				var mois_debut = vecteur[0]
				var annee_debut = vecteur[1]

				urlFonction = "/Alloa/get_liste_hotels?r=" + id_localisation + "&sm=" + choix_sous_menu + "&mois=" + mois_debut +"&annee=" + annee_debut
				urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
				$.ajax({
					type: "GET",
					url: urlFonction,
					success: function(retour){
						$("#main #loadingMain").remove()
						$("#main").append(retour)
						tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
						click_article()
					}
				})
			}else{
				$("#main").append("<div class='article'>Choisissez une destination</div>")
			}
			// on enlève la coloration sur tous les onglets
			$('#onglets a.active').attr('class', 'passive')
			// on colorie l'onglet actif
			$("a#voyages").attr('class', 'active')
			click_element_menu()
			return false
		})
		$("#lienVoyagesFamille").click(function() {
			var menu = $('#menu')
			menu.empty()
			jQuery('<ul><li><a class="element_menu" href="" id="coeur">Nos favoris</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="club">Club</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="famille">Famille</a></li>').appendTo(menu).css('font-weight', 'bold').css('text-decoration', 'underline')
			jQuery('<li><a class="element_menu" href="" id="thalasso">Bien-être</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="romance">Romance</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="circuit">Découverte</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="sejour" style="margin-left:10px">Week-end</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="prestige">Prestige</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="all" style="margin-left:10px">Tous</a></li></ul>').appendTo(menu)


			choix_menu = "voyages"
			choix_sous_menu = "club"

			$("#main").empty()
			if (id_localisation != "") {
				$('#main').empty()
				jQuery('<img id="loadingMain" src="../images/ajax-loader.gif" alt="Chargement en cours..." title="Chargement en cours..." />').appendTo("#main")
				var vecteur = $("#periode_select").attr('value').toString().split(" ");
				var mois_debut = vecteur[0]
				var annee_debut = vecteur[1]

				urlFonction = "/Alloa/get_liste_hotels?r=" + id_localisation + "&sm=" + choix_sous_menu + "&mois=" + mois_debut +"&annee=" + annee_debut
				urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
				$.ajax({
					type: "GET",
					url: urlFonction,
					success: function(retour){
						$("#main #loadingMain").remove()
						$("#main").append(retour)
						tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
						click_article()
					}
				})
			}else{
				$("#main").append("<div class='article'>Choisissez une destination</div>")
			}
			// on enlève la coloration sur tous les onglets
			$('#onglets a.active').attr('class', 'passive')
			// on colorie l'onglet actif
			$("a#voyages").attr('class', 'active')
			click_element_menu()
			return false
		})
		$("#lienVoyagesThalasso").click(function() {
			var menu = $('#menu')
			menu.empty()
			jQuery('<ul><li><a class="element_menu" href="" id="coeur">Nos favoris</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="club">Club</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="famille">Famille</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="thalasso">Bien-être</a></li>').appendTo(menu).css('font-weight', 'bold').css('text-decoration', 'underline')
			jQuery('<li><a class="element_menu" href="" id="romance">Romance</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="circuit">Découverte</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="sejour" style="margin-left:10px">Week-end</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="prestige">Prestige</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="all" style="margin-left:10px">Tous</a></li></ul>').appendTo(menu)


			choix_menu = "voyages"
			choix_sous_menu = "prestige"

			$("#main").empty()
			if (id_localisation != "") {
				$('#main').empty()
				jQuery('<img id="loadingMain" src="../inamemages/ajax-loader.gif" alt="Chargement en cours..." title="Chargement en cours..." />').appendTo("#main")
				var vecteur = $("#periode_select").attr('value').toString().split(" ");
				var mois_debut = vecteur[0]
				var annee_debut = vecteur[1]

				urlFonction = "/Alloa/get_liste_hotels?r=" + id_localisation + "&sm=" + choix_sous_menu + "&mois=" + mois_debut +"&annee=" + annee_debut
				urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
				$.ajax({
					type: "GET",
					url: urlFonction,
					success: function(retour){
						$("#main #loadingMain").remove()
						$("#main").append(retour)
						tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
						click_article()
					}
				})
			}else{
				$("#main").append("<div class='article'>Choisissez une destination</div>")
			}
			// on enlève la coloration sur tous les onglets
			$('#onglets a.active').attr('class', 'passive')
			// on colorie l'onglet actif
			$("a#voyages").attr('class', 'active')
			click_element_menu()
			return false
		})
		$("#lienVoyagesRomance").click(function() {
			var menu = $('#menu')
			menu.empty()
			jQuery('<ul><li><a class="element_menu" href="" id="coeur">Nos favoris</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="club">Club</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="famille">Famille</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="thalasso">Bien-être</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="romance">Romance</a></li>').appendTo(menu).css('font-weight', 'bold').css('text-decoration', 'underline')
			jQuery('<li><a class="element_menu" href="" id="circuit">Découverte</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="sejour" style="margin-left:10px">Week-end</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="prestige">Prestige</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="all" style="margin-left:10px">Tous</a></li></ul>').appendTo(menu)


			choix_menu = "voyages"
			choix_sous_menu = "relaxation"

			$("#main").empty()
			if (id_localisation != "") {
				$('#main').empty()
				jQuery('<img id="loadingMain" src="../images/ajax-loader.gif" alt="Chargement en cours..." title="Chargement en cours..." />').appendTo("#main")
				var vecteur = $("#periode_select").attr('value').toString().split(" ");
				var mois_debut = vecteur[0]
				var annee_debut = vecteur[1]

				urlFonction = "/Alloa/get_liste_hotels?r=" + id_localisation + "&sm=" + choix_sous_menu + "&mois=" + mois_debut +"&annee=" + annee_debut
				urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
				$.ajax({
					type: "GET",
					url: urlFonction,
					success: function(retour){
						$("#main #loadingMain").remove()
						$("#main").append(retour)
						tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
						click_article()
					}
				})
			}else{
				$("#main").append("<div class='article'>Choisissez une destination</div>")
			}
			// on enlève la coloration sur tous les onglets
			$('#onglets a.active').attr('class', 'passive')
			// on colorie l'onglet actif
			$("a#voyages").attr('class', 'active')
			click_element_menu()
			return false
		})
		$("#lienVoyagesCircuit").click(function() {
			var menu = $('#menu')
			menu.empty()
			jQuery('<ul><li><a class="element_menu" href="" id="coeur">Nos favoris</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="club">Club</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="famille">Famille</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="thalasso">Bien-être</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="romance">Romance</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="circuit">Découverte</a></li>').appendTo(menu).css('font-weight', 'bold').css('text-decoration', 'underline')
			jQuery('<li><a class="element_menu" href="" id="sejour" style="margin-left:10px">Week-end</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="prestige">Prestige</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="all" style="margin-left:10px">Tous</a></li></ul>').appendTo(menu)


			choix_menu = "voyages"
			choix_sous_menu = "all"

			$("#main").empty()
			if (id_localisation != "") {
				$('#main').empty()
				jQuery('<img id="loadingMain" src="../images/ajax-loader.gif" alt="Chargement en cours..." title="Chargement en cours..." />').appendTo("#main")
				var vecteur = $("#periode_select").attr('value').toString().split(" ");
				var mois_debut = vecteur[0]
				var annee_debut = vecteur[1]

				urlFonction = "/Alloa/get_liste_hotels?r=" + id_localisation + "&sm=" + choix_sous_menu + "&mois=" + mois_debut +"&annee=" + annee_debut
				urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
				$.ajax({
					type: "GET",
					url: urlFonction,
					success: function(retour){
						$("#main #loadingMain").remove()
						$("#main").append(retour)
						tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
						click_article()
					}
				})
			}else{
				$("#main").append("<div class='article'>Choisissez une destination</div>")
			}
			// on enlève la coloration sur tous les onglets
			$('#onglets a.active').attr('class', 'passive')
			// on colorie l'onglet actif
			$("a#voyages").attr('class', 'active')
			click_element_menu()
			return false
		})
		$("#lienVoyagesSejour").click(function() {
			var menu = $('#menu')
			menu.empty()
			jQuery('<ul><li><a class="element_menu" href="" id="coeur">Nos favoris</a></li>')
			jQuery('<li><a class="element_menu" href="" id="club">Club</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="famille">Famille</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="thalasso">Bien-être</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="romance">Romance</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="circuit">Découverte</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="sejour" style="margin-left:10px">Week-end</a></li>').appendTo(menu)
			$("#sejour").css('font-weight', 'bold').css('text-decoration', 'underline')
			jQuery('<li><a class="element_menu" href="" id="prestige">Prestige</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="all" style="margin-left:10px">Tous</a></li></ul>').appendTo(menu)


			choix_menu = "voyages"
			choix_sous_menu = "all"

			$("#main").empty()
			if (id_localisation != "") {
				$('#main').empty()
				jQuery('<img id="loadingMain" src="../images/ajax-loader.gif" alt="Chargement en cours..." title="Chargement en cours..." />').appendTo("#main")
				var vecteur = $("#periode_select").attr('value').toString().split(" ");
				var mois_debut = vecteur[0]
				var annee_debut = vecteur[1]

				urlFonction = "/Alloa/get_liste_hotels?r=" + id_localisation + "&sm=" + choix_sous_menu + "&mois=" + mois_debut +"&annee=" + annee_debut
				urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
				$.ajax({
					type: "GET",
					url: urlFonction,
					success: function(retour){
						$("#main #loadingMain").remove()
						$("#main").append(retour)
						tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
						click_article()
					}
				})
			}else{
				$("#main").append("<div class='article'>Choisissez une destination</div>")
			}
			// on enlève la coloration sur tous les onglets
			$('#onglets a.active').attr('class', 'passive')
			// on colorie l'onglet actif
			$("a#voyages").attr('class', 'active')
			click_element_menu()
			return false
		})
		$("#lienVoyagesPrestige").click(function() {
			var menu = $('#menu')
			menu.empty()
			jQuery('<ul><li><a class="element_menu" href="" id="coeur">Nos favoris</a></li>')
			jQuery('<li><a class="element_menu" href="" id="club">Club</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="famille">Famille</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="thalasso">Bien-être</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="romance">Romance</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="circuit">Découverte</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="sejour" style="margin-left:10px">Week-end</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="prestige">Prestige</a></li>').appendTo(menu).css('font-weight', 'bold').css('text-decoration', 'underline')
			jQuery('<li><a class="element_menu" href="" id="all" style="margin-left:10px">Tous</a></li></ul>').appendTo(menu)


			choix_menu = "voyages"
			choix_sous_menu = "all"

			$("#main").empty()
			if (id_localisation != "") {
				$('#main').empty()
				jQuery('<img id="loadingMain" src="../images/ajax-loader.gif" alt="Chargement en cours..." title="Chargement en cours..." />').appendTo("#main")
				var vecteur = $("#periode_select").attr('value').toString().split(" ");
				var mois_debut = vecteur[0]
				var annee_debut = vecteur[1]

				urlFonction = "/Alloa/get_liste_hotels?r=" + id_localisation + "&sm=" + choix_sous_menu + "&mois=" + mois_debut +"&annee=" + annee_debut
				urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
				$.ajax({
					type: "GET",
					url: urlFonction,
					success: function(retour){
						$("#main #loadingMain").remove()
						$("#main").append(retour)
						tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
						click_article()
					}
				})
			}else{
				$("#main").append("<div class='article'>Choisissez une destination</div>")
			}
			// on enlève la coloration sur tous les onglets
			$('#onglets a.active').attr('class', 'passive')
			// on colorie l'onglet actif
			$("a#voyages").attr('class', 'active')
			click_element_menu()
			return false
		})
		$("#lienVoyagesTous").click(function() {
			var menu = $('#menu')
			menu.empty()
			jQuery('<ul><li><a class="element_menu" href="" id="coeur">Nos favoris</a></li>')
			jQuery('<li><a class="element_menu" href="" id="club">Club</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="famille">Famille</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="thalasso">Bien-être</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="romance">Romance</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="circuit">Découverte</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="sejour" style="margin-left:10px">Week-end</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="prestige">Prestige</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" id="all" style="margin-left:10px">Tous</a></li></ul>').appendTo(menu)
			//pour ne pas souligner les espaces avant le lien
			$("#all").css('font-weight', 'bold').css('text-decoration', 'underline')

			choix_menu = "voyages"
			choix_sous_menu = "all"

			$("#main").empty()
			if (id_localisation != "") {
				$('#main').empty()
				jQuery('<img id="loadingMain" src="../images/ajax-loader.gif" alt="Chargement en cours..." title="Chargement en cours..." />').appendTo("#main")
				var vecteur = $("#periode_select").attr('value').toString().split(" ");
				var mois_debut = vecteur[0]
				var annee_debut = vecteur[1]

				urlFonction = "/Alloa/get_liste_hotels?r=" + id_localisation + "&sm=" + choix_sous_menu + "&mois=" + mois_debut +"&annee=" + annee_debut
				urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
				$.ajax({
					type: "GET",
					url: urlFonction,
					success: function(retour){
						$("#main #loadingMain").remove()
						$("#main").append(retour)
						tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
						click_article()
					}
				})
			}else{
				$("#main").append("<div class='article'>Choisissez une destination</div>")
			}
			// on enlève la coloration sur tous les onglets
			$('#onglets a.active').attr('class', 'passive')
			// on colorie l'onglet actif
			$("a#voyages").attr('class', 'active')
			click_element_menu()
			return false
		})


		$("#lienCroisieresCoeur").click(function() {
			var menu = $('#menu')
			menu.empty()
			jQuery('<ul><li><a class="element_menu" href="" name="coeur">Nos coups de coeur</a></li>').appendTo(menu).css('font-weight', 'bold').css('text-decoration', 'underline')
			jQuery('<li><a class="element_menu" href="" name="fluviale">Fluviale</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" name="maritime">Maritîme</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" name="alle">Toutes</a></li></ul>').appendTo(menu)

			choix_menu = "croisieres"
			choix_sous_menu = "coeur"

			var vecteur = $("#periode_select").attr('value').toString().split(" ");
			var mois_debut = vecteur[0]
			var annee_debut = vecteur[1]
			$("#main").empty()
			if (id_localisation != "") {
				$('#main').empty()
				jQuery('<img id="loadingMain" src="../images/ajax-loader.gif" alt="Chargement en cours..." title="Chargement en cours..." />').appendTo("#main")
				urlFonction = "/Alloa/get_liste_croisieres?r=" + id_localisation + "&sm=" + choix_sous_menu + "&mois=" + mois_debut +"&annee=" + annee_debut
				urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()

				$.ajax({
					type: "GET",
					url: urlFonction,
					success: function(retour){
						$("#main #loadingMain").remove()
						$("#main").append(retour)
						tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
						click_article()
					}
				})
			}else{
				$("#main").append("<div class='article'>Choisissez une destination</div>")
			}
			// on enlève la coloration sur tous les onglets
			$('#onglets a.active').attr('class', 'passive')
			// on colorie l'onglet actif
			$("a#croisieres").attr('class', 'active')
			click_element_menu()
			return false
		})
		$("#lienCroisieresFluviales").click(function() {
			var menu = $('#menu')
			menu.empty()
			jQuery('<ul><li><a class="element_menu" href="" name="coeur">Nos coups de coeur</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" name="fluviale">Fluviale</a></li>').appendTo(menu).css('font-weight', 'bold').css('text-decoration', 'underline')
			jQuery('<li><a class="element_menu" href="" name="maritime">Maritîme</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" name="alle">Toutes</a></li></ul>').appendTo(menu)

			choix_menu = "croisieres"
			choix_sous_menu = "fluviale"

			var vecteur = $("#periode_select").attr('value').toString().split(" ");
			var mois_debut = vecteur[0]
			var annee_debut = vecteur[1]
			$("#main").empty()
			if (id_localisation != "") {
				$('#main').empty()
				jQuery('<img id="loadingMain" src="../images/ajax-loader.gif" alt="Chargement en cours..." title="Chargement en cours..." />').appendTo("#main")
				urlFonction = "/Alloa/get_liste_croisieres?r=" + id_localisation + "&sm=" + choix_sous_menu + "&mois=" + mois_debut +"&annee=" + annee_debut
				urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()

				$.ajax({
					type: "GET",
					url: urlFonction,
					success: function(retour){
						$("#main #loadingMain").remove()
						$("#main").append(retour)
						tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
						click_article()
					}
				})
			}else{
				$("#main").append("<div class='article'>Choisissez une destination</div>")
			}
			// on enlève la coloration sur tous les onglets
			$('#onglets a.active').attr('class', 'passive')
			// on colorie l'onglet actif
			$("a#croisieres").attr('class', 'active')
			click_element_menu()
			return false
		})
		$("#lienCroisieresMaritimes").click(function() {
			var menu = $('#menu')
			menu.empty()
			jQuery('<ul><li><a class="element_menu" href="" name="coeur">Nos coups de coeur</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" name="fluviale">Fluviale</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" name="maritime">Maritîme</a></li>').appendTo(menu).css('font-weight', 'bold').css('text-decoration', 'underline')
			jQuery('<li><a class="element_menu" href="" name="alle">Toutes</a></li></ul>').appendTo(menu)

			choix_menu = "croisieres"
			choix_sous_menu = "maritime"

			var vecteur = $("#periode_select").attr('value').toString().split(" ");
			var mois_debut = vecteur[0]
			var annee_debut = vecteur[1]
			$("#main").empty()
			if (id_localisation != "") {
				$('#main').empty()
				jQuery('<img id="loadingMain" src="../images/ajax-loader.gif" alt="Chargement en cours..." title="Chargement en cours..." />').appendTo("#main")
				urlFonction = "/Alloa/get_liste_croisieres?r=" + id_localisation + "&sm=" + choix_sous_menu + "&mois=" + mois_debut +"&annee=" + annee_debut
				urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()

				$.ajax({
					type: "GET",
					url: urlFonction,
					success: function(retour){
						$("#main #loadingMain").remove()
						$("#main").append(retour)
						tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
						click_article()
					}
				})
			}else{
				$("#main").append("<div class='article'>Choisissez une destination</div>")
			}
			// on enlève la coloration sur tous les onglets
			$('#onglets a.active').attr('class', 'passive')
			// on colorie l'onglet actif
			$("a#croisieres").attr('class', 'active')
			click_element_menu()
			return false
		})
		$("#lienCroisieresToutes").click(function() {
			var menu = $('#menu')
			menu.empty()
			jQuery('<ul><li><a class="element_menu" href="" name="coeur">Nos coups de coeur</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" name="fluviale">Fluviale</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" name="maritime">Maritîme</a></li>').appendTo(menu)
			jQuery('<li><a class="element_menu" href="" name="alle">Toutes</a></li></ul>').appendTo(menu).css('font-weight', 'bold').css('text-decoration', 'underline')

			choix_menu = "croisieres"
			choix_sous_menu = "all"

			var vecteur = $("#periode_select").attr('value').toString().split(" ");
			var mois_debut = vecteur[0]
			var annee_debut = vecteur[1]
			$("#main").empty()
			if (id_localisation != "") {
				$('#main').empty()
				urlFonction = "/Alloa/get_liste_croisieres?r=" + id_localisation + "&sm=" + choix_sous_menu + "&mois=" + mois_debut +"&annee=" + annee_debut
				urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()

				$.ajax({
					type: "GET",
					url: urlFonction,
					success: function(retour){
						$("#main #loadingMain").remove()
						$("#main").append(retour)
						tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
						click_article()
					}
				})
			}else{
				$("#main").append("<div class='article'>Choisissez une destination</div>")
			}
			// on enlève la coloration sur tous les onglets
			$('#onglets a.active').attr('class', 'passive')
			// on colorie l'onglet actif
			$("a#croisieres").attr('class', 'active')
			click_element_menu()
			return false
		})
		click_element_menu()
	}*/


	/* ================================================================================================ */
	/* FONCTIONS UTILISATEUR */

	$('.client').hover(
		function() {
			$(".client").css('border','2px solid #d2e4fc');
		},
		function () {
		    $(".client").css('border','1px solid #fff1bf');
		}
	)

	/* Fonctions pour l'identification de l'utilisateur */
	$("#identifiant").keypress(function (e) {
		if (e.which == 13) {	//appui sur la touche "entrée", validation de l'authentification
			if (!document.getElementById('loadingMain')) {
				urlFonction = "/User/getConnexion"
				prm = "l=" + $("#identifiant").attr('value') + "&m=" + MD5($("#mot_de_passe").attr('value'))
				$.ajax({
					type: "POST",
					url: urlFonction,
					data: prm,
					success: function(retour){
						window.location.replace("/");
					}
				})
			}
			return false
		}
	})

	$("#mot_de_passe").keypress(function (e) {
		if (e.which == 13) {	//appui sur la touche "entrée", validation de l'authentification
			if (!document.getElementById('loadingMain')) {
				urlFonction = "/User/getConnexion"
				prm = "l=" + $("#identifiant").attr('value') + "&m=" + MD5($("#mot_de_passe").attr('value'))
				$.ajax({
					type: "POST",
					url: urlFonction,
					data: prm,
					success: function(retour){
						window.location.replace("/");
					}
				})
			}
			return false
		}
	})

	$("#valid_login").click(function () {
		//alert("valid")
		if (!document.getElementById('loadingMain')) {
			urlFonction = "/User/getConnexion"
			prm = "l=" + $("#identifiant").attr('value') + "&m=" + MD5($("#mot_de_passe").attr('value'))
			$.ajax({
				type: "POST",
				url: urlFonction,
				data: prm,
				success: function(retour){
					window.location.replace("/");
				}
			})
		}
		return false
	})


	/* Fonctions pour si le mdp est perdu par l'utilisateur */
	$("#mdpperdu").click(function() {
		if (!document.getElementById('loadingMain')) {
			$('#form_login').empty()
			$('#form_login').append("<label id='lbl_ident'>Veuillez entrer votre identifiant:</label><br /><form id='form_dmd_pwd' action='' method='post'>")
			$('#form_login').append('<input id="dmd_identifiant" type="text" name="login" size="10" value="Identifiant" />')
			$('#form_login').append('&nbsp;<input class="formLogin" id="valid_dmd_pwd" type="submit" value="Ok" /></form>')
			definition_fct_dmde_mdp()
		}

		return false
	})

	function definition_fct_dmde_mdp(){
			// Effacer le champ dmd_identifiant
		$('#dmd_identifiant').click(function() {
			$(this).attr('value', '')
		})

		$("#dmd_identifiant").keypress(function(e){
			if (e.which == 13) { //appui sur la touche "entrée", validation de l'authentification
				if (!document.getElementById('loadingMain')) {
					urlFonction = "/User/getSecretQuestion"
					prm = "l=" + $(this).attr('value')
					$.ajax({
						type: "POST",
						url: urlFonction,
						data: prm,
						success: function(retour){
							$('#main').empty()
							$('#main').append(retour)
							definition_fct_dmde_reponse()
						}
					})
				}
				return false
			}
		})

		$("#valid_dmd_pwd").click(function(){
			if (!document.getElementById('loadingMain')) {
				urlFonction = "/User/getSecretQuestion"
				prm = "l=" + $("#dmd_identifiant").attr('value')
				$.ajax({
					type: "POST",
					url: urlFonction,
					data: prm,
					success: function(retour){
						$('#main').empty()
						$('#main').append(retour)
						definition_fct_dmde_reponse()
					}
				})
			}
			return false
		})
	}


	function definition_fct_dmde_reponse(){
			// Effacer le champ dmd_reponse
		$('#secret_answer').click(function() {
			$(this).attr('value', '')
		})

		$("#secret_answer").keypress(function(e){
			if (e.which == 13) { //appui sur la touche "entrée", validation de l'authentification
				if (!document.getElementById('loadingMain')) {
					urlFonction = "/User/getSecretAnswer"
					prm = "m=" + MD5($(this).attr('value'))
					$.ajax({
						type: "POST",
						url: urlFonction,
						data: prm,
						success: function(retour){
							$('#main').empty()
							$('#main').append(retour)
							definition_fct_nv_mdp()
						}
					})
				}
				return false
			}
		})

		$("#valid_answer").click(function(){
			if (!document.getElementById('loadingMain')) {
				urlFonction = "/User/getSecretAnswer"
				prm = "m=" + MD5($("#secret_answer").attr('value'))
				$.ajax({
					type: "POST",
					url: urlFonction,
					data: prm,
					success: function(retour){
						$('#main').empty()
						$('#main').append(retour)
						definition_fct_nv_mdp()
					}
				})
			}
			return false
		})
	}


	function definition_fct_nv_mdp(){

		$("#new_pwd").keypress(function(e){
			if (e.which == 13) { //appui sur la touche "entrée", validation de l'authentification
				if (!document.getElementById('loadingMain')) {
					if($(this).attr('value') == $("#conf_new_pwd").attr('value')){
						if ($(this).attr('value') == "") {
							alert("Votre mot de passe ne doit pas être vide.")
						}
						else {
							if ($(this).attr('value').indexOf(" ") != -1 || $(this).attr('value').indexOf('"') != -1 || $(this).attr('value').indexOf("'") != -1 ||
							$(this).attr('value').indexOf("\\") != -1 || $(this).attr('value').indexOf("/") != -1) {
								alert('Les caractères ", \', /, \\ et l\'espace sont interdits pour les mots de passe.')
							}
							else {
								urlFonction = "/User/setNewPassword"
								prm = "m=" + MD5($(this).attr('value'))

								$.ajax({
									type: "POST",
									url: urlFonction,
									data: prm,
									success: function(retour){
										alert("Votre mot de passe a été modifié")
										window.location.replace("/");
									}
								})
							}
						}
					}else{
						alert("Votre confirmation de mot de passe doit être identique au premier mot de passe entré.")
					}
				}
				return false
			}
		})

		$("#conf_new_pwd").keypress(function(e){
			if (e.which == 13) { //appui sur la touche "entrée", validation de l'authentification
				if (!document.getElementById('loadingMain')) {
					if($(this).attr('value') == $("#new_pwd").attr('value')){
						if ($(this).attr('value') == "") {
							alert("Votre mot de passe ne doit pas être vide.")
						}
						else {
							if ($(this).attr('value').indexOf(" ") != -1 || $(this).attr('value').indexOf('"') != -1 || $(this).attr('value').indexOf("'") != -1 ||
							$(this).attr('value').indexOf("\\") != -1 || $(this).attr('value').indexOf("/") != -1) {
								alert('Les caractères ", \', /, \\ et l\'espace sont interdits pour les mots de passe.')
							}
							else {
								urlFonction = "/User/setNewPassword"
								prm = "m=" + MD5($(this).attr('value'))

								$.ajax({
									type: "POST",
									url: urlFonction,
									data: prm,
									success: function(retour){
										alert("Votre mot de passe a été modifié")
										window.location.replace("/");
									}
								})
							}
						}
						urlFonction = "/User/setNewPassword"
						prm = "m=" + MD5($(this).attr('value'))

						$.ajax({
							type: "POST",
							url: urlFonction,
							data: prm,
							success: function(retour){
								$('#main').empty()
								$('#main').append(retour)
							}
						})
					}else{
						alert("Votre confirmation de mot de passe doit être identique au premier mot de passe entré.")
					}
				}
				return false
			}
		})

		$("#valid_new_pwd").click(function(){
			if (!document.getElementById('loadingMain')) {
				if($("#conf_new_pwd").attr('value') == $("#new_pwd").attr('value')){
					if ($("#new_pwd").attr('value') == "") {
						alert("Votre mot de passe ne doit pas être vide.")
					}
					else {
						if ($("#new_pwd").attr('value').indexOf(" ") != -1 || $("#new_pwd").attr('value').indexOf('"') != -1 || $("#new_pwd").attr('value').indexOf("'") != -1 ||
						$("#new_pwd").attr('value').indexOf("\\") != -1 || $("#new_pwd").attr('value').indexOf("/") != -1) {
							alert('Les caractères ", \', /, \\ et l\'espace sont interdits pour les mots de passe.')
						}
						else {
							urlFonction = "/User/setNewPassword"
							prm = "m=" + MD5($("#new_pwd").attr('value'))

							$.ajax({
								type: "POST",
								url: urlFonction,
								data: prm,
								success: function(retour){
									alert("Votre mot de passe a été modifié")
									window.location.replace("/");
								}
							})
						}
					}
				}else{
					alert("Votre confirmation de mot de passe doit être identique au premier mot de passe entré.")
				}
			}
			return false
		})
	}

	function validerCreationCompte(){
		$("#deplier").click(function(){
			suite = $("#options")
			display = suite.css('display')
			if (display == 'none') {
				suite.show("normal")
				$(this).html('<<< Plier')
			}
			else {
				suite.hide("normal")
				$(this).html('Deplier >>>')
			}
			return false
		})
		$("#deplier2").click(function(){
			suite = $("#options2")
			display = suite.css('display')
			if (display == 'none') {
				suite.show("normal")
				$(this).html('<<< Plier')
			}
			else {
				suite.hide("normal")
				$(this).html('Deplier >>>')
			}
			return false
		})
		$("#valider").click(function() {
			var formulaire_valide = true
			$(".oblig").each(function() {
				var val = $(this).attr("value")
				if (jQuery.trim(val) == "") {
					formulaire_valide = false
					$(this).css("background-color", "red").attr("value", "Champ requis")
				}
				else {
					$(this).css("background-color", "#f0f6fa")
				}
			})
			$(".oblig").click(function() {
				$(this).css("background-color", "#f0f6fa")
			})
			$(".oblig").blur(function() {
				$(this).css("background-color", "#f0f6fa")
			})
			if ($("#nom").attr("value")=="" && $("#prenom").attr("value")=="" && $("#raisonsociale").attr("value")==""){
				formulaire_valide=false
				$("#nom").css("background-color", "yellow")
				$("#raisonsociale").css("background-color", "yellow")
				$("#prenom").css("background-color", "yellow")
				}
			$("#nom").click(function() {
				$(this).css("background-color", "#ffffff")
			})
			$("#prenom").click(function() {
				$(this).css("background-color", "#ffffff")
			})
			$("#raisonsociale").click(function() {
				$(this).css("background-color", "#ffffff")
			})

			if (formulaire_valide) {
				alert("form valid")
				formulaire_valide = false
				//insertion dans la bdd
				var salutations = $("#salutations").attr('value')
				var nom = $("#nom").attr('value')
				var raisonsociale = $("#raisonsociale").attr('value')
				var tel_mobile = $("#tel_mobile").attr('value')
				var adresse = $("#adresse").attr('value')
				var codpostal = $("#codpostal").attr('value')
				var ville = $("#ville").attr('value')
				var codpays = $("#codpays").attr('value')
				var facture_adresse = $("#facture_adresse").attr('value')
				var facture_codpostal = $("#facture_codpostal").attr('value')
				var facture_ville = $("#facture_ville").attr('value')
				var facture_codpays = $("#facture_codpays").attr('value')
				var prenom = $("#prenom").attr('value')
				var tel_maison = $("#tel_maison").attr('value')
				var email = $("#email").attr('value')
				var livraison_adresse = $("#livraison_adresse").attr('value')
				var livraison_codpostal = $("#livraison_codpostal").attr('value')
				var livraison_ville = $("#livraison_ville").attr('value')
				var livraison_codpays = $("#livraison_codpays").attr('value')
				var mediasource = $("#mediasource").attr('value')

				var requete = "/Valider/validerNouveauCompte"
				var prm = "nom="+nom+"&salutations="+salutations+"&raisonsociale="+raisonsociale+"&tel_mobile="+tel_mobile+"&adresse="+adresse+"&codpostal="+codpostal+"&ville="+ville+"&codpays="+codpays+"&facture_adresse="+facture_adresse+"&facture_codpostal="+facture_codpostal+"&facture_ville="+facture_ville+"&facture_codpays="+facture_codpays+"&prenom="+prenom+"&tel_maison="+tel_maison+"&email="+email+"&livraison_adresse="+livraison_adresse+"&livraison_codpostal="+livraison_codpostal+"&livraison_ville="+livraison_ville+"&livraison_codpays="+livraison_codpays+"&mediasource="+mediasource
				alert(prm)
				$("#main").empty()
				$.ajax({
					type: "POST",
					url: requete,
					data: prm,
					success: function(retour){
						alert(retour)
						$("#main").append(retour)
						validerCreationCompte()
						selectionClient()
					}
				})
			}
			return false
		})
	}

	function creerCompteClient(){
		$("#nouveauCompte").click(function(){
			if (!document.getElementById('loadingMain')) {
				$("#main").empty()
				$.ajax({
					type: "GET",
					url: "/Valider/nouveauCompteClient",
					success: function(retour){
						$("#main").append(retour)
						validerCreationCompte()
						}
					})
				}
				return false
			})
		}
	//fonction pour afficher le compte de l'utilisateur
	$("#monCompte").click(function(){
		$('#main').empty()
		$.ajax({
			type: "GET",
			url: "/User/getUserCompte",
			success: function(retour){
				$("#main").empty()
				$("#main").append(retour)
				getPanier()
			}
		})

		return false
	})

	//------------------------fct changer pwd et consulter le panier----------------------------------- --ici--

	function getPanier()
		{
					// fonction pour consulter le panier a partir de mon compte
					$("#consulte_panier2").click(function()
					{
						$('#main').empty()
							jQuery('<img id="loadingMain" src="../images/ajax-loader.gif" alt="Chargement en cours..." title="Chargement en cours..." />').appendTo("#main")

							$.ajax({
								type: "GET",
								url: "/User/getUserPanier",
								success: function(retour){
									$("#main").empty()
									$("#main").append(retour)
									validerPanier()
									fct_del_caddie()
									fct_broch() //##hi
								}
							})
						return false
					})

					// fonction pour changer le MDP a prtir de mon compte

					$("#change_pwd").click(function()
					{

								urlFonction = "/User/getNewpwd"
								$.ajax({
											type: "GET",
											url: urlFonction,
											success: function(retour)
											{
												$("#main").empty()
												$("#main").append(retour)
												definition_fct_nv_mdp()
											}
									})
					  return false
					})
		}

	//--------------------------------------------------------------------------

	function selectionClient(){
		$(".client").click(function(){
			if (!document.getElementById('loadingMain')) {
			$("#main").empty()
			url="/Valider/etape2?r="+$(this).attr('name')
			$.ajax({
				type: "GET",
				url: url,
				success: function(retour){
					$("#main").append(retour)
					}
				})
			}
			return false
		})
	}

	function validerPanier(){
		$("#validerPanier").click(function(){
		if (!document.getElementById('loadingMain')) {
			$("#main").empty()
			$.ajax({
				type: "GET",
				url: "/Valider/etape1",
				success: function(retour){
					$("#main").append(retour)
					selectionClient()
					creerCompteClient()
					}
				})
			}
		return false
		})
	}

	$("#consultPanier").click(function(){
			$('#main').empty()
			jQuery('<img id="loadingMain" src="../images/ajax-loader.gif" alt="Chargement en cours..." title="Chargement en cours..." />').appendTo("#main")

			$.ajax({
				type: "GET",
				url: "/User/getUserPanier",
				success: function(retour){
					$("#main").empty()
					$("#main").append(retour)
					validerPanier()
					fct_del_caddie()
					fct_broch() //  ###hi
				}
			})
		return false
	})

	function fct_del_caddie(){
		$(".supressionCaddie").click(function() {
			isConf = confirm("Vous allez retirer ce voyage de votre panier.")
			if (isConf){
				ref_panier = $(this).attr('name')
				url_fct = "/User/deleteItemPanier?r=" + ref_panier
				$.ajax({
					type: "GET",
					url: url_fct,
					success: function(retour){
						$("#main").empty()
						$("#main").append(retour)
						fct_del_caddie()
					}
				})
			}
			return false
		})
	}
	function fct_broch(){ // ###hi
		$(".brch").click(function()
		{
			var vecteur = $("#periode_select").attr('value').toString().split(" ");
			var mois_debut = vecteur[0]
			var annee_debut = vecteur[1]
			var mot = $(this).attr('name').toString().split(" ");
			lien ="/Alloa/get_hotel_broch?w="+mot+ "&mois=" + mois_debut + "&annee=" + annee_debut
			lien += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase() + "&sm=" + choix_sous_menu
			window.open(lien, "Brochure", 'location=0, width=800, height=400, status=no, scrollbars=yes, menubar=no, fullscreen=no')
			return false
		})
	}


	//----------------- configuration de la page d'accueil ------------------

	// Menu voyage par défaut
	var menu = $('#menu')
	/*
	jQuery('<ul><li><a class="element_menu" href="" id="coeur">Nos favoris</a></li>').appendTo(menu).css('font-weight', 'bold').css('text-decoration', 'underline')
	jQuery('<li><a class="element_menu" href="" id="club">Club</a></li>').appendTo(menu)
	jQuery('<li><a class="element_menu" href="" id="famille">Famille</a></li>').appendTo(menu)
	jQuery('<li><a class="element_menu" href="" id="thalasso">Bien-être</a></li>').appendTo(menu)
	jQuery('<li><a class="element_menu" href="" id="romance">Romance</a></li>').appendTo(menu)
	jQuery('<li><a class="element_menu" href="" id="circuit">Découverte</a></li>').appendTo(menu)
	jQuery('<li><a class="element_menu" href="" id="sejour" style="margin-left:10px">Week-end</a></li>').appendTo(menu)
	jQuery('<li><a class="element_menu" href="" id="prestige">Prestige</a></li>').appendTo(menu)
	jQuery('<li><a class="element_menu" href="" id="all" style="margin-left:10px">Tous</a></li></ul>').appendTo(menu)
	*/
	$("#dt_menu_sejour").css('font-weight', 'bold').css('text-decoration', 'underline')
	document.getElementById('dt_menu_sejour').boole=true;
	montre('smenu1')

	click_element_menu()

/*-----------------------------Page Daccueil-------------------------------------*/

	jQuery('<img id="loading" src="../images/ajax-loader.gif" alt="Chargement en cours..." />').appendTo("#country")

	requete = "/Alloa/get_liste_destinations?c=0"	//en mediterrannee
	jQuery('<div id="pays" style="line-height: 12pt"></div>').load(requete, {}, function(res, stat, xml) {
				$("#country #loading").remove()
				$(this).appendTo("#country").show("normal")
				$("#1a").css('font-weight', 'bold')
				click_pays()
	})

	//*** rempli la combo box des périodes
	i=0
	mois_tmp = date_cbo_box.getMonth()
	annee_tmp = date_cbo_box.getFullYear()
	tbl_mois = ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"]

	contenu_cbo_box = tbl_mois[mois_tmp] + annee_tmp
	for (i = 0; i < 18; i++) {
		contenu_cbo_box = tbl_mois[mois_tmp] + " " + annee_tmp
		$("#periode_select").append("<option value='" + (mois_tmp+1) + " " + annee_tmp + "' id='"+ annee_tmp +"'>"+ contenu_cbo_box +"</option>")
		mois_tmp ++
		if (mois_tmp == 12) {
			mois_tmp = 0
			annee_tmp ++
		}
	}

	//**** affiche les hotels de la page

	var vector = $("#periode_select").attr('value').toString().split(" ");
	var monthe = vector[0]
	var yer = vector[1]

	urlFonction = "/Continent/getPageContinent?c=0&mois=" + monthe +"&annee=" + yer
	urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase()

	$("#main").empty()
	//alert(urlFonction)
	$.ajax({
		type : "GET",
		url: urlFonction ,
		success:function(retour){

			$("#main").append(retour)
			$("#main #loadingMain").remove()
			tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
			click_article()
		}
	})

	//affiche l'emplacement en dessous du menu, au dessus du sous-menu
	chaineSituation = "<span class='situation_continent'> à votre agence Alloa </span>"
	$("#situation").empty()
	$("#situation").append(chaineSituation)

	urlFonction = "/Continent/getDescContinent?c=0"
			$.ajax({
				type: "GET",
				url: urlFonction,
				success: function(retour){
					$("#situation").append(retour)
					click_situation()
				}
			})

			/*----------------------------------Fin Page Daccueil-------------------------------------------------*/
	//-------------------------------vous recherchez---------------------------------------------

	$("#vos_rech").empty()
	$("#vos_rech").append("Séjours")
	$("#s_choix").empty()
	$("#s_choix").append(" > Nos Favoris ,  pour un départ de "+$("#depart_ville_select").attr('value'))
	var vect = $("#periode_select").attr('value').toString().split(" ");
	$("#s_choix").append(" dans la pèriode "+tab_mois[vect[0]]+" - "+vect[1])

	//----------------------------------------------------------------------------
	//===============================================RESERVATION===========================================================

	function res()
	{
		$('#reserv').click(function()
		{

		if (!document.getElementById('loading'))
			{

				var vecteur = $("#periode_select").attr('value').toString().split(" ");
				var mois_debut = vecteur[0]
				var annee_debut = vecteur[1]

				if (choix_menu == "voyages") {

					urlFonction = "/User/getFormReservationHebergement?h=" + $(this).attr('name').toString() + "&hp"
					//alert(urlFonction)
				}
				else if (choix_menu == "croisieres") {
					//alert("croisieres")
					//rechercher les croisières et non les hotels
					urlFonction = "/User/getFormReservationCroisiere?h=" + $(this).attr('name').toString() + "&hp=&mois=" + mois_debut
					urlFonction +=  "&annee=" + annee_debut+"&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
				}
				else if (choix_menu == "circuits") {
					//alert("circuits")
					//rechercher les circuits
					urlFonction = "/User/getFormReservationCircuit?h=" + $(this).attr('name').toString() + "&hp=&mois=" + mois_debut
					urlFonction +=  "&annee=" + annee_debut+"&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
				}
				else{
					//rechercher les locations
					urlFonction = "/User/getFormReservationLocation?h=" + $(this).attr('name').toString() + "&hp=&mois=" + mois_debut
					urlFonction +=  "&annee=" + annee_debut+"&ville=" + $("#depart_ville_select").attr('value').toLowerCase()
				}

				  $.ajax({
					type : "GET",
					url: urlFonction ,
					success:function(retour)
							{
							}
						})

			}
			return false
		  })
		}




	//=====================================================================================================================



});

