/*
 * Supersubs v0.2b - jQuery plugin
 * Copyright (c) 2008 Joel Birch
 *
 * Dual licensed under the MIT and GPL licenses:
 * 	http://www.opensource.org/licenses/mit-license.php
 * 	http://www.gnu.org/licenses/gpl.html
 *
 */
 (function(a){a.fn.hoverIntent=function(k,l){var c="mousemove",b={sensitivity:7,interval:100,timeout:0};b=a.extend(b,l?{over:k,out:l}:k);var e,f,g,h,d=function(a){e=a.pageX;f=a.pageY},j=function(k,i){i.hoverIntent_t=clearTimeout(i.hoverIntent_t);if(Math.abs(g-e)+Math.abs(h-f)<b.sensitivity){a(i).unbind(c,d);i.hoverIntent_s=1;return b.over.apply(i,[k])}else{g=e;h=f;i.hoverIntent_t=setTimeout(function(){j(k,i)},b.interval)}},m=function(c,a){a.hoverIntent_t=clearTimeout(a.hoverIntent_t);a.hoverIntent_s=0;return b.out.apply(a,[c])},i=function(f){var n="mouseover",k=this,i=(f.type==n?f.fromElement:f.toElement)||f.relatedTarget;while(i&&i!=k)try{i=i.parentNode}catch(f){i=k}if(i==k)return false;var l=jQuery.extend({},f),e=k;if(e.hoverIntent_t)e.hoverIntent_t=clearTimeout(e.hoverIntent_t);if(f.type==n){g=l.pageX;h=l.pageY;a(e).bind(c,d);if(e.hoverIntent_s!=1)e.hoverIntent_t=setTimeout(function(){j(l,e)},b.interval)}else{a(e).unbind(c,d);if(e.hoverIntent_s==1)e.hoverIntent_t=setTimeout(function(){m(l,e)},b.timeout)}};return this.mouseover(i).mouseout(i)}})(jQuery);(function(a){var c="visibility";a.fn.superfish=function(i){var b=a.fn.superfish,c=b.c,h=a(['<span class="',c.arrowClass,'"> &#187;</span>'].join("")),d=function(){var b=a(this),c=e(b);clearTimeout(c.sfTimer);b.showSuperfishUl().siblings().hideSuperfishUl()},f=function(){var f=a(this),g=e(f),c=b.op;clearTimeout(g.sfTimer);g.sfTimer=setTimeout(function(){c.retainPath=a.inArray(f[0],c.$path)>-1;f.hideSuperfishUl();c.$path.length&&f.parents(["li.",c.hoverClass].join("")).length<1&&d.call(c.$path)},c.delay)},e=function(d){var a=d.parents(["ul.",c.menuClass,":first"].join(""))[0];b.op=b.o[a.serial];return a},g=function(a){a.addClass(c.anchorClass).append(h.clone())};return this.each(function(){var k="li:has(ul)",h=this,l=h.serial=b.o.length,e=a.extend({},b.defaults,i);e.$path=a("li."+e.pathClass,h).slice(0,e.pathLevels).each(function(){a(this).addClass([e.hoverClass,c.bcClass].join(" ")).filter(k).removeClass(e.pathClass)});b.o[l]=b.op=e;a(k,h)[a.fn.hoverIntent&&!e.disableHI?"hoverIntent":"hover"](d,f).each(function(){e.autoArrows&&g(a(">a:first-child",this))}).not("."+c.bcClass).hideSuperfishUl();var j=a("a",h);j.each(function(b){var a=j.eq(b).parents("li");j.eq(b).focus(function(){d.call(a)}).blur(function(){f.call(a)})});e.onInit.call(h)}).each(function(){var d=[c.menuClass];b.op.dropShadows&&!(a.browser.msie&&a.browser.version<7)&&d.push(c.shadowClass);a(this).addClass(d.join(" "))})};var b=a.fn.superfish;b.o=[];b.op={};b.IE7fix=function(){var c=b.op;a.browser.msie&&a.browser.version>6&&c.dropShadows&&c.animation.opacity!=undefined&&this.toggleClass(b.c.shadowClass+"-off")};b.c={bcClass:"sf-breadcrumb",menuClass:"sf-js-enabled",anchorClass:"sf-with-ul",arrowClass:"sf-sub-indicator",shadowClass:"sf-shadow"};b.defaults={hoverClass:"sfHover",pathClass:"overideThisToUse",pathLevels:1,delay:400,animation:{opacity:"show"},speed:"normal",autoArrows:true,dropShadows:true,disableHI:false,onInit:function(){},onBeforeShow:function(){},onShow:function(){},onHide:function(){}};a.fn.extend({hideSuperfishUl:function(){var d=b.op,f=d.retainPath===true?d.$path:"";d.retainPath=false;var e=a(["li.",d.hoverClass].join(""),this).add(this).not(f).removeClass(d.hoverClass).find(">ul").hide().css(c,"hidden");d.onHide.call(e);return this},showSuperfishUl:function(){var d=b.op,e=b.c.shadowClass+"-off",a=this.addClass(d.hoverClass).find(">ul:hidden").css(c,"visible");b.IE7fix.call(a);d.onBeforeShow.call(a);a.animate(d.animation,d.speed,function(){b.IE7fix.call(a);d.onShow.call(a)});return this}})})(jQuery);(function(a){a.fn.supersubs=function(c){var b=a.extend({},a.fn.supersubs.defaults,c);return this.each(function(){var d=a(this),c=a.meta?a.extend({},b,d.data()):b,e=a('<li id="menu-fontsize">&#8212;</li>').css({padding:0,position:"absolute",top:"-999em",width:"auto"}).appendTo(d).width();a("#menu-fontsize").remove();$ULs=d.find("ul");$ULs.each(function(i){var f=$ULs.eq(i),d=f.children(),h=d.children("a"),g=d.css("white-space","nowrap").css("float"),b=f.add(d).add(h).css({"float":"none",width:"auto"}).end().end()[0].clientWidth/e;b+=c.extraWidth;if(b>c.maxWidth)b=c.maxWidth;else if(b<c.minWidth)b=c.minWidth;b+="em";f.css("width",b);d.css({"float":g,width:"100%","white-space":"normal"}).each(function(){var c=a(">ul",this),d=c.css("left")!==undefined?"left":"right";c.css(d,b)})})})};a.fn.supersubs.defaults={minWidth:9,maxWidth:25,extraWidth:0}})(jQuery);

