// Début de document Ready
$(document).ready(function(){ 
     
// Animation boite CodeBarre2D QR
      
      // Def fonction JQ
      (function($){
          $.fn.CodeBarre2D = function(options){  
                        
                 //var textevalue=$(this).attr("title");
                 var defaults = { 'ydecal':'-133px','textevalue':'' };                                           
                 var options = $.extend(defaults, options);
                 var iCodeBarre2D=0; //alert(options.textevalue);
                 //$("#BgCodeBarre2D").css({"opacity":"0.5"});

                 $(this).each(function(iCodeBarre2D){
                     iCodeBarre2D++;
                     if(options.textevalue==""){ options.textevalue=$(this).attr("title"); }
                     $(this).hover(function(iCodeBarre2D){                          
                          $("#BgCodeBarre2D DIV").children().html(options.textevalue).css({opacity:0.1})
                          $("#BgCodeBarre2D DIV").stop() 
                          $("#BgCodeBarre2D DIV").children().stop()
                          $("#BgCodeBarre2D DIV").animate({"top":options.ydecal})                           
                          //$("#BgCodeBarre2D").css({opacity:0.5})
                          $(this).attr("title","") 
                          $("#BgCodeBarre2D DIV").children().html(options.textevalue).fadeTo(1000, 1)
                          //$("#BgCodeBarre2D").fadeTo(100, 1)                           
                          return false
                     },function(iCodeBarre2D){                          
                          $("#BgCodeBarre2D DIV").stop() 
                          $("#BgCodeBarre2D DIV").children().stop()                           
                          //$("#BgCodeBarre2D").fadeTo(1000, 0.5)  
                          //$("#BgCodeBarre2D DIV").delay(3000)
                          $(this).attr("title",options.textevalue)
                          $("#BgCodeBarre2D DIV").animate({"top":"-153px"})
                          //$("#BgCodeBarre2D DIV").children().html(options.textevalue).fadeTo(1000, 0.1)
                          //$("#BgCodeBarre2D").fadeTo(100, 0.5)                                               
                          return false                                       
                     });                 
                 });    
          }
      })(jQuery);
            
      // init fonction JQ
      //$("#Menu1").CodeBarre2D({ 'textevalue':'Num&eacute;ro de mobile' });
      $("#Menu2 a").CodeBarre2D();
      $("#Menu3 a").CodeBarre2D();
      $("#Menu4 a").CodeBarre2D({ 'ydecal':'-28px' });


// Animations de transparence

      // Def fonction transparence
      (function($) {
          $.fn.Transparent = function() {  
                 
                 var iTransparent=0;
                 
                 $(this).each(function(iTransparent){
                     iTransparent++;
                     $(this).mouseover(function(iTransparent){     
                          $(this).stop();                          
                          $(this).animate( { "opacity":"0.5" }, 700 )
                          return false  
                     })
                     $(this).mouseout(function(iTransparent){    
                          $(this).stop(); 
                          $(this).animate( { "opacity":"1" }, 700)
                          return false                                       
                     })                 
                 })    
          }
      })(jQuery);


// Animations de transparence
      
      (function($) {
          $.fn.SwitchRef = function() {  
                 
                $("#FondReferencesTop").toggle("slow");
                var WatchCLASS=$("#FondActiviteBottom").attr("class");
                if(WatchCLASS=="ClassAdd"){
                        $("#FondActiviteBottom").toggleClass("ClassAdd",3000)                       
                }else{
                        $("#FondActiviteBottom").toggleClass("ClassAdd",3000)
                }  
                 
          }
      })(jQuery);
            
      // Switch Ref
      //$("#FondActiviteBottom").click(function(){ $(this).SwitchRef(); })
         
      // init transparences header et footer
      $("#Menus a").Transparent(); 
      //$("#Menu1").Transparent();      
      $("#CtRt a").Transparent();
    
}); // Fin de document Ready

