function changeLang(l){window.location='/i18n/setLangue.jsp?lang='+l+'&ref='+escape(window.location);}

function hotel_show_hide_outils(nom){
		
	if ($("a_pdf")) {$("a_pdf").removeClassName("actif");}
	$("a_imp").removeClassName("actif");
	$("a_pda").removeClassName("actif");
	$("a_fav").removeClassName("actif");
	if(nom!="imp" && $("bloc_outil_hotel_"+nom).style.display!="none"){
		$("bloc_outil_hotel_"+nom).hide();
	}
	else{
		$("a_"+nom).addClassName("actif");
		
		switch(nom){
		
			case 'pdf' :
				//$("bloc_outil_hotel_pdf").show();
				$("bloc_outil_hotel_pda").hide();	
				$("bloc_outil_hotel_fav").hide();
				
			break;
			
			case 'pda' :
				//$("bloc_outil_hotel_pdf").hide();
				$("bloc_outil_hotel_pda").show();
				$("bloc_outil_hotel_fav").hide();	
			break;
	
			case 'fav' :
				//$("bloc_outil_hotel_pdf").hide();
				$("bloc_outil_hotel_pda").hide();
				$("bloc_outil_hotel_fav").show();	
			break;
	
			case 'imp' :
				//$("bloc_outil_hotel_pdf").hide();
				$("bloc_outil_hotel_pda").hide();	
				$("bloc_outil_hotel_fav").hide();
	
			break;
		}	
	}

}

function hotel_show_hide_detail(nom){
		
	if(document.getElementById(nom).style.display=="" || document.getElementById(nom).style.display=="block"){
		$(nom).hide();
		document.getElementById(nom+"_a").style.background = "url(/imagerie/fichehotel/mer/fleche_bas_lien.gif) no-repeat left 4px";
	}
	else{
		$(nom).show();
		document.getElementById(nom+"_a").style.background = "url(/imagerie/fichehotel/mer/fleche_haut_lien.gif) no-repeat left 4px";
	}

}

function hotel_show_hide_salle(nom){
	
	if(document.getElementById(nom).style.display=="" || document.getElementById(nom).style.display=="table-row"){
		$(nom).hide();
		//document.getElementById(nom+"_a").style.background = "url(/imagerie/fichehotel/mer/fleche_bas_lien.gif) no-repeat left 4px";
	}
	else{
		$(nom).show();
		//document.getElementById(nom+"_a").style.background = "url(/imagerie/fichehotel/mer/fleche_haut_lien.gif) no-repeat left 4px";
	}

}
function hotel_show_social_events(nom){
	listItem=$$('.socialevents');
	$A(listItem).each(function (monItem)
            {
				monItem.hide();
			});
	$(nom).show();
	 }


function hotel_show_hide_detail_accor(nom){
		
	$("a_fiche_accor_l_hotel").removeClassName("actif");
	$("a_fiche_accor_l_institut").removeClassName("actif");
	$("a_fiche_accor_soins").removeClassName("actif");

	$(nom).addClassName("actif");
	
	switch(nom){
	
		case 'fiche_accor_l_hotel' :
			$("fiche_accor_l_hotel").show();
			$("fiche_accor_l_institut").hide();	
			$("fiche_accor_soins").hide();
			
		break;
		
		case 'fiche_accor_l_institut' :
			$("fiche_accor_l_hotel").hide();
			$("fiche_accor_l_institut").show();
			$("fiche_accor_soins").hide();	
		break;

		case 'fiche_accor_soins' :
			$("fiche_accor_l_hotel").hide();
			$("fiche_accor_l_institut").hide();
			$("fiche_accor_soins").show();	
		break;
	}

}

function hotel_show_hide_detail_accor(nom){
		
	$("a_fiche_accor_l_hotel").removeClassName("actif");
	$("a_fiche_accor_l_institut").removeClassName("actif");
	$("a_fiche_accor_soins").removeClassName("actif");

	$(nom).addClassName("actif");
	
	switch(nom){
	
		case 'fiche_accor_l_hotel' :
			$("fiche_accor_l_hotel").show();
			$("fiche_accor_l_institut").hide();	
			$("fiche_accor_soins").hide();
			
		break;
		
		case 'fiche_accor_l_institut' :
			$("fiche_accor_l_hotel").hide();
			$("fiche_accor_l_institut").show();
			$("fiche_accor_soins").hide();	
		break;

		case 'fiche_accor_soins' :
			$("fiche_accor_l_hotel").hide();
			$("fiche_accor_l_institut").hide();
			$("fiche_accor_soins").show();	
		break;
	}

}
/********************************************
**** Fonction supplementaire pour flash *****
********************************************/

function openLightBoxFromFlash(page,_paramlang,_parammarque,_paramlabel,_paramcode, height, width){
   var a = document.getElementById("galerie1");
    a.setAttribute('href', (document.location.pathname.match(/^\/[a-z]{2}\/hotel\-\d{4}.*/))?"./gallery.shtml":"./galerie_flash.shtml");
    a.setAttribute('rel',"lightbox| 524| 400");
   myLightbox.start(a);
}

function myClose() {
    self.parent.myLightbox.end();
    return false;
 }

// Ecriture du Flash Galerie dans l'Iframe avec passage des parametres de localisation
function passeFlash2() {
    var adresse= window.location.search.slice(1,window.location.search.length);
	var tab_data = adresse.split("&"); //les donnes sont séparées
	
	//traitement pour la gestion de la langue
	var myTabLangue=tab_data[0].split("=");
	var myLangue=myTabLangue[1];
	
	var myTabBrand=tab_data[1].split("=");
	var myBrand=myTabBrand[1];
	var myTabMark=tab_data[2].split("=");
	var myMark=myTabMark[1];
	var myTabRid=tab_data[3].split("=");
	var myRid=myTabRid[1];
	passeFlash(myLangue, myBrand, myMark, myRid);
}


// Ecriture du Flash Galerie dans l'Iframe
function passeFlash(myLangue, mark, brand, rid) {
    
	var myVar="firstvar=1";

	if ((!myLangue) || (myLangue=="")) {
		var contenuAlternatif='<p><a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">You need to upgrade your Flash Player to view this content. Click here to start the upgrade.<br /><br />';
		
		
	}else{
    	switch(myLangue){
    	
    		case 'fr' :
    			var contenuAlternatif='<p><a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&Lang=French&P5_Language=French">Vous devez mettre &agrave; jour votre plugin flash pour profiter de ce contenu :<br />cliquez ici pour effectuer la mise &agrave; jour.<br /><br />';
    			var contenuAlternatifClose='X Fermer';
    		break;
    		
    		case 'gb' :
    			var contenuAlternatif='<p><a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&Lang=English&P5_Language=English">You need to upgrade your Flash Plugin to view this content. Click here to upgrade.<br /><br />';
    			var contenuAlternatifClose='X Close';
    		break;
    
    		case 'de' :
    			var contenuAlternatif='<a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&Lang=German&P5_Language=German">Sie müssen ihren plug in Adobe Flash Player  um den inhalt lesen zu können :<br />klicken sie hier um aufzurüsten.<br /><br />';
    			var contenuAlternatifClose='X Schlie&szlig;e';
    		break;
    		case 'es' :
    			var contenuAlternatif='<p><a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&Lang=Spanish&P5_Language=Spanish">You need to upgrade your Flash Plugin to view this content. Click here to upgrade.<br /><br />';
    			var contenuAlternatifClose='X Close';
    		break;
    		case 'it' :
    			var contenuAlternatif='<p><a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&Lang=Italian&P5_Language=Italian">You need to upgrade your Flash Plugin to view this content. Click here to upgrade.<br /><br />';
    			var contenuAlternatifClose='X Close';
    		break;
    		case 'nl' :
    			var contenuAlternatif='<p><a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&Lang=Dutch&P5_Language=Dutch">You need to upgrade your Flash Plugin to view this content. Click here to upgrade.<br /><br />';
    			var contenuAlternatifClose='X Close';
    		break;
    		
    		case 'zh' :
    			var contenuAlternatif='<p><a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&Lang=English&P5_Language=English">You need to upgrade your Flash Plugin to view this content. Click here to upgrade.<br /><br />';
    			var contenuAlternatifClose='X Close';
    		break;    			
    	}
	}

    myVar=myVar+"&pl="+myLangue;
    myVar=myVar+"&pb="+mark;
    myVar=myVar+"&pm="+brand;
    myVar=myVar+"&pc="+rid;
  	myVar=myVar+"&lastvar=1";	
	
	document.write('<div id="flashcontent">');
	document.write(contenuAlternatif);
  document.write('<img src="/imagerie/fichehotel/mer/flash_rune.gif" width="53" height="53" border="0" alt="Flash"></a></p>'); 
  document.write('<p><a href="javascript:myClose();">'+contenuAlternatifClose+'</a></p></div>');
// <![CDATA[');
var a = new SWFObject("/flash/fichehotel/galerie_mer.swf?"+myVar, "slideshow_mer", "518", "379", "7", "#00000");
a.addParam("allowScriptAccess", "always");
a.addParam("quality", "high");;
a.addParam("scale", "noscale");
a.addParam("wmode", "transparent");
a.setAttribute('xiRedirectUrl', window.location);
a.write("flashcontent");
// ]]>';
}

// Ouverture du Flash Video depuis le lien
function openLightBoxVideo(page,_paramlang,_parammarque,_paramlabel,_paramcode){
   var a = document.getElementById("galerie1");
   a.setAttribute('href', page+'?pl='+_paramlang+'&pm='+_parammarque+'&pb='+_paramlabel+'&pc='+_paramcode);
   a.setAttribute('rel',"lightbox| 530| 400");
   myLightbox.start(a);
}


// Ecriture du Flash Video dans l'Iframe avec passage des parametres de localisation
function passeFlash3() {
	var adresse= window.location.search.slice(1,window.location.search.length);
	var tab_data = adresse.split("&"); //les donnes sont séparées
	var myVar="firstvar=1&";
	//traitement pour la gestion de la langue
	var myTabLangue=tab_data[0].split("=");
	var myLangue=myTabLangue[1];
	if ((!myLangue) || (myLangue==""))
	{
		var contenuAlternatif='<p><a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&Lang=English&P5_Language=English">You need to upgrade your Flash Player to view this content. Click here to start the upgrade.<br /><br />';
		
		
	}else{
	switch(myLangue){
	
		case 'fr' :
			var contenuAlternatif='<p><a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&Lang=French&P5_Language=French">Vous devez mettre &agrave; jour votre plugin flash pour profiter de ce contenu :<br />cliquez ici pour effectuer la mise &agrave; jour.<br /><br />';
			var contenuAlternatifClose='X Fermer';
		break;
		
		case 'gb' :
			var contenuAlternatif='<p><a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&Lang=English&P5_Language=English">You need to upgrade your Flash Plugin to view this content. Click here to upgrade.<br /><br />';
			var contenuAlternatifClose='X Close';
		break;

		case 'de' :
			var contenuAlternatif='<a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&Lang=German&P5_Language=German">Sie müssen ihren plug in Adobe Flash Player  um den inhalt lesen zu können :<br />klicken sie hier um aufzurüsten.<br /><br />';
			var contenuAlternatifClose='X Schlie&szlig;e';
		break;
		case 'es' :
			var contenuAlternatif='<p><a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&Lang=Spanish&P5_Language=Spanish">You need to upgrade your Flash Plugin to view this content. Click here to upgrade.<br /><br />';
			var contenuAlternatifClose='X Close';
		break;
		case 'it' :
			var contenuAlternatif='<p><a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&Lang=Italian&P5_Language=Italian">You need to upgrade your Flash Plugin to view this content. Click here to upgrade.<br /><br />';
			var contenuAlternatifClose='X Close';
		break;
		case 'nl' :
			var contenuAlternatif='<p><a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&Lang=Dutch&P5_Language=Dutch">You need to upgrade your Flash Plugin to view this content. Click here to upgrade.<br /><br />';
			var contenuAlternatifClose='X Close';
		break;	
		case 'zh' :
			var contenuAlternatif='<p><a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&Lang=English&P5_Language=English">You need to upgrade your Flash Plugin to view this content. Click here to upgrade.<br /><br />';
			var contenuAlternatifClose='X Close';
		break;		
	}
	}

	//traitement pour l'url d'appel de la video
	var chaine=document.location.href;
	var reg=new RegExp("[/]+", "g");
	var tableau=chaine.split(reg);
	var part1 = tableau[1];
	//traitement pour le flash
   	for(i = 0; i < tab_data.length ;i++){
  		 myVar=myVar+tab_data[i]+"&";
    }
	myVar=myVar+"lastvar=1";	
	document.write('<div id="flashcontent">');
	document.write(contenuAlternatif);
document.write('<img src="/imagerie/flash_rune.gif" width="53" height="53" border="0" alt="Flash"></a></p>'); 
document.write('<p><a href="javascript:myClose();">'+contenuAlternatifClose+'</a></p></div>');
// <![CDATA[');
var a = new SWFObject("/flash/fichehotel/mer_player_fh.swf?purl="+part1+"&"+myVar, "mer_player_fh", "528", "388", "8", "#00000");
a.addParam("allowScriptAccess", "always");
a.addParam("quality", "high");;
a.addParam("scale", "noscale");
a.setAttribute('xiRedirectUrl', window.location);
a.write("flashcontent");
// ]]>';
}

