$(document).ready(function() {
    //Dynamic CSS
    $("#sub_menu_content ul li:last").css("background-image", "none");
    $("#main_menu li ul li:first").css("background-image", "none");
    $("div.jobs_wrapper p:first").css("padding", "0 0 0 0");
    //Cacher les dialogs
    $(".dialog").css("display", "none");
    //Comportement Menu
    $('#main_menu li a.first_level').mouseover(function() {
        $(this).stop();
        if(!$(this).parent().hasClass('active')){
            $(this).animate({
                width: "106",
                height: "45",
                lineHeight: "45"
            }, 200);
        }
        $('#main_menu li').removeClass('hover');
        $(this).parent().addClass("hover");
        if($(this).parent().find("ul")){
            $(this).parent().find("ul").show("slow");
        }

        $('#main_menu li').each(function(){
            if(!$(this).hasClass('hover') && !$(this).hasClass('active')){
        //$(this).find("ul").hide("slow");
        }
        });
    });
    $('#main_menu li a.first_level').mouseout(function() {
        $(this).stop();
        if(!$(this).parent().hasClass('active')){
            $(this).animate({
                width: "80",
                height: "36",
                lineHeight: "36"
            }, 200);
        }
    });
    $('a.bottom_vid_link:first').css("margin-left","14px");
    $('a.bottom_vid_link').mouseover(function(){
        $(this).find("img").attr("src", $(this).find("img").attr("src").replace(".jpg", "_hover.jpg"));
    });
    $('a.bottom_vid_link').mouseout(function(){
        $(this).find("img").attr("src", $(this).find("img").attr("src").replace("_hover.jpg", ".jpg"));
    });
});