﻿/*
* Date Format 1.2.3
* (c) 2007-2009 Steven Levithan <stevenlevithan.com>
* MIT license
*
* Includes enhancements by Scott Trenda <scott.trenda.net>
* and Kris Kowal <cixar.com/~kris.kowal/>
*
* Accepts a date, a mask, or a date and a mask.
* Returns a formatted version of the given date.
* The date defaults to the current date/time.
* The mask defaults to dateFormat.masks.default.
*/

var dateFormat = function () {
    var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,
		timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,
		timezoneClip = /[^-+\dA-Z]/g,
		pad = function (val, len) {
		    val = String(val);
		    len = len || 2;
		    while (val.length < len) val = "0" + val;
		    return val;
		};

    // Regexes and supporting functions are cached through closure
    return function (date, mask, utc) {
        var dF = dateFormat;

        // You can't provide utc if you skip other args (use the "UTC:" mask prefix)
        if (arguments.length == 1 && Object.prototype.toString.call(date) == "[object String]" && !/\d/.test(date)) {
            mask = date;
            date = undefined;
        }

        // Passing date through Date applies Date.parse, if necessary
        date = date ? new Date(date) : new Date;
        if (isNaN(date)) throw SyntaxError("invalid date");

        mask = String(dF.masks[mask] || mask || dF.masks["default"]);

        // Allow setting the utc argument via the mask
        if (mask.slice(0, 4) == "UTC:") {
            mask = mask.slice(4);
            utc = true;
        }

        var _ = utc ? "getUTC" : "get",
			d = date[_ + "Date"](),
			D = date[_ + "Day"](),
			m = date[_ + "Month"](),
			y = date[_ + "FullYear"](),
			H = date[_ + "Hours"](),
			M = date[_ + "Minutes"](),
			s = date[_ + "Seconds"](),
			L = date[_ + "Milliseconds"](),
			o = utc ? 0 : date.getTimezoneOffset(),
			flags = {
			    d: d,
			    dd: pad(d),
			    ddd: dF.i18n.dayNames[D],
			    dddd: dF.i18n.dayNames[D + 7],
			    m: m + 1,
			    mm: pad(m + 1),
			    mmm: dF.i18n.monthNames[m],
			    mmmm: dF.i18n.monthNames[m + 12],
			    yy: String(y).slice(2),
			    yyyy: y,
			    h: H % 12 || 12,
			    hh: pad(H % 12 || 12),
			    H: H,
			    HH: pad(H),
			    M: M,
			    MM: pad(M),
			    s: s,
			    ss: pad(s),
			    l: pad(L, 3),
			    L: pad(L > 99 ? Math.round(L / 10) : L),
			    t: H < 12 ? "a" : "p",
			    tt: H < 12 ? "am" : "pm",
			    T: H < 12 ? "A" : "P",
			    TT: H < 12 ? "AM" : "PM",
			    Z: utc ? "UTC" : (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""),
			    o: (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4),
			    S: ["th", "st", "nd", "rd"][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10]
			};

        return mask.replace(token, function ($0) {
            return $0 in flags ? flags[$0] : $0.slice(1, $0.length - 1);
        });
    };
} ();

// Some common format strings
dateFormat.masks = {
    "default": "ddd mmm dd yyyy HH:MM:ss",
    shortDate: "m/d/yy",
    mediumDate: "mmm d, yyyy",
    longDate: "mmmm d, yyyy",
    fullDate: "dddd, mmmm d, yyyy",
    shortTime: "h:MM TT",
    mediumTime: "h:MM:ss TT",
    longTime: "h:MM:ss TT Z",
    isoDate: "yyyy-mm-dd",
    isoTime: "HH:MM:ss",
    isoDateTime: "yyyy-mm-dd'T'HH:MM:ss",
    isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"
};

// Internationalization strings
dateFormat.i18n = {
    dayNames: [
		"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat",
		"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
	],
    monthNames: [
		"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
		"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
	]
};

// For convenience...
Date.prototype.format = function (mask, utc) {
    return dateFormat(this, mask, utc);
};

// End of dateFormat function definition




function vIE(){return (navigator.appName=='Microsoft Internet Explorer')?parseFloat((new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})")).exec(navigator.userAgent)[1]):-1;}

function getInternetExplorerVersion() {
    var rv = -1; // Return value assumes failure.
    if (navigator.appName == 'Microsoft Internet Explorer') {
        var ua = navigator.userAgent;
        var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
        if (re.exec(ua) != null)
            rv = parseFloat(RegExp.$1);
    }
    return rv;
}

function IsIE8Browser() {
    var rv = -1;
    var ua = navigator.userAgent;
    var re = new RegExp("Trident\/([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null) {
        rv = parseFloat(RegExp.$1);
    }
    return (rv == 4);
}
function PositionnerQuisommesNous(){

                emplacementLeftmenuBasQuiSommesNous2=GetDomOffset(document.getElementById('menuBasQuiSommesNous2'), 'offsetLeft' );  
                    if (emplacementLeftmenuBasQuiSommesNous2<200){
            
                    document.getElementById("voletMenuBasQuiSommes").style.left=-(emplacementLeftmenuBasQuiSommesNous2-10)+'px';
                    }
     PositionnerEspacePress();          
     }
     
     function PositionnerEspacePress(){
       if (document.body.offsetWidth<1050){
        document.getElementById("voletMenuBasEspacePress").style.left='250px';
                    }
     //voletMenuBasEspacePress
     //
     }
     function changerEncartTelLang(quelLang){
         var divTel, divChat;
         divTel = document.getElementById('encartTel');
         divChat = document.getElementById('encartChatHoraires');

         if (divTel != null && divChat != null) {
             if (quelLang == 'fr') {
                 document.getElementById('encartTel').className = 'encartTel';
                 document.getElementById('encartChatHoraires').style.top = '26px';
             }
             if (quelLang == 'en') {
                 document.getElementById('encartTel').className = 'encartTel_en';
                 document.getElementById('encartChatHoraires').style.top = '46px';
             }
         }
     }
     
     function changerPlusInfo(quelDiv, quelLang){
                    var IE6 = false;
                    var strChUserAgent = navigator.userAgent;
                    var intSplitStart = strChUserAgent.indexOf("(",0);
                    var intSplitEnd = strChUserAgent.indexOf(")",0);
                    var strChMid = strChUserAgent.substring(intSplitStart, intSplitEnd);

                    if(strChMid.indexOf("MSIE 6") != -1) IE6 = true;
    
        if (quelLang=="fr"){
              if (IE6 == true){

                                                  quelsrc1="/statique/fr/image/offre-vign-info-fr-on.png";
                                                  quelimg=document.getElementById(quelDiv);
                                                  quelimg.runtimeStyle.backgroundImage = "none",
                                                  quelimg.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + quelsrc1 + "', sizingMethod='image')",
                                                  quelimg.src = "/image/transparent.gif"
	                             
              }
             else{
                  
                  document.getElementById(quelDiv).style.backgroundImage='url(/statique/fr/image/offre-vign-info-fr-on.png)'; 
	            
             }
        }     
        if (quelLang=="en"){
              if (IE6 == true){

                                                  quelsrc1="/statique/en/image/offre-vign-info-en-on.png";
                                                  quelimg=document.getElementById(quelDiv);
                                                  quelimg.runtimeStyle.backgroundImage = "none",
                                                  quelimg.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + quelsrc1 + "', sizingMethod='image')",
                                                  quelimg.src = "/image/transparent.gif"
	                             
              }
             else{
                  
                  document.getElementById(quelDiv).style.backgroundImage='url(/statique/en/image/offre-vign-info-en-on.png)'; 
	            
             }
        }     
        /// document.getElementById('ctl00_cphAccueil_OffreStationLink1').onmouseover = function() { this.style.backgroundImage='url(/image/video-voir-offres-offIE6.jpg)'; }
	    // document.getElementById('ctl00_cphAccueil_OffreStationLink1').onmouseout = function() { this.style.backgroundImage='url(/image/video-voir-offres-offIE6.jpg)'; }
     }
     
     
     function changerPlusInfoRollOut(quelDiv, quelLang){
                    var IE6 = false;
                    var strChUserAgent = navigator.userAgent;
                    var intSplitStart = strChUserAgent.indexOf("(",0);
                    var intSplitEnd = strChUserAgent.indexOf(")",0);
                    var strChMid = strChUserAgent.substring(intSplitStart, intSplitEnd);

                    if(strChMid.indexOf("MSIE 6") != -1) IE6 = true;
     //offresInfosGeneStationInfosTelecommandeV2
     //offres2InfosGeneStationInfosTelecommandeV2
     //filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/statique/fr/image/offre-vign-info-fr-on.png')
        if (quelLang=="fr"){
        
                      
              if (IE6 == true){
             
                     
                         
                                                  quelsrc1="/statique/fr/image/offre-vign-info-fr-off.png";
                                                  quelimg=document.getElementById(quelDiv);
                                                  quelimg.runtimeStyle.backgroundImage = "none",
                                                  quelimg.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + quelsrc1 + "', sizingMethod='image')",
                                                  quelimg.src = "/image/transparent.gif"
                                                  
                                                   
	                            
              }
             else{
                    

                  document.getElementById(quelDiv).style.backgroundImage='url(/statique/fr/image/offre-vign-info-fr-off.png)'; 

             }
        }     
        
         if (quelLang=="en"){
        
                      
              if (IE6 == true){
             
                     
                         
                                                  quelsrc1="/statique/en/image/offre-vign-info-en-off.png";
                                                  quelimg=document.getElementById(quelDiv);
                                                  quelimg.runtimeStyle.backgroundImage = "none",
                                                  quelimg.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + quelsrc1 + "', sizingMethod='image')",
                                                  quelimg.src = "/image/transparent.gif"
                                                  
                                                   
	                            
              }
             else{
                    

                  document.getElementById(quelDiv).style.backgroundImage='url(/statique/en/image/offre-vign-info-en-off.png)'; 

             }
        }     
        /// document.getElementById('ctl00_cphAccueil_OffreStationLink1').onmouseover = function() { this.style.backgroundImage='url(/image/video-voir-offres-offIE6.jpg)'; }
	    // document.getElementById('ctl00_cphAccueil_OffreStationLink1').onmouseout = function() { this.style.backgroundImage='url(/image/video-voir-offres-offIE6.jpg)'; }
     }
    function fondAleatoire(){
			switch (Math.floor(Math.random()*8)) {
			    case 0:
			        document.getElementById("animFlash").style.background = 'url(/image/fondsite/201101.jpg)';
			        break;
			    case 1:
			        document.getElementById("animFlash").style.background = 'url(/image/fondsite/201102.jpg)';
			        break;
			    case 2:
			        document.getElementById("animFlash").style.background = 'url(/image/fondsite/201103.jpg)';
    				break;
				case 3:
				    document.getElementById("animFlash").style.background = 'url(/image/fondsite/201104.jpg)';
	    			break;
				case 4 :
				    document.getElementById("animFlash").style.background = 'url(/image/fondsite/201105.jpg)';
		    		break;
				case 5 :
				    document.getElementById("animFlash").style.background = 'url(/image/fondsite/201106.jpg)';
			    	break;
				case 6 :
				    document.getElementById("animFlash").style.background = 'url(/image/fondsite/201107.jpg)';
				    break;
				default:
				    document.getElementById("animFlash").style.background = 'url(/image/fondsite/201108.jpg)';
			}
			document.getElementById("animFlash").style.backgroundRepeat ='no-repeat';
		
    }
    
     function fondAleatoireSum(){
			switch (Math.ceil(Math.random()*24)) {
				case 1:
					document.getElementById("animFlash").style.background='url(/image/fonds/campagne_01.jpg)';
				break;
				case 2:
					document.getElementById("animFlash").style.background='url(/image/fonds/campagne_02.jpg)';
				break;
				case 3:
					document.getElementById("animFlash").style.background='url(/image/fonds/campagne_03.jpg)';
				break;
				case 4 :
					document.getElementById("animFlash").style.background='url(/image/fonds/campagne_04.jpg)';
				break;
				case 5 :
					document.getElementById("animFlash").style.background='url(/image/fonds/campagne_05.jpg)';
				break;
				case 6 :
					document.getElementById("animFlash").style.background='url(/image/fonds/mer_01.jpg)';
				break;
				case 7 :
					document.getElementById("animFlash").style.background='url(/image/fonds/mer_02.jpg)';
				break;
				case 8 :
					document.getElementById("animFlash").style.background='url(/image/fonds/mer_03.jpg)';
				break;
				case 9 :
					document.getElementById("animFlash").style.background='url(/image/fonds/mer_04.jpg)';
				break;
				case 10 :
					document.getElementById("animFlash").style.background='url(/image/fonds/mer_05.jpg)';
				break;
				case 11 :
					document.getElementById("animFlash").style.background='url(/image/fonds/mer_06.jpg)';
					//supprimer 12.jpg demande hakim
				break;
				case 12 :
					document.getElementById("animFlash").style.background='url(/image/fonds/mer_07.jpg)';
				break;
				case 13 :
					document.getElementById("animFlash").style.background='url(/image/fonds/mer_08.jpg)';
				break;
				case 14 :
					document.getElementById("animFlash").style.background='url(/image/fonds/mer_09.jpg)';
				break;
				case 15 :
					document.getElementById("animFlash").style.background='url(/image/fonds/mer_10.jpg)';
				break;
				case 16 :
					document.getElementById("animFlash").style.background='url(/image/fonds/mer_11.jpg)';
				break;
				case 17 :
					document.getElementById("animFlash").style.background='url(/image/fonds/mer_12.jpg)';
				break;
				case 18 :
					document.getElementById("animFlash").style.background='url(/image/fonds/montagne_01.jpg)';
				break;
				case 19 :
					document.getElementById("animFlash").style.background='url(/image/fonds/montagne_02.jpg)';
				break;
				case 20 :
					document.getElementById("animFlash").style.background='url(/image/fonds/montagne_03.jpg)';
				break;
				case 21 :
					document.getElementById("animFlash").style.background='url(/image/fonds/montagne_04.jpg)';
				break;
				case 22 :
					document.getElementById("animFlash").style.background='url(/image/fonds/montagne_05.jpg)';
				break;
				case 23 :
					document.getElementById("animFlash").style.background='url(/image/fonds/montagne_06.jpg)';
				break;
				case 24 :
					document.getElementById("animFlash").style.background='url(/image/fonds/ville_01.jpg)';
				break;
				default:
					document.getElementById("animFlash").style.background='url(/image/fonds/mer_05.jpg)';
			}
			document.getElementById("animFlash").style.backgroundRepeat ='no-repeat';
		
    }
    
    
    
    function affichePremOnglet()
    {
    document.getElementById('contenuPageStations').style.visibility="visible";

    }
       function affichePremOngletRes()
    {
    document.getElementById('contenuPageStations').style.visibility="visible";
//  alert('visible');
    }
    function cachePremOnglet()
    {
    document.getElementById('contenuPageStations').style.visibility="hidden";
   // alert(document.getElementById('ongletStationFicheStationV2').style.visibility);
  // setTimeout(affichePremOnglet(), 10000) 

    }
     function cachePremOngletRes()
    {
    document.getElementById('contenuPageStations').style.visibility="hidden";

    }
       function jsDivWait(quelLang){
        //Loader Flash
        if (quelLang=='fr'){
       var so4 = new SWFObject("/statique/fr/Flash/loaderFlocon.swf", "loaderFlocon", "326", "77", "8", "#FFFFFF");
       }
       if (quelLang=='en'){
       var so4 = new SWFObject("/statique/en/Flash/loaderFlocon.swf", "loaderFlocon", "326", "77", "8", "#FFFFFF");
       }
       so4.addParam("wmode", "transparent");
       so4.write("loaderFlocon");
    }
     // cetnrer les div d'attente
    function PositionnerDivWait(){
        var oDivWait = document.getElementById('DivWait');
        var oDivWaitAjax = document.getElementById('DivWaitAjax');
        if (oDivWait != null) {
         oDivWait.style.top = (document.documentElement.clientHeight / 2 - 100) + 'px';
         oDivWait.style.left = (document.documentElement.clientWidth / 2 - 100) + 'px';
        }
        if (oDivWaitAjax != null) {
         //oDivWaitAjax.style.top='250px';
         //oDivWaitAjax.style.left= (basDivMenuBas('tableauMenuBas')/2)+"px";
         oDivWaitAjax.style.top = (document.documentElement.clientHeight / 2 - 100) + 'px';
         oDivWaitAjax.style.left = (document.documentElement.clientWidth / 2 - 100) + 'px';
        }
    }
    
    function PatienceAjax() {
        var dwa = document.getElementById('DivWait');
	    dwa.style.visibility = 'visible';
    }

    function UndoPatienceAjax() {
        //alert('Appel UndoPatienceAjax');
	    document.getElementById('DivWait').style.visibility = 'visible';
    }
    

    function testPng(quelimg, quelsrc){
    
         (quelimg.runtimeStyle.behavior="none") && (quelimg.pngSet ? quelimg.pngSet = true : (
         quelimg.nodeName == "IMG" ? (
         quelimg.src.toLowerCase().indexOf('.') > -1 ? (
         quelimg.runtimeStyle.backgroundImage = "none",
         quelimg.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + quelsrc + "', sizingMethod='image')",
         quelimg.src = "/image/transparent.gif"
         ) : 0
         ) : (
         quelimg.origBg = quelimg.origBg? quelimg.origBg :quelimg.currentStyle.backgroundImage.toString().replace('url("','').replace('")',''),
         quelimg.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + quelimg.origBg + "', sizingMethod='crop')",
         (quelimg.currentStyle.backgroundRepeat != 'no-repeat') ? (
         quelimg.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + quelimg.origBg + "', sizingMethod='scale')"
         ) : 0,
         quelimg.runtimeStyle.backgroundImage = "none"
         ),quelimg.pngSet=true
         )
         )
         quelimg.pngSet=true;
       //alert(quelimg.nodeName + '\n' + quelimg.runtimeStyle.filter + '\n' + quelsrc + '\n' + quelimg.src + '\n' + quelimg.pngSet);
     }
     
      function GetDomOffset( Obj, Prop ) {
	        var iVal = 0;
	        while (Obj && Obj.tagName != 'BODY') {
		        eval('iVal += Obj.' + Prop + ';');
		        Obj = Obj.offsetParent;
	        }
	        return iVal;
        }
        
   


    function ouvertureOngletNewsletter(quelDiv){
        document.getElementById(quelDiv).style.visibility='visible';
    }
    function fermerNewsletter(quelDiv){
        document.getElementById(quelDiv).style.visibility='hidden';
    }
   

   // <!-- Script de gestion des calendriers -->

    
        var CalendrierOuvert = false;
        var quelChoixZone = '';

        // Maintenir le calendrier ouvert après postback ajax pour changer le mos en cours
        function setCalendarStateToOpen(etat) {
            CalendrierOuvert = etat;
        }
                                    
        // fermeture du calendrier
        function fermerCalendrier(oId) {
	        //cacheDivMenuBas();
	        if (document.getElementById(oId) != null)
	            document.getElementById(oId).style.display='none';
        }
        


    //<!-- Script de gestion des avis -->
   
        var AvisOuvert = '';

        // Maintenir le calendrier ouvert après postback ajax pour changer le mos en cours
        function setAvisStateToOpen(avisId) {
            //alert('setAvisStateToOpen : ' + avisId);
            AvisOuvert = avisId;
        }

    
        function PromoRedirect(url) {
            window.location = url;
        }


   /* <!-- Gestion de la Telecommande -->*/

  

    //script pour connaitre la hauteur de la div pour le MenuBas

        function hauteurDivMenuBas(quelDiv){
            var divHeight = 0;

            if(document.getElementById(quelDiv).offsetHeight)
                {
                     divHeight=document.getElementById(quelDiv).offsetHeight;
                }
            else if(document.getElementById(quelDiv).style.pixelHeight)
                {
                    divHeight=document.getElementById(quelDiv).style.pixelHeight;
                }
            return divHeight;
        }
        
        function basDivMenuBas(quelDiv){
            var divWidth = 0;

            if(document.getElementById(quelDiv).offsetWidth)
                {
                     divWidth=document.getElementById(quelDiv).offsetWidth;
                }
            else if(document.getElementById(quelDiv).style.pixelWidth)
                {
                    divWidth=document.getElementById(quelDiv).style.pixelWidth;
                }
            return divWidth;
        }
        
        function rollOverVoletV2(){
            document.getElementById('telecommandeV2btnPlusCritereG').style.backgroundPosition='0 -455px';
            document.getElementById('telecommandeV2btnPlusCritereD').style.backgroundPosition='0 -325px';
           
              var node = document.getElementById("telecommandeV2btnPlusCritere");
                        var childList = node.childNodes
                       
                        var i=0;
                              while (i < childList.length){
                                  if ((childList[i].tagName=="A")){
                                      var chaine=childList[i].className;
                                      childList[i].style.color='#FFFFFF';
                                      childList[i].style.backgroundImage='url(/image/telecom-elements/telecom-bout-plus-mat-on.png)';
                                                                    
                                  }
                              i++;
                              } 
         
            
        }
       function rollOutVoletV2(){
            document.getElementById('telecommandeV2btnPlusCritereG').style.backgroundPosition='0 -390px';
            document.getElementById('telecommandeV2btnPlusCritereD').style.backgroundPosition='0 -260px';
            //#0D3D85
          
               var node = document.getElementById("telecommandeV2btnPlusCritere");
                        var childList = node.childNodes
                       
                        var i=0;
                              while (i < childList.length){
                                  if ((childList[i].tagName=="A")){
                                      var chaine=childList[i].className;
                                    childList[i].style.color='#0D3D85';
                                    childList[i].style.backgroundImage='url(/image/telecom-elements/telecom-bout-plus-mat-off.png)';
                                      
                                      var assertion = childList[i].className;
                                      var patt1=/telecommandeSelection/gi;
                                 var resultat =(assertion.match(patt1));
                                      
                        if (resultat!=null){
                          childList[i].style.color="#E45600";
                        }
                        else{
                        childList[i].style.color="#0D3D85";
                        }

                                  
                                  }
                              i++;
                              } 
                    
                    
            
        }
        
        
        
        function rollOverVoletV2Open(){
            document.getElementById('telecommandeV2btnMoinsCritereG').style.backgroundPosition='0 -195px';
            document.getElementById('telecommandeV2btnMoinsCritereM').style.backgroundImage='url(/image/telecom-elements/telecom-bout-moins-mat-on.png)';
            document.getElementById('telecommandeV2btnMoinsCritereD').style.backgroundPosition='0 -65px';
            document.getElementById('telecommandeV2btnMoinsCritereM').style.color='#FFFFFF';
                      
            
        }
        
        function rollOver2VoletV2(){ 
            document.getElementById('telecommandeV2btnPlusCritereG').style.backgroundPosition='0 -455px';
            document.getElementById('ctl00_hlPlusDeCriteres').style.backgroundImage='url(/image/telecom-elements/telecom-bout-plus-mat-on.png)';
            document.getElementById('telecommandeV2btnPlusCritereD').style.backgroundPosition='0 -325px';
            document.getElementById('ctl00_hlPlusDeCriteres').style.color='#FFFFFF';
            
               var node = document.getElementById("telecommandeV2btnPlusCritere");
                        var childList = node.childNodes;
                       
                        var i=0;
                              while (i < childList.length){
                                  if ((childList[i].tagName=="DIV")){
                                      var chaine=childList[i].className;
                                    
                                      
                                      var assertion = childList[i].className;
                                      var patt1=/telecommandeSelection/gi;
                                 var resultat =(assertion.match(patt1));
                            
                        if (resultat!=null){
                        
                         document.getElementById('ctl00_hlPlusDeCriteres').style.color='#E45600';
                        }
                        else{
                        document.getElementById('ctl00_hlPlusDeCriteres').style.color='#FFFFFF';
                        }

                                  
                                  }
                              i++;
                              } 
               
            
        }
        
       function rollOutVoletV2Open(){ 
            document.getElementById('telecommandeV2btnMoinsCritereG').style.backgroundPosition='0 -130px';
            document.getElementById('telecommandeV2btnMoinsCritereM').style.backgroundImage='url(/image/telecom-elements/telecom-bout-moins-mat-off.png)';
            document.getElementById('telecommandeV2btnMoinsCritereD').style.backgroundPosition='0 0';
          
            document.getElementById('telecommandeV2btnMoinsCritereM').style.color='#0D3D85';
            var node = document.getElementById("telecommandeV2btnPlusCritere");
            var childList = node.childNodes;
            var i=0;
                              while (i < childList.length){
                                  if ((childList[i].tagName=="A")){
                                      var chaine=childList[i].className;
                                    
                                      
                                      var assertion = childList[i].className;
                                      var patt1=/telecommandeSelection/gi;
                                 var resultat =(assertion.match(patt1));
                                  
                        if (resultat!=null){
                         document.getElementById('telecommandeV2btnMoinsCritereM').style.color='#E45600';
                        }
                        else{
                        document.getElementById('telecommandeV2btnMoinsCritereM').style.color='#0D3D85';
                        }

                                  
                                  }
                              i++;
                              } 
               
                    
            
        }
        
        
       function rollOut2VoletV2(){
            document.getElementById('telecommandeV2btnPlusCritereG').style.backgroundPosition='0 -390px';
            document.getElementById('ctl00_hlPlusDeCriteres').style.backgroundImage='url(/image/telecom-elements/telecom-bout-plus-mat-off.png)';
            document.getElementById('telecommandeV2btnPlusCritereD').style.backgroundPosition='0 -260px';
         var assertion = document.getElementById('ctl00_hlPlusDeCriteres').className;
           var patt1=/telecommandeSelection/gi;
                                 var resultat =(assertion.match(patt1));
             
                             
                            if (resultat!=null){
                             document.getElementById('ctl00_hlPlusDeCriteres').style.color='#E45600';
                            }
                            else{
                            document.getElementById('ctl00_hlPlusDeCriteres').style.color='#0D3D85';
                            }
                        

                                  
                                 
            
        }
       
        
        function PointeurSurLaTelecommande(event)
        {
					var volet1, volet2;
					volet1 = document.getElementById('telecommandeV2')

					var PanelStandardHaut = GetDomOffset(volet1, 'offsetTop');
					var PanelStandardBas = PanelStandardHaut + hauteurDivMenuBas('telecommandeV2');
					var PanelStandardGauche = GetDomOffset(volet1, 'offsetLeft');
					var PanelStandardDroite = PanelStandardGauche + basDivMenuBas('telecommandeV2');

					var e = event || window.event;
					var scroll = new Array((document.documentElement && document.documentElement.scrollLeft) || window.pageXOffset || self.pageXOffset || document.body.scrollLeft,(document.documentElement && document.documentElement.scrollTop) || window.pageYOffset || self.pageYOffset || document.body.scrollTop);;

					return((e.clientX + scroll[0] - document.body.clientLeft >= PanelStandardGauche && e.clientX + scroll[0] - document.body.clientLeft <= PanelStandardDroite && e.clientY + scroll[1] - document.body.clientTop >= PanelStandardHaut && e.clientY + scroll[1] - document.body.clientTop <= PanelStandardBas));
        }

        function PointeurSurLaTelecommandeEtendue(event)
        {
					var volet1, volet2;
					volet1 = document.getElementById('telecommandeV2')
					volet2 = document.getElementById('voletTelecommandeV2')

					var PanelStandardHaut = GetDomOffset(volet1, 'offsetTop');
					var PanelStandardBas = PanelStandardHaut + hauteurDivMenuBas('telecommandeV2');
					var PanelStandardGauche = GetDomOffset(volet1, 'offsetLeft');
					var PanelStandardDroite = PanelStandardGauche + basDivMenuBas('telecommandeV2');
					var PanelEtenduHaut = GetDomOffset(volet2, 'offsetTop');
					var PanelEtenduBas = PanelEtenduHaut + hauteurDivMenuBas('voletTelecommandeV2');
					var PanelEtenduGauche = GetDomOffset(volet2, 'offsetLeft');
					var PanelEtenduDroite = PanelEtenduGauche + basDivMenuBas('voletTelecommandeV2');
					var e = event || window.event;
					var scroll = new Array((document.documentElement && document.documentElement.scrollLeft) || window.pageXOffset || self.pageXOffset || document.body.scrollLeft,(document.documentElement && document.documentElement.scrollTop) || window.pageYOffset || self.pageYOffset || document.body.scrollTop);;

					return((e.clientX + scroll[0] - document.body.clientLeft >= PanelStandardGauche && e.clientX + scroll[0] - document.body.clientLeft <= PanelStandardDroite && e.clientY + scroll[1] - document.body.clientTop >= PanelStandardHaut && e.clientY + scroll[1] - document.body.clientTop <= PanelStandardBas) || (e.clientX + scroll[0] - document.body.clientLeft >= PanelEtenduGauche && e.clientX + scroll[0] - document.body.clientLeft <= PanelEtenduDroite && e.clientY + scroll[1] - document.body.clientTop >= PanelEtenduHaut && e.clientY + scroll[1] - document.body.clientTop <= PanelEtenduBas));
        }




   
        function EcrireCarteFlash3D(IdDiv, urlDomaineInterface, fichierXml, FichierFondCarte, urlMapStationSWF, fondFlashcorpsPageStationsPlanStation, residence) {
            // <![CDATA[
            var flashvars = {};
            var params = {};
            var attributes = {};

            // alert('Début carte flash');

            flashvars.domain_interface = urlDomaineInterface;
            flashvars.fichier_xml_carte = fichierXml;
            flashvars.fichier_image_carte = FichierFondCarte;
            
            if (residence > 0)
            {
                flashvars.residence = residence;
            }

            params.menu = "false";
            params.quality = "high";
            params.scale = "noscale";
            params.salign = "tl";
            params.wmode = "transparent";
            params.seamlesstabbing = "false";
            params.allowfullscreen = "false";
            
            attributes.name = "loader";
            attributes.align = "middle";

            // alert('Avant Embed carte flash');

            swfobject.embedSWF(urlMapStationSWF, IdDiv, "706", "415", "8.0.0", false, flashvars, params, attributes);

            // alert('Fin carte flash');

            CentrerDiv('DivGlobaleCarte3DOffres');
        }
    
    
function CentrerDiv(idDiv)
{
    var DivCarte = document.getElementById(idDiv);
    var sHeight, sWidth, x, y, carteHeight, carteWidth;
    
    sWidth=document.documentElement.clientWidth;
    sHeight=document.documentElement.clientHeight;
    
    carteHeight = 474;
    carteWidth = 764;
    
    if (carteWidth < sWidth)
        x = (sWidth - carteWidth) / 2;
    else
        x = 0;
    if (carteHeight < sHeight)
        y = (sHeight - carteHeight) / 2;
    else
        y = 0;
    
    if (DivCarte != null)
    {    
        DivCarte.style.top = y + 'px';
        DivCarte.style.left = x + 'px';
    }
}
           



        


        // Redimmensionner une div trop grande
        function resizeDiv(oId){
            if (document.getElementById(oId) != null)
            {
                var hMax = 260;
                var obj = document.getElementById(oId.replace(/dt/,"dd"));
                var tailleDiv=obj.offsetHeight;
                if ((tailleDiv) > hMax){
                    obj.style.overflow = 'scroll';
                    obj.style.overflowX = 'hidden';
                    obj.style.height = hMax + "px";
                }
            }
        }
        
function redimmenAnimFlash(){
    var oDivAnimFlash = document.getElementById('animFlash');
    if (oDivAnimFlash != null)
    {
        if (document.body.offsetWidth>1280)
        {
            document.getElementById("animFlash").style.width="1280px";
            testLeft=(basDivMenuBas('tableauMenuBas')/2)+"px";
            document.getElementById("animFlash").style.left= ((document.body.offsetWidth/2)-640)+"px";
        }
        else
        {
            document.getElementById("animFlash").style.width=document.body.offsetWidth+"px";
        }
            
}
}
        

			
			
			function tailleFaussePopupMeteo(){
 	// tailletableauMenuBas=basDivMenuBas('tableauMenuBas');
           	 tailletableauMenuBas=document.body.offsetWidth;
    
             
                    // la taille du grisé Niveau 1
					document.getElementById('faussePopup').style.width=tailletableauMenuBas+"px";
					document.getElementById('faussePopup').style.height=tailletableauMenuBas+"px";
					document.getElementById('faussePopup').style.zIndex=12000;
				
 } 
            function PositionnerPopupMeteo(){
                document.getElementById('popupMeteoNeigeFicheV2').style.left=(tailletableauMenuBas/2)-(basDivMenuBas('popupMeteoNeigeFicheV2')/2)+"px";
                
                
                }
                
                var btnOuvert="";
                var btn2Ouvert="";
                
           function onBtnMeteoNeigeV2(quelDiv){
                    if (btn2Ouvert!=""){
                    
                      document.getElementById(btn2Ouvert).style.backgroundImage='none';
                    }
                     
                        document.getElementById(quelDiv).style.backgroundImage='url(/image/meteo-neige-select-on.png)'; 
                        btnOuvert=quelDiv;
                        btn2Ouvert=quelDiv;
                    //this.style.backgroundRepeat='no-repeat';
               //this.style.backgroundImage='url(/image/meteo-neige-select-roll.png)';this.style.backgroundRepeat='no-repeat';
               
                }
                function onmouseoverBtnMeteoNeigeV2(quelDiv){
               
               if (quelDiv!=btnOuvert){
              document.getElementById(quelDiv).style.backgroundImage='url(/image/meteo-neige-select-roll.png)';
               }
               
                }
                
                function onmouseoutBtnMeteoNeigeV2(quelDiv){
                 if (quelDiv!=btnOuvert){
              document.getElementById(quelDiv).style.backgroundImage='none';
               }
              
                }
                
                function tailleOngletIE6(){
                
                
                if(navigator.appVersion.substring(0,1) == "4")
                 
                   if  (document.getElementById('ongletPageStations') != null)  {
                  
                 document.getElementById('ongletPageStations').style.width="750px";
                  }


                }


// Gestion des mois du calendrier de la télécommande
function setMoisActif(idMois, idTitreMois, tabMois, tabTitreMois)
{
    var i;
    var oMois, oTitreMois;
    
    for (i = 0; i < tabMois.length; i++)
    {
        oMois = document.getElementById(tabMois[i]);
        oTitreMois = document.getElementById(tabTitreMois[i]);

        if (oMois != null && oTitreMois != null) {
            if (tabMois[i] == idMois) {
                oMois.style.display = 'block';
                oTitreMois.style.display = 'block';
                MoisActifCalendrier = i;
            }
            else {
                oMois.style.display = 'none';
                oTitreMois.style.display = 'none';
            }
        }
    }
}

function setMoisActifNum(nb, tabMois, tabTitreMois)
{
    var i;
    var oMois, oTitreMois;

    if (nb >= 0 && nb < tabMois.length) {
        for (i = 0; i < tabMois.length; i++)
        {
            oMois = document.getElementById(tabMois[i]);
            oTitreMois = document.getElementById(tabTitreMois[i]);

            if (oMois != null && oTitreMois != null) {
                if (i == nb) {
                    oMois.style.display = 'block';
                    oTitreMois.style.display = 'block';
                    MoisActifCalendrier = i;
                }
                else {
                    oMois.style.display = 'none';
                    oTitreMois.style.display = 'none';
                }
            }
        }
    }
}


function hrefToClick(oId, url) {
    var oLink, sOnclick, sHref;
    oLink = document.getElementById(oId);
    sOnclick = oLink.attributes["onclick"].value;
    sHref = oLink.href;
    oLink.href = url;
}

var xmlhttp;
function LoadHTML(url, id) {
    if (window.XMLHttpRequest)
        xmlhttp = new XMLHttpRequest();
    else if (window.ActiveXObject)
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    else
        return null;
    xmlhttp.onreadystatechange = function () {
        if (xmlhttp.readyState == 4) {
            if (xmlhttp.status == 200) {
                document.getElementById(id).innerHTML = xmlhttp.responseText;
                positionnementVoletMenuBas();
            }
        }
    }
    xmlhttp.open("GET", url, true);
    xmlhttp.send(null);
}
function LoadHTMLToString(url) {
    var result;
    if (window.XMLHttpRequest)
        xmlhttp = new XMLHttpRequest();
    else if (window.ActiveXObject)
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    else
        return null;
    xmlhttp.open("GET", url, false);
    xmlhttp.send(null);
    return xmlhttp.responseText;
}

// chargement ajax de la fiche station
function LoadHTMLFicheStation(url, id, lang, IdDivCarte, urlDomaineInterface, fichierXML, FondCarte, urlMapStation, divPlanStation, residence, quelPage)
{
	if (window.XMLHttpRequest)
		xmlhttp = new XMLHttpRequest();
	else if (window.ActiveXObject)
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	else
		return null;
	xmlhttp.onreadystatechange=function()
	{
		if (xmlhttp.readyState==4){
			if (xmlhttp.status==200){
				document.getElementById(id).innerHTML=xmlhttp.responseText;
                //alert(document.getElementById(id).innerHTML);
                
                CacherFlocon();
                
				OuvrirModalPopup('ficheStation');
				
				cachePremOnglet();
				choixChangementOngletStationV2('ongletStationFicheStationV2', lang);
				CacherOngletFiche('btnOngletLiensFicheStation', 'spanOngletCache');
				//alert(document.getElementById(id).innerHTML);
				affichePremOnglet();
				if (residence > 0)
				    EcrireCarteFlash3D(IdDivCarte, urlDomaineInterface, fichierXML, FondCarte, urlMapStation, divPlanStation, residence);
				
				    
				//positionnementVoletMenuBas();
				redimAnimFlashFiche();
                resolution();
                if (quelPage=='comparer'){
                  griseComparateur();
                }
                else{
                 tailleFaussePopupOffres();
                }
                
				PositionnerPopup('ficheStation');
				scripletPhotosV2();
				
				// gestion popup garantie neige
				document.getElementById('popupGarantieNeigeAjax').innerHTML = document.getElementById('popupGarantieNeigeFicheStationV2').innerHTML;
				document.getElementById('popupGarantieNeigeFicheStationV2').innerHTML = '';
				document.getElementById('popupGarantieNeigeFicheStationV2').style.display = 'none';
				// gestion popup météo neige
				document.getElementById('popupMeteoNeigeAjax').innerHTML = document.getElementById('popupMeteoNeigeFicheV2').innerHTML;
				document.getElementById('popupMeteoNeigeFicheV2').innerHTML = '';
				document.getElementById('popupMeteoNeigeFicheV2').style.display = 'none';
				// gestion popup avis
				document.getElementById('popupAvisAjax').innerHTML = document.getElementById('popupAvisFicheV2Station').innerHTML;
				document.getElementById('popupAvisFicheV2Station').innerHTML = '';
				document.getElementById('popupAvisFicheV2Station').style.display = 'none';
				
				resizeDivGriseV2('ongletStationFicheStationV2');
			}
		}
	}
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);
	 
}



// chargement ajax de la fiche résidence
function LoadHTMLFicheResidence(url, id, lang, IdDivCarte, urlDomaineInterface, fichierXML, FondCarte, urlMapStation, divPlanStation, residence, IdVideo,quelPage)
{
	if (window.XMLHttpRequest)
		xmlhttp = new XMLHttpRequest();
	else if (window.ActiveXObject)
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	else
		return null;
	xmlhttp.onreadystatechange=function()
	{
		if (xmlhttp.readyState==4){
			if (xmlhttp.status==200){
				document.getElementById(id).innerHTML=xmlhttp.responseText;
                //alert(document.getElementById(id).innerHTML);
                var allscript = document.getElementById(id).getElementsByTagName('script');
                for(var i=0;i< allscript.length;i++){
                    if (window.execScript) {
                        window.execScript(allscript[i].innerHTML); // eval in global scope for IE
                    }
                    else
                        window.eval(allscript[i].innerHTML);
                }
                
                CacherFlocon();
                
				OuvrirModalPopup('ficheResidence');
				
				cachePremOngletRes();choixChangementOngletFicheResidence('ongletStationFicheResidenceV2', lang);
				CacherOngletFiche('btnOngletLiensFicheResidence', 'spanOngletCache');
				affichePremOngletRes();
				
				if (residence > 0)
				    EcrireCarteFlash3D(IdDivCarte, urlDomaineInterface, fichierXML, FondCarte, urlMapStation, divPlanStation, residence);
				else {
				    CacherOngletFiche('btnOngletLocalisationFicheResidence', 'spanOngletLocalisationCache');
				}
				
				if (IdVideo != '')
				{
				    AfficherVideo(IdVideo, 'DivEmbed', '1', '', '', '', 0);
				    document.getElementById('DivVideoResidence').style.display = 'block';
				}
				
				//positionnementVoletMenuBas();
				redimAnimFlashFiche();
                resolution();
               if (quelPage=='comparer'){
                    griseComparateur();
                }
                else{
                 tailleFaussePopupOffres();
                }
				PositionnerPopup('ficheResidence');
				scripletPhotosV2();
				
				// gestion popup garantie neige
				document.getElementById('popupGarantieNeigeAjax').innerHTML = document.getElementById('popupGarantieNeigeFicheResidence').innerHTML;
				document.getElementById('popupGarantieNeigeFicheResidence').innerHTML = '';
				document.getElementById('popupGarantieNeigeFicheResidence').style.display = 'none';
				// gestion popup météo neige
				document.getElementById('popupMeteoNeigeAjax').innerHTML = document.getElementById('popupMeteoNeigeFicheV2').innerHTML;
				document.getElementById('popupMeteoNeigeFicheV2').innerHTML = '';
				document.getElementById('popupMeteoNeigeFicheV2').style.display = 'none';
				// gestion popup avis
				document.getElementById('popupAvisAjax').innerHTML = document.getElementById('popupAvisFicheV2Residence').innerHTML;
				document.getElementById('popupAvisFicheV2Residence').innerHTML = '';
				document.getElementById('popupAvisFicheV2Residence').style.display = 'none';
				
				resizeDivGriseV2('ongletStationFicheResidenceV2');
			}
		}
	}
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);
}


// chargement ajax de la fiche résidence
function LoadHTMLFicheUnique(url, id, lang, residence, destination, quelPage)
{
var dest='';
	if (window.XMLHttpRequest)
		xmlhttp = new XMLHttpRequest();
	else if (window.ActiveXObject)
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	else
		return null;
	xmlhttp.onreadystatechange=function()
	{
		if (xmlhttp.readyState==4){
			if (xmlhttp.status==200){
				document.getElementById(id).innerHTML=xmlhttp.responseText;
                //alert(document.getElementById(id).innerHTML);
                
                CacherFlocon();
                
                //inclusion destination
                if (destination =='mer'){
                    inclusion('/CssCombiner.axd?cssfiles=/CSS/css_fiche_mer.css');
                  prechargeImagesFicheSumMer();
                }
                if (destination =='montagne'){
                    inclusion('/CssCombiner.axd?cssfiles=/CSS/css_fiche_montagne.css');
                    prechargeImagesFicheSumMontagne();
                }
                if (destination =='campagne'){
                    inclusion('/CssCombiner.axd?cssfiles=/CSS/css_fiche_campagne.css');
                    prechargeImagesFicheSumCampagne();
                }
                if (destination =='ville'){
                    inclusion('/CssCombiner.axd?cssfiles=/CSS/css_fiche_ville.css');
                    prechargeImagesFicheSumCampagne();
                }
				OuvrirModalPopup('ficheResidence');
				
				cachePremOngletRes();
				
				choixChangementOngletFicheMer('ongletMerResidenceV2', lang, destination);
				/*choixChangementOngletFicheResidence('ongletStationFicheResidenceV2', lang);*/
				CacherOngletFiche('btnOngletLiensFicheResidence', 'spanOngletCache');
				affichePremOngletRes();
				
				//positionnementVoletMenuBas();
				redimAnimFlashFiche();
                resolution();
                 if (quelPage=='comparer'){
                    griseComparateur();
                }
                else{
                 tailleFaussePopupOffres();
                }
				
				scripletPhotosV2FicheUnique('Residence');
				scripletPhotosV2FicheUnique('Ville');
				
				// gestion popup avis
				document.getElementById('popupAvisAjax').innerHTML = document.getElementById('popupAvisFicheV2Residence').innerHTML;
				document.getElementById('popupAvisFicheV2Residence').innerHTML = '';
				document.getElementById('popupAvisFicheV2Residence').style.display = 'none';
				
				resizeDivGriseV2('ongletStationFicheResidenceV2');
				PositionnerPopup('ficheResidence');
			}
		}
	}
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);
}




function PositionnerPopup(quelDiv){

    document.getElementById(quelDiv).style.left=((document.body.offsetWidth)/2)-(basDivMenuBas(quelDiv)/2)+"px";
    tailleDiv=document.getElementById(quelDiv).style.width;
    
}

function PositionnerPopupN2(quelDiv){
    var tailleWidthpopupGarantieNeigeFicheV2=document.getElementById(quelDiv).offsetWidth;
    emplacementLeftFicheStation=GetDomOffset(document.getElementById('contenuPageStations'), 'offsetWidth' );
    document.getElementById(quelDiv).style.left=(emplacementLeftFicheStation/2)-(tailleWidthpopupGarantieNeigeFicheV2/2)+"px";
}


function EcrireFlashVideo(IdDiv, IdVideo, EtatVideo) {
    if (document.getElementById(IdDiv)) {
        document.getElementById(IdDiv).style.display = 'block';
        var so = new SWFObject("/Lecteur_skibed.swf", "Lecteur", "524", "350", "8", "#FFFFFF");
        so.addParam("wmode", "transparent");
        so.addVariable("idbien", IdVideo);
        so.addVariable("etatvideo", EtatVideo);
        so.write(IdDiv);
    }
}






function scripletPhotosV2(){
    document.getElementById('thumbs').style.width = '220px';
    document.getElementById('gallery').style.display = 'block';
    
  jQuery(document).ready(function($) {
				// We only want these styles applied when javascript is enabled
				$('div.navigation').css({'width' : '240px', 'float' : 'left'});
				$('div.content').css('display', 'block');

				// Initially set opacity on thumbs and add
				// additional styling for hover effect on thumbs
				var onMouseOutOpacity = 0.67;
				$('#thumbs ul.thumbs li').opacityrollover({
					mouseOutOpacity:   onMouseOutOpacity,
					mouseOverOpacity:  1.0,
					fadeSpeed:         'fast',
					exemptionSelector: '.selected'
				});
				
				// Initialize Advanced Galleriffic Gallery
				var gallery = $('#thumbs').galleriffic({
					delay:                     2500,
					numThumbs:                 15,
					preloadAhead:              10,
					enableTopPager:            true,
					enableBottomPager:         true,
					maxPagesToShow:            7,
					imageContainerSel:         '#slideshow',
					controlsContainerSel:      '#controls',
					captionContainerSel:       '#caption',
					loadingContainerSel:       '#loading',
					renderSSControls:          true,
					renderNavControls:         true,
					playLinkText:              'Play Slideshow',
					pauseLinkText:             'Pause Slideshow',
					prevLinkText:              '&lsaquo; Previous Photo',
					nextLinkText:              'Next Photo &rsaquo;',
					nextPageLinkText:          'Next &rsaquo;',
					prevPageLinkText:          '&lsaquo; Prev',
					enableHistory:             false,
					autoStart:                 false,
					syncTransitions:           true,
					defaultTransitionDuration: 900,
					onSlideChange:             function(prevIndex, nextIndex) {
						// 'this' refers to the gallery, which is an extension of $('#thumbs')
						this.find('ul.thumbs').children()
							.eq(prevIndex).fadeTo('fast', onMouseOutOpacity).end()
							.eq(nextIndex).fadeTo('fast', 1.0);
					},
					onPageTransitionOut:       function(callback) {
						this.fadeTo('fast', 0.0, callback);
					},
					onPageTransitionIn:        function() {
						this.fadeTo('fast', 1.0);
					}
				});

				/**** Functions to support integration of galleriffic with the jquery.history plugin ****/

				// PageLoad function
				// This function is called when:
				// 1. after calling $.historyInit();
				// 2. after calling $.historyLoad();
				// 3. after pushing "Go Back" button of a browser
				function pageload(hash) {
					// alert("pageload: " + hash);
					// hash doesn't contain the first # character.
					if(hash) {
						$.galleriffic.gotoImage(hash);
					} else {
						gallery.gotoIndex(0);
					}
				}

				// Initialize history plugin.
				// The callback is called at once by present location.hash. 
				$.historyInit(pageload, "advanced.html");

				// set onlick event for buttons using the jQuery 1.3 live method
				
				$("a[rel='history']").live('click', function(e) {
					if (e.button != 0) return true;
					
					var hash = this.href;
					hash = hash.replace(/^.*#/, '');

					// moves to a new page. 
					// pageload is called at once. 
					// hash don't contain "#", "?"
					$.historyLoad(hash);

					return false;
				});

				/****************************************************************************************/
			});
}


function scripletPhotosV2FicheUnique(id){
    document.getElementById('thumbs' + id).style.width = '220px';
    document.getElementById('gallery' + id).style.display = 'block';
    
  jQuery(document).ready(function($) {
				// We only want these styles applied when javascript is enabled
				$('div.navigation').css({'width' : '240px', 'float' : 'left'});
				$('div.content').css('display', 'block');

				// Initially set opacity on thumbs and add
				// additional styling for hover effect on thumbs
				var onMouseOutOpacity = 0.67;
				$('#thumbs'  + id + ' ul.thumbs li').opacityrollover({
					mouseOutOpacity:   onMouseOutOpacity,
					mouseOverOpacity:  1.0,
					fadeSpeed:         'fast',
					exemptionSelector: '.selected'
				});
				
				// Initialize Advanced Galleriffic Gallery
				var gallery = $('#thumbs' + id).galleriffic({
					delay:                     2500,
					numThumbs:                 15,
					preloadAhead:              10,
					enableTopPager:            true,
					enableBottomPager:         true,
					maxPagesToShow:            7,
					imageContainerSel:         '#slideshow' + id,
					controlsContainerSel:      '#controls',
					captionContainerSel:       '#caption' + id,
					loadingContainerSel:       '#loading' + id,
					renderSSControls:          true,
					renderNavControls:         true,
					playLinkText:              'Play Slideshow',
					pauseLinkText:             'Pause Slideshow',
					prevLinkText:              '&lsaquo; Previous Photo',
					nextLinkText:              'Next Photo &rsaquo;',
					nextPageLinkText:          'Next &rsaquo;',
					prevPageLinkText:          '&lsaquo; Prev',
					enableHistory:             false,
					autoStart:                 false,
					syncTransitions:           true,
					defaultTransitionDuration: 900,
					onSlideChange:             function(prevIndex, nextIndex) {
						// 'this' refers to the gallery, which is an extension of $('#thumbs')
						this.find('ul.thumbs').children()
							.eq(prevIndex).fadeTo('fast', onMouseOutOpacity).end()
							.eq(nextIndex).fadeTo('fast', 1.0);
					},
					onPageTransitionOut:       function(callback) {
						this.fadeTo('fast', 0.0, callback);
					},
					onPageTransitionIn:        function() {
						this.fadeTo('fast', 1.0);
					}
				});

				/**** Functions to support integration of galleriffic with the jquery.history plugin ****/

				// PageLoad function
				// This function is called when:
				// 1. after calling $.historyInit();
				// 2. after calling $.historyLoad();
				// 3. after pushing "Go Back" button of a browser
				function pageload(hash) {
					// alert("pageload: " + hash);
					// hash doesn't contain the first # character.
					if(hash) {
						$.galleriffic.gotoImage(hash);
					} else {
						gallery.gotoIndex(0);
					}
				}

				// Initialize history plugin.
				// The callback is called at once by present location.hash. 
				$.historyInit(pageload, "advanced.html");

				// set onlick event for buttons using the jQuery 1.3 live method
				$("a[rel='history']").live('click', function(e) {
					if (e.button != 0) return true;
					
					var hash = this.href;
					hash = hash.replace(/^.*#/, '');

					// moves to a new page. 
					// pageload is called at once. 
					// hash don't contain "#", "?"
					$.historyLoad(hash);

					return false;
				});

				/****************************************************************************************/
			});
}




function ViderContenuDiv(oId)
{
    var oDiv = document.getElementById(oId);
    if (oDiv != null)
        oDiv.innerHTML = '';
}


function AfficherFlocon(){
    var divWait, divGrise;
    divWait = document.getElementById('DivWait');
    divGrise = document.getElementById('faussePopupFlocon');
    if (divWait != null)
    {
        document.getElementById('DivWait').style.visibility = 'visible';
        if (divGrise != null)
            document.getElementById('faussePopupFlocon').style.display = 'block';
    }
}
function A(){
    var divWait, divGrise;
    divWait = document.getElementById('DivWait');
    divGrise = document.getElementById('faussePopupFlocon');
    if (divWait != null)
    {
        document.getElementById('DivWait').style.visibility = 'visible';
        if (divGrise != null)
            document.getElementById('faussePopupFlocon').style.display = 'block';
    }
}

function CacherFlocon(){
    var divWait, divGrise;
    divWait = document.getElementById('DivWait');
    divGrise = document.getElementById('faussePopupFlocon');
    if (divWait != null)
    {
        document.getElementById('DivWait').style.visibility = 'hidden';
        if (divGrise != null)
            document.getElementById('faussePopupFlocon').style.display = 'none';
    }
}


function LogoSkibedTransp(quelDiv){
    quelsrc="/statique/fr/image/logo-skibed.png";
    quelimg=document.getElementById(quelDiv);

    quelimg.runtimeStyle.backgroundImage = "none",
    quelimg.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + quelsrc + "', sizingMethod='image')",
    quelimg.src = "/image/transparent.gif"

}
function LogoSkibedTranspSum(){
    quelsrc="/statique/fr/image/logo-summerbed.png";
    quelimg=document.getElementById('logoSkibedV2');

    quelimg.runtimeStyle.backgroundImage = "none",
    quelimg.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + quelsrc + "', sizingMethod='image')",
    quelimg.src = "/image/transparent.gif"

}

function DrapeauxSkibedTransp(){
    quelsrc="/image/menuV2/menu-drap-fr-off.png";
    quelimg=document.getElementById('drapeauFrV2');

    quelimg.runtimeStyle.backgroundImage = "none",
    quelimg.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + quelsrc + "', sizingMethod='image')",
    quelimg.src = "/image/transparent.gif"
}



function PictoGarantieNeigeHomeTransp(quelLang){
quelsrc="/statique/"+quelLang+"/image/colonne_droite/colonne-droite-we-off.png";
 quelimg=document.getElementById('pictoGarantieNeigeHomeV2');
quelimg.runtimeStyle.backgroundImage = "none",
quelimg.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + quelsrc + "', sizingMethod='image')",
quelimg.src = "/image/transparent.gif"
/*
quelsrc2="/image/croix-h1n1-V2-off.png";
 quelimg2=document.getElementById('pictoGrippeH1N1');
quelimg2.runtimeStyle.backgroundImage = "none",
quelimg2.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + quelsrc2 + "', sizingMethod='image')",
quelimg2.src = "/image/transparent.gif"
//logoSkibedV2
*/

}
function PictoESFTransp(quelLang){
quelsrc="/statique/"+quelLang+"/image/colonne_droite/colonne-droite-cours-ski-off.png";
 quelimg=document.getElementById('pictoESFHomeV2');
quelimg.runtimeStyle.backgroundImage = "none",
quelimg.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + quelsrc + "', sizingMethod='image')",
quelimg.src = "/image/transparent.gif"


}

function PictoNouveau(quelLang){
quelsrc="/statique/"+quelLang+"/image/colonne_droite/colonne-droite-nouveau-fr.png";
 quelimg=document.getElementById('pictoNouveauHomeV2');
quelimg.runtimeStyle.backgroundImage = "none",
quelimg.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + quelsrc + "', sizingMethod='image')",
quelimg.src = "/image/transparent.gif"


}
function RollOverPictoWeekend(quelLang){
    if (vIE()==6){
      
     
quelsrc="/statique/"+quelLang+"/image/colonne_droite/colonne-droite-we-on.png";
 quelimg=document.getElementById('pictoGarantieNeigeHomeV2');
quelimg.runtimeStyle.backgroundImage = "none",
quelimg.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + quelsrc + "', sizingMethod='image')",
quelimg.src = "/image/transparent.gif"

    }
    else{
     document.getElementById('pictoGarantieNeigeHomeV2').src='/statique/'+quelLang+'/image/colonne_droite/colonne-droite-we-on.png'; 
    }
}
function RollOutPictoWeekend(quelLang){

if (vIE()==6){
      
     
quelsrc="/statique/"+quelLang+"/image/colonne_droite/colonne-droite-we-off.png";
 quelimg=document.getElementById('pictoGarantieNeigeHomeV2');
quelimg.runtimeStyle.backgroundImage = "none",
quelimg.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + quelsrc + "', sizingMethod='image')",
quelimg.src = "/image/transparent.gif"

    }
    else{
     document.getElementById('pictoGarantieNeigeHomeV2').src='/statique/'+quelLang+'/image/colonne_droite/colonne-droite-we-off.png'; 
    }
}


/*gestion roll over ESF colonne droite*/

function RollOverESF(quelLang){
    if (vIE()==6){
      
     
quelsrc="/statique/"+quelLang+"/image/colonne_droite/colonne-droite-cours-ski-on.png";
 quelimg=document.getElementById('pictoESFHomeV2');
quelimg.runtimeStyle.backgroundImage = "none",
quelimg.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + quelsrc + "', sizingMethod='image')",
quelimg.src = "/image/transparent.gif"

    }
    else{
     document.getElementById('pictoESFHomeV2').src='/statique/'+quelLang+'/image/colonne_droite/colonne-droite-cours-ski-on.png'; 
    }
}
function RollOutESF(quelLang){

if (vIE()==6){
      
     
quelsrc="/statique/"+quelLang+"/image/colonne_droite/colonne-droite-cours-ski-off.png";
 quelimg=document.getElementById('pictoESFHomeV2');
quelimg.runtimeStyle.backgroundImage = "none",
quelimg.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + quelsrc + "', sizingMethod='image')",
quelimg.src = "/image/transparent.gif"

    }
    else{
     document.getElementById('pictoESFHomeV2').src='/statique/'+quelLang+'/image/colonne_droite/colonne-droite-cours-ski-off.png'; 
    }
}
/*fin gestion roll over ESF*/

/*Gestion roll over colonne droite Offre eurogroupe Ete Hiver*/
function PictoEteHiverHomeTransp(quelLang){

    quelsrc="/statique/"+quelLang+"/image/colonne-droite-hiver-ete-off.png";
    quelimg=document.getElementById('pictoEteHiverHomeV2');
    quelimg.runtimeStyle.backgroundImage = "none",
    quelimg.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + quelsrc + "', sizingMethod='image')",
    quelimg.src = "/image/transparent.gif"


}

function RollOverPictoEteHiver(quelLang){
    if (vIE()==6){
      
             
        quelsrc="/statique/"+quelLang+"/image/colonne-droite-hiver-ete-on.png";
        quelimg=document.getElementById('pictoEteHiverHomeV2');
        quelimg.runtimeStyle.backgroundImage = "none",
        quelimg.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + quelsrc + "', sizingMethod='image')",
        quelimg.src = "/image/transparent.gif"

    }
    else{
     document.getElementById('pictoEteHiverHomeV2').src='/statique/'+quelLang+'/image/colonne-droite-hiver-ete-on.png'; 
    }
}
function RollOutPictoEteHiver(quelLang){

if (vIE()==6){
      
     
quelsrc="/statique/"+quelLang+"/image/colonne-droite-hiver-ete-off.png";
 quelimg=document.getElementById('pictoEteHiverHomeV2');
quelimg.runtimeStyle.backgroundImage = "none",
quelimg.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + quelsrc + "', sizingMethod='image')",
quelimg.src = "/image/transparent.gif"

    }
    else{
     document.getElementById('pictoEteHiverHomeV2').src='/statique/'+quelLang+'/image/colonne-droite-hiver-ete-off.png'; 
    }
}

/*Fin gestion roll over colonne droite Offre eurogroupe Ete Hiver*/
function rollOverCroixGrippeColonneDroite(){
    if (vIE()==6){
          
         
    quelsrc="/image/croix-h1n1-V2-on.png";
     quelimg=document.getElementById('pictoGrippeH1N1');
    quelimg.runtimeStyle.backgroundImage = "none",
    quelimg.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + quelsrc + "', sizingMethod='image')",
    quelimg.src = "/image/transparent.gif"

    }
    else{
     document.getElementById('pictoGrippeH1N1').src='/image/croix-h1n1-V2-on.png'; 
    
    }
 //   document.getElementById('ctl00_cphAccueil_MLLabel11').style.color="#FF0000";
}

function rollOutCroixGrippeColonneDroite(){
 if (vIE()==6){
          
         
    quelsrc="/image/croix-h1n1-V2-off.png";
     quelimg=document.getElementById('pictoGrippeH1N1');
    quelimg.runtimeStyle.backgroundImage = "none",
    quelimg.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + quelsrc + "', sizingMethod='image')",
    quelimg.src = "/image/transparent.gif"

    }
    else{
   //  document.getElementById('pictoGrippeH1N1').src='/image/croix-h1n1-V2-off.png'; 
    
    }
   
   // document.getElementById('ctl00_cphAccueil_MLLabel11').style.color="#0D2F85";
}
function ouvrirPopupGrippeH1N1(){

    if ( document.getElementById('popupGrippeAH1N1')){
     document.getElementById('popupGrippeAH1N1').style.display="block";
    }
    PositionnerPopup('popupGrippeAH1N1');
}
function fermerPopupGrippeH1N1(){
    if ( document.getElementById('popupGrippeAH1N1')){
     document.getElementById('popupGrippeAH1N1').style.display="none";
    }
}

/*Gestion Popup Accueil Eurogroupe Ete Hiver*/
function ouvrirPopupEteHiver(){

    if ( document.getElementById('popupEteHiver')){
     document.getElementById('popupEteHiver').style.display="block";
     document.getElementById('faussePopupFlocon').style.display = 'block';
    }
    PositionnerPopup('popupEteHiver');
}
function fermerPopupEteHiver(){
    if ( document.getElementById('popupEteHiver')){
     document.getElementById('popupEteHiver').style.display="none";
     document.getElementById('faussePopupFlocon').style.display = 'none';
    }
}
/*FIN Gestion Popup Accueil Eurogroupe Ete Hiver*/

/*Gestion Popup Offre Eurogroupe Ete Hiver*/
function ouvrirPopupEteHiverOffre(){

    if ( document.getElementById('popupEteHiverOffre')){
     document.getElementById('popupEteHiverOffre').style.display="block";
     document.getElementById('faussePopupFlocon').style.display = 'block';
    }
    PositionnerPopup('popupEteHiverOffre');
}
function fermerPopupEteHiverOffre(){
    if ( document.getElementById('popupEteHiverOffre')){
     document.getElementById('popupEteHiverOffre').style.display="none";
     document.getElementById('faussePopupFlocon').style.display = 'none';
    }
}
/*FIN Gestion Popup Offre Eurogroupe Ete Hiver*/

function fermerPopupTelechargerFlash(){
    if ( document.getElementById('divtelechargerFlash')){
     document.getElementById('divtelechargerFlash').style.display="none";
    }
}
function ouvrirPopupControleAge(){

    if ( document.getElementById('popupControleAge')){
        PositionnerPopupControleAge();
        document.getElementById('popupControleAge').style.display="block";
    }
}

function fermerPopupControleAge(){
    if ( document.getElementById('popupControleAge')){
     document.getElementById('popupControleAge').style.display="none";
    }
}

function r(s) {
    location.href = s;
}


function PositionnerPopupControleAge()
{
    if (document.getElementById('flechePositionOccupation') != null && document.getElementById('popupControleAge') != null)
    {
        /*emplacementLeftFlecheControleAge=GetDomOffset(document.getElementById('flecheControleAge'), 'offsetLeft');  
        emplacementTopFlecheControleAge=GetDomOffset(document.getElementById('flecheControleAge'), 'offsetTop');  */

        emplacementLeftMenuAge=GetDomOffset(document.getElementById('flechePositionOccupation'), 'offsetLeft');  
        emplacementTopMenuAge=GetDomOffset(document.getElementById('flechePositionOccupation'), 'offsetTop');  

        document.getElementById('popupControleAge').style.left=emplacementLeftMenuAge+42+"px";
        document.getElementById('popupControleAge').style.top=emplacementTopMenuAge-5+"px";
    }
}


function setCook(nom,valeur) {
    document.cookie = nom + "=" + valeur
}
function getCook(nom) {
    deb = document.cookie.indexOf(nom + "=")
    if (deb >= 0) {
        deb += nom.length + 1
        fin = document.cookie.indexOf(";",deb)
        if (fin < 0) fin = document.cookie.length
        return unescape(document.cookie.substring(deb,fin))
        }
    return ""
}

function AfficherPopupOffreEuroGroup() {
var href;

    if (navigator.appName=='Microsoft Internet Explorer') {
         href = document.URL.toString();
    }
    else{
         href = window.location.href;
    }

    if (href.indexOf(".co.uk") != -1){
     
       
    }
    else{

         var ck = getCook('offreEuroGroup');
        
        if (ck!='offreEuroGroup'){
            ouvrirPopupEteHiver();
        }
        setCook('offreEuroGroup','offreEuroGroup');
    }
    
       


    }
    
    
function PositionnerBtnVoirOffresCarte(){
    if(document.getElementById('voirToutesOffresStationCarte3DV2')!= null){
      taillemenu=basDivMenuBas('voirToutesOffresStationCarte3DV2');

      document.getElementById('voirToutesOffresStationCarte3DV2').style.marginLeft=((724/2)-(taillemenu/2))+"px";
    }


}
/*Gestion telecharger Flash*/

 function ouvertureTelechargerFlash(){
      divGrise = document.getElementById('faussePopupFlocon');
      if (divGrise){
           divGrise.style.display = 'block';
            tailleAnimFlashHauteur=document.getElementById('animFlash').offsetHeight;
            tailleAnimFlashWidth=document.body.offsetWidth;
            var largFenetre=document.body.offsetWidth;
              // alert(largFenetre);
             if (largFenetre<1260){
                  largFenetre='1260';
              }

					
					document.getElementById('faussePopupFlocon').style.width=tailleAnimFlashWidth+"px";
					document.getElementById('faussePopupFlocon').style.height=tailleAnimFlashHauteur+"px";
					document.getElementById('faussePopupFlocon').style.zIndex=200;

    }
    document.getElementById('divtelechargerFlash').style.display = 'block';
   // document.getElementById('divtelechargerFlash').style.left=(basDivMenuBas('tableauMenuBas')/2)-(basDivMenuBas('divtelechargerFlash')/2)+"px";
 }
 
 function fermertureTelechargerFlash(){
      divGrise = document.getElementById('faussePopupFlocon');
      if (divGrise){
           divGrise.style.display = 'none';
    }
    document.getElementById('divtelechargerFlash').style.display = 'none';
   // document.getElementById('divtelechargerFlash').style.left=(basDivMenuBas('tableauMenuBas')/2)-(basDivMenuBas('divtelechargerFlash')/2)+"px";
 }
/**/
//Gestion des jeux concours
 function ouvertureJeuConcours() {
    var startIndex = document.cookie.indexOf("skibedJeuConcours-a-enlever");
    if (startIndex == -1) {
        document.cookie = "skibedJeuConcours";
        if (document.getElementById('animFlash') != null) {
            divGrise = document.getElementById('faussePopupFlocon');
            if (divGrise) {
                divGrise.style.display = 'block';
            }
            LoadHTML('/ucwrapper/cms.aspx?ressource=SkibedV2_10semaines', 'CMSJeuConcours');
            document.getElementById('divJeuConcours').style.display = 'block';
            document.getElementById('divJeuConcours').style.left = (basDivMenuBas('tableauMenuBas') / 2) - (basDivMenuBas('divJeuConcours') / 2) + "px";
        }
    }
}
function fermetureJeuConcours() {
    document.getElementById('faussePopupFlocon').style.display = 'none';
    document.getElementById('divJeuConcours').style.display = "none";
}
function v2011() {
    var civ = "";
    var email = "";
    var nais = "";

    if(document.getElementById('civ1').checked) civ = "1"
    else if(document.getElementById('civ2').checked) civ = "2"
    else if(document.getElementById('civ3').checked) civ = "3";
    if(civ == "") document.getElementById('civdiv').style.color = '#ff0000'
    else document.getElementById('civdiv').style.color = '#0d3d85';

    var reg = new RegExp('^[a-z0-9]+([_|\.|-]{1}[a-z0-9]+)*@[a-z0-9]+([_|\.|-]{1}[a-z0-9]+)*[\.]{1}[a-z]{2,6}$', 'i');
    if(!reg.test(document.getElementById('email').value))
        document.getElementById('emaildiv').style.color = '#ff0000'
    else {
        email = document.getElementById('email').value;
        document.getElementById('emaildiv').style.color = '#0d3d85';
    }

    var jour = document.getElementById('jour').value;
    var mois = document.getElementById('mois').value;
    var annee = document.getElementById('annee').value;

    if ((jour == "JJ" || mois == "MM" || annee == "AAAA") || ((mois == 2 && jour > 28 && annee % 4 != 0) || (mois == 2 && jour > 29 && annee % 4 == 0) || ((mois == 4 || mois == 6 || mois == 9 || mois == 11) && jour > 30)))
        document.getElementById('naisdiv').style.color = '#ff0000'
    else {
        nais = jour + "/" + mois + "/" + annee
        document.getElementById('naisdiv').style.color = '#0d3d85';
    }

    if (civ != '' && email != '' && nais != '') {
        if (LoadHTMLToString('/evenement/jeu201111/inscription.aspx?civ=' + civ + '&email=' + encodeURIComponent(email) + '&nais=' + encodeURIComponent(nais) + '&referent=' + GetCookie('ReferentActuel')) != '' && annee < 1986) {
            tag = new Image();
            tag.src = "http://baseco.solution.weborama.fr/fcgi-bin/performance.fcgi?ID=310703&A=2&TR=14006&CL=&AC=&MA=0.0&AR=1&AV=0";
        }
        LoadHTML('/ucwrapper/cms.aspx?ressource=SkibedV2_10semainesmerci', 'CMSJeuConcours');
        setTimeout('fermetureJeuConcours()', 3000);
    }
}

/* cette fonction retourne la valeur d'un cookie */
/* mercid de NE PAS ajouter de code qui ne concerne pas la récupération de la valeur d'un cookie !!! */
function GetCookie(name)
{
    deb = document.cookie.indexOf(name + "=")
    if (deb >= 0) {
        deb += name.length + 1
        fin = document.cookie.indexOf(";",deb)
        if (fin < 0) fin = document.cookie.length
        return unescape(document.cookie.substring(deb,fin))
        }
    return ""
}


function fermeturePopupFanSkibedFaceBook(){
document.getElementById('faussePopupFlocon').style.display = 'none';

    document.getElementById('FanFacebook').style.visibility="hidden";

}



function SiteEnCours(){
    var href;

    if (navigator.appName=='Microsoft Internet Explorer') {
         href = document.URL.toString();
    }
    else{
         href = window.location.href;
    }

    if ((href.indexOf(".summerbed.") != -1) ||( href.indexOf(":8088") != -1)){
     
        return "Summerbed"
    }
    else{

        return "Skibed";
    }




}

function montreEteHiver(quel) {
	if(i==false) {
		document.getElementById("curseurEteHiver").style.visibility="visible"; // Si il est cacher (la verif n'est qu'une securitÃ©) on le rend visible.
		
		if (quel=='1'){
		   document.getElementById("txtInfosBullesEteHiver").innerHTML = document.getElementById("txtEteHiver1Avant").innerHTML;  
		}
		if (quel=='2'){
		    document.getElementById("txtInfosBullesEteHiver").innerHTML = document.getElementById("txtEteHiver2Avant").innerHTML;
		}
		
		i=true;
	}
}
function cacheEteHiver() {
	if(i==true) {
		GetId("curseurEteHiver").style.visibility="hidden"; // Si la bulle etais visible on la cache
		i=false;
	}
}

function montreEteHiverPromo(quel) {
	if(i==false) {
	document.getElementById("curseurEteHiverPromo").style.display="block"; 
		document.getElementById("curseurEteHiverPromo").style.visibility="visible"; // Si il est cacher (la verif n'est qu'une securitÃ©) on le rend visible.
		i=true;
	}
}
function cacheEteHiverPromo() {
	if(i==true) {
	document.getElementById("curseurEteHiverPromo").style.display="none";
		GetId("curseurEteHiverPromo").style.visibility="hidden"; // Si la bulle etais visible on la cache
		i=false;
	}
}


// RAZ des cookies du fil d'Ariane
function ResetCookiesFilAriane(NomCookieCriteres, NomCookieDernierCritere, RappelOffresNomCookie)
{
    setCookie(NomCookieCriteres, '', '/');
    setCookie(NomCookieDernierCritere, '', '/');
    setCookie(RappelOffresNomCookie, '0', '/');
}


// gestion des cookies en JS
function setCookie(name, value, path) {
    var s;
    s = name + "=" + escape(value) + ((path) ? "; path=" + path : "");
    document.cookie = s;
}

function setCookieV2(name, value, expires, path, domain, secure) {
    var curCookie = name + "=" + escape(value) +
	    ((expires) ? "; expires=" + expires.toGMTString() : "") +
	    ((path) ? "; path=" + path : "") +
	    ((domain) ? "; domain=" + domain : "") +
	    ((secure) ? "; secure" : "");
    document.cookie = curCookie;
}


function inclusion(fichier) {
    if (fichier.search('\.js') >= 0) {
        var js_effets=document.createElement("script");
        js_effets.setAttribute("type", "text/javascript");
        js_effets.setAttribute("src", fichier);
        document.getElementsByTagName("head")[0].appendChild(js_effets);
    } else {
        var css_style=document.createElement("link");
        css_style.setAttribute("rel", "stylesheet");
        css_style.setAttribute("type", "text/css");
        css_style.setAttribute("href", fichier);
        css_style.setAttribute("media", "screen");
        document.getElementsByTagName("head")[0].appendChild(css_style);
    }
}

function quelPrechargImagesFichesSum(quelDestination){
    if(quelDestination=='mer') {
      prechargeImagesFicheSumMer();
    }
    if(quelDestination=='montagne') {
     prechargeImagesFicheSumMontagne();
    }
    if(quelDestination=='campagne') {
      prechargeImagesFicheSumCampagne();
    }
    if(quelDestination=='ville') {
      prechargeImagesFicheSumVille();
    }

}
function prechargeImagesFicheSumMer(){


btnOnglet1 = new Image();
btnOnglet1.src = "/statique/fr/image/fiche-mer/fiche-summer-ongl-01-roll.png";
btnOnglet2 = new Image();
btnOnglet2.src = "/statique/fr/image/fiche-mer/fiche-summer-ongl-02-roll.png";
btnOnglet3 = new Image();
btnOnglet3.src = "/statique/fr/image/fiche-mer/fiche-summer-ongl-03-roll.png";
btnOnglet4 = new Image();
btnOnglet4.src = "/statique/fr/image/fiche-mer/fiche-summer-ongl-04-roll.png";
btnOnglet5 = new Image();
btnOnglet5.src = "/statique/fr/image/fiche-mer/fiche-summer-ongl-05-roll.png";
btnOnglet6 = new Image();
btnOnglet6.src = "/statique/fr/image/fiche-mer/fiche-summer-ongl-01-on.png";
btnOnglet7 = new Image();
btnOnglet7.src = "/statique/fr/image/fiche-mer/fiche-summer-ongl-02-on.png";
btnOnglet8 = new Image();
btnOnglet8.src = "/statique/fr/image/fiche-mer/fiche-summer-ongl-03-on.png";
btnOnglet9 = new Image();
btnOnglet9.src = "/statique/fr/image/fiche-mer/fiche-summer-ongl-04-on.png";
btnOnglet10 = new Image();
btnOnglet10.src = "/statique/fr/image/fiche-mer/fiche-summer-ongl-05-on.png";
btnOnglet11 = new Image();
btnOnglet11.src = "/statique/fr/image/fiche-mer/fiche-summer-ongl-01-off.png";


}
function prechargeImagesFicheSumMontagne(){

btnOnglet1 = new Image();
btnOnglet1.src = "/statique/fr/image/fiche-montagne/fiche-summer-ongl-01-roll.png";
btnOnglet2 = new Image();
btnOnglet2.src = "/statique/fr/image/fiche-montagne/fiche-summer-ongl-02-roll.png";
btnOnglet3 = new Image();
btnOnglet3.src = "/statique/fr/image/fiche-montagne/fiche-summer-ongl-03-roll.png";
btnOnglet4 = new Image();
btnOnglet4.src = "/statique/fr/image/fiche-montagne/fiche-summer-ongl-04-roll.png";
btnOnglet5 = new Image();
btnOnglet5.src = "/statique/fr/image/fiche-montagne/fiche-summer-ongl-05-roll.png";
btnOnglet6 = new Image();
btnOnglet6.src = "/statique/fr/image/fiche-montagne/fiche-summer-ongl-01-on.png";
btnOnglet7 = new Image();
btnOnglet7.src = "/statique/fr/image/fiche-montagne/fiche-summer-ongl-02-on.png";
btnOnglet8 = new Image();
btnOnglet8.src = "/statique/fr/image/fiche-montagne/fiche-summer-ongl-03-on.png";
btnOnglet9 = new Image();
btnOnglet9.src = "/statique/fr/image/fiche-montagne/fiche-summer-ongl-04-on.png";
btnOnglet10 = new Image();
btnOnglet10.src = "/statique/fr/image/fiche-montagne/fiche-summer-ongl-05-on.png";
btnOnglet11 = new Image();
btnOnglet11.src = "/statique/fr/image/fiche-montagne/fiche-summer-ongl-01-off.png";


}
function prechargeImagesFicheSumCampagne(){

btnOnglet1 = new Image();
btnOnglet1.src = "/statique/fr/image/fiche-campagne/fiche-summer-ongl-01-roll.png";
btnOnglet2 = new Image();
btnOnglet2.src = "/statique/fr/image/fiche-campagne/fiche-summer-ongl-02-roll.png";
btnOnglet3 = new Image();
btnOnglet3.src = "/statique/fr/image/fiche-campagne/fiche-summer-ongl-03-roll.png";
btnOnglet4 = new Image();
btnOnglet4.src = "/statique/fr/image/fiche-campagne/fiche-summer-ongl-04-roll.png";
btnOnglet5 = new Image();
btnOnglet5.src = "/statique/fr/image/fiche-campagne/fiche-summer-ongl-05-roll.png";
btnOnglet6 = new Image();
btnOnglet6.src = "/statique/fr/image/fiche-campagne/fiche-summer-ongl-01-on.png";
btnOnglet7 = new Image();
btnOnglet7.src = "/statique/fr/image/fiche-campagne/fiche-summer-ongl-02-on.png";
btnOnglet8 = new Image();
btnOnglet8.src = "/statique/fr/image/fiche-campagne/fiche-summer-ongl-03-on.png";
btnOnglet9 = new Image();
btnOnglet9.src = "/statique/fr/image/fiche-campagne/fiche-summer-ongl-04-on.png";
btnOnglet10 = new Image();
btnOnglet10.src = "/statique/fr/image/fiche-campagne/fiche-summer-ongl-05-off.png";
btnOnglet11 = new Image();
btnOnglet11.src = "/statique/fr/image/fiche-campagne/fiche-summer-ongl-01-off.png";

}
function prechargeImagesFicheSumVille(){

btnOnglet1 = new Image();
btnOnglet1.src = "/statique/fr/image/fiche-ville/fiche-summer-ongl-01-roll.png";
btnOnglet2 = new Image();
btnOnglet2.src = "/statique/fr/image/fiche-ville/fiche-summer-ongl-02-roll.png";
btnOnglet3 = new Image();
btnOnglet3.src = "/statique/fr/image/fiche-ville/fiche-summer-ongl-03-roll.png";
btnOnglet4 = new Image();
btnOnglet4.src = "/statique/fr/image/fiche-ville/fiche-summer-ongl-04-roll.png";
btnOnglet5 = new Image();
btnOnglet5.src = "/statique/fr/image/fiche-ville/fiche-summer-ongl-05-roll.png";
btnOnglet6 = new Image();
btnOnglet6.src = "/statique/fr/image/fiche-ville/fiche-summer-ongl-01-on.png";
btnOnglet7 = new Image();
btnOnglet7.src = "/statique/fr/image/fiche-ville/fiche-summer-ongl-02-on.png";
btnOnglet8 = new Image();
btnOnglet8.src = "/statique/fr/image/fiche-ville/fiche-summer-ongl-03-on.png";
btnOnglet9 = new Image();
btnOnglet9.src = "/statique/fr/image/fiche-ville/fiche-summer-ongl-04-on.png";
btnOnglet10 = new Image();
btnOnglet10.src = "/statique/fr/image/fiche-ville/fiche-summer-ongl-05-off.png";
btnOnglet11 = new Image();
btnOnglet11.src = "/statique/fr/image/fiche-ville/fiche-summer-ongl-01-off.png";

}

function lancementFondSite(){

var tailleImage="";
if  (document.documentElement.clientWidth< 1260){
tailleImage=" width='"+document.documentElement.clientWidth+"'";
}

if(fonds.length==0){
fonds[0]="home_01.jpg";
}

         for (var i=0; i<fonds.length; i++){ 
           
            document.getElementById('slideshow').innerHTML = document.getElementById('slideshow').innerHTML+"<img src='http://www1.summerbed.com/image/fonds/"+fonds[i]+"' "+tailleImage+" />";
          } 
           premiereImageFond = new Image();
           premiereImageFond.src = "http://www1.summerbed.com/image/fonds/"+ fonds[0];
           
           
       
           

            $(document).ready(function() {
                  document.getElementById("slideshow").style.display='block';
                    $('.slideshow').cycle({
		                fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	                });
                });
     
}

function lancementFondSiteBO(){

var tailleImage="";
if  (document.documentElement.clientWidth< 1260){
tailleImageWidth=document.documentElement.clientWidth;
tailleImageHeight=(tailleImageWidth*742)/1260;
}
else{
tailleImageWidth="1260";
tailleImageHeight="742";
}

if(fonds.length==0){
fonds[0]="home_01.jpg";
}

         for (var i=0; i<fonds.length; i++){ 
          
            document.getElementById('slideshow').style.width=tailleImageWidth+"px";
             document.getElementById('slideshow').style.height=tailleImageHeight+"px";
            
			document.getElementById('slideshow').style.background="url(http://www1.summerbed.com/image/fonds/"+fonds[i]+")";
          } 
          // premiereImageFond = new Image();
           //premiereImageFond.src = "http://www1.summerbed.com/image/fonds/"+ fonds[0];
           
           
       
           

            $(document).ready(function() {
                  document.getElementById("slideshow").style.display='block';
                    $('.slideshow').cycle({
		                fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	                });
                });
     
}
/***************************************************************/
/* fonction appelée pour tracker des événements de type "clic" */
function clk(action)
{
    if(document.images)
    {
        (new Image()).src="http://suivi.travelbed.fr/default.ashx?"+action;
    }
    return true;
}
/***************************************************************/

function carteStationsSkibed(quelLang){
    if (document.getElementById("fondFlashcorpsPageStationsPlanStation") != null)
    {
        var so = new SWFObject("/map/navig.swf", "Lecteur", "706", "475", "8", "#FFFFFF");
        if (quelLang=='fr'){
            so.addVariable("dataxml", '%2Fmap%2Fdata_fr');
        }
        else
        {
            so.addVariable("dataxml", '%2Fmap%2Fdata_en');
        }
        //swfobject.embedSWF("/map/navig.swf", "fondFlashcorpsPageStationsPlanStation", "706", "475", "9.0.0", false, flashvars, params, attributes);
        so.addParam("menu", "false");
        so.addParam("quality", "high");
        so.addParam("scale", "noscale");
        so.addParam("salign", "tl");
        so.addParam("wmode", "transparent");
        so.addParam("seamlesstabbing", "false");
        so.addParam("allowfullscreen", "false");
        //so.addAtributes("name", "loader");
        //so.addAtributes("align", "middle");
        so.write('fondFlashcorpsPageStationsPlanStation');
    }
}


function ouvrirInfosFormules(){
  document.getElementById("infosFormules").style.display='block';

}
function fermerInfosFormules(){
  document.getElementById("infosFormules").style.display='none';

}
function ouvertureGriseFichesOnglets(){
    
    if (document.getElementById("pageFicheMixte") !=null){
        ouvertureGriseFichesInterne2();
    }
    if (document.getElementById("pageComparateur") !=null){
        ouvertureGriseFichesInterne2('ficheResidence');
    }
   
}


function ouvertureGriseFichesInterne2(quelDiv){

if( document.getElementById('ficheResidence') != null){
   
     topquelDiv=document.getElementById('ficheResidence').offsetTop;

    
}
//faussePopupDerriereFicheStation
      divGrise = document.getElementById('faussePopup');
      if (divGrise){
           divGrise.style.display = 'block';
            tailleAnimFlashHauteur=document.getElementById('animFlash').offsetHeight;
            tailleAnimFlashWidth=document.getElementById('animFlash').offsetWidth;
            
         var largFenetre=0;
            
              // alert(largFenetre);
             if (largFenetre<1260){
                  largFenetre='1260';
              }
             if( document.getElementById('ucFicheStationARemettre') != null){
                 tailleAnimFlashHauteur33=hauteurDivMenuBas('ucFicheStationARemettre');
                if (tailleAnimFlashHauteur33<1000){
                    document.getElementById('faussePopup').style.height=1050+"px";
                }
                else{
                 document.getElementById('faussePopup').style.height=tailleAnimFlashHauteur33+50+"px";
                }
             }
             if((document.getElementById('ficheResidence') != null)&&(document.getElementById('pageComparateur')!= null)){
                 tailleAnimFlashHauteur33=hauteurDivMenuBas('ficheResidence');
                if (tailleAnimFlashHauteur33<(hauteurDivMenuBas('tableDevis1')+hauteurDivMenuBas('banBasCompa')+40)){
                    document.getElementById('faussePopup').style.height=hauteurDivMenuBas('tableDevis1')+hauteurDivMenuBas('banBasCompa')+40+"px";
                }
                else{
                 document.getElementById('faussePopup').style.height=hauteurDivMenuBas('ficheResidence')+topquelDiv+"px";
               
                }
             }
            
              largFenetre=basDivMenuBas('slideshow');

					//document.getElementById('animFlash').style.width=basDivMenuBas('tableauMenuBas')+"px";
					document.getElementById('faussePopup').style.width=basDivMenuBas('tableauMenuBas')+"px";
					document.getElementById('faussePopupNiveau2').style.height=document.documentElement.clientHeight+200+"px";
					document.getElementById('faussePopupNiveau2').style.width=basDivMenuBas('tableauMenuBas')+"px";
					document.getElementById('faussePopup').style.zIndex=200;
					
					if (document.getElementById('faussePopupDerriereFicheStation') !=null){
					    document.getElementById('faussePopupDerriereFicheStation').style.width=basDivMenuBas('tableauMenuBas')+"px";
					    document.getElementById('faussePopupDerriereFicheStation').style.height=document.documentElement.clientHeight+"px";
    					
					}
					//document.documentElement.clientHeight
					//faussePopupDerriereFicheStation
					
					

    }
 }
 
function ouvertureGriseFichesInterne(){

//faussePopupDerriereFicheStation
      divGrise = document.getElementById('faussePopup');
      if (divGrise){
           divGrise.style.display = 'block';
            tailleAnimFlashHauteur=document.getElementById('animFlash').offsetHeight;
            tailleAnimFlashWidth=document.getElementById('animFlash').offsetWidth;
            
         var largFenetre=0;
            
              // alert(largFenetre);
             if (largFenetre<1260){
                  largFenetre='1260';
              }
             if( document.getElementById('ucFicheStationARemettre') != null){
                 tailleAnimFlashHauteur33=hauteurDivMenuBas('ucFicheStationARemettre');
                if (tailleAnimFlashHauteur33<1000){
                    document.getElementById('faussePopup').style.height=1050+"px";
                }
                else{
                 document.getElementById('faussePopup').style.height=tailleAnimFlashHauteur33+50+"px";
                }
             }
            
              largFenetre=basDivMenuBas('slideshow');

					//document.getElementById('animFlash').style.width=basDivMenuBas('tableauMenuBas')+"px";
					document.getElementById('faussePopup').style.width=basDivMenuBas('tableauMenuBas')+"px";
					document.getElementById('faussePopupNiveau2').style.height=document.documentElement.clientHeight+200+"px";
					document.getElementById('faussePopupNiveau2').style.width=basDivMenuBas('tableauMenuBas')+"px";
					document.getElementById('faussePopup').style.zIndex=200;
					
					if (document.getElementById('faussePopupDerriereFicheStation') !=null){
					    document.getElementById('faussePopupDerriereFicheStation').style.width=basDivMenuBas('tableauMenuBas')+"px";
					    document.getElementById('faussePopupDerriereFicheStation').style.height=document.documentElement.clientHeight+"px";
    					
					}
					//document.documentElement.clientHeight
					//faussePopupDerriereFicheStation
					
					

    }
 }
 function positionFichesInterne(){

     emplacementLeftImageTelecommande=GetDomOffset(document.getElementById('fauxMenuSsFiche'), 'offsetLeft' );
    
     var emplacmtFiche=0;
   
     emplacmtFiche=basDivMenuBas('fauxMenuSsFiche')+emplacementLeftImageTelecommande+15;

     document.getElementById('ucFicheStationARemettre').style.left=emplacmtFiche+"px";
}

function affichageBtnFermerFichesInternes(){
    var cookiePopUp=getCook('FichePopup');
    //contenuPageStations
    position1=GetDomOffset(document.getElementById('contenuPageStations'), 'offsetLeft' );
    positionTop=GetDomOffset(document.getElementById('contenuPageStations'), 'offsetTop' );
    var emplacmtBtn=position1+660;

      var largFenetre=document.body.offsetWidth;
               
             if (largFenetre<1260){
                  document.getElementById('ficheStation').style.left=emplacmtBtn+5+"px";
              }
              else{
                document.getElementById('ficheStation').style.left=emplacmtBtn+"px";
              }
    document.getElementById('ficheStation').style.top=positionTop+10+"px";
    if (cookiePopUp=="1"){
      document.getElementById('ficheStation').style.display="block";
     
     
        //ficheStation
    }
}
function btnFermerFicheComparateur(){
    if (document.getElementById('ficheStation')){
    
        //divFicheStationHaut
        if (document.getElementById('divFicheStationHaut')){
            document.getElementById('divFicheStationHaut').style.zIndex="500";  
            document.getElementById('divFicheStationHaut').style.position="absolute";  
            document.getElementById('divFicheStationHaut').style.top="8px";  
            document.getElementById('divFicheStationHaut').style.left="665px";  
        }
        if (document.getElementById('divFicheResidenceHaut')){
            document.getElementById('divFicheResidenceHaut').style.zIndex="500";  
            document.getElementById('divFicheResidenceHaut').style.position="absolute";  
            document.getElementById('divFicheResidenceHaut').style.top="8px";  
            document.getElementById('divFicheResidenceHaut').style.left="665px";  
        }
   
    }

}

function verificationPopupFicheUnique(){
 var cookiePopUp=getCook('FichePopup');
    if (cookiePopUp=="1"){
   
        cachePremOngletRes();
        CacherOngletFiche('btnOngletLiensFicheResidence', 'spanOngletCache');
        affichePremOngletRes();

    }
}


function retourHistoriqueFiche(){
    history.back(-1);
}


function retourOffresURLFiches(){
    var cookieRetourOffres=getCook('RetourOffres');
	var lienRetourOffres=decodeURIComponent(cookieRetourOffres.replace(/\+/g,  " "));
	var cookiePageOffresPopup= '0';

	cookiePageOffresPopup=getCook('PageOffresPopup');
	document.cookie = 'PageOffres='+cookiePageOffresPopup+';path=/';
	setCookie('PageOffresPopup', '', '/');
	
	// pour ne pas tracker la page des offres après fermeture d'une fiche
	setCookie('FermetureFiche', '1', '/');
	
    document.location.replace(lienRetourOffres);
}


/* Redirection vers le comparateur */
function ComparateurRedirect(IdOffre)
{
    var nbOffresMax = 4;
    var ckVal, lData, lID, oID, resID, resVal, params;
    var i;
    var rx;
    
    resID = '';
    
    /* Gestion du cookie Comparateur */
    ckVal = GetCookie('Comparateur');
    
    if (ckVal != '')
    {
        lData = ckVal.split('|');
        lID = lData[0].split('!');
        for (i = 0; i < lID.length; i++)
        {
            if (i < nbOffresMax - 1)
            {
                if (resID != '')
                    resID += '!';
                resID += lID[i];
            }
        }
    }
    
    
    if (IdOffre > 0)
    {    
        if (resID != '')
            resID += '!';
        resID += IdOffre
    }
    
    resVal = resID + '|' + window.location;
    setCookie('Comparateur', resVal, '/');
    
    rx = new RegExp("!", "g");
    params = resID.replace(rx, "@");
    
    location.href = '/reservation/comparer.aspx?o=' + params;
}

function nbOffresComparateur()
{
    var ckVal, lData, lID;
    var cnt;
    var trouveCookie=0;
    cnt = 0;
    
    /* Gestion du cookie Comparateur */
    ckVal = GetCookie('Comparateur');
   
    var x = readCookie('Comparateur')
    if (x) {
	    trouveCookie=1;
    }

    if ((ckVal != '')&&(ckVal != '|')){
   
        lData = ckVal.split('|');
        lID = lData[0].split('!');
        cnt = lID.length;
    }
    
    
    return cnt;
}

//verifi qu'un cookie existe
function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}
/* Ouverture de la petite popup avec les boutons Comparer et Réserver */
function OuvrirPopupComparerReserver(IdOffre, e, id, idSpan, promo, OffreSpecialeForfait, OffreSpecialeMateriel , afficheBtnComp)
{   
    if (document.getElementById('divOffresSpecialesTitre') !=null){
        document.getElementById('divOffresSpecialesTitre').style.display="none";
    }
    
    montrePopupComparateur();
    /*

    if (!e) var e = window.event;
                            				
    if (e.pageX || e.pageY)
    {
		posx = e.pageX;
		posy = e.pageY;
		
	}
	else if (e.clientX || e.clientY)
	{
		posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
		posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
                                           		
	}
	*/
    var divReserver, divComparer, divPromo, divTauxPromo, divOSTitre, divOSForfait, divOSMateriel, tbOffresSpecialesDates;
    
   // posPrix=document.getElementById("dlOffres_ctl00_DivScrollPrix").scrollLeft;
    var leftSpan2=GetDomOffset(document.getElementById(idSpan), 'offsetLeft' ); 
    var topSpan2=GetDomOffset(document.getElementById(idSpan), 'offsetTop' ); 
   
    var leftSpan1=GetDomOffset(document.getElementById('globalCentre2'), 'offsetLeft' ); 
    var topSpan1=GetDomOffset(document.getElementById('globalCentre2'), 'offsetTop' ); 

    
    var ajoutIE=0;
    var strChUserAgent = navigator.userAgent;
    var intSplitStart = strChUserAgent.indexOf("(",0);
    var intSplitEnd = strChUserAgent.indexOf(")",0);
    var strChMid = strChUserAgent.substring(intSplitStart, intSplitEnd);

    if((strChMid.indexOf("MSIE 7") != -1)||(strChMid.indexOf("MSIE 8") != -1)){
        IE7 = true;
        if (SiteEnCours()=="Summerbed"){
        ajoutIE=-20;
        }
         if (SiteEnCours()=="Skibed"){
          ajoutIE=-20;
         }
       
    }
    if(IsIE8Browser()){
     
        if (SiteEnCours()=="Summerbed"){
        ajoutIE=-20;
        }
         if (SiteEnCours()=="Skibed"){
          ajoutIE=-2;
         }
    }
    
    if(strChMid.indexOf("MSIE 6") != -1){
        IE6 = true;
        ajoutIE=-11;
    }
     if (SiteEnCours()=="Summerbed"){
     posx=((leftSpan2-leftSpan1)+ajoutIE+24)-clickScroll;
     }  
     if (SiteEnCours()=="Skibed"){
     posx=((leftSpan2-leftSpan1)+ajoutIE+21)-clickScroll;
     }         
    
   
    posy=(topSpan2-topSpan1)+5;
  
    divReserver = document.getElementById('DivBoutonReserver');
    divComparer = document.getElementById('DivBoutonComparer');
    
    if (divReserver != null)
        divReserver.onclick = new Function('OfferRedirect(' + IdOffre + '); A();');
    if (divComparer != null)
        divComparer.onclick = new Function('ComparateurRedirect(' + IdOffre + '); A();');
    
    // Ajout de la promo
    divPromo = document.getElementById('promoPopupOffres');
    divTauxPromo = document.getElementById('spanPromoPopupOffres');
    if (divPromo != null && divTauxPromo != null)
    {
        if (promo != '')
            divPromo.style.display = 'block';
        else
            divPromo.style.display = 'none';
        divTauxPromo.innerHTML = promo;
    }

    // Ajout des descriptifs des offres spéciales
    // utilisation d'une variable globale lOS
    // qui contient les offres spéciales disponibles sur la page
    var hasOS = false;
    tbOffresSpecialesDates = document.getElementById('tbOffreSpecialeForfaitPopupOffre');
    divOSTitre = document.getElementById('divOffresSpecialesTitre');
    divOSForfait = document.getElementById('divOffreSpecialeForfait');
    divOSMateriel = document.getElementById('divOffreSpecialeMateriel');
    if (lOS)
    {
        if (lOS[OffreSpecialeForfait])
        {
            divOSTitre.style.display='block';
            divOSForfait.innerHTML = lOS[OffreSpecialeForfait];
            hasOS = true;
        }
        else
            if (divOSForfait != null){
                divOSForfait.innerHTML = '';
            }
            
        if (lOS[OffreSpecialeMateriel])
        {   
            divOSTitre.style.display='block';
            divOSMateriel.innerHTML = lOS[OffreSpecialeMateriel];
            hasOS = true;
        }
        else
             if (divOSMateriel != null){
                 divOSMateriel.innerHTML = '';
            }
           
    }
    if (hasOS)
    {
        tbOffresSpecialesDates.style.display = 'block';
        divOSTitre.style.display='block';
    }
    else
    {
        if (tbOffresSpecialesDates != null){
                tbOffresSpecialesDates.style.display = 'none';
            }
         if (divOSTitre != null){
                divOSTitre.style.display = 'none';
            }
     
    }
     if (afficheBtnComp==false){
        document.getElementById('tabCompReserOffres').style.display='none';
        posx=posx-5;
     }
     
    
        
    affiche(id, idSpan, posx, posy);
    varQuelScroll='';
}



function fermerPopupComparerReserver(){
    document.getElementById('popupComparerReserverOffres').style.display="none";
}

 function griseComparateur(){
    tailleTableDevis=hauteurDivMenuBas('tableDevis1')+hauteurDivMenuBas('banBasCompa')+40;
   
       if (document.getElementById('contenuFicheStation') !=null){
       
            if(tailleTableDevis<hauteurDivMenuBas('contenuFicheStation')){
                document.getElementById('faussePopup').style.height=tailleTableDevis+"px";
            }
            else{
                 document.getElementById('faussePopup').style.height=tailleTableDevis+"px";
            }
            
        }
    }
    
    
    function tailleSlideshowComparateur(){
    largFenetreComparateur=document.getElementById('animFlash').offsetWidth;
        if (largFenetreComparateur<1260){
                   document.getElementById("imgSlideshowComparateur").style.width=document.getElementById('animFlash').offsetWidth+"px";
  
              }
    }
    
    function affiche(id , idSpan, posx, posy) {
   // alert(e.pageX + "\n" +e.pageY);
  document.getElementById(id).style.display = 'block';
   
  positionPopupComparerReserver(idSpan, posx, posy);
}

function positionPopupComparerReserver(IdSpan, posX, posY){
   // var leftSpan=GetDomOffset(document.getElementById(IdSpan), 'offsetLeft' );  
   // var topSpan=GetDomOffset(document.getElementById(IdSpan), 'offsetTop' );  
  
    if(IsIE8Browser()){
        if (SiteEnCours()=="Summerbed"){
            posX=posX+20;
        }
    }
    document.getElementById('popupComparerReserverOffres').style.left=(posX-124)+"px";
    document.getElementById('popupComparerReserverOffres').style.top=(posY+6)+"px";
   // alert(posX+"/"+posY);
}
function cachePopupComparateur2(e,id) {
  var relTarg = e.relatedTarget || e.toElement;
 
  if(!isChildOf(relTarg,document.getElementById('popupComparerReserverOffres'))) {
    document.getElementById(id).style.display = 'none';
  }
}
function isChildOf(child,par) {
if (child=='undefined'){
child='';
}
if (child.parentNode != 'undefined') {

      while(child!=document) {
     // alert("child : "+child.id + "/ par : "+par.id);
        if(child==par) { return true; }
        child = child.parentNode;
      }
  }
  return false;
}

function coords(e) { // capturer position de la souris
 xpos = e.layerX? e.layerX :
         e.offsetX? e.offsetX : 0; // +document.body.scrollLeft
 ypos = e.layerY? e.layerY :
        e.offsetY? e.offsetY  : 0; // +document.body.scrollTop
 if(xpos!=0 && ypos !=0) {

  
   // ou bien :
  
   }
   if (trouveLigneParente){
  
   }
 }
 
 
function trouveLigneParente(MonElement){
	var Parent = MonElement.parentNode ;
	if(Parent.tagName.toLowerCase() != "body"){
	
		temp = trouveLigneParente(Parent);
		if ((Parent.id == 'ctl00_dlOffres_ctl00_DivScrollPrix') || (Parent.id == 'ctl00_dlOffres_ctl01_DivScrollPrix') || (Parent.id == 'ctl00_dlOffres_ctl02_DivScrollPrix') || (Parent.id == 'ctl00_dlOffres_ctl03_DivScrollPrix')) {
			
			 switch (Parent.id) {
			     case 'ctl00_dlOffres_ctl00_DivScrollPrix':
                     clickScroll=clickScroll0;
                     break;
                 case 'ctl00_dlOffres_ctl01_DivScrollPrix':
                      clickScroll=clickScroll1;
                     break;
                 case 'ctl00_dlOffres_ctl02_DivScrollPrix':
                     clickScroll=clickScroll2;
                     break;
                 case 'ctl00_dlOffres_ctl03_DivScrollPrix':
                     clickScroll=clickScroll3;
                     break;
                     default: 
                     clickScroll=0;
                     break;
                    }
		}
	}
	else{
		temp = Parent;
	}
	
	return temp;
}


function montrePopupComparateur() {
id='popupComparerReserverOffres';
if (document.getElementById) {
document.getElementById(id).style.display="block";
} else if (document.all) {
document.all[id].style.display="block";
} else if (document.layers) {
document.layers[id].display="block";
}
}

function cachePopupComparateur(id) {
    id='popupComparerReserverOffres';
    if (document.getElementById) {
        document.getElementById(id).style.display="none";
    } else if (document.all) {
        document.all[id].style.display="none";
    } else if (document.layers) {
        document.layers[id].display="none";
    }
}



/* Ouverture de la popup infos hébergeur (prévue pour un usage interne) */
function OuvrirPopupHebergeur(NomHebergeur, TelHebergeur, idDiv)
{

     emplacementIdDivLeft=GetDomOffset(document.getElementById(idDiv), 'offsetLeft' );  
     emplacementIdDivTop=GetDomOffset(document.getElementById(idDiv), 'offsetTop' );  
    //infosHebergeurs
    document.getElementById('infosHebergeurs').innerHTML="<div style='padding:4px;'> Hebergeur : " + NomHebergeur + "</div> " + "<div style='padding:4px;'> Telephone : " + TelHebergeur + "</div> ";
    document.getElementById('infosHebergeurs').style.display="block";
    document.getElementById('infosHebergeurs').style.top=emplacementIdDivTop+"px";
    document.getElementById('infosHebergeurs').style.left=emplacementIdDivLeft-150+"px";
    //idDiv
}

function FermerPopupHebergeur(){

document.getElementById('infosHebergeurs').style.display="none";
}


// Overture d'une div en popup avec la vidéo de la résidence
// Overture d'une div en popup avec la vidéo de la résidence
function AfficherVideo(idVideo, IdDiv, etatVideo, NomResidence, urlOffres, TextLienOffres, nbOffres)
{

    var spanNomResidence, LienOffres, divLienOffres, sEtat;
    
    spanNomResidence = document.getElementById('NomResidenceSelection');
    if (spanNomResidence != null)
        spanNomResidence.innerHTML = NomResidence;
        
    LienOffres = document.getElementById('LienOffresResidence');
    if (LienOffres != null)
    {
        LienOffres.innerHTML = TextLienOffres;
        //LienOffres.href = urlOffres;
        LienOffres.onclick = new Function('r(\'' + escape(urlOffres) + '\');');
    }
        
    divLienOffres = document.getElementById('voirToutesOffresStationCarte3DV2');
    if (divLienOffres != null)
    {
        if (nbOffres > 0)
            divLienOffres.style.display = "block";
        else
            divLienOffres.style.display = "none";
    }
   
    
    if (etatVideo == 1)
        sEtat = 'true'
    else
        sEtat = 'false';
    
    var so = new SWFObject("/Lecteur_skibed.swf", "Lecteur", "710", "450", "9", "#FFFFFF");
    so.addVariable("js_diaporama", "false");
    so.addVariable("js_affichagelogo", "assets/logo.png");
    so.addVariable("js_affichagechapitre", "true");
    so.addVariable("js_referent", "skibed");
    so.addVariable("js_affichageIntercalaire", "false");
    so.addVariable("js_prechargement", "3000");
    so.addVariable("js_cliquable", "false");
    so.addVariable("js_pause", sEtat);
    so.addVariable("js_annonceid", idVideo);
    so.addVariable("js_appelfonctionfinlecture", "playercallback");
    so.addVariable("js_appeldatalecteur", "http://www.visiteonline.fr/appeldatalecteur.aspx");
    so.addParam("menu", "false");
    so.addParam("scale", "noScale");
    so.addParam("allowFullscreen", "transparent");
    so.addParam("allowScriptAccess", "always");
    so.addParam("bgcolor", "#ffffff");
    so.addParam("wmode", "transparent");
    so.write(IdDiv);
}

function AfficherVideoV1(idVideo, IdDiv, etatVideo, NomResidence, urlOffres, TextLienOffres, nbOffres)
{
    var spanNomResidence, LienOffres, divLienOffres;
    
    spanNomResidence = document.getElementById('NomResidenceSelection');
    if (spanNomResidence != null)
        spanNomResidence.innerHTML = NomResidence;
        
    LienOffres = document.getElementById('LienOffresResidence');
    if (LienOffres != null)
    {
        LienOffres.innerHTML = TextLienOffres;
        LienOffres.href = urlOffres;
    }
        
    divLienOffres = document.getElementById('voirToutesOffresStationCarte3DV2');
    if (divLienOffres != null)
    {
        if (nbOffres > 0)
            divLienOffres.style.display = "block";
        else
            divLienOffres.style.display = "none";
    }
    
    var so = new SWFObject("/Lecteur_skibed.swf", "Lecteur", "524", "350", "8", "#FFFFFF");
    so.addVariable("idbien", idVideo);
    so.addVariable("etatvideo", etatVideo);
    so.addParam("wmode", "transparent");
    so.write(IdDiv);
}


function placerDivVideoSelection(){

 emplacementIdDivTop=GetDomOffset(document.getElementById('fondResidenceVideos'), 'offsetTop' );  
  emplacementIdDivTopcontenuCentre=GetDomOffset(document.getElementById('contenuCentre'), 'offsetTop' );  

//divVideoSelection
document.getElementById('divVideoSelection').style.top=emplacementIdDivTop-emplacementIdDivTopcontenuCentre+"px";
}



function ConfirmerNewsletter() {
var divEmail, divConfirm;
divEmail = document.getElementById('divEmailNewsletter');
divConfirm = document.getElementById('divConfirmNewsletter');

if (divEmail != null)
divEmail.style.display = 'none';
if (divConfirm != null)
divConfirm.style.display = 'block';

(new Image()).src = "http://www.travelbed.fr/inscription.aspx?email="+encodeURIComponent(document.getElementById("NewsletterEmail").value)+"&source=Skibed&operation=Newsletter&muet";
}


     function ouvertureAvis(divAOuvrir){
                var nomDivClosed;
                nomDivClosed = divAOuvrir.replace(/Closed/,"Open");
                //alert(divAOuvrir + ', ' + nomDivClosed);
	            document.getElementById(divAOuvrir).style.display='none';
	            //alert(divAOuvrir + ', ' + document.getElementById(divAOuvrir).style.display);
		        document.getElementById(nomDivClosed).style.display='block';
		        //alert(nomDivClosed + ', ' + document.getElementById(nomDivClosed).style.display);
            }
            
            function fermetureAvis(divAFermer){
                var nomDivClosed;
                nomDivClosed = divAFermer.replace(/Open/,"Closed");
                //alert(divAFermer + ', ' + nomDivClosed);
	            document.getElementById(nomDivClosed).style.display='block';
		        document.getElementById(divAFermer).style.display='none';
            }
            

						function GestionTelecommande(event) {
						    alert('GestionTelecommande');
							if(!VoletOuvert) {
								if(CriteresEtendus() && PointeurSurLaTelecommande(event)) {
									OuvrirVoletV2();
								}
							} else {
								if(!PointeurSurLaTelecommandeEtendue(event)) {
									FermerVoletV2();
								}
							}
						}

						function MouseOverTelecommande(event) {
						alert('MouseOverTelecommande');
							if(!VoletOuvert && CriteresEtendus())
								OuvrirVoletV2();
						}

						function MouseOutTelecommande(event) {
						alert('MouseOutTelecommande');
							if(VoletOuvert && !PointeurSurLaTelecommande(event))
								FermerVoletV2();
						}

						function MouseOutVoletTelecommande(event) {
						alert('MouseOutVoletTelecommande');
							if(VoletOuvert && !PointeurSurLaTelecommande(event))
								FermerVoletV2();
						}

						function ouvertureVolet1NbrePersTelecommandeV2(){
							document.getElementById('telecommandeV2ListeNbrePersVolet1').style.display='block';
						}
 
 function ouvertureVolet2NbrePersTelecommandeV2(){
 document.getElementById('telecommandeV2ListeNbrePersVolet1').style.display='none';
   document.getElementById('telecommandeV2ListeNbrePersVolet').style.display='block';
 }
  function ouvertureVolet3NbrePersTelecommandeV2(){
 
    topVolet2TelecommandeV2=GetDomOffset(document.getElementById('Liens1telecommandeV2FormulesDureeMat2'), 'offsetTop' );
    topTelecommandeV2=GetDomOffset(document.getElementById('telecommandeV2'), 'offsetTop' );
  //alert(topVolet2TelecommandeV2);
     document.getElementById('telecommandeV2ListeListeNbrePersVolet3').style.top=(topVolet2TelecommandeV2-topTelecommandeV2-20)+'px';
   document.getElementById('telecommandeV2ListeListeNbrePersVolet3').style.display='block';

 }
   function fermerVolet3NbrePersTelecommandeV2(){
   document.getElementById('telecommandeV2ListeListeNbrePersVolet3').style.display='none';
 }
 function fermerVolet2NbrePersTelecommandeV2(){
 //telecommandeV2ListeNbrePersVolet
  document.getElementById('telecommandeV2ListeNbrePersVolet').style.display='none';
 }
    
function tailleFaussePopupOffres()
{


    if (document.getElementById('animFlash') != null && document.getElementById('faussePopup') != null && document.getElementById('faussePopupFlocon') != null && document.getElementById('faussePopupNiveau2') != null)
    {
        tailleAnimFlashHauteur = document.getElementById('animFlash').offsetHeight;
        tailleAnimFlashWidth=document.body.offsetWidth;
        var largFenetre=document.body.offsetWidth;
        // alert(largFenetre);
        if (largFenetre<1260)
        {
            largFenetre='1260';
        }
        // la taille du grisé Niveau 1
        document.getElementById('faussePopup').style.width=tailleAnimFlashWidth+"px";
        document.getElementById('faussePopup').style.height=tailleAnimFlashHauteur+"px";
        document.getElementById('faussePopup').style.zIndex=200;

	    document.getElementById('faussePopupFlocon').style.width=tailleAnimFlashWidth+"px";
        document.getElementById('faussePopupFlocon').style.height=tailleAnimFlashHauteur+"px";
        document.getElementById('faussePopupFlocon').style.zIndex=200;

        // la taille du grisé Niveau 2
        document.getElementById('faussePopupNiveau2').style.width=tailleAnimFlashWidth+"px";
        document.getElementById('faussePopupNiveau2').style.height=tailleAnimFlashHauteur+"px";
    }
}

function tailleFaussePopupAttente(){
    if (document.getElementById('animFlash') != null && document.getElementById('faussePopupFlocon') != null)
    {
        tailleAnimFlashHauteur=document.getElementById('animFlash').offsetHeight;
        tailleAnimFlashWidth=document.body.offsetWidth;

        var largFenetre=document.body.offsetWidth;
        // alert(largFenetre);
        if (largFenetre<1260){
            largFenetre='1260';
        }
	    document.getElementById('faussePopupFlocon').style.width=tailleAnimFlashWidth+"px";
	    document.getElementById('faussePopupFlocon').style.height=tailleAnimFlashHauteur+"px";
	    document.getElementById('faussePopupFlocon').style.zIndex=200;
	}
}
				
				
				function RollNouvelleRechercheTelecommandeV2(){
				
				    var IE6 = false;
                    var strChUserAgent = navigator.userAgent;
                    var intSplitStart = strChUserAgent.indexOf("(",0);
                    var intSplitEnd = strChUserAgent.indexOf(")",0);
                    var strChMid = strChUserAgent.substring(intSplitStart, intSplitEnd);

                    if(strChMid.indexOf("MSIE 6") != -1) IE6 = true;
                      
                    if (IE6 == true){
                         quelsrc1="/image/telecom-elements/telecom-bouton-g-on.png";
                         quelsrc3="/image/telecom-elements/telecom-bouton-d-on.png";
                         
                         quelimg1=document.getElementById('telecommandeV2btnNouvelleRechercheG2');
                         quelimg3=document.getElementById('telecommandeV2btnNouvelleRechercheD2');

                        quelimg1.runtimeStyle.backgroundImage = "none",
                        quelimg1.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + quelsrc1 + "', sizingMethod='image')",
                        quelimg1.src = "/image/transparent.gif"
                        
                      
                        quelimg3.runtimeStyle.backgroundImage = "none",
                        quelimg3.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + quelsrc3 + "', sizingMethod='image')",
                        quelimg3.src = "/image/transparent.gif"
                        
                    }
                    else{
                     document.getElementById('telecommandeV2btnNouvelleRechercheG2').style.backgroundPosition='0 -1067px';
				    
				     document.getElementById('telecommandeV2btnNouvelleRechercheD2').style.backgroundPosition='0 -935px';
				     
                    }
				    document.getElementById('telecommandeV2btnNouvelleRechercheM2').style.background='url(/image/telecom-elements/telecom-bouton-mat-on.png)';

				}
				
				function RollFermeNouvelleRechercheTelecommandeV2(){
				     var IE6 = false;
                    var strChUserAgent = navigator.userAgent;
                    var intSplitStart = strChUserAgent.indexOf("(",0);
                    var intSplitEnd = strChUserAgent.indexOf(")",0);
                    var strChMid = strChUserAgent.substring(intSplitStart, intSplitEnd);

                    if(strChMid.indexOf("MSIE 6") != -1) IE6 = true;
                     if (IE6 == true){
                         quelsrc1="/image/telecom-elements/telecom-bouton-g-off.png";
                         quelsrc3="/image/telecom-elements/telecom-bouton-d-off.png";
                         
                         quelimg1=document.getElementById('telecommandeV2btnNouvelleRechercheG2');
                         quelimg3=document.getElementById('telecommandeV2btnNouvelleRechercheD2');

                        quelimg1.runtimeStyle.backgroundImage = "none",
                        quelimg1.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + quelsrc1 + "', sizingMethod='image')",
                        quelimg1.src = "/image/transparent.gif"
                        
                      
                        quelimg3.runtimeStyle.backgroundImage = "none",
                        quelimg3.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + quelsrc3 + "', sizingMethod='image')",
                        quelimg3.src = "/image/transparent.gif"
                        
                    }
                    else{
                     document.getElementById('telecommandeV2btnNouvelleRechercheG2').style.backgroundPosition='0 -1001px';

				     document.getElementById('telecommandeV2btnNouvelleRechercheD2').style.backgroundPosition='0 -869px';
				    
				     }
				    document.getElementById('telecommandeV2btnNouvelleRechercheM2').style.background='url(/image/telecom-elements/telecom-bouton-mat-off.png)';
				
				
				}
function ouvertureDivDureeTelecommandeV2(){
document.getElementById('divOuverteDureetelecommandeV2ListeStation').style.display='block';
}
//fermetureDivDureeTelecommandeV2
function fermetureDivDureeTelecommandeV2(){
document.getElementById('divOuverteDureetelecommandeV2ListeStation').style.display='none';
}
function ouvertureligneVoletDuree(){
document.getElementById('volet2DureeTelecommandeV2').style.display='block';
}
function fermetureligneVoletDuree(){
document.getElementById('volet2DureeTelecommandeV2').style.display='none';
}
//volet2DureeTelecommandeV2

function fermetureVolet2Duree(){
document.getElementById('ctl00_cphAccueil_TelecommandeOffres_divDureeListeBase').style.display='none';
}
function emplacementVolet3Personne(){
//Recupere le Top de la div Adulte
 if(document.getElementById('ctl00_cphAccueil_TelecommandeOffres_dlParticipants_ctl01_divTitreParticipant')!= null){
 //ctl00_cphAccueil_TelecommandeOffres_dlMenusAges_ctl01_divListeAges
 //ctl00_cphAccueil_TelecommandeOffres_dlParticipants_ctl01_divTitreParticipant
 
emplacementctl00_cphAccueil_TelecommandeOffres_dlMenusAges_ctl02_divListeAges=GetDomOffset(document.getElementById('ctl00_cphAccueil_TelecommandeOffres_dlParticipants_ctl01_divTitreParticipant'), 'offsetTop' );
}
//Recupere le Top de la div contenante de la telecommande 
emplacementtelecommandeV2=GetDomOffset(document.getElementById('telecommandeV2Mat'), 'offsetTop' );

emplacement101=emplacementctl00_cphAccueil_TelecommandeOffres_dlMenusAges_ctl02_divListeAges-emplacementtelecommandeV2;
 if(document.getElementById('ctl00_cphAccueil_TelecommandeOffres_dlMenusAges_ctl01_divListeAges')!= null){
 document.getElementById('ctl00_cphAccueil_TelecommandeOffres_dlMenusAges_ctl01_divListeAges').style.top=emplacement101+"px";
 }

}			


 // Redimmensionner une div trop grande
        function resizeDiv(oId){
            if (document.getElementById(oId) != null)
            {
                var hMax = 260;
                var obj = document.getElementById(oId.replace(/dt/,"dd"));
                var tailleDiv=obj.offsetHeight;
                if ((tailleDiv) > hMax){
                    obj.style.overflow = 'scroll';
                    obj.style.overflowX = 'hidden';
                    obj.style.height = hMax + "px";
                }
            }
        }
        
        // Redimmensionner une div trop grande
        function resizeDivV2(oId){
            if (document.getElementById(oId) != null)
            {
                var hMax = 260;
                var obj = document.getElementById(oId);
                var tailleDiv=obj.offsetHeight;
                if ((tailleDiv) > hMax){
                    obj.style.overflow = 'scroll';
                    obj.style.overflowX = 'hidden';
                    obj.style.height = hMax + "px";
                }
            }
        }

        // Gestion du click sur un menu déroulant en div
        function cacheDivMenuBasSelectif(oId){
            if (document.getElementById(oId) != null)
            {
	            var o = document.getElementById(oId.replace(/dt/,"dd"));
            	
	            if ((!o.style.display) || (o.style.display == 'none')) {
		            cacheDivMenuBas();
		            o.style.display = 'block';
	            } else {
		            cacheDivMenuBas();
	            }
	        }
        }
        
        // Gestion du click sur un menu déroulant en div
        function cacheDivMenuBasSelectifV2(oId){
            // alert(document.getElementById(oId));
            if (document.getElementById(oId) != null)
            {
	            var o = document.getElementById(oId);
    	        
	            if ((!o.style.display) || (o.style.display == 'none')) {
		            cacheDivMenuBas();
		            o.style.display = 'block';
	            } else {
		            cacheDivMenuBas();
	            }
	        }
        }
        
        function ouvrirDivMenu(oId){
            if (document.getElementById(oId) != null)
            {
	            var o = document.getElementById(oId);
		            o.style.display = 'block';
	        }
        }
        
        function fermerDivMenu(oId){
            if (document.getElementById(oId) != null)
            {
	            var o = document.getElementById(oId);
		            o.style.display = 'none';
	        }
        }
        
        function testChildNodes(para){
            // if (para.hasChildNodes())
            // On vérifie d'abord si l'objet n'est pas vide, c.-à-d. s'il a des enfants
            {
              var collEnfants = para.childNodes;
              for (var i = 0; i < collEnfants.length; i++) 
              {
               // faire quelque chose avec chaque enfant en tant que children[i]
               // NOTE : la liste n'est pas une copie, l'ajout ou le retrait 
               // d'éléments modifiera la liste
                //alert(para.childNodes[i].id);
              }
            }
        }
        
          // ouverture de la carte 3D depuis les promos de l'accueil
        function OuvrirCarte(idStation) {
            var mp = $find('mpCarte3D');

            //PatienceAjax();
            __doPostBack('lbTargetCarte3D', idStation);
        }
    
        // monitor redimmenAnimFlash()
        /*FunctionMonitor.register("redimmenAnimFlash");
        alert(FunctionMonitor.getMetrics("redimmenAnimFlash"));
        FunctionMonitor.unregister("redimmenAnimFlash");*/
        
        function ovtStat(quelDiv){
             document.getElementById(quelDiv).style.display="block";
        
        }
        function cloStat(quelDiv){
             document.getElementById(quelDiv).style.display="none";
        //btnFermerVoletMenuBas
        }
        

/* vérifie si une fonction javascript existe */
function isDefinedFunction(f)
{
    return (typeof(f) == 'function');
}

function placerZonePaiement(){

        leftzoneAPrendre=GetDomOffset(document.getElementById('zoneAPrendre'), 'offsetLeft' );  
   	  topzoneAPrendre=GetDomOffset(document.getElementById('zoneAPrendre'), 'offsetTop' );  
   	 
   	   document.getElementById("ZonePaiement").style.left=leftzoneAPrendre+"px";
   	    document.getElementById("ZonePaiement").style.top=topzoneAPrendre+"px";
}
function fermerPopUpActicle(quelDiv){
 if ( document.getElementById(quelDiv)){
     document.getElementById(quelDiv).style.display="none";
     document.getElementById('faussePopup').style.display = 'none';
    }
}

 function PositionnerPopUp1erActicle(quelDiv){
     if (document.getElementById(quelDiv) != null)
         {
         
         document.getElementById(quelDiv).style.left=((document.body.offsetWidth)/2)-(basDivMenuBas(quelDiv)/2)+"px";
         }
                             
}


function ouvertureSkipassHome(quelDiv){
  if (document.getElementById(quelDiv) != null){
        document.getElementById(quelDiv).style.display='block';
        //telecommandeV2
     emplacementLeft=GetDomOffset(document.getElementById('telecommandeV2'), 'offsetLeft' );  

        document.getElementById(quelDiv).style.left=emplacementLeft+230+"px";
  }

}
function fermetureSkipassHome(quelDiv){
  if (document.getElementById(quelDiv) != null){
        document.getElementById(quelDiv).style.display='none';
        
  }

}


// Get URL Parameter
function gup(name)
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}

// gestion des référents en javascript (pour les appels vers Suivi)
function jsReferent()
{
    var res, annee;
    var refActuel = gup('referent');
    var hname = location.hostname.toLowerCase();
    var dnow = new Date();
    
    if (refActuel == '')
    {
        refActuel = GetCookie('ReferentActuel');
        if (refActuel == '')
        {
            switch (hname) {
                case 'www.skibed.com':
                case 'www.skibed.co.uk':
                    refActuel = 'SKI-' + dnow.add(-4, 'months').getFullYear().substr(2, 2) + dnow.add(8, 'months').getFullYear().substr(2, 2) + '-';
                    break;
                case 'www.summerbed.com':
                    refActuel = 'SUM-' + dnow.getFullYear().substr(2, 2) + '-';
                    break;
                default:
                    annee = dnow.getFullYear();
                    refActuel = 'DEV-' + dnow.getFullYear().substr(2, 2) + '-';
                    break;
            }
            
            switch (hname)
            {
                case 'www.skibed.co.uk' :
                    refActuel += 'EN-';
                    break;
                default:
                    refActuel += 'FR-';
                    break;
            }
            
            refActuel += 'PAS_DE_REFERENT';
        }
    }
    return refActuel.toUpperCase();
}

function copieDivPaiements(source, dest) {
    var divSource, divDest;
    divSource = document.getElementById(source);
    divDest = document.getElementById(dest);

    if (divDest != null && divSource != null) {
        divDest.innerHTML = divSource.innerHTML;
        divSource.innerHTML = '';
    }
}

