addEvent(window, 'load', initCorners);
function initCorners() {
    var settings = {
      tl: { radius: 8 },
      tr: { radius: 8 },
      bl: { radius: 8 },
      br: { radius: 8 },
      antiAlias: true
    }

}
    //curvyCorners(settings, ".one-box"); 
      
Cufon.replace(".cufon", { fontFamily: 'Helvetica-Light' });
     Cufon.replace(".home h2", { fontFamily: 'Helvetica-Light' });
     Cufon.replace(".entry h2", { fontFamily: 'Helvetica-Light' });  
     

      $(document).ready(function() {
         
             $("#menu ul li a").html("");
            $(".samegheight").equalHeights();
           
            $("#menu li:first-child").css("background","none");
            $("#menu-footer li:first-child").css("background","none");
            $("#menu-secondaire-footer li:first-child").css("background","none");
            
            
            $("#mydiaporama").carousel({ pagination: true,autoSlide:true,autoSlideInterval:4000  });
            $("#list-client-footer").carousel({ dispItems: 4,loop: true });
            
            $('.carousel-control').html('');
       
       
            $(".page-id-12 h4").append("&nbsp;<span>(Survolez le logo pour voir la mission)</span>");
              
              
            $('#liste-formations a').click(function(a) {
                $('#detail-formation').css("display","none");
                $('.myloader').css("display","block");
                $.ajax({
                  url: this.href,
                  success: function(data) {
                    $('#content_ajax').html(data);
                    $('#detail-formation').css("display","block");
                    $('.myloader').css("display","none");
                    
                    
                    
     
                        $.each($("#detail-formation table td:last-child"), function(a,b) { 
                          
                            duree = $(b).text();
                            $(b).html("<div class='myduree'>"+duree+"</div>");
                        });
                        
                        Cufon.replace("h2", { fontFamily: 'Helvetica-Light' });  

                  }
                });
                return false;
            });
            i= 0;
            $.each($("#liste-formations li"), function(a,b) { 
                i++;
                if(i%4==0){
                    text = $(b).text();
                    $(b).css("background-image","none");
                }
            });
      
            //$("#liste-formations li:last-child").addClass("last");
            
            
          
            
            $('.page-id-12 #content img').each(function()
            {
                //on vire les infos bulles par default pour les rempalcer avec QTIP
                bulle = $(this).attr('title');
                $(this).attr('title','');
                $(this).attr('tooltip',bulle);
               
                if($(this).attr('tooltip')!=""){
                    
                    $(this).css("cursor","pointer");
                    $(this).qtip({
                         content: $(this).attr('tooltip'), 
                         position: {
                            corner: {
                             target: 'bottomMiddle',
                             tooltip: 'topMiddle'
                            },
                            adjust: {
                               screen: true // Keep the tooltip on-screen at all times
                            }
                         },
                         show: { 
          
                            solo: true // Only show one tooltip at a time
                         },

       
                         style: { name: 'dark', tip: true }  // Give it a crea mstyle to make it stand out
                      });
                 }
            });

            $('.page-id-9 .content-box .mycontentbox').css('display',"none");
           
            lien = 0;
            $.each($(".page-id-9 .content-box .mycontentbox"), function(a,b) { 
                lien++;   
                text = $(b).text();
                   $(b).after('<a href="javascript:view_hide_content(\''+$(b).attr('id')+'\', \'lien'+lien+'\')" class="hideshow" id="lien'+lien+'">Lire plus</a>');
            });
           
           
           $('#list_cvs .cat-item > a').each(function(index) {
                $(this).css("cursor","default");
                $(this).attr("title","");
                $(this).click(function() {
                  return false;
                });
              })
              
              
           
           $('.morepopup').fancybox({
                'transitionIn'    :    'elastic',
                'transitionOut'    :    'elastic',
                'speedIn'        :    600, 
                'speedOut'        :    200, 
                'type'    :    'iframe',
                'width':770,
                'height':570,
                'padding':0,
                'margin':0
            });  
            
            
      });
  
       
     
     function view_hide_content(montre,cache){
            $('#'+montre).slideDown("slow");
            
            
            $('#'+cache).html("Masquer");
            $('#'+cache).attr("href",'javascript:hide_view_content(\''+montre+'\',\''+cache+'\')');
     }
     
     function hide_view_content(cache,montre){
            $('#'+cache).slideUp();
            
            
            $('#'+montre).html("Lire plus");
            $('#'+montre).attr("href",'javascript:view_hide_content(\''+cache+'\',\''+montre+'\')');
     }
