$(document).ready(function() {

    $(".dMenu .flMonitor .flmWrapper").css("height", ($(".dMenu .dmContainer").height() - 9) + "px");
    
    var helperHeight = $(".dMenu .flMonitor").height() - 22;
    $(".dMenu .slMonitor .slmLeftBottom").css("height", helperHeight + "px");
    $(".dMenu .secondLvl").css("height", helperHeight + 2 + "px");
    
    $(".dMenu .firstLvl a").mouseover(function(){
        var panel = $(".dMenu .flMonitor").eq($(".dMenu .firstLvl a").index(this));
        $(".dMenu .flMonitor").removeClass("active");
        $(".dMenu .firstLvl a").removeClass("active");
        panel.addClass("active");
        
        $(this).addClass("active");
        
        return false;
    });
    
    $(".dMenu .firstLvl a, .dMenu .secondLvl a").click(function(){
        return false;
    });
    
    $(".dMenu .secondLvl a").mouseover(function(){
        var monitors = $(this).parent().parent().children(".slMonitor");
        var hrefs =  $(this).parent().children("a");
        var panel = monitors.eq(hrefs.index(this));
        
        monitors.removeClass("active");
        hrefs.removeClass("active");
        panel.addClass("active");
        
        $(this).addClass("active");
        
        return false;
    });
});
