(function(n){function i(n){return n.replace(/(:|\.)/g,"\\$1")}var r={exclude:[],excludeWithin:[],offset:0,direction:"top",scrollElement:null,scrollTarget:null,beforeScroll:function(){},afterScroll:function(){},easing:"swing",speed:400,autoCoefficent:2},t=function(t){var i=[],u=!1,r=t.dir&&t.dir=="left"?"scrollLeft":"scrollTop";return this.each(function(){if(this!=document&&this!=window){var t=n(this);t[r]()>0?i.push(this):(t[r](1),u=t[r]()>0,u&&i.push(this),t[r](0))}}),i.length||this.each(function(){this.nodeName==="BODY"&&(i=[this])}),t.el==="first"&&i.length>1&&(i=[i[0]]),i},u="ontouchend"in document;n.fn.extend({scrollable:function(n){var i=t.call(this,{dir:n});return this.pushStack(i)},firstScrollable:function(n){var i=t.call(this,{el:"first",dir:n});return this.pushStack(i)},smoothScroll:function(t){t=t||{};var r=n.extend({},n.fn.smoothScroll.defaults,t),u=n.smoothScroll.filterPath(location.pathname);return this.unbind("click.smoothscroll").bind("click.smoothscroll",function(t){var e=this,o=n(this),s=r.exclude,h=r.excludeWithin,c=0,l=0,f=!0,a={},y=location.hostname===e.hostname||!e.hostname,p=r.scrollTarget||(n.smoothScroll.filterPath(e.pathname)||u)===u,v=i(e.hash);if(r.scrollTarget||y&&p&&v){while(f&&c