/*
	Juiz DropDown Menu v1.5.6
	Plugin by Geoffrey Crofte
	http://www.creativejuiz.cc
	Free for personal use (cc)
	
	More info about license : http://jq.creativejuiz.fr/plugins-jquery/dropdown-menu.php
*/

(function (a) {
    a.fn.juizDropDownMenu = function (c) {
        jz = a.extend({}, d, c);
        a(this).addClass("juizdropdown");
        a("li ul", a(this)).addClass("juizSub");
        a(".juizSub ul", a(this)).addClass("juizSubSub").removeClass("juizSub");
        a("li:first-child", a(this)).addClass("first");
        a("li:last-child", a(this)).addClass("last");
        a("li:has('.juizSub')", a(this)).addClass("hasSub");
        a(".juizSub li:has('.juizSubSub')", a(this)).addClass("hasSubSub");
        a(this).after('<div class="juizClear">&nbsp;</div>');
        if (640 < a(window).width()) {
            a(this).children("li").hover(function () {
                a(".juizSub:visible").trigger("mouseleave");
                "slide" == jz.showEffect ? a(this).addClass("juizHovered").find("ul:not('.juiSubSub')").slideDown(jz.showSpeed) : a(this).addClass("juizHovered").find("ul:not('.juizSubSub')").fadeIn(jz.showSpeed);
                return !1
            }, function () {
                "slide" == jz.hideEffect ? a(this).removeClass("juizHovered").find("ul:not('.juizSubSub')").stop(!0, !0).slideUp(jz.hideSpeed) : a(this).removeClass("juizHovered").find("ul:not('.juizSubSub')").stop(!0, !0).fadeOut(jz.hideSpeed);
                return !1
            });
            var b = "px 0px";
            "1.6.4" == a().jquery && (b = "");
            a(this).find(".juizSub > li").hover(function () {
                a(".juizSubSub:visible").trigger("mouseleave");
                a(this).addClass("juizHovered").find("ul").fadeIn(jz.showSpeed);
                a(this).children("a").animate({
                    backgroundPosition: jz.hoverFrom + b
                }, jz.showBgSpeed);
                return !1
            }, function () {
                a(this).removeClass("juizHovered").find("ul").stop(!0, !0).fadeOut(jz.hideSpeed);
                a(this).children("a").animate({
                    backgroundPosition: jz.hoverBack + b
                }, jz.hideBgSpeed);
                return !1
            });
            a(this).find("a").focus(function () {
                a(this).closest("li").trigger("mouseenter")
            });
            a("ul li a", a(this)).blur(function () {
                a(this).closest("li").trigger("mouseleave")
            });
            a.browser.msie && "8.0" > a.browser.version && (a(this).find("li:not('li li')").css({
                zoom: "1",
                display: "inline"
            }), a(this).find("li>ul").css({
                top: "42px",
                left: "-38px"
            }), a(this).find("li li>ul").css({
                top: "0",
                left: "auto"
            }), "6.0" > a.browser.version && a(this).children("li").hover(function () {
                a("select, embed, object").hide(300)
            }, function () {
                a("select, embed, object").show(300)
            }))
        }
    };
    var d = {
        showSpeed: 400,
        hideSpeed: 400,
        showBgSpeed: 200,
        hideBgSpeed: 200,
        showEffect: "slide",
        hideEffect: "fade",
        hoverFrom: "0",
        hoverBack: "-150"
    }
})(jQuery);
