(function(c){function k(b){return b.replace(/^\//,"").replace(/(index|default).[a-zA-Z]{3,4}$/,"").replace(/\/$/,"")}var l=k(location.pathname),m=function(b){var d=[],a=!1,e=b.dir&&b.dir=="left"?"scrollLeft":"scrollTop";this.each(function(){if(!(this==document||this==window)){var b=c(this);b[e]()>0?d.push(this):(b[e](1),a=b[e]()>0,b[e](0),a&&d.push(this))}});b.el==="first"&&d.length&&(d=[d.shift()]);return d};c.fn.extend({scrollable:function(b){return this.pushStack(m.call(this,{dir:b}))},firstScrollable:function(b){return this.pushStack(m.call(this,
{el:"first",dir:b}))},smoothScroll:function(b){var b=b||{},d=c.extend({},c.fn.smoothScroll.defaults,b);this.die("click.smoothscroll").live("click.smoothscroll",function(a){var e=c(this),f=location.hostname===this.hostname||!this.hostname,g=d.scrollTarget||(k(this.pathname)||l)===l,i=this.hash,h=!0;if(!d.scrollTarget&&(!f||!g||!i))h=!1;else{for(var f=d.exclude,g=0,j=f.length;h&&g<j;)e.is(f[g++])&&(h=!1);f=d.excludeWithin;g=0;for(j=f.length;h&&g<j;)e.closest(f[g++]).length&&(h=!1)}if(h)d.scrollTarget=
b.scrollTarget||i,d.link=this,a.preventDefault(),c.smoothScroll(d)});return this}});c.smoothScroll=function(b,d){var a,e,f,g=0;e="offset";var i="scrollTop",h={};typeof b==="number"?(a=c.fn.smoothScroll.defaults,f=b):(a=c.extend({},c.fn.smoothScroll.defaults,b||{}),a.scrollElement&&(e="position",a.scrollElement.css("position")=="static"&&a.scrollElement.css("position","relative")),f=d||c(a.scrollTarget)[e]()&&c(a.scrollTarget)[e]()[a.direction]||0);a=c.extend({link:null},a);i=a.direction=="left"?"scrollLeft":
i;a.scrollElement?(e=a.scrollElement,g=e[i]()):e=c("html, body").firstScrollable();h[i]=f+g+a.offset;e.animate(h,{duration:a.speed,easing:a.easing,complete:function(){a.afterScroll&&c.isFunction(a.afterScroll)&&a.afterScroll.call(a.link,a)}})};c.smoothScroll.version="1.4";c.fn.smoothScroll.defaults={exclude:[],excludeWithin:[],offset:0,direction:"top",scrollElement:null,scrollTarget:null,afterScroll:null,easing:"swing",speed:400}})(jQuery);
