//Contenu milieu de la page
var contentMiddle = document.getElementById("content-middle") ;

/**********************************************************************************
*                                            Framework javascript
**********************************************************************************/
/** #########################################
* Permet de récupérer l'objet IFRAME
*/
function getIframeObjectMore(iframeName){                            
   if(document.frames){
   //IE 5
   IFrameObj = document.frames[iframeName];
   }
   else {
   //DOM IMPLEMENTED BROWSERS
   IFrameObj = document.getElementById(iframeName);
   }
   
   if(IFrameObj){
   if(IFrameObj.contentWindow){
   //IE 5.5 and more
   iframeObject = IFrameObj.contentWindow.document;        
   }
   else if(IFrameObj.contentDocument){
   //GECKO
   iframeObject = IFrameObj.contentDocument.document;        
   }
   else if(IFrameObj.document){
   //IE 5
   iframeObject = IFrameObj.document;
   }
   
   return iframeObject ;
   }
   return null ;
}

/** #########################################
* Permet de récupérer l'objet AJAX
*/
function getXhr(){
   if (window.ActiveXObject){
   try{
   xhr = new ActiveXObject("Msxml2.XMLHTTP");
   }
   catch (e){
   xhr = new ActiveXObject("Microsoft.XMLHTTP");
   }
   }
   else if(window.XMLHttpRequest)
   // Firefox et autres
   xhr = new XMLHttpRequest(); 
   else{
   // XMLHttpRequest not supported by browser
   alert("Your browser doesn't support XMLHTTPRequest objects..."); 
   xhr = false; 
   }                        
   return xhr ;
}

function setHtml(idObj, innerObj){
    var obj = document.getElementById(idObj) ;
    
    if(obj){
        if(innerObj != ""){
            obj.innerHTML = innerObj ;
        }
    }    
}

function setIframeSrc(idObj, src){
    var obj = document.getElementById(idObj) ;
    if(obj){
        if(src != ""){
            obj.src = src ;
        }
    }
}

function setHref(idObj, href, target){
    var obj = document.getElementById(idObj) ;
    if(obj){
        if(href != ""){
            obj.href = href ;
        }
        if(target != ""){
            obj.target = target ;
        }
    }
}

function setImage(idObj, src, alt, title){
    var obj = document.getElementById(idObj) ;
    if(obj){
        if(src != ""){
            obj.src = src ;
        }
        if(alt != ""){
            obj.alt = alt ;
        }
        if(title != ""){
            obj.title = title ;
        }        
    }
}

function setImageObj(obj, src, alt, title){    
    if(obj){
        if(src != ""){
            obj.src = src ;
        }
        if(alt != ""){
            obj.alt = alt ;
        }
        if(title != ""){
            obj.title = title ;
        }        
    }
}

function getElement(idObj, fromDocument, objSrc){
    if(fromDocument){
        if(document.getElementById(idObj)){
            return document.getElementById(idObj) ;
        }
        else{
            return null ;
        }
    }
    else{
        if(objSrc && objSrc != ""){
            if(objSrc.document.getElementById(idObj)){
                return document.getElementById(idObj) ;
            }
            else{
                return null ;
            }
        }
        else{
            return null ;
        }
    }
}

function hideBloc(obj){
    if(obj){
        obj.style.display = "none" ;
    }
}

function displayBloc(obj){
    if(obj){
        obj.style.display = "block" ;
    }
}
/** #########################################
* Permet de récupérer les paramètres passés à l'url
*/
function getParameters() {
    urlGet = document.location.search;
    params = urlGet.split("&");
    param = new Array();
    for(j=0;j<params.length; j++){
       param.push(params[j].split("=")) ;
    }
    return param;
}

/** #########################################
* Permet de cacher ou de montrer la carte map decathlon dans la page "où acheter"
*/
function displayMap(){
    if(document.getElementById('map-decathlon').style.display == "none"){
        document.getElementById('map-decathlon').style.display="block" ;
    }
    else{
        document.getElementById('map-decathlon').style.display="none" ;                            
    }
}

/** #########################################
* Permet de charger vue3D
*/
function chargeVue3d(urlVue3d, nomVue3d){
    if(document.getElementById('iframe-vue3d')){
        document.getElementById('iframe-vue3d').src = urlVue3d ;
	document.getElementById('title-vue3d').innerHTML = nomVue3d ;
    }    
}

/** #########################################
* Permet de créer le cookie
*/
function setCookie(langue, name, value) {      
    var argv=setCookie.arguments;
    var argc=setCookie.arguments.length;
    var path=null;
    if(langue && langue != ""){
            path="/"+langue+"/" ;
   }
    var exp = (argc > 3) ? argv[3] : null;
    var domain=(argc > 4) ? argv[4] : null;
    var secure=(argc > 5) ? argv[5] : false;    
    
    document.cookie=name+"="+escape(value)+
        ((exp==null) ? "" : ("; expires="+exp))+
        ((path==null) ? "" : ("; path="+path))+
        ((domain==null) ? "" : ("; domain="+domain))+
        ((secure==true) ? "; secure" : "");
}

/** #########################################
* Permet de récupérer les informations d'un cookie
*/
function getCookieVal(offset)
{
   var endstr=document.cookie.indexOf (";", offset);
   if (endstr==-1) endstr=document.cookie.length;
   return unescape(document.cookie.substring(offset, endstr));
}

function getCookie(name) {
    var arg=name+"=";
    var alen=arg.length;
    var clen=document.cookie.length;
    var i=0;
    while (i<clen) {
        var j=i+alen;
        if (document.cookie.substring(i, j)==arg)
            return getCookieVal (j);
        i=document.cookie.indexOf(" ",i)+1;
        if (i==0) 
            break;
    }
    return null;
}

/** #########################################
* Permet de supprimer un cookie
*/
function deleteCookie(langue, name) {
    var exp=new Date();
    exp.setTime (exp.getTime() - 100000);
    var cval=getCookie(name);
    if(cval){
        setCookie(langue, name, cval, exp.toGMTString());
    }
}

/** #########################################
* Permet d'afficher la popup de sondage
*/
function afficheSondage(language, nom, url){
    //A la 4ème page, on affiche la popup
    nbPageDefault = 1 ;
    nbPageLu = getCookie(nom);
    // Le cookie n'existe pas
    if (nbPageLu == null ){
        nbPageLu = 1 ;
        setCookie(language, nom, nbPageLu, "");
    }
    //sinon, il existe et on va incrémenter la valeur du nombre de clic dans ce cookie
    else{
        nbPageLu++ ;
        setCookie(language, nom, nbPageLu, "");
    }
   
    if(nbPageLu == nbPageDefault){
        //var win2 = window.open(url, 'sondage','width=600, height=500, scrollbars=yes, resizable =yes,alwaysLowered=yes');
        show_filter('main');
        show_filter('main-homepage');
        show_filter('main-autre');        
        show_popup('bloc-sondage');
    }
}

/** #########################################
* Permet de cacher ou afficher une div
*/
function hideSectionAdvice(obj){
    var parentSection = obj.parentNode ;
    if(parentSection){
        var section = parentSection.getElementsByTagName('div');
        for(i=0;i  < section.length; i++){
             section[i].className = 'rubConseil';
         }
    }
}

/** #########################################
* Permet d'afficher les fiches conseil par onglet
*/
function displaySection(obj, sectionDest, sectionId){    
    var sectionToDisplay = sectionId ;
    if(!obj || !document.getElementById(sectionId)){
        sectionToDisplay = "advice-links1" ;
        obj = document.getElementById("rubConseil1") ;
    }
    
    if(document.getElementById(sectionToDisplay)){
        var srcInnerrHtml = document.getElementById(sectionToDisplay).innerHTML ;
        if(document.getElementById(sectionDest)){
            document.getElementById(sectionDest).innerHTML = srcInnerrHtml ;
            document.getElementById(sectionDest).style.display = "block";
            
            if(obj){
                hideSectionAdvice(obj) ;
                obj.className = "rubConseilSelected" ;
                rubDefaut = obj.id ;
                advicesDefaut = sectionToDisplay ;
            }
        }
    }
}

/** #########################################
* Permet d'augmenter une zone de texte
*/
function increaseFontSize(idZones){
    var idZonesArr = idZones.split(';') ;
    for(var i=0 ; i<idZonesArr.length ; i++){
        var content = idZonesArr[i] ;
        increaseElement(content, "DIV") ;
        increaseElement(content, "A") ;
    }    
}


/** #########################################
* Permet de réduire une zone de texte
*/
function reduceFontSize(idZones){
    var idZonesArr = idZones.split(';') ;    
    for(var i=0 ; i<idZonesArr.length ; i++){
        var content = idZonesArr[i] ;
        reduceElement(content, "DIV") ; 
        reduceElement(content, "A") ;        
    }        
}


/** #########################################
* Permet de réduire les texte d'un bloc
*/
function reduceElement(content, elementType){    
    if(contentMiddle){
        var childNode = contentMiddle.getElementsByTagName(elementType);
        for(i=0;i  < childNode.length; i++){
            var childrenNode = childNode[i] ;
            if(childrenNode.id == content){
                if(childrenNode.style){
                    if(childrenNode.style.fontSize == "1.5em"){
                        childrenNode.style.fontSize ="1em" ;
                    }         
                    else if(childrenNode.style.fontSize == "" || childrenNode.style.fontSize == "1em"){
                        childrenNode.style.fontSize = "0.9em" ;
                    }
                }
            }
            if(childrenNode.className == content){
                childrenNode.style.height = "22em" ;
            }
        }
    }
}


/** #########################################
* Permet d'augmenter les textes d'un bloc
*/
function increaseElement(content, elementType){    
    if(contentMiddle){
        var childNode = contentMiddle.getElementsByTagName(elementType);
        for(i=0;i  < childNode.length; i++){
            var childrenNode = childNode[i] ;
            if(childrenNode.id == content){
                if(childrenNode.style){
                    if(childrenNode.style.fontSize == "0.9em"){
                        childrenNode.style.fontSize = "1em" ;
                    }         
                    else if(childrenNode.style.fontSize == "" || childrenNode.style.fontSize == "1em"){
                        childrenNode.style.fontSize = "1.5em" ;
                    }
                }            
            }
            if(childrenNode.className == content){
                childrenNode.style.height = "25em" ;
            }
        }       
    }
}


/** #########################################
* Permet de sélectionner le pays dans le footer
*/
function selectPays(){
    var url = document.location.href ;
    var tabUrl = url.split('/') ;
    var pays = "" ;
    if(tabUrl.length > 0){
        pays = tabUrl[3] ;
        if(document.getElementById("site-"+pays+"-selected")){
            document.getElementById("site-"+pays+"-selected").style.display = "block" ;
            if(document.getElementById("footer-site")){
                document.getElementById("footer-site").style.display = "block" ;
            }
            if(document.getElementById("langue-"+pays)){
                document.getElementById("langue-"+pays).style.display = "none" ;
            }
        }
    }
}

/* #######################
* Permet de remplacer une chaine de caractère d'un string
*/
function replaceAll( str, replacements ) {
    var idx = str.indexOf( replacements[0] );

    while ( idx > -1 ) {
        str = str.replace( replacements[0], replacements[1] ); 
        idx = str.indexOf( replacements[0] );
    }
    return str;
}


/** #########################################
* Permet d'ouvrir une nouvelle fenetre
*/
function openWindow(url, largeur, hauteur, scrolls, location, under){
    var timestamp = Math.floor((new Date()).getTime() / 1000) ;
    window.open(url, 'nw'+timestamp, 'top=screen.height,left=0,width='+largeur+',height='+hauteur+',menubar=yes,toolbar=yes,scrollbars='+scrolls+',resizable=yes,location='+location+','+under) ;
}

/* #######################
* Permet de remplacer une chaine de caractère d'un string
*/
function changeStyle(objId, newStyle) {
    var obj = document.getElementById(objId) ;
    if(obj){
        obj.className = newStyle ;
    }
}

/* #######################
* Permet de récupérer le server URL
*/
function getServerUrl(){
    var urlToReturn = "" ;
    var url = document.location.href ;
    if(url){
        var tabUrl = url.split("/") ;
        if(tabUrl && tabUrl.length > 3){
            for(var k=0 ; k<3 ; k++){                
                urlToReturn = urlToReturn + tabUrl[k] ;
                if(k != 2){
                    urlToReturn = urlToReturn + "/" ;
                }
            }
        }
    }
    return urlToReturn ;
}

/*########################################################
* Permet de faire le liage entre la fiche marque et la fiche enseigne
*/
function goToProduct(rootPath, urlLiage, urlEnseigne){
    var xhr = getXhr();
    
    xhr.onreadystatechange = function(){
        if(xhr.readyState == 4 && xhr.status == 200){
            responseAjax = xhr.responseXML ;
            if(responseAjax.getElementsByTagName("product")[0]){                
                var productTag = responseAjax.getElementsByTagName("product")[0] ;
                var urlProductEnseigne = "" ;
                
                for (var i=0; i<productTag.childNodes.length; i++){
                    if (productTag.childNodes[i].nodeName=="url"){
                        if(productTag.childNodes[i].firstChild.nodeValue){
                            urlProductEnseigne = rootPath+"/"+productTag.childNodes[i].firstChild.nodeValue ;
                        }
                    }
                }
                window.open(urlEnseigne+urlProductEnseigne, "", "width=800,height=600,resizable=yes,location=yes,scrollbars=yes,toolbar=yes") ;
            }
            else{
                window.open(urlEnseigne, "", "width=800,height=600,resizable=yes,location=yes,scrollbars=yes,toolbar=yes") ;
            }
        }
    }    
    xhr.open("GET", urlLiage, true);
    xhr.setRequestHeader('Content-Type','text/xml');
    xhr.send(null);
}

/*########################################################
* Permet de faire bouger une dic vers le haut
*/
function moveUp(divId1, divId2){
    var divObj1 = getElement(divId1, true, "") ;
    var divObj2 = getElement(divId2, true, "") ;
    if(divObj1 != null){
        if(navigator.appName != 'Microsoft Internet Explorer' || (navigator.appName == 'Microsoft Internet Explorer' && navigator.appVersion.indexOf("MSIE 6.0") == -1)) {
            divObj1.style.marginTop = "-5px" ;
        }
    }
    if(divObj2 != null){
        if(navigator.appName != 'Microsoft Internet Explorer' || (navigator.appName == 'Microsoft Internet Explorer' && navigator.appVersion.indexOf("MSIE 6.0") == -1)) {
            divObj2.style.marginTop = "5px" ;
        }
    }
}

/*########################################################
* Permet de faire bouger une dic vers le haut
*/
function moveDown(divId1, divId2){
    var divObj1 = getElement(divId1, true, "") ;
    var divObj2 = getElement(divId2, true, "") ;
    if(divObj1 != null){
        divObj1.style.marginTop = "0px" ;
    }
    if(divObj2 != null){
        divObj2.style.marginTop = "0px" ;    
    }
}

function hideWaitingMessage(){
    if(getElement("waitingMessage", true, "")){
        hideBloc(getElement("waitingMessage", true, "")) ;
        if(getElement("produits", true, "")){
            displayBloc(getElement("produits", true, "")) ;
        }
        else if(getElement("mainContent", true, "")){
            displayBloc(getElement("mainContent", true, "")) ;
        }
    }
}

function preventFrameIsolation(toRedirect) {
    if (parent.frames.length < 1 ) { 
        document.location.replace(toRedirect);      
    }
}

/*########################################################
* Permet de recuperer l'ambiance du site
*/
function getAmbiance() {
    var cookieAmb = getCookie("ambiance") ;

    if(cookieAmb != null){
        if(mapSiteAmbiance){ //declarer dans la page html
            var siteAmbianceObj = mapSiteAmbiance.get(cookieAmb) ;

            if(siteAmbianceObj){
                _bgimage = siteAmbianceObj.getBgImage() ;
                _mdrimage = siteAmbianceObj.getSearchConfirmButton() ;
                _mdrbgcolor = siteAmbianceObj.getSearchSelectBgImage() ;
                _menuhautbgcolor = siteAmbianceObj.getTopMenuBgColor() ;
                _mainbgcolor = siteAmbianceObj.getMainBgColor() ;
                _logoAmbiance = siteAmbianceObj.getLogoAmbiance() ;
                
                setAmbiance(cookieAmb, _bgimage, _mdrimage, _mdrbgcolor, _menuhautbgcolor, _mainbgcolor, _logoAmbiance) ;
            }
        }
    }
}

/*########################################################
* Permet de charger l'ambiance du site
*/
function setAmbiance(_newAmbiance, _bgimage, _mdrimage, _mdrbgcolor, _menuhautbgcolor, _mainbgcolor, _logoAmbiance){
    //Mise à jour du flash
    if(typeof urlFlash != "undefined"){
        var flashUrl = urlFlash ; //urlFlash declare dans l'html
        
        var newflashUrl = urlFlash.split("&ambiance=")[0] ;
        if(newflashUrl){
            newflashUrl = newflashUrl + "&ambiance=" + _newAmbiance ;  
        }
            
        if(typeFlash == -1){
            if(document.getElementById("banner-flash").movie){
                document.getElementById("banner-flash").movie = newflashUrl ;
            }
        }
        else if(typeFlash == 1){                    
            insert_flash(newflashUrl, '#FFFFFF',  widthFlash, heightFlash, 'banner-flash');
        }
        else if(typeFlash == 2){
            insert_flash2(newflashUrl, '#FFFFFF', widthFlash, heightFlash, 'banner-flash', idContainerFlash); //widthFlash, heightFlash et idContainerFlash declare dans l'html
        }
    }
    
    //fond d'ecran et couleur de fond
    document.body.style.backgroundImage = "url("+_bgimage+")" ;
    document.body.style.backgroundColor = _mainbgcolor ;
    
    //logo kalenji
    setImage("picto-logo", _logoAmbiance, "", "") ;
    
    //bouton OK du mdr
    if(document.getElementById("mdr-button")){
        document.getElementById("mdr-button").style.backgroundImage = "url("+_mdrimage+")" ;
    }
    
    //liste de selection du mdr
    if(document.getElementById("mdr-select")){
        document.getElementById("mdr-select").style.backgroundColor =_mdrbgcolor ;
    }
    
    //menu haut
    if(document.getElementById("content-bottom")){
        document.getElementById("content-bottom").style.backgroundColor =_menuhautbgcolor ;
     }
     
    //zone comment choisir page famille
    if(document.getElementById("content-choose")){
        document.getElementById("content-choose").style.backgroundColor =_menuhautbgcolor ;
     }
     
    //Zone titre de toutes les pages
    if(document.getElementById("content-title")){
        document.getElementById("content-title").style.backgroundColor =_menuhautbgcolor ;
     }
     
    //modification des styles de l'arbo rayon dans page famille
    var arboRayon = document.getElementById("menu-arbo") ;
    if(arboRayon){
        var sousRayons = arboRayon.getElementsByTagName("li") ;
    
        for(var i=0 ; i<sousRayons.length ; i++){
            if(sousRayons[i] && sousRayons[i].id == ''){
                sousRayons[i].style.backgroundColor =_menuhautbgcolor ;
            }
        }
    }
    
    //modification des styles des sous rayon dans page rayon
    var listeSousRayon = document.getElementById("sousrayons") ;
    if(listeSousRayon){
        var famille = listeSousRayon.getElementsByTagName("li") ;
    
        for(var i=0 ; i<famille.length ; i++){
            if(famille[i] && famille[i].className == 'sousrayon'){
                famille[i].style.backgroundColor =_menuhautbgcolor ;
            }
        }
    }
    
    //modification des styles des onglets
    var listeOnglets = document.getElementById("subheadings") ;
    if(listeOnglets){
        var ongletsImg = listeOnglets.getElementsByTagName("img") ;
    
        for(var i=0 ; i<ongletsImg.length ; i++){
            if(ongletsImg[i]){
                ongletsImg[i].style.backgroundColor =_menuhautbgcolor ;
            }
        }
    } 
    setCookie(_language, "ambiance", _newAmbiance) ;
    setCookie(_language, 'langue', _language.toLowerCase());
}


/*
########################################################################################################################
##############################################          OBJET         ##################################################
########################################################################################################################
*/

/* ############################################################# */
/* #####################   Hashmap   ########################### */
/* ############################################################# */
function KeyValue( key, value ){
    this.key = key;
    this.value = value;
}


/* ############################################################
* Constructeur
*/
function Map(){
    this.array = new Array();
}

/* ############################################################
* Méthode put
* param :
*     key : clé
*     value : valeur
*/
Map.prototype.put = function( key, value ){
    if( ( typeof key != "undefined" ) && ( typeof value != "undefined" ) )
    {
        this.array[this.array.length] = new KeyValue( key, value );
    }
}

/* ############################################################
* Méthode get
* param :
*     key : clé
* return :
*     String	    
*/
Map.prototype.get = function( key ){
    for( var k = 0 ; k < this.array.length ; k++ )
    {
        if( this.array[k].key == key ) {
            return this.array[k].value;
        }
    }
    return "";
}

/* ############################################################
* Méthode remove
* param :
*     key : clé
* return :
*     String	    
*/
Map.prototype.remove = function( key ){
    for( var k = 0 ; k < this.array.length ; k++ )
    {
        if( this.array[k].key == key ) {
            this.array[k] = "" ;
            return k ;
        }
    }
    return -1 ;
}


/* ############################################################
* Méthode length
* return :
*     String	    
*/
Map.prototype.length = function(){
    return this.array.length;
}



/* ############################################################## */
/* #####################   ArrayList  ########################### */
/* ############################################################## */
function ArrayList(){
    this.arraylist = new Array();
}

/* ############################################################
* Méthode add
* param :
*     value : valeur à ajouter
*/
ArrayList.prototype.add = function(value){
    if( typeof value != "undefined" )
    {
        this.arraylist[this.arraylist.length] = value ;
    }
}

/* ############################################################
* Méthode get
* param :
*     index : index de la valeur à retourner
* return :
*     String	    
*/
ArrayList.prototype.get = function(index){
    if(this.arraylist[index]){
        return this.arraylist[index] ;    
    }
    else{
        return "" ;
    }
}

/* ############################################################
* Méthode length
* return :
*     String	    
*/
ArrayList.prototype.length = function(){
    return this.arraylist.length;
}

/* ############################################################
* Méthode contains
* param :
*     value : valeur à rechercher
* return :
*     boolean	    
*/
ArrayList.prototype.contains = function(value)
{
    for( var k = 0 ; k < this.arraylist.length ; k++ )
    {
        if( this.arraylist[k] == value ) {
            return k ;
        }
    }
    return -1 ;
}
/** #########################################
* Code pour xiti
*/
function calculateXiti(Xt_param) {
       if (window.xtparam!=null){Xt_param+=xtparam;} 
        try {Xt_r = top.document.referrer;} 
        catch(e) {Xt_r = document.referrer;} 
        Xt_h = new Date();      
           var xtorL=recupxtor("xtor");
                if(xtorL){
                     if(xtorL.indexOf("#")>-1)xtorL=xtorL.substring(0,xtorL.indexOf("#"));
                     wcookie("xtor",xtorL,false,_language +"/");
                 }
                 if(Getxtorcookie("xtor"))Xt_param+="&xto=" + Getxtorcookie("xtor").toUpperCase();
        Xt_i = '<img width="1" height="1" alt="" src="http://logi151.xiti.com/hit.xiti?'+Xt_param; 
      
        Xt_i += '&hl='+Xt_h.getHours()+'x'+Xt_h.getMinutes()+'x'+Xt_h.getSeconds(); 
        
        if(parseFloat(navigator.appVersion)>=4) {
            Xt_s=screen;
            Xt_i+='&r='+Xt_s.width+'x'+Xt_s.height+'x'+Xt_s.pixelDepth+'x'+Xt_s.colorDepth;
        }            
        
        return (Xt_i+'&ref='+Xt_r.replace(/[<>\"]/g, '').replace(/&/g, '$')+'" >');
}

/*****************************************************************/
function initCountry(){
     var isChangeCountry = false ;
    
     //si des pays sont rajoutes dans itool, ajouter une ligne en plus
     var params = getParameters() ;
     if(params != "" && params.length == 1){
         if(params[0][0] && params[0][0].indexOf("changepays") > -1 && params[0][1] == "1"){
             isChangeCountry = true ;
         }
     }
    
     if(isChangeCountry){
         setCookie("FR", "country", "FR", -1) ;
         setCookie("EN", "country", "EN", -1) ;
         setCookie("ES", "country", "ES", -1) ;
         setCookie("IT", "country", "IT", -1) ;
         setCookie("DE", "country", "DE", -1) ;
     }
     else{
         redirectSiteCountry() ;
     }
}

function setCentralCountry(country, language){
    setCookie(language, "country", country) ;
    setCookie("", "redirect", language+"_"+country) ;
     document.location.href="./"+language+"/";
}

function redirectSiteCountry(){
    var countryCookie = getCookie("redirect") ;

    if(countryCookie && countryCookie != ""){
        //recuperation de la langue et du pays
        var langue = countryCookie.split("_")[0] ;
        var country = countryCookie.split("_")[1] ;
        
        var currentUrlSite = document.location.href ;
        var urlSite = currentUrlSite.split("/")[2] ;
        
        setCentralCountry(country, langue) ;        
        //document.location.href = "http://"+urlSite  + "/" + countryCookie + "/" ;
    }
}
