var NavFX = {
    rate: 150,
    delay: 200,
    
    cur: null,
    last: null,
    path: null,

    start: function(path) {
        NavFX.path = path;
        NavFX._start();
    },
    
    _start: function() {
        $(NavFX.path).children("ul").hide();
        $(NavFX.path).hover(NavFX.hover);
    },
    
    hover: function() {
        NavFX.cur = this;
        NavFX.last = this;
        setTimeout(NavFX._hover, NavFX.delay);
        $(this).mouseleave(function() {
            NavFX.cur = null;
            //$(NavFX.path).children("ul").slideUp(NavFX.rate);
        });
    },
    
    _hover: function() {
        if (NavFX.cur == null) return;
    
        $(NavFX.cur).children("ul")
            .slideDown(NavFX.rate);
        
        $(NavFX.cur).mouseleave(NavFX.mouseleave);
    },
    
    mouseleave: function() {
        $(this).children("ul").slideUp(NavFX.rate);
    }
};

