﻿var menuOpacity = 0.9, shadowDiameter = 5, currentRequest = ""; $(function () { var a = 0; $(".MenuDiv").hide().disableTextSelect(); $(".MenuHref").disableTextSelect(); $(".MenuHref").mouseenter(function () { var b = "#" + $(this).attr("rel"), a = $(this).parents(".MenuDiv").length; HideAllSubMenus($(this)); if ($(b).is(":hidden")) { a || HideAllMenus(!0); var c = $(this).offset(), d = $(this).attr("rev"), d = d == "rtl" ? a ? c.left - $(b).outerWidth() - 1 : c.left - $(b).outerWidth() + $(this).width() : d == "ltr" ? a ? c.left + $(this).width() + 1 : c.left : c.left - $(b).outerWidth() + $(this).width(), f = c.top + 20; if (a) f = c.top; d < 0 && (d = 0); $(b).css({ left: d, top: f }).fadeTo(0, 0).animate({ opacity: menuOpacity }, "normal"); $(b).find("tr:last").find("td").css({ border: "none" }); $.browser.msie && $.browser.version == "6.0" && (a = $("<iframe width='0' scrolling='no' height='0' frameborder='0' class='ddlIframe " + b + "' style='display:block; position:absolute'> </iframe>"), $(a).css({ left: d, top: f, height: $(b).height(), width: $(b).width() }), $("body").append($(a))) } }); $(".CloseMenu").mouseenter(function () { $(".MenuDiv:visible").length && (clearTimeout(a), a = 0, a = setTimeout("HideAllMenus()", 200)) }); $(".MenuHref").click(function (a) { $(this).trigger("mouseenter"); a.stopPropagation() }); $(".MenuDiv").add($(".MenuHref")).mouseenter(function () { clearTimeout(a); a = 0 }); $(".MenuDiv").mouseleave(function () { a = setTimeout("HideAllMenus()", 2E3) }); $(".MenuHref").mouseleave(function () { $(this).parents(".MenuDiv").length || (a = setTimeout("HideAllMenus()", 2E3)) }); $(".MenuDiv").click(function (a) { a.stopPropagation() }); $(document).click(function () { HideAllMenus() }) }); function HideAllMenus(a) { a ? ($(".MenuDiv").hide(), $(".MenuShadow").hide().remove()) : ($(".MenuDiv").fadeOut("fast"), $(".MenuShadow").fadeOut("fast", function () { $(this).remove() })); $(".ddlIframe").hide().remove() } function HideAllSubMenus(a) { var b = "#" + $(a).attr("rel"), e = $(".MenuDiv"), a = $(a).parents(".MenuDiv"), b = $(b); $(a).addClass("Temp"); $(b).addClass("Temp"); e = $(e).not('[class*="Temp"]'); $(a).removeClass("Temp"); $(b).removeClass("Temp"); $(e).each(function () { $(".ddlIframe").not('[class*="' + this.id + '"]').remove(); $(this).hide() }) } $.extend($.fn.resizeShadow = function () { $(this).is(".MenuDiv") && $(".MenuShadow").css({ width: $(this).width() + "px", height: $(this).height() + "px" }) }); $.extend($.fn.disableTextSelect = function () { return this.each(function () { $.browser.mozilla ? $(this).css("MozUserSelect", "none") : $.browser.msie ? $(this).bind("selectstart", function () { return !1 }) : $(this).mousedown(function () { return !1 }) }) });
