<!--
function popup_planning_prestation(typeprest,prestataire,prestation,langue) {
	var page;
	page = 'popup_planning.php?typeprest=' + typeprest + '&prestataire=' + prestataire + '&prestation=' + prestation + '&langue=' + langue;
	var win = window.open (page,'', config='height=450, width=1000, toolbar=no, menubar=yes, scrollbars=yes, resizable=yes, location=no, directories=no, status=no');
    if(win.focus){win.focus();} 
}

function affiche_liste_pdf() {
	var page;
	page = 'liste_pdf.php';
	var win = window.open (page,'', config='height=800, width=600, toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, directories=no, status=no');
    if(win.focus){win.focus();} 
}

function fenetreCent(url,nom,largeur,hauteur,options) {
	var haut=(screen.height-hauteur)/2;
	var Gauche=(screen.width-largeur)/2;
	fencent=window.open(url,nom,"top="+haut+",left="+Gauche+",width="+largeur+",height="+hauteur+","+options);
	if( self.focus ) fencent.focus();
}

function openWin(url,hauteur,largeur)
{	
	window.open(url,'nom','toolsbar=no,height='+hauteur+',width='+largeur);
}

function openWinvideo(url,hauteur,largeur)
{	
	window.open(url,'video','toolsbar=no,height='+hauteur+',width='+largeur);
}

function openWin2(url,hauteur,largeur)
{	
	window.open(url,'nom2','toolsbar=no,scrollbars=1,height='+hauteur+',width='+largeur);
}

function openWin3(url,hauteur,largeur)
{	
	var top=(screen.height-hauteur)/2;
    var left=(screen.width-largeur)/2;	
	window.open(url,'nom2','toolsbar=no,scrollbars=no,resizable=no,height='+hauteur+',width='+largeur+",top="+top+",left="+left);
}

function popup_plan_situation_google(latitude,longitude){
	var page;
	page = 'plan_de_situation_google.php?longitude=' + longitude + '&latitude=' + latitude;
	var win = window.open (page,'', config='height=200, width=300, toolbar=no, menubar=no, scrollbars=no, resizable=yes, location=no, directories=no, status=no');
    if(win.focus){win.focus();} 
}

function rollOver(ImgNme)
{
 obj=document.images[ImgNme];
 obj.src=(obj.src.lastIndexOf('_on')!=-1)? obj.src.replace(/_on/gi,"_off"):obj.src.replace(/_off/gi,"_on");
}


function PSR_imprimer () { 
    var PSR_f1 = null; 
    var PSR_content=document.getElementById('PSR_print').parentNode.innerHTML; 
    var PSR_title=document.getElementsByTagName('title')[0].innerText; 
    if (PSR_f1) {if(!PSR_f1.closed) PSR_f1.close();} 
    PSR_f1 = window.open ('',"PSR_f1", "height=500,width=600,menubar=yes,scrollbars=yes,resizable=yes,,left=10,top=10"); ; 
    PSR_f1.document.open(); 
    PSR_f1.document.write("<html><head><title>" + PSR_title + "</title><link rel='STYLESHEET' type='text/css' href='style.css'></head><body bgcolor='#ffffff'><div align=center><img src='images/logo_aayc.gif'></div><br>"+PSR_content+"</body></html>"); 
    PSR_f1.document.close(); 

    PSR_f1.focus(); 
PSR_f1.print();
} 


function popup_images_prestataire(typeprest,code){
	var page;
	page = 'image_prestataire.php?TYPREST=' + typeprest + '&CODE=' + code;
	var win = window.open (page,'', config='height=80, width=250, toolbar=no, menubar=no, scrollbars=no, resizable=yes, location=no, directories=no, status=no');
    if(win.focus){win.focus();} 
}

function popup_images_prestataire(url, typeprest,code){
	var page;
	page = url + 'image_prestataire.php?TYPREST=' + typeprest + '&CODE=' + code;
	var win = window.open (page,'', config='height=80, width=250, toolbar=no, menubar=no, scrollbars=no, resizable=yes, location=no, directories=no, status=no');
    if(win.focus){win.focus();} 
}

function popup_images_prestation(typeprest,code,codeprest){
	var page;
	page = 'image_prestation.php?TYPREST=' + typeprest + '&CODE=' + code + '&CODEPREST=' + codeprest;
	var win = window.open (page,'', config='height=80, width=250, toolbar=no, menubar=no, scrollbars=no, resizable=yes, location=no, directories=no, status=no');
    if(win.focus){win.focus();} 
}

function popup_images_prestataireV2(url,typeprest,code){
	var page;
	page = url + 'image_prestataire_v2.php?TYPREST=' + typeprest + '&CODE=' + code ;
	var win = window.open (page,'', config='height=80, width=250, toolbar=no, menubar=no, scrollbars=no, resizable=yes, location=no, directories=no, status=no');
    if(win.focus){win.focus();} 
}

function popup_images_prestation(url,typeprest,code,codeprest){
	var page;
	page = url + 'image_prestation.php?TYPREST=' + typeprest + '&CODE=' + code + '&CODEPREST=' + codeprest;
	var win = window.open (page,'', config='height=80, width=250, toolbar=no, menubar=no, scrollbars=no, resizable=yes, location=no, directories=no, status=no');
    if(win.focus){win.focus();} 
}

function popup_images_prestationV2(url,typeprest,code,codeprest){
	var page;
	page = url + 'image_prestation_v2.php?TYPREST=' + typeprest + '&CODE=' + code + '&CODEPREST=' + codeprest;
	var win = window.open (page,'', config='height=80, width=250, toolbar=no, menubar=no, scrollbars=no, resizable=yes, location=no, directories=no, status=no');
    if(win.focus){win.focus();} 
}

function popup_plan_situation(typeprest,code,lot){
	var page;
	page = 'plan_de_situation.php?typeprest=' + typeprest + '&presta=' + code + '&lot=' + lot;
	var win = window.open (page,'', config='height=200, width=300, toolbar=no, menubar=no, scrollbars=no, resizable=yes, location=no, directories=no, status=no');
    if(win.focus){win.focus();} 
}

function redirection_moteur(moteur, langue, mode,theme) {
		numoption = document.frmMoteur.type_hebergement.selectedIndex;
		valeurchoix = document.frmMoteur.type_hebergement.options[numoption].value;
    var nom_modele = '';		

		if(mode == 'MINI') {
            window.location.href = 'http://www.chamrousse.com/moteur_recherche_mini.php?type_hebergement=' + valeurchoix + '&langue=' + langue+ '&theme=' + theme;
        }
        if(mode == 'NORMAL') {
            switch(valeurchoix) {
                case 'H' :
                    nom_modele = 'reserver_hotel';
                    break;
                case 'M' :
                    nom_modele = 'reserver_chambre_hote';
                    break;
                case 'I' :
                    nom_modele = 'reserver_meuble';
                    break;
                case 'J' :
                    nom_modele = 'reserver_collectivite';
                    break;
                case 'K' :
                    nom_modele = 'reserver_chalet';
                    break;
                      
            }            
            window.location.href = 'http://www.chamrousse.com/index.php?modele=' + nom_modele + '&theme=' + theme + '&langue=' + langue;
        }
}

function redirection_moteur_radio(moteur, langue) {
		window.location.href = 'http://www.chamrousse.com/moteur_recherche_FR.php?type_hebergement=' + moteur + '&langue=' + langue;
}

function afficheId(baliseId) {
	  if (document.getElementById && document.getElementById(baliseId) != null){
	    	if(document.getElementById(baliseId).style.visibility == 'hidden'){
	    		document.getElementById(baliseId).style.visibility='visible';
	    		document.getElementById(baliseId).style.display='block';
	    	}else {
	    		document.getElementById(baliseId).style.visibility='hidden';
	    		document.getElementById(baliseId).style.display='none';
	    	}
	    }
}

function afficheStrictId(baliseId)
{
  if (document.getElementById && document.getElementById(baliseId) != null)
    {
    document.getElementById(baliseId).style.visibility='visible';
    document.getElementById(baliseId).style.display='block';
    }
}

function cacheId(baliseId)
{
  if (document.getElementById && document.getElementById(baliseId) != null)
    {
    document.getElementById(baliseId).style.visibility='hidden';
    document.getElementById(baliseId).style.display='none';
    }
}

/**
 * Fonction pour creation de l'objet XMLRequest AJAX
 */
function createRequestObject() {
    
    var xhr;
    
    try {
    	xhr = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (err) {
    	try {
    		xhr = new ActiveXObject("Microsoft.XMLHTTP");
    	} catch(err) {
    		xhr = false;
    	}
    }
    
    if(!xhr && typeof XMLHttpRequest != 'undefined') {
    	xhr = new XMLHttpRequest();
    }
    
    return xhr;
}

var http = createRequestObject();

/**
 * Fonction d'appel de tratement AJAX
 */ 
 function gestion_ajax_simple(lien) {
  
	// Ouverture de la requete GET
	http.open('get', lien);
	 
	// Recupération du retour de la fonction	
	http.onreadystatechange = function() {
         if(http.readyState == 4){         	
	        var response = http.responseText;
	        var html = new String();
	        
	        // Récupération du code HTML (echo)
	        html = response;
			  
	        document.location.href = lien;
	    }
    }    
	http.send(null);
}

 function init_durees_proposees(date_debut, traduction_semaine, traduction_jour, id_div) {           

    var html = '<select id="divDureeSejour" name="duree">';                                        
    //semaine du samedi 19/12/2010 au dimanche 26/12/2010 (8 jours)
    if (date_debut == '02/01/2012'){
        html = html + '<option value="5" >5 ' + traduction_jour + 's</option>';
    } else {
        //semaine du dimanche 26/12/2010 au dimanche 02/01/2011 (7 jours)
        if (date_debut == '26/12/2010'){
            html = html + '<option value="7" >1 ' + traduction_semaine + '</option>';
        } else {
            //semaine du dimanche 02/01/2011 au samedi 08/01/2011 (6 jours)
            if (date_debut == '02/01/2011'){
                html = html + '<option value="6" >6 ' + traduction_jour + 's</option>';
            } else { 
                for(iDuree=1; iDuree<=5; iDuree++){
                    if(iDuree>1){s = "s";}else{s = "";}
                    html = html + '<option value="' + (iDuree*7) + '" >' + iDuree + ' ' + traduction_semaine + s + '</option>';
                }
            }
        }
    }
    html = html + '</select>';                  
    document.getElementById(id_div).innerHTML = html;                      
}
	
//-->

// Ajax pour liste personne qui partagent une chambre
function request_detail_prestation(idDiv,key,nomAction,langue) {

	// Loading
	document.getElementById(idDiv).innerHTML = '<div align="center"><img src="/images/loading_ajax.gif"  alt="" border="0" /></div>';
	
	// Ouverture de la requete GET
	 http.open('get', 'detail_prestation_ajax.php?action='+ nomAction +'&key=' + key + '&langue=' + langue);
	 
	 // Recupération du retour de la fonction
	 http.onreadystatechange = function() {
         if(http.readyState == 4){
         	
	        var response = http.responseText;
	        var html = new String();
	        
	        // Récupération du code HTML (echo)
	        html = response;
			  
	       document.getElementById(idDiv).innerHTML = html;
	    }
    }
	http.send(null);
}
