(function(b){var a=b.scrollTo=function(d,f,e){b(window).scrollTo(d,f,e)};a.defaults={axis:"y",duration:1};a.window=function(d){return b(window).scrollable()};b.fn.scrollable=function(){return this.map(function(){var d=this.parentWindow||this.defaultView,h=this.nodeName=="#document"?d.frameElement||d:this,f=h.contentDocument||(h.contentWindow||h).document,e=h.setInterval;return h.nodeName=="IFRAME"||e&&b.browser.safari?f.body:e?f.documentElement:this})};b.fn.scrollTo=function(f,e,d){if(typeof e=="object"){d=e;e=0}if(typeof d=="function"){d={onAfter:d}}d=b.extend({},a.defaults,d);e=e||d.speed||d.duration;d.queue=d.queue&&d.axis.length>1;if(d.queue){e/=2}d.offset=c(d.offset);d.over=c(d.over);return this.scrollable().each(function(){var h=this,s=b(h),r=f,g,n={},m=s.is("html,body");switch(typeof r){case"number":case"string":if(/^([+-]=)?\d+(px)?$/.test(r)){r=c(r);break}r=b(r,this);case"object":if(r.is||r.style){g=(r=b(r)).offset()}}b.each(d.axis.split(""),function(k,x){var u=x=="x"?"Left":"Top",p=u.toLowerCase(),w="scroll"+u,q=h[w],o=x=="x"?"Width":"Height",l=o.toLowerCase();if(g){n[w]=g[p]+(m?0:q-s.offset()[p]);if(d.margin){n[w]-=parseInt(r.css("margin"+u))||0;n[w]-=parseInt(r.css("border"+u+"Width"))||0}n[w]+=d.offset[p]||0;if(d.over[p]){n[w]+=r[l]()*d.over[p]}}else{n[w]=r[p]}if(/^\d+$/.test(n[w])){n[w]=n[w]<=0?0:Math.min(n[w],i(o))}if(!k&&d.queue){if(q!=n[w]){j(d.onAfterFirst)}delete n[w]}});j(d.onAfter);function j(k){s.animate(n,e,d.easing,k&&function(){k.call(this,f,d)})}function i(k){var o="scroll"+k,l=h.ownerDocument;return m?Math.max(l.documentElement[o],l.body[o]):h[o]}}).end()};function c(d){return typeof d=="object"?d:{top:d,left:d}}})(jQuery);(function(d){var c=location.href.replace(/#.*/,""),b=d.localScroll=function(e){d("body").localScroll(e)};b.defaults={duration:1000,axis:"y",event:"click",stop:1};b.hash=function(e){e=d.extend({},b.defaults,e);e.hash=0;if(location.hash){setTimeout(function(){a(0,location,e)},0)}};d.fn.localScroll=function(e){e=d.extend({},b.defaults,e);return(e.persistent||e.lazy)?this.bind(e.event,function(h){var g=d([h.target,h.target.parentNode]).filter(f)[0];g&&a(h,g,e)}):this.find("a,area").filter(f).bind(e.event,function(g){a(g,this,e)}).end().end();function f(){var g=this;return !!g.href&&!!g.hash&&g.href.replace(g.hash,"")==c&&(!e.filter||d(g).is(e.filter))}};function a(j,h,g){var l=h.hash.slice(1),k=document.getElementById(l)||document.getElementsByName(l)[0],i;if(k){j&&j.preventDefault();i=d(g.target||d.scrollTo.window());if(g.lock&&i.is(":animated")||g.onBefore&&g.onBefore.call(h,j,k,i)===!1){return}if(g.stop){i.queue("fx",[]).stop()}i.scrollTo(k,g).trigger("notify.serialScroll",[k]);if(g.hash){i.queue(function(){location=h.hash;d(this).dequeue()})}}}})(jQuery);(function(f){var e="serialScroll",d="."+e,h="bind",g=f[e]=function(a){f.scrollTo.window()[e](a)};g.defaults={duration:1000,axis:"x",event:"click",start:0,step:1,lock:1,cycle:1,constant:1};f.fn[e]=function(i){i=f.extend({},g.defaults,i);var b=i.event,a=i.step,c=i.lazy;return this.each(function(){var E=i.target?this:document,D=f(i.target||this,E),C=D[0],B=i.items,A=i.start,z=i.interval,y=i.navigation,n;if(!c){B=G()}if(i.force){J({},A)}f(i.prev||[],E)[h](b,-a,K);f(i.next||[],E)[h](b,a,K);if(!C.ssbound){D[h]("prev"+d,-a,K)[h]("next"+d,a,K)[h]("goto"+d,J)}if(z){D[h]("start"+d,function(j){if(!z){H();z=1;I()}})[h]("stop"+d,function(){H();z=0})}D[h]("notify"+d,function(l,j){var k=F(j);if(k>-1){A=k}});C.ssbound=1;if(i.jump){(c?D:G())[h](b,function(j){J(j,F(j.target))})}if(y){y=f(y,E)[h](b,function(j){j.data=Math.round(G().length/y.length)*y.index(this);J(j,this)})}function K(j){j.data+=A;J(j,this)}function J(p,s){if(!isNaN(s)){p.data=s;s=C}var r=p.data,j,q=p.type,o=i.exclude?G().slice(0,-i.exclude):G(),m=o.length,l=o[r],k=i.duration;if(q){p.preventDefault()}if(z){H();n=setTimeout(I,i.interval)}if(!l){j=r<0?0:j=m-1;if(A!=j){r=j}else{if(!i.cycle){return}else{r=m-j-1}}l=o[r]}if(!l||q&&A==r||i.lock&&D.is(":animated")||q&&i.onBefore&&i.onBefore.call(s,p,l,D,G(),r)===!1){return}if(i.stop){D.queue("fx",[]).stop()}if(i.constant){k=Math.abs(k/a*(A-r))}D.scrollTo(l,k,i).trigger("notify"+d,[r])}function I(){D.trigger("next"+d)}function H(){clearTimeout(n)}function G(){return f(B,C)}function F(k){if(!isNaN(k)){return k}var j=G(),l;while((l=j.index(k))==-1&&k!=C){k=k.parentNode}return l}})}})(jQuery);