$(document).ready(function(){

    $(".niv0").find("li").each(function() {
        if($(this).find("ul.niv1").length > 0) {
            $(this).mouseenter(function() { $(this).find("ul.niv1").stop(true, true).fadeIn('fast'); });
            $(this).mouseleave(function() { $(this).find("ul.niv1").stop(true, true).fadeOut('fast'); });
        }
    });
    $(".niv1").find("li").each(function() {
        $(this).prepend("<div class='smenu_element_lien_top'></div>"); $(this).append("<div class='smenu_element_lien_bottom'></div>");
        $(this).mouseenter(function(){ $(this).find(".smenu_element_lien_top").show(); $(this).find(".smenu_element_lien_bottom").show(); });
        $(this).mouseleave(function(){ $(this).find(".smenu_element_lien_top").hide(); $(this).find(".smenu_element_lien_bottom").hide(); });
        if($(this).find("ul.niv2").length > 0) {
            $(this).mouseenter(function() { $(this).find("ul.niv2").stop(true, true).fadeIn('fast'); });
            $(this).mouseleave(function() { $(this).find("ul.niv2").stop(true, true).fadeOut('fast'); });
        }
    });
    $(".niv2").find("li").each(function() {
        if($(this).find("ul.niv3").length > 0) {
            $(this).mouseenter(function() { $(this).find("ul.niv3").stop(true, true).fadeIn('fast'); });
            $(this).mouseleave(function() { $(this).find("ul.niv3").stop(true, true).fadeOut('fast'); });
        }
    });
    $(".niv3").find("li").each(function() {
        if($(this).find("ul.niv4").length > 0) {
            $(this).mouseenter(function() { $(this).find("ul.niv4").stop(true, true).fadeIn('fast'); });
            $(this).mouseleave(function() { $(this).find("ul.niv4").stop(true, true).fadeOut('fast'); });
        }
    });
    $(".niv4").find("li").each(function() {
        if($(this).find("ul.niv5").length > 0) {
            $(this).mouseenter(function() { $(this).find("ul.niv5").stop(true, true).fadeIn('fast'); });
            $(this).mouseleave(function() { $(this).find("ul.niv5").stop(true, true).fadeOut('fast'); });
        }
    });
    $(".niv5").find("li").each(function() {
        if($(this).find("ul.niv6").length > 0) {
            $(this).mouseenter(function() { $(this).find("ul.niv6").stop(true, true).fadeIn('fast'); });
            $(this).mouseleave(function() { $(this).find("ul.niv6").stop(true, true).fadeOut('fast'); });
        }
    });

    $(".video_zone_multimedia").width($(".video_zone_multimedia p *:first-child").width());
    $(".zone_actualites p:last").css("margin","0");
    $(".zone_libre p:last").css("margin","0");
    $(".niv1 li").each(function(){ $(this).find("a.lvl1:last").css("border-bottom","0"); });
    $(".niv0 li a:first").css("border-left","none");
    
    $("blockquote").wrap("<div class='tour_blockquote' />").find("p:last").css("margin","0");
    $(".resume_actu").each(function(){ $(this).find("p:last").css('margin','0'); });
});
