(function (a) { a.fn.dropmenu = function (b) { function p(b) { d.onHidden.call(a(b).parent()) } function o(b) { d.onShown.call(a(b).parent()) } function n(b) { var c = b.siblings("." + d.openMenuClass); a.each(c, function (b, e) { var f = a(c[b]).find("li." + d.openMenuClass); f.css("z-index", d.zindex - 1); j(f); j(a(c[b])) }) } function m(b, c) { if (c) { a(b).parent().addClass(d.openMenuClass).end().show(d.openSpeed, function () { o(a(b)) }) } else { a(b).hide(d.closeSpeed, function () { a(this).parent().removeClass(d.openMenuClass); p(a(b)) }) } } function l(b, c) { if (c) { a(b).parent().addClass(d.openMenuClass).end().fadeIn(d.openSpeed, function () { o(a(b)) }) } else { a(b).fadeOut(d.closeSpeed, function () { a(this).parent().removeClass(d.openMenuClass); p(a(b)) }) } } function k(b, c) { if (c) { a(b).parent().addClass(d.openMenuClass).end().slideDown(d.openSpeed, function () { o(a(b)) }) } else { a(b).slideUp(d.closeSpeed, function () { a(this).parent().removeClass(d.openMenuClass); p(a(b)) }) } } function j(b) { var c = b.find("> ul, > div").stop(true, true); if (typeof d.closeAnimation == "function") { a(b).removeClass(d.openMenuClass); d.closeAnimation.call(c); return } switch (d.closeAnimation) { case "fade": l(c, false); break; case "size": m(c, false); break; default: k(c, false); break } } function i(b) { var c = b.find("> ul, > div").stop(true, true); a(b).parent().find("ul, div").css("z-index", d.zindex); c.css("z-index", d.zindex + 1); if (typeof d.openAnimation == "function") { a(b).addClass(d.openMenuClass); d.openAnimation.call(c); return } if (!a(b).is("." + d.openMenuClass)) { switch (d.openAnimation) { case "fade": l(c, true); break; case "size": m(c, true); break; default: k(c, true); break } } } var c = { openAnimation: "size", closeAnimation: "slide", openClick: false, openSpeed: 0, closeSpeed: 0, closeDelay: 100, onHide: function () { }, onHidden: function () { }, onShow: function () { }, onShown: function () { }, zindex: 20000001, openMenuClass: "open", autoAddArrowElements: false }; var d = a.extend({}, c, b); var e = ""; var f = a(this); var g = f.find("> li").children("ul, div").css("display", "none").end().find("ul ul, li > div").css("display", "none").end(); f.removeClass("css-only"); var h = f.find("li > ul, li > div").parent().addClass("dropitem"); if (d.autoAddArrowElements) { h.find("> a").append('<span class="arrow"></span>') } a(h).hover(function () { if (d.closeDelay != 0) { window.clearInterval(e); n(a(this)) } if (!d.openClick && !a(this).is("." + d.openMenuClass)) { d.onShow.call(a(this)); i(a(this)) } }, function () { d.onHide.call(a(this)); if (d.closeDelay == 0) { j(a(this).find("li." + d.openMenuClass)); j(a(this)) } else { var b = a(this); window.clearInterval(e); e = setInterval(function () { window.clearInterval(e); j(a(b).find("li." + d.openMenuClass)); j(b) }, d.closeDelay) } }); if (d.openClick) { a(h).click(function () { d.onShow.call(a(this)); i(a(this)) }) } return this } })(jQuery)
