
function fonction_slider(uuid, is_hotel, uuidimg)
{
  var height_slide = (screen.height - 500)/2;
  var width_slide = (screen.width - 500)/2;
  slide = window.open('../web_page/popup.html' ,'', 'resizable=no, location=no, width=530, height=520, status=no, scrollbars=no, menubar=no, fullscreen=no')
  slide.moveTo(width_slide, height_slide)
  urlFonction = '/Slider/getSliderPage?u=' + uuid + '&h=' + is_hotel + '&i=' + uuidimg
  $.ajax({
    type: "GET",
    url: urlFonction,
    success: function(retour){
    slide.document.write(retour)
    }
  })
}

function logout()
{
  urlFonction = '/User/logout'
  $.ajax({
    type: "GET",
    url: urlFonction,
    async: false,
    success: function(retour)
    {
    }
  })
}

$(document).ready(function() {
//------------------------------------------------ CONNEXION --------------------------------------
$('#login_connect').click(function()
{
  var login = $('#home_login').attr('value')
  var password = MD5($('#home_password').attr('value'))
  if (login.indexOf("'") != -1 || login.indexOf("\\") != -1 || login.indexOf('"') != -1 || login.indexOf(" ") != -1 || login.indexOf("/") != -1)
    {
      alert ('Un login ne peut pas contenir les caractères ", \', /, \\ et l\'espace.')
      return
    }
  urlFonction = '/User/getConnexion?l=' + login + '&m=' + password
  $.ajax({
    type: "GET",
    url: urlFonction,
    success: function(retour)
    {
      if (retour == 'error')
      {
        alert('Connexion échoué, couple login/mot de passe incorrect.')
      }
      else
      {
        $('#espaceperso').empty()
        $('#espaceperso').append(retour)
      }
    }
  })
})

//----------------------------------------------// criteres de recherches----------------------------------------------------

$('.menu_type').click(function()
{
  if ($(this).attr('value') == 'Croisieres' || $(this).attr('value') == 'Circuits')
  {
    var opt_div = document.getElementById('moreOptionSejour')
    if (opt_div.style.display != 'none' && opt_div.style.display != '')
    {
      opt_div.style.display = 'none'
      document.getElementById('moreOptionTour').style.display = 'block'
    }
  }
  else
  {
    var opt_div = document.getElementById('moreOptionTour')
    if (opt_div.style.display != 'none' && opt_div.style.display != '')
    {
      opt_div.style.display = 'none'
      document.getElementById('moreOptionSejour').style.display = 'block'
    }
  }
  if (refcontinent == '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"]
    choix_menu = ""
    var tmp_choix_menu = document.getElementsByName('type')
    for (var cpt = 0; cpt < tmp_choix_menu.length; cpt++)
    {
      if (tmp_choix_menu[cpt].checked)
      {
        choix_menu = tmp_choix_menu[cpt].value
      }
    }
    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_0").append("<option value='" + (mois_tmp+1) + " " + annee_tmp + "' id='"+ annee_tmp +"'>"+ contenu_cbo_box +"</option>")
      $("#periode_select_1").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"+indice).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()
    urlFonction += "&choix_menu=" + choix_menu
  
    $("#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: 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()
      }
    })

  }
  else
  {
      $(".boutonRechercher").click()
  }
});

$('#moreOptionButton').click(function()
{
  document.getElementById('moreOptionSejour').style.display = 'none'
  document.getElementById('moreOptionTour').style.display = 'none'
  if ($(this).attr('value') == "Plus d'options")
  {
    var tmp = document.getElementsByName('type')
    for (var cpt = 0; cpt != tmp.length; cpt = cpt + 1)
    {
      if (tmp[cpt].checked)
      {
        if (tmp[cpt].value == 'Sejours')
        {
          document.getElementById('moreOptionSejour').style.display = 'block'
        }
        else if (tmp[cpt].value == 'Circuits' || tmp[cpt].value == 'Croisieres')
        {
          document.getElementById('moreOptionTour').style.display = 'block'
        }
      }
    }
    $(this).attr('value', 'Cacher')
  }
  else
  {
    $(this).attr('value', "Plus d'options")
  }
});
  
  //----------------------------------------------// 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 = "dans votre agence de voyages Alloa";// ##here
  var nom_pays = "";// ##here
  var nom_region = "" ;// ##here
  var id_localisation = "0";// ##here
  var refcontinent = "0";// ##here
  var continentVilles = "";
  var nom_menu = "menu_0";
  var choix_menu = "";
  var indice = "_0";
  var choix_liste = "iscat_selection";
  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 dmd_clic = false;
  var stringsitu = "";
  //-------------------------------------------------
//  var tab_menu = Array();

  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";


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

              /* ========================= FONCTIONS POUR LES LIENS THEMATIQUES ========================================= */

$(".lien_thematique").click(function() {
  urlFonction = "/Alloa/get_hotels_lien_thema?d=" + $(this).attr('name') + "&liste_choix=&mois=1&annee=1970"
  urlFonction += "&ville=lille_paris_bruxelles&n=0"

  $('#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: urlFonction ,
    success:function(retour){
      $('#main').empty()
      $("#main").append(retour)
      click_article()
    }
  })
  $("#situation").empty()
  $("#situation").append("<span class='situation_continent'> dans notre catégorie " + $(this).attr('href') + "</span>")
  urlFonction = "/Continent/getDescContinent?c=" + $(this).attr('name')
  $.ajax({
    type: "GET",
    url: urlFonction,
    async: false,
    success: function(retour){
      $("#situation").append(retour)
    }
  })
  $("#country"+indice).empty()
  $("#reg"+indice).empty()
  $("#country"+indice).append('<label class="titre">Choisissez votre pays: </label><br/>')
  requete = "/Alloa/get_liste_destinations?c=" + $(this).attr('name')
  jQuery('<select class="select" id="pays"></select>').load(requete, {}, function(res, stat, xml) {
        $("#country" +indice +" #loading").remove()
        $(this).appendTo("#country"+indice).show("normal")
        click_pays()
      })
  return false
  });

              /* ========================= 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_sous_menu == "sejours") {
            urlFonction = "/Alloa/get_liste_hotels?r=" + id_localisation + "&sm=" +choix_menu + "&date=" + date_depart + "&mois=" + mois_debut +"&annee=" + annee_debut
          }
//changer et mettre les tours a la place des croisieres
          else {
            //rechercher les croisières et non les hotels
            urlFonction = "/Alloa/get_liste_croisieres?r=" + id_localisation + "&sm=" + choix_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>")
        }
      }
      }
  });
  
            
 
 
/* onglet plus utiliser
   $('#onglet').click(function() {
    for (var i=0; i<2; i++) {
      nommenu=".menu" + i + " a"
      if($(nommenu).attr('class')=='current') {
        indice='_'+i
        nom_menu="menu"+indice
      }
    }
    if (nom_menu == 'menu_0'){
      choix_menu = 'Sejour'
    }
    else if (nom_menu == 'menu_1'){
      choix_menu = 'Tour'
    }
  })
*/
            /* ================================================================================================ */

  //---------------------------------------- FONCTION POUR EFFECTUER LA RECHERCHE --------------------------------------------
  
  $(".boutonRechercher").click(function() {
    var inputs = document.getElementsByTagName('input')
    ref = refcontinent
    yes = '_destination'
    if (ref != ''){
      ref = ref_pays
      yes = ''
      if (ref != ''){
        ref = ref_region
        if (ref == ''){
          ref = ref_pays
        }
        yes = ''
      }
      else {
        ref = refcontinent
        yes = '_destination'
      }
    }
         
    var vecteur = $("#periode_select"+indice).attr('value').toString().split(" ");
    var mois_debut = vecteur[0]
    var annee_debut = vecteur[1]

    choix_menu = ""
    var tmp_choix_menu = document.getElementsByName('type')
    for (var cpt = 0; cpt < tmp_choix_menu.length; cpt++)
    {
      if (tmp_choix_menu[cpt].checked)
      {
        choix_menu = tmp_choix_menu[cpt].value
      }
    }
    var nature = '0'
    if (choix_menu == 'Sejours') {
      liste_choix = ""
      for (var i = 0 ; i < inputs.length ; i++) {
        if ((inputs[i].name == choix_menu || inputs[i].name == 'all') && inputs[i].checked) {
          if (inputs[i].value != 'iscat_nature')
          {
            liste_choix+= inputs[i].value + "/"
          }
          else
          {
            nature = '1'
          }
        }
      }
      urlFonction = "/Alloa/get_liste_hotels" + yes +"?r=" + ref + "&menu=" + choix_menu + "&liste_choix=" + liste_choix + "&mois=" + mois_debut + "&annee=" + annee_debut
      urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase() + "&n=" + nature
    }
    else if (choix_menu == 'Croisieres' || choix_menu == 'Circuits') {
      liste_choix = ""
      for (var i = 0 ; i < inputs.length ; i++) {
        if ((inputs[i].name == 'Tour' || inputs[i].name == "all")&& inputs[i].checked) {
          if (inputs[i].value == 'iscat_relaxation')
            {
              liste_choix += "isthem_bienetre/"
            }
            else if (inputs[i].value == 'iscat_romance')
            {
              liste_choix += "is_charme/"
            }
            else if (inputs[i].value != 'iscat_nature')
            {
              liste_choix+= inputs[i].value + "/"
            }
            else
            {
              nature = '1'
            }
        }
      }
      urlFonction = "/Alloa/get_liste_tour" + yes +"?r=" + ref + "&menu=" + choix_menu + "&liste_choix=" + liste_choix + "&mois=" + mois_debut + "&annee=" + annee_debut
      urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase() + "&n=" + nature
    }

    $('#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: urlFonction ,
      success:function(retour){
        $('#main').empty()
        $("#main").append(retour)
        tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
        click_article()
      }
    })
    document.getElementById("situ").style.display = "block";
    document.getElementById("country_choice").style.display = "block";
  })
                            /* FONCTIONS POUR LA CARTE */

  $('area').click(function() {
    if (!document.getElementById('loading')) {
      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"
      }
      ref_pays = ''
      ref_region=''
      //--------------------------------------------------------------------------------------
        if (dmd_clic == true)
          {
            dmd_clic=false
            $("#situation").css('margin-top','20px')
            //$(".text_navig_menu").css('margin-bottom','25px')
            //$(".text_navig_menu").css('margin-top','35px')
            $("#main").css('margin-top','25px')
            $("#main").css('background','#fbefc5')
            $("#bn_cont").append("Bienvenue")           
            $("#situation").empty()
          }
      //--------------------------------------------------------------------------------------
      
      chaineSituation += "</span>"
      $("#situation").empty()
      $("#situation").append(chaineSituation)
      id_localisation = ""
      $("#country"+indice).empty()
      $("#country"+indice).append('<label class="titre">Choisissez votre pays: </label><br/>')
      $("#reg"+indice).empty()
      $("#country" +indice +" #pays").remove()
      $("#reg" +indice +" #regions").remove()
      

      jQuery('<select class="select" id="pays"></select>').load(requete, {}, function(res, stat, xml) {
        $("#country" +indice +" #loading").remove()
        $(this).appendTo("#country"+indice).show("normal")
        click_pays()
      })

      var vecteur = $("#periode_select"+indice).attr('value').toString().split(" ");
      var mois_debut = vecteur[0]
      var annee_debut = vecteur[1]
      //charge les hotels, circuits ou croisieres preferes du continent
      choix_menu = ""
      var tmp_choix_menu = document.getElementsByName('type')
      for (var cpt = 0; cpt < tmp_choix_menu.length; cpt++)
      {
        if (tmp_choix_menu[cpt].checked)
        {
          choix_menu = tmp_choix_menu[cpt].value
        }
      }
      var inputs = document.getElementsByTagName('input')
      var nature = '0'
      if (choix_menu == 'Sejours') {
        liste_choix = ""
        for (var i = 0 ; i < inputs.length ; i++) {
          if ((inputs[i].name == choix_menu || inputs[i].name == 'all') && inputs[i].checked) {
            if (inputs[i].value != 'iscat_nature')
            {
              liste_choix+= inputs[i].value + "/"
            }
            else
            {
              nature = '1'
            }
          }
        }
        urlFonction = "/Alloa/get_liste_hotels_destination?r=" + refcontinent + "&menu=" + choix_menu + "&liste_choix=" + liste_choix + "&mois=" + mois_debut + "&annee=" + annee_debut
        urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase() + "&n=" + nature
      }
      else if (choix_menu == 'Croisieres' || choix_menu == 'Circuits') {
        liste_choix = ""
        for (var i = 0 ; i < inputs.length ; i++) {
          if ((inputs[i].name == 'Tour' || inputs[i].name == 'all') && inputs[i].checked) {
            //check le nom des champs (certains champs n'ont pas le meme nom dans la base tour)
            if (inputs[i].value == 'iscat_relaxation')
            {
              liste_choix += "isthem_bienetre/"
            }
            else if (inputs[i].value == 'iscat_romance')
            {
              liste_choix += "is_charme/"
            }
            else if (inputs[i].value != 'iscat_nature')
            {
              liste_choix+= inputs[i].value + "/"
            }
            else
            {
              nature = '1'
            }
          }
        }
        urlFonction = "/Alloa/get_liste_tour_destination?r=" + refcontinent + "&menu=" + choix_menu + "&liste_choix=" + liste_choix + "&mois=" + mois_debut + "&annee=" + annee_debut
        urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase() + "&n=" + nature
      }
      
      $('#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: 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()      
      urlFonction = "/Continent/getDescContinent?c=" + refcontinent
      $.ajax({
        type: "GET",
        url: urlFonction,
        async: false,
        success: function(retour){
          $("#situation").append(retour)
        }
      })
      //click_element_menu()
    }
    document.getElementById("situ").style.display = "block";
    document.getElementById("country_choice").style.display = "block";
    return false
  });


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


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

  $('#carte_0 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 PAYS ET REGIONS----------------------------------------------------------


  //-----------------------------------------------click_pays concerne les liens des pays en dessous de la carte pays ----------------------------
  function click_pays() {
    $("#pays").change(function() {
      if (!document.getElementById('loading')) {
        ref_lib = $("#pays").attr('value').toString().split(";");
        ref_pays = ref_lib[0]
        nom_pays = ref_lib[1]
        
        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"+indice).empty()
        $('#reg'+indice+' #regions').remove()
        $('#reg'+indice+' #pays').remove()
        $('#main').empty()
        requete = "/Alloa/get_liste_sous_destinations?p=" + ref_pays
        jQuery('<select class="select" id="regions"></select>').load(requete, {}, function(res, stat, xml){
          $("#reg"+indice+" #loading").remove()
          $(this).appendTo("#reg"+indice).show("normal")
          click_region()
        })
        
        var vecteur = $("#periode_select"+indice).attr('value').toString().split(" ");
        var mois_debut = vecteur[0]
        var annee_debut = vecteur[1]
        //charge les hotels, circuits ou croisieres preferes du continent
        
        choix_menu = ""
        var tmp_choix_menu = document.getElementsByName('type')
        for (var cpt = 0; cpt < tmp_choix_menu.length; cpt++)
        {
          if (tmp_choix_menu[cpt].checked)
          {
            choix_menu = tmp_choix_menu[cpt].value
          }
        }
        var inputs = document.getElementsByTagName('input')
        var nature = '0'
        if (choix_menu == 'Sejours') {
          liste_choix = ""
          for (var i = 0 ; i < inputs.length ; i++) {
            if ((inputs[i].name == choix_menu || inputs[i].name == 'all') && inputs[i].checked) {
              if (inputs[i].value != 'iscat_nature')
              {
                liste_choix+= inputs[i].value + "/"
              }
              else
              {
                nature = '1'
              }
            }
          }
          urlFonction = "/Alloa/get_liste_hotels?r=" + ref_pays + "&menu=" + choix_menu + "&liste_choix=" + liste_choix + "&mois=" + mois_debut + "&annee=" + annee_debut
          urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase() + "&n=" + nature
        }
        else if (choix_menu == 'Croisieres' || choix_menu == 'Circuits') {
          liste_choix = ""
          for (var i = 0 ; i < inputs.length ; i++) {
            if ((inputs[i].name == 'Tour' || inputs[i].name == 'all') && inputs[i].checked) {
              if (inputs[i].value == 'iscat_relaxation')
              {
                liste_choix += "isthem_bienetre/"
              }
              else if (inputs[i].value == 'iscat_romance')
              {
                liste_choix += "is_charme/"
              }
              else if (inputs[i].value != 'iscat_nature')
              {
                liste_choix+= inputs[i].value + "/"
              }
              else
              {
                nature = '1'
              }
            }
          }
          urlFonction = "/Alloa/get_liste_tour?r=" + ref_pays + "&menu=" + choix_menu + "&liste_choix=" + liste_choix + "&mois=" + mois_debut + "&annee=" + annee_debut
          urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase() + "&n=" + nature
        }
        
        $('#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: 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()
          }
        })
          //-----------------description pays ###ac ----------------------
        urlFonction = "/Continent/getaccreg?n=" + nom_pays.toLowerCase() + "&d=" + ref_pays.toLowerCase() +"***"
          $.ajax({
              type: "GET",
              url: urlFonction,
              success: function(retour)
                {
                  $("#situation").append(retour)
                }
              })
          //-------------------------------------------------------

      }
      return false
    })

  }

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

  function click_region() {
    $("#regions").change(function() {
      if (!document.getElementById('loadingMain')) {
        $('#main').empty()

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

        choix_menu = ""
        var tmp_choix_menu = document.getElementsByName('type')
        for (var cpt = 0; cpt < tmp_choix_menu.length; cpt++)
        {
          if (tmp_choix_menu[cpt].checked)
          {
            choix_menu = tmp_choix_menu[cpt].value
          }
        }
        var inputs = document.getElementsByTagName('input')
        var nature = '0'
        if (choix_menu == 'Sejours') {
          liste_choix = ""
          for (var i = 0 ; i < inputs.length ; i++) {
            if ((inputs[i].name == choix_menu || inputs[i].name == 'all') && inputs[i].checked) {
              if (inputs[i].value != 'iscat_nature')
              {
                liste_choix+= inputs[i].value + "/"
              }
              else
              {
                nature = '1'
              }
            }
          }
          urlFonction = "/Alloa/get_liste_hotels?r=" + ref_region + "&menu=" + choix_menu + "&liste_choix=" + liste_choix + "&mois=" + mois_debut + "&annee=" + annee_debut
          urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase() + "&n=" + nature
        }
        else if (choix_menu == 'Circuits' || choix_menu == 'Croisieres') {
          liste_choix = ""
          for (var i = 0 ; i < inputs.length ; i++) {
            if ((inputs[i].name == 'Tour' || inputs[i].name == 'all') && inputs[i].checked) {
              if (inputs[i].value == 'iscat_relaxation')
              {
                liste_choix += "isthem_bienetre/"
              }
              else if (inputs[i].value == 'iscat_romance')
              {
                liste_choix += "is_charme/"
              }
              else if (inputs[i].value != 'iscat_nature')
              {
                liste_choix+= inputs[i].value + "/"
              }
              else
              {
                nature = '1'
              }
            }
          }
          urlFonction = "/Alloa/get_liste_tour?r=" + ref_region + "&menu=" + choix_menu + "&liste_choix=" + liste_choix + "&mois=" + mois_debut + "&annee=" + annee_debut
          urlFonction += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase() + "&n=" + nature
        }
        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()
        $.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_region.toLowerCase()
          $.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 = ref_pays.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 = ref_pays.split("-")[1].toLowerCase()
        urlFonction = "/Continent/getDefPays?n=" + nom_region.toLowerCase() + "&d=" + refDestPays
      }
      else
        urlFonction = "/Continent/getDefRegion?d=" + ref_region + "&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;
    })
  }


  /* DIFFERENTES FONCTIONS POUR LES ARTICLES OU PAGES */
  function click_article(){
    
    
    $(".lire_suite_situ").click(function(){
      v_s = $(this).attr("name")
      descriptif = $(".desc_"+v_s)
      accroche = $(".accr_"+v_s)      
      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")
        $(this).html('Lire la suite &gt;&gt;')
      }
      return false
    })

    //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
    })
    
    
    $(".lire_suite_dmd").click(function(){      
            
      v_s = $(this).attr("name")
      descriptif = $(".desc_"+v_s)
      accroche = $(".accr_"+v_s)      
      display = descriptif.css('display')
      if (display == 'none') {        
        descriptif.show("normal")
        $(this).html('&lt;&lt; Fermer')
      }
      else {
        setTimeout("accroche.show()", 400)
        descriptif.hide("normal")       
        $(this).html('Détails &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
    })

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

    $(".lienDmdInfos").click(function(){
      var vecteur = $("#periode_select").attr('value').toString().split(" ");
      //var lien = "/User/getFormDemandeInfosHebergement?" + $(this).attr('name')
      var lien = "/User/getFormDmdeInfos?" + $(this).attr('name')
      window.open(lien, "Prix", 'location=0, width=800, height=800, 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;
    })

    //clic sur ma selection
    $(".selection").click(function()
    {
      req ="/Valider/addSelection?h=" + $(this).attr('name')
      $.ajax({
        type : "GET",
        url: req ,
        success:function(retour)
        {

          alert(retour)
        }
      })
      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 header
  $(".lienheader").click(function() {
  	if ($(this).attr('id') == 'newsletter' || $(this).attr('id') == 'first_visit')
  	{
	  lien = "../web_page/" + $(this).attr('id') + '.html'
      mywindow = window.open(lien, '', 'location=no, width=850, height=400, 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=850, height=700, status=no, scrollbars=yes, menubar=no, fullscreen=no')
      mywindow.moveTo(200,150);
    }
	
	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=850, 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=850, height=500, 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
  })



  /* ================================================================================================ */
  /* 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){
            if (retour == "ok1")
            {
              alert("Veuillez consulter vos demande");
            }
            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){          
          if (retour == "ok1")
            {
              alert("Veuillez consulter vos demande");
            }
          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){
        
            dmd_clic= true
            stringsitu = $("#situation").html()         
            $("#situation").empty()
            $("#situation").css('margin-top','-35px')         
            $("#main").css('margin-top','-55px')
            $("#main").css('background','#fdfdfd')
            $("#bn_cont").empty()
            $("#country").empty()
            $("#reg").empty()       
            $("#situation").append("<span class='situation_continent'> Mon Compte Client </span>")
            $("#main").empty()
            $("#main").append(retour)
            getPanier()
      }
    })

    return false
  })

  $("#maSelection").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(" ");
    var urlF ="/Alloa/getSelection?w=00120&mois=" + mois_debut + "&annee=" + annee_debut
    urlF += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase() + "&sm=" + choix_menu
    //window.open(urlF, "Brochure", 'location=0, width=800, height=400, status=no, scrollbars=yes, menubar=no, fullscreen=no')
    //var urlF = "/Alloa/getSelection?w=00120"//?c=" + refcontinent + "&mois=" + mois_debut +"&annee=" + annee_debut
    //urlF += "&ville=" + $("#depart_ville_select").attr('value').toLowerCase() + "&sm=" + dt_clique.attr('id')
    $.ajax({
          type: "GET",
          url: urlF,
          success: function(retour)
          {
            dmd_clic= true
            stringsitu = $("#situation").html()         
            $("#situation").empty()
            $("#situation").css('margin-top','-35px')         
            $("#main").css('margin-top','-55px')
            $("#main").css('background','#fdfdfd')
            $("#bn_cont").empty()
            $("#country").empty()
            $("#reg").empty()       
            $("#situation").append("<span class='situation_continent'> Ma Sélection </span>")
            $("#main").empty()
            $("#main").append(retour)
            click_article()
          }
      })

    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/getPanier_hotel",
        success: function(retour){          
          dmd_clic= true
          stringsitu = $("#situation").html()         
          $("#situation").empty()
          $("#situation").css('margin-top','-35px')         
          $("#main").css('margin-top','-55px')
          $("#main").css('background','#fdfdfd')
          $("#bn_cont").empty()
          $("#country").empty()
          $("#reg").empty()       
          $("#situation").append("<span class='situation_continent'> Espace Panier </span>")
          $("#main").empty()
          $("#main").append(retour)
          validerPanier()
          fct_del_caddie()          
          fct_broch() 
          suppDmd()
          valDmd()
          click_article()
        }
      })
    return false
  })
  
  $("#Dmd").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/getUserDmd",
        success: function(retour){  
          dmd_clic= true
          stringsitu = $("#situation").html()         
          $("#situation").empty()
          $("#situation").css('margin-top','-35px')         
          $("#main").css('margin-top','-55px')
          $("#main").css('background','#fdfdfd')
          $("#bn_cont").empty()
          $("#country").empty()
          $("#reg").empty()       
          $("#situation").append("<span class='situation_continent'> Espace Demandes </span>")
          $("#main").empty()
          $("#main").append(retour)
          validerPanier()
          fct_del_caddie()
          fct_broch() 
          suppDmd()
          valDmd()
          click_article()
        }
      })
    return false
  })  
  
  function suppDmd()
  {
      $(".suppDmd").click(function()
      {                           
        isConf = confirm("Vous allez supprimer ce dossier definitivement.")     
        if (isConf)
        {
          var refldoss = $(this).attr('name')
          url_fct = "/User/suppDmd?refldoss=" + refldoss
        $.ajax({
            type: "GET",
            url: url_fct,
            success: function(retour)
              {
                $("#main").empty()
                $("#main").append(retour)               
              }
          })
                        
        }
        return false;
      })
  }
  
  function valDmd()
  {
      $(".valDmd").click(function()
      { 
        refldoss = $(this).attr("name")
        lien = "/User/valDmd?refldoss="+refldoss
        window.open(lien, "Brochure", 'location=0, width=920, height=650, status=no, scrollbars=yes, menubar=no, fullscreen=no')
        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_menu
      //alert(lien)
      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 ------------------

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

  urlFonction ='User/getLoggedUser'
  $.ajax({
    type : "GET",
    url: urlFonction ,
    success:function(retour)
    {
      if (retour != '')
      {
        $('#espaceperso').empty()
        $('#espaceperso').append(retour)
      }
    }
  })



  requete = "/Alloa/get_liste_destinations?c=0"
  //*** 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"]
  choix_menu = ""
  var tmp_choix_menu = document.getElementsByName('type')
  for (var cpt = 0; cpt < tmp_choix_menu.length; cpt++)
  {
    if (tmp_choix_menu[cpt].checked)
    {
      choix_menu = tmp_choix_menu[cpt].value
    }
  }
  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_0").append("<option value='" + (mois_tmp+1) + " " + annee_tmp + "' id='"+ annee_tmp +"'>"+ contenu_cbo_box +"</option>")
    $("#periode_select_1").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"+indice).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()
  urlFonction += "&choix_menu=" + choix_menu

  $("#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'> dans votre agence de voyages Alloa </span>"
  $("#situation").empty()
  $("#situation").append(chaineSituation)

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

      /*----------------------------------Fin Page Daccueil-------------------------------------------------*/
  //-------------------------------vous recherchez---------------------------------------------
  $("#s_choix").empty()
  var vect = $("#periode_select"+indice).attr('value').toString().split(" ");
  $("#s_choix").append(choix_menu + " ,  pour un départ de "+$("#depart_ville_select").attr('value'))
  $("#s_choix").append(" dans la pèriode de " +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 == "sejours") {

          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
      })
    }


  //===================================================Recherche par nom=================================================
  function trim (myString)
  {
    return myString.replace(/^\s+/g,'').replace(/\s+$/g,'')
  }

  $('#namesearch').click(function()
  {
    var to_search = document.getElementById('name_to_search').value
    var search_in = document.getElementById('searchtype').value
    var urlFunc = ''

    to_search = trim(to_search)
    if (to_search.length < 2)
    {
      alert('Vous devez rentrer au moins deux caractères dans le champ de recherche. Nous vous conseillons de remplir au mieux possible ce champ, pour que nous puissions vous donnez une liste de résultat qui correspond le mieux a votre attente')
      return false
    }
    to_search = to_search.replace(/\\/g,"\\\\")
    to_search = to_search.replace(/\'/g,"\\'")
    to_search = to_search.replace(/\"/g,"\\\"")
    if (search_in == 'ville')
    {
      urlFunc = '/Alloa/Search_city_by_name?v=' + to_search
    }
    else if (search_in == 'hotel')
    {
      urlFunc = '/Alloa/Search_hotel_by_name?h=' + to_search
    }
    else if (search_in == 'croisière')
    {
      urlFunc = '/Alloa/Search_tour_by_name?c=' + to_search + '&cr=1'
    }
    else if (search_in == 'circuit')
    {
      urlFunc = '/Alloa/Search_tour_by_name?c=' + to_search + '&cr=0'
    }
    document.getElementById('situ').style.display='none'
    $('#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: urlFunc,
      async:false,
      success: function(retour)
      {
        if (retour.substr(0, 4) == 'city')
        {
            retour = retour.substr(4, retour.length)
            var height_slide = (screen.height - 500)/2;
            var width_slide = (screen.width - 500)/2;
            villes = window.open('../web_page/popup.html' ,'', 'location=no, width=530, height=520, status=no, scrollbars=yes, menubar=no, fullscreen=no')
            villes.moveTo(width_slide, height_slide)
            villes.document.write(retour)
        }
        else
        {
          $("#main").empty()
          $("#main").append(retour)
          click_article_parent()
        }
      }
    })
  });
  
//--------------------------------------------- Inscription / connexion ---------------------------------------------------
  
  $('#subscribe').click(function()
  {
    document.location.href="/User/formulaireInscription"
  });
});

  function click_article_parent(){
    
    
    /*$(".lire_suite_situ").click(function(){
      v_s = $(this).attr("name")
      descriptif = $(".desc_"+v_s)
      accroche = $(".accr_"+v_s)      
      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")
        $(this).html('Lire la suite &gt;&gt;')
      }
      return false
    })*/

    //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
    })
    
    
    $(".lire_suite_dmd").click(function(){      
            
      v_s = $(this).attr("name")
      descriptif = $(".desc_"+v_s)
      accroche = $(".accr_"+v_s)      
      display = descriptif.css('display')
      if (display == 'none') {        
        descriptif.show("normal")
        $(this).html('&lt;&lt; Fermer')
      }
      else {
        setTimeout("accroche.show()", 400)
        descriptif.hide("normal")       
        $(this).html('Détails &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
    })

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

    $(".lienDmdInfos").click(function(){
      var vecteur = $("#periode_select").attr('value').toString().split(" ");
      //var lien = "/User/getFormDemandeInfosHebergement?" + $(this).attr('name')
      var lien = "/User/getFormDmdeInfos?" + $(this).attr('name')
      window.open(lien, "Prix", 'location=0, width=800, height=800, 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_parent()
        }
      })
      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;
    })

    //clic sur ma selection
    $(".selection").click(function()
    {
      req ="/Valider/addSelection?h=" + $(this).attr('name')
      $.ajax({
        type : "GET",
        url: req ,
        success:function(retour)
        {

          alert(retour)
        }
      })
      return false
    })
  }
