$(document).ready(function() {
    var config = {
        timeout: 50,
        over: function() {
            var thisid = "#sub_" + $(this).attr("id").replace(/mainnav_/, '');
            $(thisid).show("slide", { direction: "up" }, 600);
        },
        out: function() {
            var thisid = "#sub_" + $(this).attr("id").replace(/mainnav_/, '');
            $(thisid).hide("slide", { direction: "up" }, 600);
        }
    };

    $("#nav li.menu").hoverIntent( config );
});

