/*
pages/gestion_menus_mobile/js.js


// Pour avoir les sous-menu cliquable ET dépliable en version mobile
$menu_mobile_class = sous_menu_depliant


// Pour que le menu mobile soit toujours déplié
$menu_mobile_class = menu_mobile_deplier
CSS hover : .menu_principal ul>li:hover>a , .menu_principal ul>li:focus>a , .menu_principal ul>li.active>a , .menu_principal ul>li:hover>p , .menu_principal ul>li:focus>p , .menu_principal ul>li.active>p{
	
// Menu fixe lorsque la page défile :
body.window_defilement	
*/

jQuery().ready(function(){

  var element_parent , menu_vertival , element , taille_temp , element_menu_deroulant , data_mobile , data_tablette , data_portable , taille , menu_mobile_deplier , bouton_externe;
  
  function menu_mobile( element , taille , menu_vertival , element_menu_deroulant ){
  
		taille_temp = $(window).width();
		
    if( taille_temp>taille ){
			
			$(".menu_ouvrir , .menu_mobile_bouton_externe").addClass("hide");
			element_menu_deroulant.show().addClass("menu_mobile_ouvert");
      
    }else{
			
			$(".menu_ouvrir , .menu_mobile_bouton_externe").removeClass("hide");
			element_menu_deroulant.hide().removeClass("menu_mobile_ouvert");
      
    }
		
		return taille_temp;
    
  }
  
  function menu_mobile_ouvert( element , menu_vertival , element_menu_deroulant ){
		
		$(".menu_hamburger").addClass("actif");
		
		if( menu_vertival ){
			
			element_menu_deroulant.css( "display", "table" );
			
		}else{
			
			element_menu_deroulant.slideToggle("slow");
			
		}
		
		element_menu_deroulant.addClass("menu_mobile_ouvert");

  }
  
  function menu_mobile_ferme( element , menu_vertival , element_menu_deroulant ){
		
		$(".menu_hamburger").removeClass("actif");
    element_menu_deroulant.slideToggle("slow").removeClass("menu_mobile_ouvert");
		
  }
 
	// Le bouton pour déplier le menu mobile est présent
  $("a.menu_mobile.menu_mobile_menu").each(function(e){
    
    element = $("a.menu_mobile.menu_mobile_menu , .menu_mobile_deplier , .menu_mobile_bouton_externe");
    element_menu_principal = element.parents("nav.menu_principal");
    menu_vertival = element_menu_principal.hasClass("menu_vertival");
    element_parent = element_menu_principal.find("div.menu_mobile");
		element_menu_deroulant = $("nav[role=navigation] ul.menu_deroulant");
		element_menu_deroulant.removeClass("show show_t show_p show_m hide hide_t hide_p hide_m");
		menu_mobile_deplier = bouton_externe = false;
		
		data_mobile = element.attr("data-mobile");
		data_tablette = element.attr("data-tablette");
		data_portable = element.attr("data-portable");
		
		if( data_mobile=="" ){
			
			data_mobile = 700;
			
		}
		
		if( data_tablette=="" ){
			
			data_tablette = 1100;
			
		}
		
		if( data_portable=="" ){
			
			data_portable = 1500;
			
		}
		
    taille = data_mobile;
		
    if( element_parent.hasClass("show_m") ){
      
      taille = data_mobile;
      
    }else if( element_parent.hasClass("show_t") ){
      
      taille = data_tablette;
      
    }else if( element_parent.hasClass("show_p") ){
      
      taille = data_portable;
      
    }
    
    if( taille==undefined ){
			
			taille = 700;
			
		}
		
		// Le menu doit rester être déplier en mobile
    $(".menu_mobile_deplier").each(function(e){
			
			menu_mobile_deplier = true;
		
		});
		
		// Le bouton pour déplier le menu principal est externe
    $(".menu_mobile_bouton_externe").each(function(e){
			
			bouton_externe = true;
			element_parent.removeClass("show_m");
		
		}).click(function(e){
			
			$(this).toggleClass( "actif" , "" );
		
		});
		
    element.click(function(e){

      if( element_menu_deroulant.hasClass( "menu_mobile_ouvert" ) ){

        menu_mobile_ferme( element , menu_vertival , element_menu_deroulant );
        
      }else{
        
        menu_mobile_ouvert( element , menu_vertival , element_menu_deroulant );
        
      }
			
			element_menu_deroulant.change();
			
      return false;
      
    });
	
		// On replie le menu
		if( !menu_mobile_deplier ){
			 
			taille_temp = menu_mobile( element , taille , menu_vertival , element_menu_deroulant );
			
			$(window).resize(function() {
				
				if( taille_temp!=$(window).width() ){
					
					taille_temp = menu_mobile( element , taille , menu_vertival , element_menu_deroulant );
					
				}
					
			});
  
		}
		
		// On est sur mobile
		if( $(window).width()<=taille ){

			// Les sous menu sont cliquable et dépliable
			$(".sous_menu_depliant li.menu_ul").each(function(e){
				
				element = $(this);
				
				if( element.hasClass("active") ){
					
					element.append("<p class='sous_menu_depliant_replier sous_menu_depliant_deplier'></p>");
					
				}else{
					
					element.append("<p class='sous_menu_depliant_replier'></p>");
					element.children("ul,div").hide();
					
				}
				
			});
		
			$("li.menu_ul").on("click" , ".sous_menu_depliant_replier" , function(e){

				if( $(this).hasClass("sous_menu_depliant_deplier") ){
					console.log( "hasClass" );
					$(this).parent("li.menu_ul").children("ul,div").hide();
					$(this).removeClass("sous_menu_depliant_deplier");
					
				}else{
					
					console.log( "not hasClass" );
					$(this).parent("li.menu_ul").children("ul,div").show();
					$(this).addClass("sous_menu_depliant_deplier");
					
				}
				
				return false;
				
			});
			
		}
		
  });


  $("header[role=banner]").each(function(e){
		
		var hauteur_banner = $(this).height() , window_defilement = false , vrai , _body = $("body");
		
		$(window).scroll(function(e){
			
			vrai = $(this).scrollTop()>=hauteur_banner;
			
			if( vrai && !window_defilement ){
				
				_body.addClass("window_defilement");
				window_defilement = true;
				
			}else if( !vrai && window_defilement ){
				
				_body.removeClass("window_defilement");
				window_defilement = false;
				
			}
		
		});
		
		
	});
	
});
/* js/jquery_timers.js */

/*
element.everyTime( 2000 , "banniere_time" , function(){
	
	// Action
	
});
*/

jQuery().ready(function(){

  jQuery.fn.extend({
    everyTime: function(interval, label, fn, times, belay) {
      return this.each(function() {
        jQuery.timer.add(this, interval, label, fn, times, belay);
      });
    },
    oneTime: function(interval, label, fn) {
      return this.each(function() {
        jQuery.timer.add(this, interval, label, fn, 1);
      });
    },
    stopTime: function(label, fn) {
      return this.each(function() {
        jQuery.timer.remove(this, label, fn);
      });
    }
  });

  jQuery.extend({
    timer: {
      guid: 1,
      global: {},
      regex: /^([0-9]+)\s*(.*s)?$/,
      powers: {
        // Yeah this is major overkill...
        'ms': 1,
        'cs': 10,
        'ds': 100,
        's': 1000,
        'das': 10000,
        'hs': 100000,
        'ks': 1000000
      },
      timeParse: function(value) {
        if (value == undefined || value == null)
          return null;
        var result = this.regex.exec(jQuery.trim(value.toString()));
        if (result[2]) {
          var num = parseInt(result[1], 10);
          var mult = this.powers[result[2]] || 1;
          return num * mult;
        } else {
          return value;
        }
      },
      remove: function(element, label, fn) {
        var timers = element.$timers, ret;

        if ( timers ) {

          if (!label) {
            for ( label in timers )
              this.remove(element, label, fn);
          } else if ( timers[label] ) {
            if ( fn ) {
              if ( fn.$timerID ) {
                window.clearInterval(timers[label][fn.$timerID]);
                delete timers[label][fn.$timerID];
              }
            } else {
              for ( var fn in timers[label] ) {
                window.clearInterval(timers[label][fn]);
                delete timers[label][fn];
              }
            }

            for ( ret in timers[label] ) break;
            if ( !ret ) {
              ret = null;
              delete timers[label];
            }
          }

          for ( ret in timers ) break;
          if ( !ret )
            element.$timers = null;
        }
      },
      add: function(element, interval, label, fn, times, belay) {
        
        _jQuery = jQuery;
        var counter = 0;

        if (jQuery.isFunction(label)) {
          if (!times)
            times = fn;
          fn = label;
          label = interval;
        }

        interval = jQuery.timer.timeParse(interval);

        if (typeof interval != 'number' || isNaN(interval) || interval <= 0)
          return;

        if (times && times.constructor != Number) {
          belay = !!times;
          times = 0;
        }

        times = times || 0;
        belay = belay || false;

        if (!element.$timers)
          element.$timers = {};

        if (!element.$timers[label])
          element.$timers[label] = {};

        fn.$timerID = fn.$timerID || this.guid++;

        var handler = function() {
          if (belay && this.inProgress)
            return;
          this.inProgress = true;
          if ((++counter > times && times !== 0) || fn.call(element, counter) === false)
            _jQuery.timer.remove(element, label, fn);
          this.inProgress = false;
        };

        handler.$timerID = fn.$timerID;

        if (!element.$timers[label][fn.$timerID])
          element.$timers[label][fn.$timerID] = window.setInterval(handler,interval);

        if ( !this.global[label] )
          this.global[label] = [];
        this.global[label].push( element );

      }
    }
  });
  
});
/* pages/banniere/js_tous.js */

function banniere_suivant( element , element_conteneur , en_cours , nombre_banniere , deplacement , element_precedent , element_suivant ){
	
	en_cours++;
	
	if( en_cours>=nombre_banniere ){
		
		en_cours = 0;
		
	}
	
	element_conteneur.animate({ "margin-left":"-"+( deplacement * ( en_cours - nombre_banniere ) )+"%" },400);
	
	$(".banniere_admin").html("nombre_banniere="+nombre_banniere+"<br />en_cours="+en_cours);
	
	return en_cours;
	
}

function banniere_precedent( element , element_conteneur , en_cours , nombre_banniere , deplacement , element_precedent , element_suivant ){
	
	en_cours--;
	
	if( en_cours<0 ){
		
		en_cours = nombre_banniere;
	
	}
	
	element_conteneur.animate({ "margin-left":"-"+( deplacement * ( en_cours - nombre_banniere ) )+"%" },400);
	
	$(".banniere_admin").html("nombre_banniere="+nombre_banniere+"<br />en_cours="+en_cours);
	
	return en_cours;
	
}

$(function(){
  
  $(".banniere_precedent,.banniere_suivant").hide();
  
	$(".banniere").each(function(){
    
    var element = $(this);
    var element_conteneur = $(".banniere_conteneur");
    var element_suivant = element.parents(".banniere_fond").find(".banniere_suivant");
    var element_precedent = element.parents(".banniere_fond").find(".banniere_precedent");
    var aleatoire = 2500;
    var nombre_banniere = element.children("*").length;
    var nombre_banniere_m = element.attr("data-m");
    var nombre_banniere_t = element.attr("data-t");
    var nombre_banniere_c = element.attr("data-c");
    var nombre_banniere_affiche = 0 , en_cours = 0;
    var taille_ecran = $(window).width();
    
    if( taille_ecran<700 && nombre_banniere_m!=undefined ){
      
      nombre_banniere_affiche = en_cours = nombre_banniere_m;
      
    }else if( taille_ecran<1200 && nombre_banniere_t!=undefined ){
      
      nombre_banniere_affiche = en_cours = nombre_banniere_t;
      
    }else if( nombre_banniere_c!=undefined ){
      
      nombre_banniere_affiche = en_cours = nombre_banniere_c;
      
    }else{
			
			nombre_banniere_affiche = nombre_banniere;
			
		}
		
    if( nombre_banniere_affiche>0 ){
      
      var deplacement = 100 / nombre_banniere_affiche;
      element_conteneur.width( ( deplacement * nombre_banniere) + "%" );
      
      $(window).resize(function(){
        
        var taille_ecran = $(this).width();
        
        if( taille_ecran<700 ){
          
          nombre_banniere_affiche = en_cours = nombre_banniere_m;
          
        }else if( taille_ecran<1200 ){
          
          nombre_banniere_affiche = en_cours = nombre_banniere_t;
          
        }else{
          
          nombre_banniere_affiche = en_cours = nombre_banniere_c;
          
        }
        
        deplacement = 100 / nombre_banniere_affiche;
        element_conteneur.width( ( deplacement * nombre_banniere) + "%" );
        element_conteneur.animate({ "margin-left":"0%" },1);
        element.stopTime("banniere_time");
        element_precedent.hide();
        
      });
			
      if( element.hasClass("banniere_fleche") ){
        
        element_suivant.show();
        element_precedent.show();
        
      }
			
      element.everyTime( aleatoire , "banniere_time" , function(){
        
				en_cours = banniere_suivant( element , element_conteneur , en_cours , nombre_banniere , deplacement , element_precedent , element_suivant );
				
      });

      element_precedent.click(function(){
        
        element.stopTime("banniere_time");
				en_cours = banniere_precedent( element , element_conteneur , en_cours , nombre_banniere , deplacement , element_precedent , element_suivant );
				
      });
        
      element_suivant.click(function(){
        
        element.stopTime("banniere_time");
				en_cours = banniere_suivant( element , element_conteneur , en_cours , nombre_banniere , deplacement , element_precedent , element_suivant );
				
      });
      
    }
    
  });
  
});

/* pages/banniere/js.js */

var scroll_top , hauteur_win , top_element , margin_top , calcule , hauteur_element , hauteur_image , difference , pourc , nb_element , ajout , retour , pas , enCours , enCours_2 , animation , nthchild , animation_left_right , i , scope , element_banniere_fond , clone , banniere;

var _banniere = $.inherit({

  __constructor : function( objet ) {
    
    this.config =
      $.extend({
        element_conteneur:'',
        nb_element:0,
        enCours:0,
        pas:1,
        aleatoire:5000,
        limite_hauteur:2000,
        clone:false,
        test:false
      }, ( typeof objet == "undefined" ? {} : objet ) );
  
    this.config.element = this.config.element_conteneur.children(".banniere");
    this.config.image_entiere = this.config.element_conteneur.parents(".banniere_fond").hasClass("image_entiere");
    this.config.element_image = this.config.element.children("a");
    this.config.animation = this.config.element_conteneur.attr("data-anim");
    if( this.config.animation=="" || this.config.animation==undefined ) this.config.animation = "animation_degrade";
    
  },
  
  // ===================================================================================================================================
  placement : function(){
    
    if( this.config.test ){
      
      console.log("fx:placement");
      
    }
    
    var _this = this;
    var config = _this.config;
    var element = config.element ,
        nb_element = config.nb_element ,
        enCours = config.enCours ,
        element_conteneur = config.element_conteneur ,
        element_image = config.element_image ,
        retour = false ,
        pas = 1 ,
        pourc = 0 ,
        paralaxe = 0 ,
        banniere_taille_ecran = false ,
        window_width = $(window).width() ,
        data_media = ""
        ;
    var element_banniere_fond = element.parents("div.banniere_fond") ,
        image_entiere = config.image_entiere ,
        limite_hauteur = element.parents("div.banniere_conteneur").attr("data-limite-hauteur");
    _this.config.limite_hauteur = limite_hauteur;
    
    if( element.parents(".banniere_conteneur").attr("data-delais")!=undefined ){
      
      _this.config.aleatoire = parseInt( element.parents(".banniere_conteneur").attr("data-delais") );
      
    }
    
    element.find('[class*="bloque_"]').each(function(){
    
			class_bloc = $(this).attr( "class" ).split( "bloque_" );
			class_bloc_num = 0;
			
			if( class_bloc[1]!=undefined ){
				
				class_bloc = class_bloc[1].split( " " );
				
				if( class_bloc[0]!=undefined && $.isNumeric( class_bloc[0] ) ){
					
					class_bloc_num = class_bloc[0];
					
				}
				
			}
			
			$(this).attr( "data-bloque" , class_bloc_num );
			
    });
		
    element.find("picture").each(function(){
      
      element_banniere_fond.find(".banniere_point").append("<p datanb='"+nb_element+"'></p>");
      nb_element++;
    
    }); 
		
    if( nb_element==1 ){
    
      element_banniere_fond.find(".banniere_point").hide();
      
    }
    
    banniere_no_js = config.element.find(".banniere_no_js").length;

    if( banniere_no_js==0 && !config.element.hasClass("banniere_no_js") ){

      config.nb_element = nb_element;
			
			if( nb_element>1 ){
			
				config.element.addClass("banniere_js");
				
			}
			
      element.find(".banniere_desc").html( element.children("a,div").eq(enCours).attr("data-desc") );
      element_banniere_fond.find(".banniere_point p").eq(enCours).addClass("actif");
      banniere_taille_ecran = config.element.hasClass("banniere_taille_ecran");
      
      $(".banniere_hide").each(function(){
        
        var banniere_hide_enfant = $(this).children("div").length;
        
        for( i=0 ; i<banniere_hide_enfant ; i++ ){
          
          element.children("a,div").eq(i).append( "<div>"+$(this).children("div").eq(i).html()+"</div>" );
          
        }
        
      });

      if( element.hasClass("banniere_multiple_2") ){
        
        config.pas = pas = 2;
        config.aleatoire = 2000;
          
      }
      
      if( nb_element>pas ){
				
        if( element.hasClass("banniere_triple_ecran") ){
          
          config.clone = true;
          element_conteneur_clone_1 = element_conteneur.clone();
          element_conteneur_clone_2 = element_conteneur.clone();
          
          element_conteneur.addClass("conteneur").css({ paddingTop:40 , paddingBottom:40 });
          element_conteneur_clone_1.appendTo( ".banniere_fond" ).addClass("conteneur_triple_ecran_gauche").children(".banniere");
          element_conteneur_clone_2.appendTo( ".banniere_fond" ).addClass("conteneur_triple_ecran_droit").children(".banniere");
       
          config.element_clone_1 = element_conteneur_clone_1.children(".banniere");
          config.element_clone_2 = element_conteneur_clone_2.children(".banniere");
          
          retour = _this.premier_affichage( element , 0 );
          _this.premier_affichage( config.element_clone_1 , -1 );
          _this.premier_affichage( config.element_clone_2 , 1 );
          
        }else if( pas>1 ){
          
          retour = _this.premier_affichage( element , 0 );
          
        }else{
          
          retour = _this.premier_affichage( element , 0 );
        
        }
        
      }
      
      if( banniere_taille_ecran ){
        
        _this.affichage_hauteur( element , element_image , enCours , limite_hauteur , false );
      
      }else{
        
        pourc = false;
      
      }
      
      $(window).resize(function(e){
        
        _this.affichage_hauteur( element , element_image , _this.config.enCours , limite_hauteur , false );
      
      });
      
      paralaxe = element_image.eq(enCours).attr("data-paralaxe");

      if( paralaxe!="" && $.isNumeric( paralaxe ) && paralaxe>0 && $(window).width()>800 ){

        element.css("padding-bottom",paralaxe+"%").css("height","0");
        element.addClass("banniere_paralaxe");
        paralaxe_inverse = element_image.eq(enCours).hasClass("paralaxe_inverse");
        
        element.find("a:not(hide),div:not(hide)").find("img").load(function() {
          
          _this.banniere_paralaxe( element , paralaxe , paralaxe_inverse );

        });
        
        $(window).scroll(function(){
        
          _this.banniere_paralaxe( element , paralaxe , paralaxe_inverse );
          
        });
        
      }
    
    }
    
    element.oneTime( 500 , "banniere_affichage" , function(){
  
			if( !$(this).hasClass("banniere_paralaxe") ){
				
				_this.affichage_hauteur( element , element.find("a,div") , 0 , limite_hauteur , false );
				
			}
      
    });
		
    return retour;
    
  },

  // ===================================================================================================================================
	// Fonction pour mettre la bonne hauteur de la bannière en fonction de la bannière en cours et de la largeur de l'écran
  affichage_hauteur : function( element , element_image , en_cours , limite_hauteur , animation ){

		var element_image_en_cours = element_image.eq( en_cours );
    var pourc = 0 , pourc_temp , media , bloque , banniere_height , vrai = false;
    var window_width = $(".banniere").width();
    
    element_image_en_cours.find("source").each(function(){
      
      media = $(this).attr("data-media");
      pourc_temp = $(this).attr("data-pourc");

      if( vrai ){
				
        pourc = pourc_temp;
				vrai = false;
				
			}
			
      if( pourc_temp!==undefined && media!==undefined && ( ( media=="" && pourc==0 ) || ( parseInt( media )<=window_width ) ) ){
        
				vrai = true;
         
      }
        
    });
		
    if( pourc==0 ){
			
			pourc = element_image_en_cours.find("img").attr("data-pourc");
        
			if( !$.isNumeric( pourc ) ){
				
				if( $.isNumeric( pourc_temp ) ){
					
					pourc = pourc_temp;		
					
				}else{
						
					img_height = element_image_en_cours.find("img").height();
					img_width = element_image_en_cours.find("img").width();
					picture_width = element_image_en_cours.find("picture").width();
					pourc = ( img_height / img_width * 100 ) / ( window_width / picture_width );

				}
				
			}
			
    }
		
    if( this.config.test ){
      
      console.log("fx:affichage_hauteur");
      
    }
    
    if( limite_hauteur==0 ){
      
      limite_hauteur = this.config.limite_hauteur;
      
    }
    
    var window_width = $(window).width();
    
    if( window_width > limite_hauteur ){
      
      pourc = pourc / window_width * limite_hauteur;
      
    }
    
    class_bloc = " "+element_image_en_cours.attr("class")+" ";
    class_bloc = class_bloc.split( "bloque_" );
    class_bloc_num = 300;
    
    if( class_bloc[1]!=undefined ){
      
      class_bloc = class_bloc[1].split( " " );
      
      
      if( class_bloc[0]!=undefined && $.isNumeric( class_bloc[0] ) ){
        
        class_bloc_num = class_bloc[0];
        
      }
      
    }
		
    bloque = parseInt( element.find('[class*="bloque_"]').attr( "data-bloque" ) );
    banniere_height = window_width / 100 * pourc;
		
		if( bloque>0 && banniere_height<bloque ){
			
			pourc = bloque / window_width * 100;
			element.children("a,div").addClass("bloc_hauteur");
			
		}else{
			
			element.children("a,div").removeClass("bloc_hauteur");
			
		}
		
		if( this.config.pas>1 ){
			
			pourc = pourc / this.config.pas;
			
		}
		
		if( ( element_image_en_cours.hasClass( "image_centree" ) || element_image_en_cours.hasClass( "image_bloquee_droite" ) || element_image_en_cours.hasClass( "image_bloquee_gauche" ) ) && ( window_width / 100 * pourc )<class_bloc_num ){
      
      pourc = class_bloc_num+"px";
      
    }else{
      
      pourc = pourc+"%";
      
    }
		
    if( this.config.test ){
      
      console.log( "Pourc = " + pourc );
      
    }
		
    if( pourc!="NaN%" ){
      
      if( animation ){
				
        element.animate( { "padding-bottom" :pourc , "height":0 } , 400 );
        
      }else{
				
        element.css({ paddingBottom:pourc , height:0 });
        
      }
      
    }
		
  },
  
  // ===================================================================================================================================
  banniere_paralaxe : function( element , paralaxe , paralaxe_inverse ){
    
    if( this.config.test ){
      
      console.log("fx:banniere_paralaxe");
      
    }
    
    scroll_top = $(window).scrollTop();
    hauteur_win = $(window).height();
    top_element = element.offset().top;
    margin_top = 0;
    calcule = top_element - hauteur_win - scroll_top;
    
    if( calcule<0 ){
      
      hauteur_element = element.outerHeight();
			hauteur_image = element.find("img").height();
      difference = hauteur_image - hauteur_element;
      pourc = calcule / hauteur_win;
      
      if( paralaxe_inverse ){
        
        margin_top = difference * pourc;
        
      }else{
        
        margin_top = difference * ( 1 + pourc );
      
      }
      
    }
    
    element.find("img").css("margin-top",margin_top+"px");
    
  },

  // ===================================================================================================================================
  nthchild : function( decalage , element ){
    
    if( this.config.test ){
      
      console.log("fx:nthchild");
      
    }
		
    nb_element = this.config.nb_element;
		ajout = ":nth-child(-" + nb_element + "n+" + ( 1 + decalage+nb_element * 100 ) + ")";
    retour = element.replace( "," , ajout+"," )+ajout;
		
    return retour;
    
  },
  
  // ===================================================================================================================================
  premier_affichage : function( element , decalage ) {
    
    if( this.config.test ){
      
      console.log("fx:premier_affichage");
      
    }
    
    pas = this.config.pas;
		enCours = this.config.enCours;
		animation = this.config.animation+"_init";
		pourc = 10000;
		nthchild;
		animation_left_right , scope = this;
    this[animation]( true , element );
    
    for( i = 0 ; i < pas ; i++ ){
      
      this[animation]( false , element.children( this.nthchild( ( enCours + decalage + i )  , "a,div" ) ) );
      
    }
    
    element.children("a.animer_description,div.animer_description").children("div:not(.description_droit)").each(function(){
      animation_left_right = $(this).css("left");
      $(this).css({ left : "100%" }).animate({ left : animation_left_right } , (scope.config.aleatoire/3) );
    });
    
    element.children("a.animer_description,div.animer_description").children("div.description_droit").each(function(){
      animation_left_right = $(this).css("right");
      $(this).css({ right : "100%" }).animate({ left : animation_left_right },(scope.config.aleatoire/3));
    });
    
    return true;
    
  },

  // ===================================================================================================================================
  evenement : function(){
    
    if( this.config.test ){
      
      console.log("fx:evenement");
      
    }
    
    element = this.config.element , scope = this;

    element.everyTime( this.config.aleatoire , "banniere_time" , function(){
      
      scope.animation( 1 , -1 );
      
    });
    
    $(".banniere_precedent").click(function(){
      
      element.stopTime("banniere_time");
      scope.animation( -1 , -1 );
      
    });
      
    $(".banniere_suivant").click(function(){
      
      element.stopTime("banniere_time");
      scope.animation( 1 , -1 );
      
    });
    
    $(".banniere_point p").click(function(){
      
      element.stopTime("banniere_time");
      scope.animation( 0 , $(this).attr("datanb") );
      
    });
    
    
  },

  // ===================================================================================================================================
  animation : function( deplacement , datanb ) {

    if( this.config.test ){
      
      console.log("fx:animation");
      
    }
    
    scope = this;
		enCours = enCours_1 = scope.config.enCours;
		pas = scope.config.pas;
		enCours_2 = 0;
		nb_element = scope.config.nb_element;
    
    if( datanb>-1 ){
      
      enCours = enCours_2 = datanb;
      deplacement = 1;
      
    }else if( deplacement>0 ){
      
      enCours = enCours_1 + deplacement;
			
      if( enCours>=nb_element ){
				
				enCours = nb_element - enCours;
				
			}
			
      enCours_2 = enCours + pas - 1;
      
    }else{
      
      enCours = enCours_1 - deplacement;
			
      if( enCours<=-1 ){
				
				enCours = nb_element - enCours;
				
			}
			
      enCours_2 = enCours + pas - 1;
      
    }
    
    enCours = parseInt( enCours );
    enCours_2 = parseInt( enCours_2 );
    enCours_1 = parseInt( enCours_1 );
    
    scope.config.enCours = enCours;
    scope.animations( deplacement , false , scope , enCours_2 , 0 );
    scope.animations( deplacement , true , scope , enCours_1 , 0 );
    
    element_banniere_fond = scope.config.element.parents("div.banniere_fond");
    element_banniere_fond.find(".banniere_point p").removeClass("actif");
    element_banniere_fond.find(".banniere_point p[datanb="+enCours_2+"]").addClass("actif");
    $(".banniere_pagination font").html( enCours + 1 );
    
  },
  
  // ===================================================================================================================================
  animations : function( deplacement , debut , scope , enCours , timeout ) {
    
    if( this.config.test ){
      
      console.log("fx:animations");
      
    }
    
    clone = scope.config.clone , animation = this.config.animation;
    
    setTimeout(function(){
      
      scope[animation]( deplacement , debut , scope.config.element , enCours );
      
    }, timeout);
  
    if( clone ){
      
      setTimeout(function(){
        
        scope[animation]( deplacement , debut , scope.config.element_clone_1 , enCours-1 );
        
      }, timeout);
      
      setTimeout(function(){
        
        scope[animation]( deplacement , debut , scope.config.element_clone_2 , enCours+1 );
        
      }, timeout);
      
    }
    
  },

  // ===================================================================================================================================
  animation_degrade_init : function( tous , element ) {
    
    if( this.config.test ){
      
      console.log("fx:animation_degrade_init = "+tous);
      
    }
    
    if( tous ){
      
      element.children("a,div").css({opacity:0}).addClass("hide");
      
    }else{
      
      element.css({opacity:1}).removeClass( "hide" ).addClass( "show" );
      
    }
  },
  
  // ===================================================================================================================================
  animation_degrade : function( deplacement , debut , element , decalage ) {
    
    _this = this;
    
    if( _this.config.test ){
      
      console.log("fx:animation_degrade = "+debut);
      
    }
    
    if( debut ){
        
      nthchild = _this.nthchild( decalage , "a,div" );
      element.children( nthchild ).animate({opacity:0},400,function(){
        $(this).toggleClass( "hide show" );
      });
    
    }else{
			
			nthchild = _this.nthchild( decalage , "a,div" );
      element_a = element.children( nthchild );
      element_a.toggleClass( "hide show" ).animate({opacity:1},400);
      _this.affichage_hauteur( element , element_a , 0 , 40000 , false );
      element.find(".banniere_desc").html( element_a.attr("data-desc") );
    
    }
    
  },

  // ===================================================================================================================================
  animation_slide_gauche_init : function( tous , element ) {
    
    if( this.config.test ){
      
      console.log("fx:animation_slide_gauche_init");
      
    }
    
    if( tous ){
      
      element.children("a,div").css({left:"100%"});
      
    }else{
      
      element.css({left:"0%"});
      
    }
    
  },
  
  // ===================================================================================================================================
  animation_slide_gauche : function( deplacement , debut , element , decalage ) {
    
    if( this.config.test ){
      
      console.log("fx:animation_slide_gauche");
      
    }
    
    aleatoire = this.config.aleatoire;
    
    if( debut ){
      
      deplacement = deplacement==1 ?"-100%" : "100%";
      nthchild = this.nthchild( decalage , "a,div" );
      element.children( nthchild ).animate({left:deplacement}, (aleatoire/8) );
      element.children( nthchild ).children("div").animate({left:deplacement},(aleatoire/3));
    
    }else{
      
      deplacement = deplacement==1 ?"100%" : "-100%";
      element_a = element.children( this.nthchild( decalage , "a,div" ) );
      element_a.css({left:deplacement}).animate({left:"0%"},(aleatoire/8));
      element.animate({ "padding-bottom" :element_a.attr("data-pourc")+"%" },(aleatoire/8));
      element.find(".banniere_desc").html( element_a.attr("data-desc") );
      element.children("a,div").children("div:not(.description_droit)").css({left:deplacement}).animate({left:"0%"},(this.config.aleatoire/3));
      element.children("a,div").children("div.description_droit").css({right:deplacement}).animate({right:"0%"},(this.config.aleatoire/3));
    
    }
    
  },
  
});


$(function(){
  
  $(".banniere_fond").each(function(){

    // Initialisation de la bannière
    banniere = new _banniere({ element_conteneur:$(this).children(".banniere_conteneur") });
    
    // On place les éléments
    if( banniere.placement() ){
  
      banniere.evenement();
      
    }
    
  });
  
});
/*jslint browser: true, evil: true */

// define correct path for files inclusion
var scripts = document.getElementsByTagName('script'),
    path = scripts[scripts.length - 1].src.split('?')[0],
		/* NETPLUSMEDIA> */
		cdn = "/communs/tarteaucitron/" ,
		/* <NETPLUSMEDIA */
    alreadyLaunch = (alreadyLaunch === undefined) ? 0 : alreadyLaunch,
    tarteaucitronForceLanguage = (tarteaucitronForceLanguage === undefined) ? '' : tarteaucitronForceLanguage,
    tarteaucitronForceExpire = (tarteaucitronForceExpire === undefined) ? '' : tarteaucitronForceExpire,
    tarteaucitronCustomText = (tarteaucitronCustomText === undefined) ? '' : tarteaucitronCustomText,
    timeExipre = 31536000000,
    tarteaucitronProLoadServices,
    tarteaucitronNoAdBlocker = false ,
		pourc = 0
		;

var tarteaucitron = {
    "version": 20181023,
    "cdn": cdn,
    "user": {},
    "lang": {},
    "services": {},
    "added": [],
    "idprocessed": [],
    "state": [],
    "launch": [],
    "parameters": {},
    "isAjax": false,
    "reloadThePage": false,
    "events": {
        "init": function () {},
        "load": function () {},
    },
    "init": function (params) {
        "use strict";
        var origOpen;

        tarteaucitron.parameters = params;
        if (alreadyLaunch === 0) {
            alreadyLaunch = 1;
            if (window.addEventListener) {
                window.addEventListener("load", function () {
                    tarteaucitron.load();
                    tarteaucitron.fallback(['tarteaucitronOpenPanel'], function (elem) {
                        elem.addEventListener("click", function (event) {
                            tarteaucitron.userInterface.openPanel();
                            event.preventDefault();
                        }, false);
                    }, true);
                }, false);
                window.addEventListener("scroll", function () {
                    var scrollPos = window.pageYOffset || document.documentElement.scrollTop,
                        heightPosition;
                    if (document.getElementById('tarteaucitronAlertBig') !== null && !tarteaucitron.highPrivacy) {
                        if ( document.getElementById('tarteaucitronAlertBig').style.display === 'block' && tarteaucitron.scrollApprouve ) {
                            heightPosition = document.getElementById('tarteaucitronAlertBig').offsetHeight + 'px';

                            if (scrollPos > (screen.height * 2) ) {
                                tarteaucitron.userInterface.respondAll(true);
                            } else if (scrollPos > (screen.height / 2)) {
                                document.getElementById('tarteaucitronDisclaimerAlert').innerHTML = '<strong>' + tarteaucitron.lang.alertBigScroll + '</strong> ' + tarteaucitron.lang.alertBig;
                            }

                            if (tarteaucitron.orientation === 'top') {
																/* NETPLUSMEDIA> */
                                document.getElementById('tarteaucitronPercentage').style.top = 0;
																/* <NETPLUSMEDIA */
                            } else {
                                document.getElementById('tarteaucitronPercentage').style.bottom = heightPosition;
                            }
														/* NETPLUSMEDIA> */
														pourc = ( 100 / screen.height * scrollPos );
                            document.getElementById('tarteaucitronPercentage').style.width = pourc + '%';
														if( pourc>=100 ){
                              tarteaucitron.userInterface.respondAll(true);
														}
														/* <NETPLUSMEDIA */
                        }
                    }
                }, false);

                window.addEventListener("keydown", function (evt) {
                    if (evt.keyCode === 27) {
                        tarteaucitron.userInterface.closePanel();
                    }
                }, false);
                window.addEventListener("hashchange", function () {
                    if (document.location.hash === tarteaucitron.hashtag && tarteaucitron.hashtag !== '') {
                        tarteaucitron.userInterface.openPanel();
                    }
                }, false);
                window.addEventListener("resize", function () {
                    if (document.getElementById('tarteaucitron') !== null) {
                        if (document.getElementById('tarteaucitron').style.display === 'block') {
                            tarteaucitron.userInterface.jsSizing('main');
                        }
                    }

                    if (document.getElementById('tarteaucitronCookiesListContainer') !== null) {
                        if (document.getElementById('tarteaucitronCookiesListContainer').style.display === 'block') {
                            tarteaucitron.userInterface.jsSizing('cookie');
                        }
                    }
                }, false);
            } else {
                window.attachEvent("onload", function () {
                    tarteaucitron.load();
                    tarteaucitron.fallback(['tarteaucitronOpenPanel'], function (elem) {
                        elem.attachEvent("onclick", function (event) {
                            tarteaucitron.userInterface.openPanel();
                            event.preventDefault();
                        });
                    }, true);
                });
                window.attachEvent("onscroll", function () {
                    var scrollPos = window.pageYOffset || document.documentElement.scrollTop,
                        heightPosition;
                    if (document.getElementById('tarteaucitronAlertBig') !== null && !tarteaucitron.highPrivacy) {
                        if (document.getElementById('tarteaucitronAlertBig').style.display === 'block') {
                            heightPosition = document.getElementById('tarteaucitronAlertBig').offsetHeight + 'px';

                            if (scrollPos > (screen.height * 2)) {
                                tarteaucitron.userInterface.respondAll(true);
                            } else if (scrollPos > (screen.height / 2)) {
                                document.getElementById('tarteaucitronDisclaimerAlert').innerHTML = '<strong>' + tarteaucitron.lang.alertBigScroll + '</strong> ' + tarteaucitron.lang.alertBig;
                            }
                            if (tarteaucitron.orientation === 'top') {
                                document.getElementById('tarteaucitronPercentage').style.top = heightPosition;
                            } else {
                                document.getElementById('tarteaucitronPercentage').style.bottom = heightPosition;
                            }
                            document.getElementById('tarteaucitronPercentage').style.width = ((100 / (screen.height * 2)) * scrollPos) + '%';
                        }
                    }
                });
                window.attachEvent("onkeydown", function (evt) {
                    if (evt.keyCode === 27) {
                        tarteaucitron.userInterface.closePanel();
                    }

                    if ( evt.keyCode === 9 && focusableEls.indexOf(evt.target) >= 0) {
                        if ( evt.shiftKey ) /* shift + tab */ {
                            if (document.activeElement === firstFocusableEl) {
                                lastFocusableEl.focus();
                                evt.preventDefault();
                            }
                        } else /* tab */ {
                            if (document.activeElement === lastFocusableEl) {
                                firstFocusableEl.focus();
                                evt.preventDefault();
                            }
                        }
                    }

                });
                window.attachEvent("onhashchange", function () {
                    if (document.location.hash === tarteaucitron.hashtag && tarteaucitron.hashtag !== '') {
                        tarteaucitron.userInterface.openPanel();
                    }
                });
                window.attachEvent("onresize", function () {
                    if (document.getElementById('tarteaucitron') !== null) {
                        if (document.getElementById('tarteaucitron').style.display === 'block') {
                            tarteaucitron.userInterface.jsSizing('main');
                        }
                    }

                    if (document.getElementById('tarteaucitronCookiesListContainer') !== null) {
                        if (document.getElementById('tarteaucitronCookiesListContainer').style.display === 'block') {
                            tarteaucitron.userInterface.jsSizing('cookie');
                        }
                    }
                });
            }

            if (typeof XMLHttpRequest !== 'undefined') {
                origOpen = XMLHttpRequest.prototype.open;
                XMLHttpRequest.prototype.open = function () {

                    if (window.addEventListener) {
                        this.addEventListener("load", function () {
                            if (typeof tarteaucitronProLoadServices === 'function') {
                                tarteaucitronProLoadServices();
                            }
                        }, false);
                    } else if (typeof this.attachEvent !== 'undefined') {
                        this.attachEvent("onload", function () {
                            if (typeof tarteaucitronProLoadServices === 'function') {
                                tarteaucitronProLoadServices();
                            }
                        });
                    } else {
                        if (typeof tarteaucitronProLoadServices === 'function') {
                            setTimeout(tarteaucitronProLoadServices, 1000);
                        }
                    }

                    try {
                        origOpen.apply(this, arguments);
                    } catch (err) {}
                };
            }
        }

        if(tarteaucitron.events.init) {
            tarteaucitron.events.init();
        }
    },
    "load": function () {
        "use strict";
        var cdn = tarteaucitron.cdn,
            language = tarteaucitron.getLanguage(),
            pathToLang = cdn + 'lang/tarteaucitron.' + language + '.js?v=' + tarteaucitron.version,
            pathToServices = cdn + 'tarteaucitron.services.js?v=' + tarteaucitron.version,
            linkElement = document.createElement('link'),
            defaults = {
                "adblocker": false,
                "hashtag": '#tarteaucitron',
                "cookieName": 'tarteaucitron',
                "highPrivacy": false,
                "orientation": "top",
                "removeCredit": false,
                "showAlertSmall": true,
                "cookieslist": true,
                "handleBrowserDNTRequest": false,
								"scrollApprouve":false ,
                "AcceptAllCta" : false,
                "moreInfoLink": true,
                "privacyUrl": "",
                "useExternalCss": false
            },
            params = tarteaucitron.parameters;

        // Step 0: get params
        if (params !== undefined) {

            for (var k in defaults) {
                if(!tarteaucitron.parameters.hasOwnProperty(k)) {
                    tarteaucitron.parameters[k] = defaults[k];
                }
            }
        }

        // global
        tarteaucitron.orientation = tarteaucitron.parameters.orientation;
        tarteaucitron.hashtag = tarteaucitron.parameters.hashtag;
        tarteaucitron.highPrivacy = tarteaucitron.parameters.highPrivacy;
        tarteaucitron.handleBrowserDNTRequest = tarteaucitron.parameters.handleBrowserDNTRequest;


        // Step 1: load css
        if ( !tarteaucitron.parameters.useExternalCss ) {
            linkElement.rel = 'stylesheet';
            linkElement.type = 'text/css';
            linkElement.href = cdn + 'css/tarteaucitron.css?v=' + tarteaucitron.version;
            document.getElementsByTagName('head')[0].appendChild(linkElement);
        }
        // Step 2: load language and services
        tarteaucitron.addScript(pathToLang, '', function () {

          if(tarteaucitronCustomText !== ''){
            tarteaucitron.lang = tarteaucitron.AddOrUpdate(tarteaucitron.lang, tarteaucitronCustomText);
          }
            tarteaucitron.addScript(pathToServices, '', function () {

                var /* NETPLUSMEDIA> */
										/* <NETPLUSMEDIA */
                    div = document.createElement('div'),
                    html = '',
                    index,
                    orientation = 'Top',
                    cat = ['ads', 'analytic', 'api', 'comment', 'social', 'support', 'video', 'other'],
                    i;

                cat = cat.sort(function (a, b) {
                    if (tarteaucitron.lang[a].title > tarteaucitron.lang[b].title) { return 1; }
                    if (tarteaucitron.lang[a].title < tarteaucitron.lang[b].title) { return -1; }
                    return 0;
                });

                // Step 3: prepare the html
                html += '<div id="tarteaucitronPremium"></div>';
                html += '<button id="tarteaucitronBack" onclick="tarteaucitron.userInterface.closePanel();" aria-label="' + tarteaucitron.lang.close + '"></button>';
                html += '<div id="tarteaucitron" role="dialog" aria-labelledby="dialogTitle">';
                html += '   <button id="tarteaucitronClosePanel" onclick="tarteaucitron.userInterface.closePanel();">';
                html += '       ' + tarteaucitron.lang.close;
                html += '   </button>';
                html += '   <div id="tarteaucitronServices">';
                html += '      <div class="tarteaucitronLine tarteaucitronMainLine" id="tarteaucitronMainLineOffset">';
                html += '         <span class="tarteaucitronH1" role="heading" aria-level="h1" id="dialogTitle">'+ tarteaucitron.lang.title + '</span>';
                html += '         <div id="tarteaucitronInfo" class="tarteaucitronInfoBox">';
                html += '         ' + tarteaucitron.lang.disclaimer;
                if (tarteaucitron.parameters.privacyUrl !== "") {
                    html += '   <br/><br/>';
                    html += '   <button id="tarteaucitronPrivacyUrl" onclick="document.location = tarteaucitron.parameters.privacyUrl">';
                    html += '       ' + tarteaucitron.lang.privacyUrl;
                    html += '   </button>';
                }
                html += '         </div>';
                html += '         <div class="tarteaucitronName">';
                html += '            <span class="tarteaucitronH2" role="heading" aria-level="h2">' + tarteaucitron.lang.all + '</span>';
                html += '         </div>';
                html += '         <div class="tarteaucitronAsk" id="tarteaucitronScrollbarAdjust">';
                html += '            <button id="tarteaucitronAllAllowed" class="tarteaucitronAllow" onclick="tarteaucitron.userInterface.respondAll(true);">';
                html += '               &#10003; ' + tarteaucitron.lang.allowAll;
                html += '            </button> ';
                html += '            <button id="tarteaucitronAllDenied" class="tarteaucitronDeny" onclick="tarteaucitron.userInterface.respondAll(false);">';
                html += '               &#10007; ' + tarteaucitron.lang.denyAll;
                html += '            </button>';
                html += '         </div>';
                html += '      </div>';
                html += '      <div class="tarteaucitronBorder">';
                html += '         <div class="clear"></div><ul>';
                for (i = 0; i < cat.length; i += 1) {
                    html += '         <li id="tarteaucitronServicesTitle_' + cat[i] + '" class="tarteaucitronHidden">';
                    html += '            <div class="tarteaucitronTitle">';
                    html += '               <button onclick="tarteaucitron.userInterface.toggle(\'tarteaucitronDetails' + cat[i] + '\', \'tarteaucitronInfoBox\');return false">&#10011; ' + tarteaucitron.lang[cat[i]].title + '</button>';
                    html += '            </div>';
                    html += '            <div id="tarteaucitronDetails' + cat[i] + '" class="tarteaucitronDetails tarteaucitronInfoBox">';
                    html += '               ' + tarteaucitron.lang[cat[i]].details;
                    html += '            </div>';
                    html += '         <ul id="tarteaucitronServices_' + cat[i] + '"></ul></li>';
                }
                html += '         </ul>';
                html += '         <div class="tarteaucitronHidden" id="tarteaucitronScrollbarChild" style="height:20px;display:block"></div>';
                if (tarteaucitron.parameters.removeCredit === false) {
                    html += '     <a class="tarteaucitronSelfLink" href="https://opt-out.ferank.eu/" rel="nofollow noopener" target="_blank" title="tarteaucitron ' + tarteaucitron.lang.newWindow + '">🍋 ' + tarteaucitron.lang.credit + '</a>';
                }
                html += '       </div>';
                html += '   </div>';
                html += '</div>';

                if (tarteaucitron.parameters.orientation === 'bottom') {
                    orientation = 'Bottom';
                }

                if (tarteaucitron.parameters.highPrivacy && !tarteaucitron.parameters.AcceptAllCta) {
                    html += '<div id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '">';
                    html += '  <div id="tarteaucitronCentre">';
                    html += '   <span id="tarteaucitronDisclaimerAlert">';
                    html += '       ' + tarteaucitron.lang.alertBigPrivacy;
                    html += '   </span>';
                    html += '   <button id="tarteaucitronPersonalize" onclick="tarteaucitron.userInterface.openPanel();">';
                    html += '       ' + tarteaucitron.lang.personalize;
                    html += '   </button>';

                    if (tarteaucitron.parameters.privacyUrl !== "") {
                        html += '   <button id="tarteaucitronPrivacyUrl" onclick="document.location = tarteaucitron.parameters.privacyUrl">';
                        html += '       ' + tarteaucitron.lang.privacyUrl;
                        html += '   </button>';
                    }

                    html += '		</div>';
                    html += '</div>';
                } else {
                    html += '<div id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '">';
                    html += '  <div id="tarteaucitronCentre">';
                    html += '   <span id="tarteaucitronDisclaimerAlert">';

                    if (tarteaucitron.parameters.highPrivacy) {
                        html += '       ' + tarteaucitron.lang.alertBigPrivacy;
                    } else {
                        html += '       ' + tarteaucitron.lang.alertBigClick + ' ' + tarteaucitron.lang.alertBig;
                    }

                    html += '   </span>';
                    html += '   <button id="tarteaucitronRefuseCroix" onclick="tarteaucitron.userInterface.respondAll(false);">';
                    html += '       &#x2718;';
                    html += '   </button>';
                    html += '   <button id="tarteaucitronPersonalize" onclick="tarteaucitron.userInterface.respondAll(true);">';
                    html += '       &#10003; ' + tarteaucitron.lang.acceptAll;
                    html += '   </button>';
                    html += '   <button id="tarteaucitronRefuse" onclick="tarteaucitron.userInterface.respondAll(false);">';
                    html += '       &#x2718; ' + tarteaucitron.lang.refuseAll;
                    html += '   </button>';
                    html += '   <button id="tarteaucitronCloseAlert" onclick="tarteaucitron.userInterface.openPanel();">';
                    html += '       ' + tarteaucitron.lang.personalize;
                    html += '   </button>';

                    if (tarteaucitron.parameters.privacyUrl !== "") {
                        html += '   <button id="tarteaucitronPrivacyUrl" onclick="document.location = tarteaucitron.parameters.privacyUrl">';
                        html += '       ' + tarteaucitron.lang.privacyUrl;
                        html += '   </button>';
                    }

                    html += '  </div>';
                    html += '</div>';
                    html += '<div id="tarteaucitronPercentage"></div>';
                }

                if (tarteaucitron.parameters.showAlertSmall === true) {
                    html += '<div id="tarteaucitronAlertSmall" class="tarteaucitronAlertSmall' + orientation + '">';
                    html += '   <button id="tarteaucitronManager" onclick="tarteaucitron.userInterface.openPanel();">';
                    html += '       ' + tarteaucitron.lang.alertSmall;
                    html += '       <span id="tarteaucitronDot">';
                    html += '           <span id="tarteaucitronDotGreen"></span>';
                    html += '           <span id="tarteaucitronDotYellow"></span>';
                    html += '           <span id="tarteaucitronDotRed"></span>';
                    html += '       </span>';
                    if (tarteaucitron.parameters.cookieslist === true) {
                        html += '   </button><!-- @whitespace';
                        html += '   --><button id="tarteaucitronCookiesNumber" onclick="tarteaucitron.userInterface.toggleCookiesList();">0</button>';
                        html += '   <div id="tarteaucitronCookiesListContainer">';
                        html += '       <button id="tarteaucitronClosePanelCookie" onclick="tarteaucitron.userInterface.closePanel();">';
                        html += '           ' + tarteaucitron.lang.close;
                        html += '       </button>';
                        html += '       <div class="tarteaucitronCookiesListMain" id="tarteaucitronCookiesTitle">';
                        html += '            <span class="tarteaucitronH2" role="heading" aria-level="h2" id="tarteaucitronCookiesNumberBis">0 cookie</span>';
                        html += '       </div>';
                        html += '       <div id="tarteaucitronCookiesList"></div>';
                        html += '    </div>';
                    } else {
                        html += '   </div>';
                    }
                    html += '</div>';
                }

                tarteaucitron.addScript(tarteaucitron.cdn + 'advertising.js?v=' + tarteaucitron.version, '', function () {
                    if (tarteaucitronNoAdBlocker === true || tarteaucitron.parameters.adblocker === false) {

												/* NETPLUSMEDIA> */
                        div.id = 'tarteaucitronRoot';
												div.innerHTML = "<! - googleoff: all -> <section role='dialog' aria-live='polite'>"+html+"</section><! - googleon: all ->";

												if ( document.body.hasChildNodes()) {
													
													var children = document.body.childNodes;
													
													if( children.length>0 ){
														
														document.body.insertBefore( div , children[0] );
														
													}
													
												}
												/* <NETPLUSMEDIA */
												
                        if (tarteaucitron.job !== undefined) {
                            tarteaucitron.job = tarteaucitron.cleanArray(tarteaucitron.job);
                            for (index = 0; index < tarteaucitron.job.length; index += 1) {
                                tarteaucitron.addService(tarteaucitron.job[index]);
                            }
                        } else {
                            tarteaucitron.job = []
                        }

                        tarteaucitron.isAjax = true;

                        tarteaucitron.job.push = function (id) {

                            // ie <9 hack
                            if (typeof tarteaucitron.job.indexOf === 'undefined') {
                                tarteaucitron.job.indexOf = function (obj, start) {
                                    var i,
                                        j = this.length;
                                    for (i = (start || 0); i < j; i += 1) {
                                        if (this[i] === obj) { return i; }
                                    }
                                    return -1;
                                };
                            }

                            if (tarteaucitron.job.indexOf(id) === -1) {
                                Array.prototype.push.call(this, id);
                            }
                            tarteaucitron.launch[id] = false;
                            tarteaucitron.addService(id);
                        };

                        if (document.location.hash === tarteaucitron.hashtag && tarteaucitron.hashtag !== '') {
                            tarteaucitron.userInterface.openPanel();
                        }

                        tarteaucitron.cookie.number();
                        setInterval(tarteaucitron.cookie.number, 60000);
                    }
                }, tarteaucitron.parameters.adblocker);

                if (tarteaucitron.parameters.adblocker === true) {
                    setTimeout(function () {
                        if (tarteaucitronNoAdBlocker === false) {
                            html = '<div id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '" style="display:block" role="alert" aria-live="polite">';
														html += ' <div id="tarteaucitronCentre">';
                            html += '   <p id="tarteaucitronDisclaimerAlert">';
                            html += '       ' + tarteaucitron.lang.adblock + '<br/>';
                            html += '       <strong>' + tarteaucitron.lang.adblock_call + '</strong>';
                            html += '   </p>';
                            html += '   <button id="tarteaucitronPersonalize" onclick="location.reload();">';
                            html += '       ' + tarteaucitron.lang.reload;
                            html += '   </button>';
                            html += '	</div>';
                            html += '</div>';
                            html += '<div id="tarteaucitronPremium"></div>';

														/* NETPLUSMEDIA> */
														div.id = 'tarteaucitronRoot';
														div.innerHTML = "<! - googleoff: all -> <section role='dialog' aria-live='polite'>"+html+"</section><! - googleon: all ->";

														if ( document.body.hasChildNodes()) {
															
															var children = document.body.childNodes;
															
															if( children.length>0 ){
																
																document.body.insertBefore( div , children[0] );
																
															}
															
														}
														/* <NETPLUSMEDIA */
                            tarteaucitron.pro('!adblocker=true');
                        } else {
                            tarteaucitron.pro('!adblocker=false');
                        }
                    }, 1500);
                }
            });
        });

        if(tarteaucitron.events.load) {
            tarteaucitron.events.load();
        }
    },
    "addService": function (serviceId) {
        "use strict";
        var html = '',
            s = tarteaucitron.services,
            service = s[serviceId],
            cookie = tarteaucitron.cookie.read(),
            hostname = document.location.hostname,
            hostRef = document.referrer.split('/')[2],
            isNavigating = (hostRef === hostname && window.location.href !== tarteaucitron.parameters.privacyUrl) ? true : false,
            isAutostart = (!service.needConsent) ? true : false,
            isWaiting = (cookie.indexOf(service.key + '=wait') >= 0) ? true : false,
            isDenied = (cookie.indexOf(service.key + '=false') >= 0) ? true : false,
            isAllowed = (cookie.indexOf(service.key + '=true') >= 0) ? true : false,
            isResponded = (cookie.indexOf(service.key + '=false') >= 0 || cookie.indexOf(service.key + '=true') >= 0) ? true : false,
            isDNTRequested = (navigator.doNotTrack === "1" || navigator.doNotTrack === "yes" || navigator.msDoNotTrack === "1" || window.doNotTrack === "1") ? true : false;

        if (tarteaucitron.added[service.key] !== true) {
            tarteaucitron.added[service.key] = true;

            html += '<li id="' + service.key + 'Line" class="tarteaucitronLine">';
            html += '   <div class="tarteaucitronName">';
            html += '       <span class="tarteaucitronH3" role="heading" aria-level="h3">' + service.name + '</span>';
            html += '       <span id="tacCL' + service.key + '" class="tarteaucitronListCookies"></span><br/>';

            if (tarteaucitron.parameters.moreInfoLink == true) {

                var link = 'https://opt-out.ferank.eu/service/' + service.key + '/';
                if (service.readmoreLink !== undefined && service.readmoreLink !== '') {
                    link = service.readmoreLink;
                }
                if (tarteaucitron.parameters.readmoreLink !== undefined && tarteaucitron.parameters.readmoreLink !== '') {
                    link = tarteaucitron.parameters.readmoreLink;
                }
                html += '       <a href="' + link + '" target="_blank" rel="noopener" title="'+ tarteaucitron.lang.cookieDetail + ' ' + service.name + ' ' + tarteaucitron.lang.ourSite + ' ' + tarteaucitron.lang.newWindow +'">';
                html += '           ' + tarteaucitron.lang.more;
                html += '       </a>';
                html += '        - ';
                html += '       <a href="' + service.uri + '" target="_blank" rel="noopener" title="' + service.name + ' ' + tarteaucitron.lang.newWindow + '">';
                html += '           ' + tarteaucitron.lang.source;
                html += '       </a>';
            }

            html += '   </div>';
            html += '   <div class="tarteaucitronAsk">';
            html += '       <button id="' + service.key + 'Allowed" class="tarteaucitronAllow" onclick="tarteaucitron.userInterface.respond(this, true);">';
            html += '           eee&#10003; ' + tarteaucitron.lang.allow;
            html += '       </button> ';
            html += '       <button id="' + service.key  + 'Denied" class="tarteaucitronDeny" onclick="tarteaucitron.userInterface.respond(this, false);">';
            html += '           &#10007; ' + tarteaucitron.lang.deny;
            html += '       </button>';
            html += '   </div>';
            html += '</li>';

            tarteaucitron.userInterface.css('tarteaucitronServicesTitle_' + service.type, 'display', 'block');

            if (document.getElementById('tarteaucitronServices_' + service.type) !== null) {
                document.getElementById('tarteaucitronServices_' + service.type).innerHTML += html;
            }

            tarteaucitron.userInterface.order(service.type);
        }

        // allow by default for non EU
        if (isResponded === false && tarteaucitron.user.bypass === true) {
            isAllowed = true;
            tarteaucitron.cookie.create(service.key, true);
        }

        if ((!isResponded && (isAutostart || (isNavigating && isWaiting)) && !tarteaucitron.highPrivacy) || isAllowed) {
            if (!isAllowed) {
                tarteaucitron.cookie.create(service.key, true);
            }
            if (tarteaucitron.launch[service.key] !== true) {
                tarteaucitron.launch[service.key] = true;
                service.js();
            }
            tarteaucitron.state[service.key] = true;
            tarteaucitron.userInterface.color(service.key, true);
        } else if (isDenied) {
            if (typeof service.fallback === 'function') {
                service.fallback();
            }
            tarteaucitron.state[service.key] = false;
            tarteaucitron.userInterface.color(service.key, false);
        } else if (!isResponded && isDNTRequested && tarteaucitron.handleBrowserDNTRequest) {
            tarteaucitron.cookie.create(service.key, 'false');
            if (typeof service.fallback === 'function') {
                service.fallback();
            }
            tarteaucitron.state[service.key] = false;
            tarteaucitron.userInterface.color(service.key, false);
        } else if (!isResponded) {
            tarteaucitron.cookie.create(service.key, 'wait');
            if (typeof service.fallback === 'function') {
                service.fallback();
            }
            tarteaucitron.userInterface.color(service.key, 'wait');
            tarteaucitron.userInterface.openAlert();
        }

        tarteaucitron.cookie.checkCount(service.key);
    },
    "cleanArray": function cleanArray(arr) {
        "use strict";
        var i,
            len = arr.length,
            out = [],
            obj = {},
            s = tarteaucitron.services;

        for (i = 0; i < len; i += 1) {
            if (!obj[arr[i]]) {
                obj[arr[i]] = {};
                if (tarteaucitron.services[arr[i]] !== undefined) {
                    out.push(arr[i]);
                }
            }
        }

        out = out.sort(function (a, b) {
            if (s[a].type + s[a].key > s[b].type + s[b].key) { return 1; }
            if (s[a].type + s[a].key < s[b].type + s[b].key) { return -1; }
            return 0;
        });

        return out;
    },
    "userInterface": {
        "css": function (id, property, value) {
            "use strict";
            if (document.getElementById(id) !== null) {
                document.getElementById(id).style[property] = value;
            }
        },
        "respondAll": function (status) {
            "use strict";
            var s = tarteaucitron.services,
                service,
                key,
                index = 0;

            for (index = 0; index < tarteaucitron.job.length; index += 1) {
                service = s[tarteaucitron.job[index]];
                key = service.key;
                if (tarteaucitron.state[key] !== status) {
                    if (status === false && tarteaucitron.launch[key] === true) {
                        tarteaucitron.reloadThePage = true;
                    }
                    if (tarteaucitron.launch[key] !== true && status === true) {
                        tarteaucitron.launch[key] = true;
                        tarteaucitron.services[key].js();
                    }
                    tarteaucitron.state[key] = status;
                    tarteaucitron.cookie.create(key, status);
                    tarteaucitron.userInterface.color(key, status);
                }
            }
        },
        "respond": function (el, status) {
            "use strict";
            var key = el.id.replace(new RegExp("(Eng[0-9]+|Allow|Deni)ed", "g"), '');

            // return if same state
            if (tarteaucitron.state[key] === status) {
                return;
            }

            if (status === false && tarteaucitron.launch[key] === true) {
                tarteaucitron.reloadThePage = true;
            }

            // if not already launched... launch the service
            if (status === true) {
                if (tarteaucitron.launch[key] !== true) {
                    tarteaucitron.launch[key] = true;
                    tarteaucitron.services[key].js();
                }
            }
            tarteaucitron.state[key] = status;
            tarteaucitron.cookie.create(key, status);
            tarteaucitron.userInterface.color(key, status);
        },
        "color": function (key, status) {
            "use strict";
            var gray = '#808080',
                greenDark = '#1B870B',
                greenLight = '#E6FFE2',
                redDark = '#9C1A1A',
                redLight = '#FFE2E2',
                yellowDark = '#FBDA26',
                c = 'tarteaucitron',
                nbDenied = 0,
                nbPending = 0,
                nbAllowed = 0,
                sum = tarteaucitron.job.length,
                index;

            if (status === true) {
                tarteaucitron.userInterface.css(key + 'Line', 'borderLeft', '5px solid ' + greenDark);
                tarteaucitron.userInterface.css(key + 'Allowed', 'backgroundColor', greenDark);
                tarteaucitron.userInterface.css(key + 'Denied', 'backgroundColor', gray);

                document.getElementById(key + 'Line').classList.add('tarteaucitronIsAllowed');
                document.getElementById(key + 'Line').classList.remove('tarteaucitronIsDenied');
            } else if (status === false) {
                tarteaucitron.userInterface.css(key + 'Line', 'borderLeft', '5px solid ' + redDark);
                tarteaucitron.userInterface.css(key + 'Allowed', 'backgroundColor', gray);
                tarteaucitron.userInterface.css(key + 'Denied', 'backgroundColor', redDark);

                document.getElementById(key + 'Line').classList.remove('tarteaucitronIsAllowed');
                document.getElementById(key + 'Line').classList.add('tarteaucitronIsDenied');
            }

            // check if all services are allowed
            for (index = 0; index < sum; index += 1) {
                if (tarteaucitron.state[tarteaucitron.job[index]] === false) {
                    nbDenied += 1;
                } else if (tarteaucitron.state[tarteaucitron.job[index]] === undefined) {
                    nbPending += 1;
                } else if (tarteaucitron.state[tarteaucitron.job[index]] === true) {
                    nbAllowed += 1;
                }
            }

            tarteaucitron.userInterface.css(c + 'DotGreen', 'width', ((100 / sum) * nbAllowed) + '%');
            tarteaucitron.userInterface.css(c + 'DotYellow', 'width', ((100 / sum) * nbPending) + '%');
            tarteaucitron.userInterface.css(c + 'DotRed', 'width', ((100 / sum) * nbDenied) + '%');

            if (nbDenied === 0 && nbPending === 0) {
                tarteaucitron.userInterface.css(c + 'AllAllowed', 'backgroundColor', greenDark);
                tarteaucitron.userInterface.css(c + 'AllDenied', 'opacity', '0.4');
                tarteaucitron.userInterface.css(c + 'AllAllowed', 'opacity', '1');
            } else if (nbAllowed === 0 && nbPending === 0) {
                tarteaucitron.userInterface.css(c + 'AllAllowed', 'opacity', '0.4');
                tarteaucitron.userInterface.css(c + 'AllDenied', 'opacity', '1');
                tarteaucitron.userInterface.css(c + 'AllDenied', 'backgroundColor', redDark);
            } else {
                tarteaucitron.userInterface.css(c + 'AllAllowed', 'opacity', '0.4');
                tarteaucitron.userInterface.css(c + 'AllDenied', 'opacity', '0.4');
            }

            // close the alert if all service have been reviewed
            if (nbPending === 0) {
                tarteaucitron.userInterface.closeAlert();
            }

            if (tarteaucitron.services[key].cookies.length > 0 && status === false) {
                tarteaucitron.cookie.purge(tarteaucitron.services[key].cookies);
            }

            if (status === true) {
                if (document.getElementById('tacCL' + key) !== null) {
                    document.getElementById('tacCL' + key).innerHTML = '...';
                }
                setTimeout(function () {
                    tarteaucitron.cookie.checkCount(key);
                }, 2500);
            } else {
                tarteaucitron.cookie.checkCount(key);
            }
        },
        "openPanel": function () {
            "use strict";

            tarteaucitron.userInterface.css('tarteaucitron', 'display', 'block');
            tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'block');
            tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'display', 'none');

            document.getElementById('tarteaucitronClosePanel').focus();
            document.getElementsByTagName('body')[0].classList.add('modal-open');
            tarteaucitron.userInterface.focusTrap();
            tarteaucitron.userInterface.jsSizing('main');
        },
        "closePanel": function () {
            "use strict";

            if (document.location.hash === tarteaucitron.hashtag) {
                document.location.hash = '';
            }
            tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none');
            tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'display', 'none');

            tarteaucitron.fallback(['tarteaucitronInfoBox'], function (elem) {
                elem.style.display = 'none';
            }, true);

            if (tarteaucitron.reloadThePage === true) {
                window.location.reload();
            } else {
                tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'none');
            }
            if (document.getElementById('tarteaucitronCloseAlert') !== null) {
                document.getElementById('tarteaucitronCloseAlert').focus();
            }
            document.getElementsByTagName('body')[0].classList.remove('modal-open');

        },
        "focusTrap": function() {
            "use strict";

            var focusableEls,
                firstFocusableEl,
                lastFocusableEl,
                filtered;

            focusableEls = document.getElementById('tarteaucitron').querySelectorAll('a[href], button');
            filtered = [];

            // get only visible items
            for (var i = 0, max = focusableEls.length; i < max; i++) {
                if (focusableEls[i].offsetHeight > 0) {
                   filtered.push(focusableEls[i]);
                }
            }

            firstFocusableEl = filtered[0];
            lastFocusableEl = filtered[filtered.length - 1];

            //loop focus inside tarteaucitron
            document.getElementById('tarteaucitron').addEventListener("keydown", function (evt) {

                if ( evt.key === 'Tab' || evt.keyCode === 9 ) {

                    if ( evt.shiftKey ) /* shift + tab */ {
                        if (document.activeElement === firstFocusableEl) {
                            lastFocusableEl.focus();
                            evt.preventDefault();
                        }
                    } else /* tab */ {
                        if (document.activeElement === lastFocusableEl) {
                            firstFocusableEl.focus();
                            evt.preventDefault();
                        }
                    }
                }
            })
        },
        "openAlert": function () {
            "use strict";
            var c = 'tarteaucitron';
            tarteaucitron.userInterface.css(c + 'Percentage', 'display', 'block');
            tarteaucitron.userInterface.css(c + 'AlertSmall', 'display', 'none');
            tarteaucitron.userInterface.css(c + 'AlertBig',   'display', 'block');
        },
        "closeAlert": function () {
            "use strict";
            var c = 'tarteaucitron';
            tarteaucitron.userInterface.css(c + 'Percentage', 'display', 'none');
            tarteaucitron.userInterface.css(c + 'AlertSmall', 'display', 'block');
            tarteaucitron.userInterface.css(c + 'AlertBig',   'display', 'none');
            tarteaucitron.userInterface.jsSizing('box');
        },
        "toggleCookiesList": function () {
            "use strict";
            var div = document.getElementById('tarteaucitronCookiesListContainer');

            if (div === null) {
                return;
            }

            if (div.style.display !== 'block') {
                tarteaucitron.cookie.number();
                div.style.display = 'block';
                tarteaucitron.userInterface.jsSizing('cookie');
                tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none');
                tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'block');
                tarteaucitron.fallback(['tarteaucitronInfoBox'], function (elem) {
                    elem.style.display = 'none';
                }, true);
            } else {
                div.style.display = 'none';
                tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none');
                tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'none');
            }
        },
        "toggle": function (id, closeClass) {
            "use strict";
            var div = document.getElementById(id);

            if (div === null) {
                return;
            }

            if (closeClass !== undefined) {
                tarteaucitron.fallback([closeClass], function (elem) {
                    if (elem.id !== id) {
                        elem.style.display = 'none';
                    }
                }, true);
            }

            if (div.style.display !== 'block') {
                div.style.display = 'block';
            } else {
                div.style.display = 'none';
            }
        },
        "order": function (id) {
            "use strict";
            var main = document.getElementById('tarteaucitronServices_' + id),
                allDivs,
                store = [],
                i;

            if (main === null) {
                return;
            }

            allDivs = main.childNodes;

            if (typeof Array.prototype.map === 'function' && typeof Enumerable === 'undefined') {
                Array.prototype.map.call(main.children, Object).sort(function (a, b) {
                //var mainChildren = Array.from(main.children);
                //mainChildren.sort(function (a, b) {
                    if (tarteaucitron.services[a.id.replace(/Line/g, '')].name > tarteaucitron.services[b.id.replace(/Line/g, '')].name) { return 1; }
                    if (tarteaucitron.services[a.id.replace(/Line/g, '')].name < tarteaucitron.services[b.id.replace(/Line/g, '')].name) { return -1; }
                    return 0;
                }).forEach(function (element) {
                    main.appendChild(element);
                });
            }
        },
        "jsSizing": function (type) {
            "use strict";
            var scrollbarMarginRight = 10,
                scrollbarWidthParent,
                scrollbarWidthChild,
                servicesHeight,
                e = window,
                a = 'inner',
                windowInnerHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight,
                mainTop,
                mainHeight,
                closeButtonHeight,
                headerHeight,
                cookiesListHeight,
                cookiesCloseHeight,
                cookiesTitleHeight,
                paddingBox,
                alertSmallHeight,
                cookiesNumberHeight;

            if (type === 'box') {
                if (document.getElementById('tarteaucitronAlertSmall') !== null && document.getElementById('tarteaucitronCookiesNumber') !== null) {

                    // reset
                    tarteaucitron.userInterface.css('tarteaucitronCookiesNumber', 'padding', '0px 10px');

                    // calculate
                    alertSmallHeight = document.getElementById('tarteaucitronAlertSmall').offsetHeight;
                    cookiesNumberHeight = document.getElementById('tarteaucitronCookiesNumber').offsetHeight;
                    paddingBox = (alertSmallHeight - cookiesNumberHeight) / 2;

                    // apply
                    tarteaucitron.userInterface.css('tarteaucitronCookiesNumber', 'padding', paddingBox + 'px 10px');
                }
            } else if (type === 'main') {

                // get the real window width for media query
                if (window.innerWidth === undefined) {
                    a = 'client';
                    e = document.documentElement || document.body;
                }

                // height of the services list container
                if (document.getElementById('tarteaucitron') !== null && document.getElementById('tarteaucitronClosePanel') !== null && document.getElementById('tarteaucitronMainLineOffset') !== null) {

                    // reset
                    tarteaucitron.userInterface.css('tarteaucitronServices', 'height', 'auto');

                    // calculate
                    mainHeight = document.getElementById('tarteaucitron').offsetHeight;
                    closeButtonHeight = document.getElementById('tarteaucitronClosePanel').offsetHeight;

                    // apply
                    servicesHeight = (mainHeight - closeButtonHeight + 2);
                    tarteaucitron.userInterface.css('tarteaucitronServices', 'height', servicesHeight + 'px');
                    tarteaucitron.userInterface.css('tarteaucitronServices', 'overflow-x', 'auto');
                }

                // align the main allow/deny button depending on scrollbar width
                if (document.getElementById('tarteaucitronServices') !== null && document.getElementById('tarteaucitronScrollbarChild') !== null) {

                    // media query
                    if (e[a + 'Width'] <= 479) {
                        tarteaucitron.userInterface.css('tarteaucitronScrollbarAdjust', 'marginLeft', '11px');
                    } else if (e[a + 'Width'] <= 767) {
                        scrollbarMarginRight = 12;
                    }

                    scrollbarWidthParent = document.getElementById('tarteaucitronServices').offsetWidth;
                    scrollbarWidthChild = document.getElementById('tarteaucitronScrollbarChild').offsetWidth;
                    tarteaucitron.userInterface.css('tarteaucitronScrollbarAdjust', 'marginRight', ((scrollbarWidthParent - scrollbarWidthChild) + scrollbarMarginRight) + 'px');
                }

                // center the main panel
                if (document.getElementById('tarteaucitron') !== null) {

                    // media query
                    if (e[a + 'Width'] <= 767) {
                        mainTop = 0;
                    } else {
                        mainTop = ((windowInnerHeight - document.getElementById('tarteaucitron').offsetHeight) / 2) - 21;
                    }

                    // correct
                    if (mainTop < 0) {
                        mainTop = 0;
                    }

                    if (document.getElementById('tarteaucitronMainLineOffset') !== null) {
                        if (document.getElementById('tarteaucitron').offsetHeight < (windowInnerHeight / 2)) {
                            mainTop -= document.getElementById('tarteaucitronMainLineOffset').offsetHeight;
                        }
                    }

                    // apply
                    tarteaucitron.userInterface.css('tarteaucitron', 'top', mainTop + 'px');
                }


            } else if (type === 'cookie') {

                // put cookies list at bottom
                if (document.getElementById('tarteaucitronAlertSmall') !== null) {
                    tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'bottom', (document.getElementById('tarteaucitronAlertSmall').offsetHeight) + 'px');
                }

                // height of cookies list
                if (document.getElementById('tarteaucitronCookiesListContainer') !== null) {

                    // reset
                    tarteaucitron.userInterface.css('tarteaucitronCookiesList', 'height', 'auto');

                    // calculate
                    cookiesListHeight = document.getElementById('tarteaucitronCookiesListContainer').offsetHeight;
                    cookiesCloseHeight = document.getElementById('tarteaucitronClosePanelCookie').offsetHeight;
                    cookiesTitleHeight = document.getElementById('tarteaucitronCookiesTitle').offsetHeight;

                    // apply
                    tarteaucitron.userInterface.css('tarteaucitronCookiesList', 'height', (cookiesListHeight - cookiesCloseHeight - cookiesTitleHeight - 2) + 'px');
                }
            }
        }
    },
    "cookie": {
        "owner": {},
        "create": function (key, status) {
            "use strict";

            if (tarteaucitronForceExpire !== '') {
                // The number of day cann't be higher than 1 year
                timeExipre = (tarteaucitronForceExpire > 365) ? 31536000000 : tarteaucitronForceExpire * 86400000; // Multiplication to tranform the number of days to milliseconds
            }

            var d = new Date(),
                time = d.getTime(),
                expireTime = time + timeExipre, // 365 days
                regex = new RegExp("!" + key + "=(wait|true|false)", "g"),
                cookie = tarteaucitron.cookie.read().replace(regex, ""),
                value = tarteaucitron.parameters.cookieName + '=' + cookie + '!' + key + '=' + status,
                domain = (tarteaucitron.parameters.cookieDomain !== undefined && tarteaucitron.parameters.cookieDomain !== '') ? 'domain=' + tarteaucitron.parameters.cookieDomain + ';' : '';

          if (tarteaucitron.cookie.read().indexOf(key + '=' + status) === -1) {
                tarteaucitron.pro('!' + key + '=' + status);
            }

            d.setTime(expireTime);
            document.cookie = value + '; expires=' + d.toGMTString() + '; path=/;' + domain;
        },
        "read": function () {
            "use strict";
            var nameEQ = tarteaucitron.parameters.cookieName + "=",
                ca = document.cookie.split(';'),
                i,
                c;

            for (i = 0; i < ca.length; i += 1) {
                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 '';
        },
        "purge": function (arr) {
            "use strict";
            var i;

            for (i = 0; i < arr.length; i += 1) {
                document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/;';
                document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location.hostname + ';';
                document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location.hostname.split('.').slice(-2).join('.') + ';';
            }
        },
        "checkCount": function (key) {
            "use strict";
            var arr = tarteaucitron.services[key].cookies,
                nb = arr.length,
                nbCurrent = 0,
                html = '',
                i,
                status = document.cookie.indexOf(key + '=true');

            if (status >= 0 && nb === 0) {
                html += tarteaucitron.lang.useNoCookie;
            } else if (status >= 0) {
                for (i = 0; i < nb; i += 1) {
                    if (document.cookie.indexOf(arr[i] + '=') !== -1) {
                        nbCurrent += 1;
                        if (tarteaucitron.cookie.owner[arr[i]] === undefined) {
                            tarteaucitron.cookie.owner[arr[i]] = [];
                        }
                        if (tarteaucitron.cookie.crossIndexOf(tarteaucitron.cookie.owner[arr[i]], tarteaucitron.services[key].name) === false) {
                            tarteaucitron.cookie.owner[arr[i]].push(tarteaucitron.services[key].name);
                        }
                    }
                }

                if (nbCurrent > 0) {
                    html += tarteaucitron.lang.useCookieCurrent + ' ' + nbCurrent + ' cookie';
                    if (nbCurrent > 1) {
                        html += 's';
                    }
                    html += '.';
                } else {
                    html += tarteaucitron.lang.useNoCookie;
                }
            } else if (nb === 0) {
                html = tarteaucitron.lang.noCookie;
            } else {
                html += tarteaucitron.lang.useCookie + ' ' + nb + ' cookie';
                if (nb > 1) {
                    html += 's';
                }
                html += '.';
            }

            if (document.getElementById('tacCL' + key) !== null) {
                document.getElementById('tacCL' + key).innerHTML = html;
            }
        },
        "crossIndexOf": function (arr, match) {
            "use strict";
            var i;
            for (i = 0; i < arr.length; i += 1) {
                if (arr[i] === match) {
                    return true;
                }
            }
            return false;
        },
        "number": function () {
            "use strict";
            var cookies = document.cookie.split(';'),
                nb = (document.cookie !== '') ? cookies.length : 0,
                html = '',
                i,
                name,
                namea,
                nameb,
                c,
                d,
                s = (nb > 1) ? 's' : '',
                savedname,
                regex = /^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i,
                regexedDomain = (tarteaucitron.cdn.match(regex) !== null) ? tarteaucitron.cdn.match(regex)[1] : tarteaucitron.cdn,
                host = (tarteaucitron.domain !== undefined) ? tarteaucitron.domain : regexedDomain;

            cookies = cookies.sort(function (a, b) {
                namea = a.split('=', 1).toString().replace(/ /g, '');
                nameb = b.split('=', 1).toString().replace(/ /g, '');
                c = (tarteaucitron.cookie.owner[namea] !== undefined) ? tarteaucitron.cookie.owner[namea] : '0';
                d = (tarteaucitron.cookie.owner[nameb] !== undefined) ? tarteaucitron.cookie.owner[nameb] : '0';
                if (c + a > d + b) { return 1; }
                if (c + a < d + b) { return -1; }
                return 0;
            });

            if (document.cookie !== '') {
                for (i = 0; i < nb; i += 1) {
                    name = cookies[i].split('=', 1).toString().replace(/ /g, '');
                    if (tarteaucitron.cookie.owner[name] !== undefined && tarteaucitron.cookie.owner[name].join(' // ') !== savedname) {
                        savedname = tarteaucitron.cookie.owner[name].join(' // ');
                        html += '<div class="tarteaucitronHidden">';
                        html += '     <span class="tarteaucitronTitle tarteaucitronH3" role="heading" aria-level="h3">';
                        html += '        ' + tarteaucitron.cookie.owner[name].join(' // ');
                        html += '    </span>';
                        html += '</div><ul class="cookie-list">';
                    } else if (tarteaucitron.cookie.owner[name] === undefined && host !== savedname) {
                        savedname = host;
                        html += '<div class="tarteaucitronHidden">';
                        html += '     <span class="tarteaucitronTitle tarteaucitronH3" role="heading" aria-level="h3">';
                        html += '        ' + host;
                        html += '    </span>';
                        html += '</div><ul class="cookie-list">';
                    }
                    html += '<li class="tarteaucitronCookiesListMain">';
                    html += '    <div class="tarteaucitronCookiesListLeft"><button onclick="tarteaucitron.cookie.purge([\'' + cookies[i].split('=', 1) + '\']);tarteaucitron.cookie.number();tarteaucitron.userInterface.jsSizing(\'cookie\');return false"><strong>&times;</strong></button> <strong>' + name + '</strong>';
                    html += '    </div>';
                    html += '    <div class="tarteaucitronCookiesListRight">' + cookies[i].split('=').slice(1).join('=') + '</div>';
                    html += '</li>';
                }
                html += '</ul>';
            } else {
                html += '<div class="tarteaucitronCookiesListMain">';
                html += '    <div class="tarteaucitronCookiesListLeft"><strong>-</strong></div>';
                html += '    <div class="tarteaucitronCookiesListRight"></div>';
                html += '</div>';
            }

            html += '<div class="tarteaucitronHidden" style="height:20px;display:block"></div>';

            if (document.getElementById('tarteaucitronCookiesList') !== null) {
                document.getElementById('tarteaucitronCookiesList').innerHTML = html;
            }

            if (document.getElementById('tarteaucitronCookiesNumber') !== null) {
                document.getElementById('tarteaucitronCookiesNumber').innerHTML = nb;
            }

            if (document.getElementById('tarteaucitronCookiesNumberBis') !== null) {
                document.getElementById('tarteaucitronCookiesNumberBis').innerHTML = nb + ' cookie' + s;
            }

            for (i = 0; i < tarteaucitron.job.length; i += 1) {
                tarteaucitron.cookie.checkCount(tarteaucitron.job[i]);
            }
        }
    },
    "getLanguage": function () {
        "use strict";
        if (!navigator) { return 'en'; }

        var availableLanguages = 'cs,en,fr,es,it,de,nl,pt,pl,ru,el',
            defaultLanguage = 'en',
            lang = navigator.language || navigator.browserLanguage ||
                navigator.systemLanguage || navigator.userLang || null,
            userLanguage = lang.substr(0, 2);

        if (tarteaucitronForceLanguage !== '') {
            if (availableLanguages.indexOf(tarteaucitronForceLanguage) !== -1) {
                return tarteaucitronForceLanguage;
            }
        }

        if (availableLanguages.indexOf(userLanguage) === -1) {
            return defaultLanguage;
        }
        return userLanguage;
    },
    "getLocale": function () {
        "use strict";
        if (!navigator) { return 'en_US'; }

        var lang = navigator.language || navigator.browserLanguage ||
                navigator.systemLanguage || navigator.userLang || null,
            userLanguage = lang.substr(0, 2);

        if (userLanguage === 'fr') {
            return 'fr_FR';
        } else if (userLanguage === 'en') {
            return 'en_US';
        } else if (userLanguage === 'de') {
            return 'de_DE';
        } else if (userLanguage === 'es') {
            return 'es_ES';
        } else if (userLanguage === 'it') {
            return 'it_IT';
        } else if (userLanguage === 'pt') {
            return 'pt_PT';
        } else if (userLanguage === 'nl') {
            return 'nl_NL';
        } else if (userLanguage === 'el') {
            return 'el_EL';
        } else {
            return 'en_US';
        }
    },
    "addScript": function (url, id, callback, execute, attrName, attrVal) {
        "use strict";
        var script,
            done = false;

        if (execute === false) {
            if (typeof callback === 'function') {
                callback();
            }
        } else {
            script = document.createElement('script');
            script.type = 'text/javascript';
            script.id = (id !== undefined) ? id : '';
            script.async = true;
            script.src = url;

            if (attrName !== undefined && attrVal !== undefined) {
                script.setAttribute(attrName, attrVal);
            }

            if (typeof callback === 'function') {
                script.onreadystatechange = script.onload = function () {
                    var state = script.readyState;
                    if (!done && (!state || /loaded|complete/.test(state))) {
                        done = true;
                        callback();
                    }
                };
            }

            document.getElementsByTagName('head')[0].appendChild(script);
        }
    },
    "makeAsync": {
        "antiGhost": 0,
        "buffer": '',
        "init": function (url, id) {
            "use strict";
            var savedWrite = document.write,
                savedWriteln = document.writeln;

            document.write = function (content) {
                tarteaucitron.makeAsync.buffer += content;
            };
            document.writeln = function (content) {
                tarteaucitron.makeAsync.buffer += content.concat("\n");
            };

            setTimeout(function () {
                document.write = savedWrite;
                document.writeln = savedWriteln;
            }, 20000);

            tarteaucitron.makeAsync.getAndParse(url, id);
        },
        "getAndParse": function (url, id) {
            "use strict";
            if (tarteaucitron.makeAsync.antiGhost > 9) {
                tarteaucitron.makeAsync.antiGhost = 0;
                return;
            }
            tarteaucitron.makeAsync.antiGhost += 1;
            tarteaucitron.addScript(url, '', function () {
                if (document.getElementById(id) !== null) {
                    document.getElementById(id).innerHTML += "<span style='display:none'>&nbsp;</span>" + tarteaucitron.makeAsync.buffer;
                    tarteaucitron.makeAsync.buffer = '';
                    tarteaucitron.makeAsync.execJS(id);
                }
            });
        },
        "execJS": function (id) {
            /* not strict because third party scripts may have errors */
            var i,
                scripts,
                childId,
                type;

            if (document.getElementById(id) === null) {
                return;
            }

            scripts = document.getElementById(id).getElementsByTagName('script');
            for (i = 0; i < scripts.length; i += 1) {
                type = (scripts[i].getAttribute('type') !== null) ? scripts[i].getAttribute('type') : '';
                if (type === '') {
                    type = (scripts[i].getAttribute('language') !== null) ? scripts[i].getAttribute('language') : '';
                }
                if (scripts[i].getAttribute('src') !== null && scripts[i].getAttribute('src') !== '') {
                    childId = id + Math.floor(Math.random() * 99999999999);
                    document.getElementById(id).innerHTML += '<div id="' + childId + '"></div>';
                    tarteaucitron.makeAsync.getAndParse(scripts[i].getAttribute('src'), childId);
                } else if (type.indexOf('javascript') !== -1 || type === '') {
                    eval(scripts[i].innerHTML);
                }
            }
        }
    },
    "fallback": function (matchClass, content, noInner) {
        "use strict";
        var elems = document.getElementsByTagName('*'),
            i,
            index = 0;

        for (i in elems) {
            if (elems[i] !== undefined) {
                for (index = 0; index < matchClass.length; index += 1) {
                    if ((' ' + elems[i].className + ' ')
                            .indexOf(' ' + matchClass[index] + ' ') > -1) {
                        if (typeof content === 'function') {
                            if (noInner === true) {
                                content(elems[i]);
                            } else {
                                elems[i].innerHTML = content(elems[i]);
                            }
                        } else {
                            elems[i].innerHTML = content;
                        }
                    }
                }
            }
        }
    },
    "engage": function (id) {
        "use strict";
        var html = '',
            r = Math.floor(Math.random() * 100000),
            engage = tarteaucitron.services[id].name + ' ' + tarteaucitron.lang.fallback;

        if (tarteaucitron.lang['engage-' + id] !== undefined) {
            engage = tarteaucitron.lang['engage-' + id];
        }

        html += '<div class="tac_activate">';
        html += '   <div class="tac_float">';
        html += '      ' + engage;
        html += '      <button class="tarteaucitronAllow" id="Eng' + r + 'ed' + id + '" onclick="tarteaucitron.userInterface.respond(this, true);">';
        html += '          &#10003; ' + tarteaucitron.lang.allow;
        html += '       </button>';
        html += '   </div>';
        html += '</div>';

        return html;
    },
    "extend": function (a, b) {
        "use strict";
        var prop;
        for (prop in b) {
            if (b.hasOwnProperty(prop)) {
                a[prop] = b[prop];
            }
        }
    },
    "proTemp": '',
    "proTimer": function () {
        "use strict";
        setTimeout(tarteaucitron.proPing, 1000);
    },
    "pro": function (list) {
        "use strict";
        tarteaucitron.proTemp += list;
        clearTimeout(tarteaucitron.proTimer);
        tarteaucitron.proTimer = setTimeout(tarteaucitron.proPing, 2500);
    },
    "proPing": function () {
        "use strict";
        if (tarteaucitron.uuid !== '' && tarteaucitron.uuid !== undefined && tarteaucitron.proTemp !== '') {
            var div = document.getElementById('tarteaucitronPremium'),
                timestamp = new Date().getTime(),
                url = '//opt-out.ferank.eu/premium.php?';

            if (div === null) {
                return;
            }

            url += 'domain=' + tarteaucitron.domain + '&';
            url += 'uuid=' + tarteaucitron.uuid + '&';
            url += 'c=' + encodeURIComponent(tarteaucitron.proTemp) + '&';
            url += '_' + timestamp;

            div.innerHTML = '<img src="' + url + '" style="display:none" />';

            tarteaucitron.proTemp = '';
        }

        tarteaucitron.cookie.number();
    },
    "AddOrUpdate" : function(source, custom){
        /**
         Utility function to Add or update the fields of obj1 with the ones in obj2
         */
        for(key in custom){
            if(custom[key] instanceof Object){
                source[key] = tarteaucitron.AddOrUpdate(source[key], custom[key]);
            }else{
                source[key] = custom[key];
            }
        }
        return source;
    },
    "getElemWidth": function(elem) {
        return elem.getAttribute('width') || elem.clientWidth;
    },
    "getElemHeight": function(elem) {
        return elem.getAttribute('height') || elem.clientHeight;
    }
};

var params = {
  "privacyUrl":"", /* URL de la page de la politique de vie privée */

  "hashtag":"#tarteaucitron", /* Ouvrir le panneau contenant ce hashtag */
  "cookieName":"tartaucitron", /* Nom du Cookie */

  "orientation":"top", /* Position de la bannière (top - bottom) */
  "showAlertSmall":true, /* Voir la bannière réduite en bas à droite */
  "cookieslist":true, /* Voir la liste des cookies */

  "adblocker":false, /* Voir une alerte si un bloqueur de publicités est détecté */
  "AcceptAllCta":true, /* Voir le bouton accepter tout (quand highPrivacy est à true) */
  "highPrivacy":true, /* Désactiver le consentement automatique */
  "handleBrowserDNTRequest":false, /* Si la protection du suivi du navigateur est activée, tout interdire */
	"scrollApprouve":false ,
	
  "removeCredit":false, /* Retirer le lien vers tarteaucitron.js */
  "moreInfoLink":true, /* Afficher le lien "voir plus d'infos" */
	"useExternalCss":false, /* Si false, tarteaucitron.css sera chargé */

	// "cookieDomain":".my-multisite-domaine.fr", /* Cookie multisite */

	// "readmoreLink":"/cookiespolicy" /* Lien vers la page "Lire plus" */
  };
params.cookieName = "tartaucitron";
params.orientation = "top";
params.showAlertSmall = false;
var tarteaucitronForceLanguage = "fr"; 
tarteaucitron.init(params);

//Google jsapi
(tarteaucitron.job = tarteaucitron.job || []).push('jsapi');

/*
//Google Maps
tarteaucitron.user.googlemapsKey = 'API KEY';
(tarteaucitron.job = tarteaucitron.job || []).push('googlemaps');
tarteaucitron.user.mapscallback = 'callback_function';
tarteaucitron.user.googlemapsLibraries = 'LIBRARIES';
*/
// communs/tarteaucitron/modules/google_analytics_universal_tac.js

var attr = document.getElementsByTagName("body")[0].attributes;

if( attr['data-ga'] && attr['data-ga'].nodeValue && attr['data-ga'].nodeValue!="" ){
	
	tarteaucitron.user.gajsUa = attr['data-ga'].nodeValue;
	(tarteaucitron.job = tarteaucitron.job || []).push('gajs');
	
}
/* pages/mise_en_avant/js.js */

$(function() {

  function mise_en_avant( element_description , element ){

    $(".mise_en_avant_contenu .mise_en_avant li").removeClass("active");
    element.addClass("active");
    element_description.html( element.children("div").html() );
    
  }
  
  var element_parent = $(".mise_en_avant_contenu .mise_en_avant");
  
  element_parent.each(function(){

    var element = $(this).children("li");
    element_parent.after("<div class='mise_en_avant_description gauche bloc_100 marge_haut align_justify'></div>");
    var element_description = $(".mise_en_avant_description");
    
    mise_en_avant( element_description , element.eq(0) );
    
    element.click(function(){
			
      mise_en_avant( element_description , $(this) );
			
      return false;
			
    });
    
  });

	function mise_en_avant_precedent( element_li , nb , en_cours ){
		
		en_cours--;
		
		if( en_cours<0 ){
			
			en_cours = nb-1;
			
		}
		
		element_li.hide();
		element_li.eq(en_cours).show();
		
		return en_cours;
		
	}

	function mise_en_avant_suivant( element_li , nb , en_cours ){
		
		en_cours++;
		
		if( en_cours==nb ){
			
			en_cours = 0;
			
		}
		
		element_li.hide();
		element_li.eq(en_cours).show();
		
		return en_cours;
		
	}

  $(".animation_banniere").each(function(){

		var en_cours = 0;
		var animation_banniere = $(this);
		animation_banniere.addClass("animation_banniere_js");
		animation_banniere.parent('div').addClass('relative').append("<div class='mise_en_avant_precedent'>&lt;</div><div class='mise_en_avant_suivant'>&gt;</div>");
		
    var element_li = animation_banniere.children("li");
		element_li.hide();
		element_li.eq(en_cours).show();
		var nb = element_li.length;
		
		$(".mise_en_avant_precedent").click(function(){
			
			en_cours = mise_en_avant_suivant( element_li , nb , en_cours );
      animation_banniere.stopTime("mise_en_avant");
		
		});
		
		$(".mise_en_avant_suivant").click(function(){
			
			en_cours = mise_en_avant_precedent( element_li , nb , en_cours );
      animation_banniere.stopTime("mise_en_avant");
		
		});
		
    animation_banniere.everyTime( 3000 , "mise_en_avant" , function(){
      
			en_cours = mise_en_avant_suivant( element_li , nb , en_cours );
			
		});

  });

});
/* pages/formulaire/js.js */

jQuery().ready(function(){

	var element , classe;
	
	function champs_cache( element ){
		
		classe = element.attr( "data-champs-cache" );
		console.log( classe );
		element = element.find( "option[value='" + element.val() + "']" ).attr( "data-champs-cache" );
		console.log( element );
		
		if( classe!=undefined && classe!="" ){
			
			$( classe ).show();
			
		}
		
		if( element!=undefined && element!=""){
			
			$( element ).hide();
			
		}
		
	}
	
  $(".champs_cache").each(function(e){
  
		champs_cache( $(this) );
		
  }).change(function(e){
  
		champs_cache( $(this) );
		
  });
	
});
/*
js/description_facture.js
v1.3 - 26/04/2022
*/

(function($){

	var element = 'textarea[class*="textarea_auto"] , [class*="textarea_auto"] textarea' , valeur , taille_police , hauteur , nb_ligne , i;
	
  function textarea_auto( element ){
  
    valeur = element.val();
    taille_police = parseFloat ( element.css("font-size") );
    hauteur = taille_police + ( taille_police / 5 );
    nb_ligne = valeur.split("\n").length;

    for( i=2 ; i<4 ; i++ ){
			
      if( element.hasClass("textarea_auto_"+i) && nb_ligne<i ){
				
        nb_ligne = i;
				
      }
			
    }
    
    element.animate({
      height:( ( ( hauteur / ( element.innerWidth() / 7.8 ) ) * valeur.length ) + ( nb_ligne * hauteur ) + ( element.innerHeight() - element.height() ) )+"px"
    } , 10);

  }

	$("html").on( "keyup" , element , function(e){
	
    textarea_auto( $(this) );
    
  });
	
  $(document).on('DOMNodeInserted', function(e) {
			 
    if ( $( e.target ).find(".textarea_auto").length>0 ) {
       
			textarea_auto( $(element) );
		
    }
		
	});
	
})(jQuery);
/* /extensions/fonctions/form/js.js */

jQuery().ready(function(){

	var element , valeur , div , i;
	
	$("input[type=time][class*=firefox]").each(function(){

		$(this).after("<div class='form_input_time'><span></span></div>");
		
	});
	
	$("html").on("click" , ".form_input_time span" , function(e){
		
		element = $(this).parent(".form_input_time");
		valeur = element.prev("input[type=time]").val().split(":");
		
		div = "";
		div += "<div>";
			div += "<div class='form_input_time_heure'>";
				for( i=0 ; i<24 ; i++ ){
					
					j = i<10 ? "0"+i : i;
					div += "<p" + ( j==valeur[0] ? " class='actif'" : "" ) + ">" + j + "</p>";
					
				}
			div += "</div>";
			div += "<div class='form_input_time_minute'>";
				for( i=0 ; i<60 ; i++ ){
					
					j = i<10 ? "0"+i : i;
					div += "<p" + ( j==valeur[1] ? " class='actif'" : "" ) + ">" + j + "</p>";
					
				}
			div += "</div>";
		div += "</div>";
		
		element.append( div );
		
		$(".form_input_time_heure p.actif , .form_input_time_minute p.actif").each(function(){
			
			$(this).parent("div").scrollTop( $(this).position().top - 20 );
		
		});
	
	});
	
	$("html").on("click" , ".form_input_time p" , function(e){
		
		element = $(this);
		element.parent("div").find("p").removeClass("actif");
		element.addClass("actif");
		
		if( element.parent("div").hasClass("form_input_time_heure") ){
			
			valeur[0] = element.html();
			
		}else{
			
			valeur[1] = element.html();
			
		}
		
		element.parents(".form_input_time").prev("input[type=time]").val( valeur.join(":") );
		
	});
	
	var element_form_on_off = $("form.form_on_off_js");
	
	element_form_on_off.each(function(){
		
		$(this).find("input[type=submit]").hide();
		var form_on_off_js = 0;
		
		$(this).find("label.form_on_off input").change(function(){
			
			$.ajax({
				type: "POST",
				url : $( "link[rel=canonical]" ).attr( "href" ) ,
				data: "actif=" + $(this).is(':checked') + "&name=" + $(this).attr( "name" ) ,
				success : function(html){
				
					if( !( html && html=="ok" ) ){
					
						element_form_on_off.find("input[type=submit]").show();
						
					}
					
				} ,
				error : function(html){
					
					element_form_on_off.find("input[type=submit]").show();
					
				}
				
			});
			
		});
	
	});
	
});
/* extensions/fonctions/popup/js.js */
jQuery().ready(function(){
	
  $(".popup_ouverture").click(function(e){
		
    var leLien = $(this).attr("href");
		
    $.ajax({
      type: "POST",
      url : leLien,
      data: "popup=oui",
      success : function(html){
				
        if(html){
					
          //affichage
      		$("body").append("<div class='popup_fond'><div class='fermer'>X</div><div class='popup'>"+html+"</div></div>");

          $(".fermer").click(function(){
						
        		$(".popup_fond").fadeOut("fast" , function(){
							
              $('.popup_fond').remove();
							
            });
						
            return false;
						
          });
					
        }else{
					
					alert("Erreur");
					
				}
				
      }
			
    });

    return false;

  });
	
	var element = $(".popup_fond , .popup");
	
	$(".popup").each(function(e){
		
		$(this).addClass("fixed");
		
		if( !$(this).hasClass("hide") ){
			
			$(".popup_fond").removeClass("hide");
			
		}
	
	});
	
	element.click(function(e){
		
		element.remove();
		
	});
	
});
