﻿function toggleRecent() {
    if (jQuery("#loc-recent ul").css("display") == "none") {
        jQuery("#loc-recent").addClass("open");
        jQuery("#loc-recent ul").slideDown("slow");
    } else {
        jQuery("#loc-recent ul").slideUp("slow");
        jQuery("#loc-recent").removeClass("open");
    }
    return (false);
}
var hide;
function hideRecent() {
    if (hide) clearTimeout(hide);
    var changeClass = "setTimeout('jQuery(\"#loc-recent\").removeClass(\"open\");', 500);"
    hide = setTimeout('jQuery("#loc-recent ul").slideUp("slow"); jQuery("#loc-recent").removeClass("open");', 1500);
}
function fixRecent() {
    // this should be called only for ie6
    // fixes a problem with the open button -- it isn't clickable.
    jQuery("#loc-recent-hdr").width(jQuery("#loc-recent ul").width() + 2 + "px");
    jQuery("#loc-recent-hdr").css("padding-right", "0px");
}

jQuery(document).ready(function() {
    jQuery("#loc-recent ul").show();
    // can't equalize widths if the menu is invisible
    jQuery("#loc-recent ul a").equalizeAllWidths();
    // make all menu links the same width
    jQuery("#loc-recent ul").hide();
    // hide the menu

    jQuery("#loc-recent").bind("mouseout", hideRecent);
    jQuery("#loc-recent").bind("mouseover", function() { if (hide) clearTimeout(hide); });
    jQuery("#loc-recent-hdr").bind("click", toggleRecent);
    jQuery("#loc-recent-hdr").bind("focus", function() { this.blur(); });
});
