$(document).ready(function() {
    $(".jd_menu ul").show().each(function() {
        var ul = $(this);
        var content = ul.find(".menu-content");
        var menuContent = content.find(".menu-content-left, .menu-content-right");
        var contentColumn = content.find(".left-column, .right-column");

        if (jQuery.browser.msie)
        {
            // If IE, we need to set a fixed width
            // And to do that, hack festival!
            ul.css({position: "relative"});

            ul.width(1500);

            content.css({ whiteSpace: "nowrap" });
            var width = menuContent.eq(0).outerWidth(true);
            content.css({ whiteSpace: "normal" });
            
            width += menuContent.eq(1).outerWidth(true);
            content.width(width);
            
            ul.css({position: "absolute"});
            ul.width(width)
            ul.children().width(width);
        }
 
        menuContent.vjustify();
        contentColumn.height(menuContent.eq(0).height() - 7);
    }).hide();
    $("ul.jd_menu").jdMenu({ onAnimate: onAnimate });
});

function onAnimate(show)
{
    if (!jQuery.browser.msie)
    {
        if (show)
            $(this).fadeIn("fast");
        else
            $(this).fadeOut("fast");
    }
    else
    {
        if (show)
            $(this).show();
        else
            $(this).hide();
    }
}