;
(function ($) {
    $.fn.superfish = function (d) {
        var e = $.fn.superfish,
            c = e.c,
            $arrow = $(['<span class="', c.arrowClass, '"> &#187;</span>'].join('')),
            over = function () {
                var a = $(this),
                    menu = getMenu(a);
                clearTimeout(menu.sfTimer);
                a.showSuperfishUl().siblings().hideSuperfishUl()
            },
            out = function () {
                var a = $(this),
                    menu = getMenu(a),
                    o = e.op;
                clearTimeout(menu.sfTimer);
                menu.sfTimer = setTimeout(function () {
                    o.retainPath = ($.inArray(a[0], o.$path) > -1);
                    a.hideSuperfishUl();
                    if (o.$path.length && a.parents(['li.', o.hoverClass].join('')).length < 1) {
                        over.call(o.$path)
                    }
                }, o.delay)
            },
            getMenu = function (a) {
                var b = a.parents(['ul.', c.menuClass, ':first'].join(''))[0];
                e.op = e.o[b.serial];
                return b
            },
            addArrow = function (a) {
                a.addClass(c.anchorClass).append($arrow.clone())
            };
        return this.each(function () {
            var s = this.serial = e.o.length;
            var o = $.extend({}, e.defaults, d);
            o.$path = $('li.' + o.pathClass, this).slice(0, o.pathLevels).each(function () {
                $(this).addClass([o.hoverClass, c.bcClass].join(' ')).filter('li:has(ul)').removeClass(o.pathClass)
            });
            e.o[s] = e.op = o;
            $('li:has(ul)', this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over, out).each(function () {
                if (o.autoArrows) addArrow($('>a:first-child', this))
            }).not('.' + c.bcClass).hideSuperfishUl();
            var b = $('a', this);
            b.each(function (i) {
                var a = b.eq(i).parents('li');
                b.eq(i).focus(function () {
                    over.call(a)
                }).blur(function () {
                    out.call(a)
                })
            });
            o.onInit.call(this)
        }).each(function () {
            var a = [c.menuClass];
            if (e.op.dropShadows && !($.browser.msie && $.browser.version < 7)) a.push(c.shadowClass);
            $(this).addClass(a.join(' '))
        })
    };
    var f = $.fn.superfish;
    f.o = [];
    f.op = {};
    f.IE7fix = function () {
        var o = f.op;
        if ($.browser.msie && $.browser.version > 6 && o.dropShadows && o.animation.opacity != undefined) this.toggleClass(f.c.shadowClass + '-off')
    };
    f.c = {
        bcClass: 'sf-breadcrumb',
        menuClass: 'sf-js-enabled',
        anchorClass: 'sf-with-ul',
        arrowClass: 'sf-sub-indicator',
        shadowClass: 'sf-shadow'
    };
    f.defaults = {
        hoverClass: 'sfHover',
        pathClass: 'overideThisToUse',
        pathLevels: 1,
        delay: 800,
        animation: {
            opacity: 'show'
        },
        speed: 'normal',
        autoArrows: true,
        dropShadows: true,
        disableHI: false,
        onInit: function () {},
        onBeforeShow: function () {},
        onShow: function () {},
        onHide: function () {}
    };
    $.fn.extend({
        hideSuperfishUl: function () {
            var o = f.op,
                not = (o.retainPath === true) ? o.$path : '';
            o.retainPath = false;
            var a = $(['li.', o.hoverClass].join(''), this).add(this).not(not).removeClass(o.hoverClass).find('>ul').hide().css('visibility', 'hidden');
            o.onHide.call(a);
            return this
        },
        showSuperfishUl: function () {
            var o = f.op,
                sh = f.c.shadowClass + '-off',
                $ul = this.addClass(o.hoverClass).find('>ul:hidden').css('visibility', 'visible');
            f.IE7fix.call($ul);
            o.onBeforeShow.call($ul);
            $ul.animate(o.animation, o.speed, function () {
                f.IE7fix.call($ul);
                o.onShow.call($ul)
            });
            return this
        }
    })
})(jQuery);
(function ($) {
    $.fn.supersubs = function (k) {
        var l = $.extend({}, $.fn.supersubs.defaults, k);
        return this.each(function () {
            var h = $(this);
            var o = $.meta ? $.extend({}, l, h.data()) : l;
            var j = $('<li id="menu-fontsize">&#8212;</li>').css({
                'padding': 0,
                'position': 'absolute',
                'top': '-999em',
                'width': 'auto'
            }).appendTo(h).width();
            $('#menu-fontsize').remove();
            $ULs = h.find('ul');
            $ULs.each(function (i) {
                var c = $ULs.eq(i);
                var d = c.children();
                var e = d.children('a');
                var f = d.css('white-space', 'nowrap').css('float');
                var g = c.add(d).add(e).css({
                    'float': 'none',
                    'width': 'auto'
                }).end().end()[0].clientWidth / j;
                g += o.extraWidth;
                if (g > o.maxWidth) {
                    g = o.maxWidth
                } else if (g < o.minWidth) {
                    g = o.minWidth
                }
                g += 'em';
                c.css('width', g);
                d.css({
                    'float': f,
                    'width': '100%',
                    'white-space': 'normal'
                }).each(function () {
                    var a = $('>ul', this);
                    var b = a.css('left') !== undefined ? 'left' : 'right';
                    a.css(b, g)
                })
            })
        })
    };
    $.fn.supersubs.defaults = {
        minWidth: 9,
        maxWidth: 25,
        extraWidth: 0
    }
})(jQuery);
var $j = jQuery.noConflict();
$j(document).ready(function () {
    $j('ul.menu').supersubs({
        minWidth: 12,
        maxWidth: 27,
        extraWidth: 1
    }).superfish({
        delay: 100,
        animation: {
            opacity: 'show',
            height: 'show'
        },
        speed: 'fast',
        autoArrows: false,
        dropShadows: false
    })
});