jQuery.fn.enterMenu = function() {
    if(jQuery(this).is(":animated")) { jQuery(this).stop(true, true); }
    jQuery(this).fadeIn("slow");
}

jQuery.fn.leaveMenu = function () {
    if(jQuery(this).is(":animated")) { jQuery(">.pseudolink", this).stop(true, true); }
    jQuery(this).fadeOut("slow");
}
jQuery.fn.hoverEffects = function (options) {
    settings = jQuery.extend({
    }, options);

    jQuery(">li", this).append('<div style="display: none;" class="pseudolink">&nbsp;</div>');

    jQuery(">li", this).mouseenter(function() {
        jQuery("> .pseudolink", this).enterMenu();
    }).mouseleave(function() {
        jQuery("> .pseudolink", this).leaveMenu();
    });
}

jQuery.fn.showMenu = function() {
    if(this.is(":animated")) this.stop(true, true);
    //this.show("slow");
    this.slideDown("fast");
}

jQuery.fn.hideMenu = function () {
    if(this.is(":animated")) this.stop(true, true);
    //this.hide("slow");
    this.slideUp("fast");
}

jQuery.fn.dropdowns = function(options) {
    jQuery(">li>ul", this).hide().css({left:'auto'});
    var defaults = {className: "active"};
    settings = jQuery.extend(defaults, options);

    jQuery(">li", this).bind("mouseenter", function() {
        jQuery(">a", this).addClass(settings.className);
        jQuery(">ul", this).showMenu();
    });

    jQuery(">li", this).bind("mouseleave", function() {
        jQuery(">a", this).removeClass(settings.className);
        jQuery(">ul", this).hideMenu();
    });

    jQuery(">li>ul", this).bind("mouseleave", function() {
        jQuery(">a", this).removeClass(settings.className);
        jQuery(this).hideMenu();
    });
}
