(function(d){var b=location.href.replace(/#.*/,"");var c=d.localScroll=function(e){d("body").localScroll(e)};c.defaults={axis:"y",event:"click",stop:true};c.hash=function(e){e=d.extend({},c.defaults,e);e.hash=false;if(location.hash){setTimeout(function(){a(0,location,e)},0)}};d.fn.localScroll=function(f){f=d.extend({},c.defaults,f);return(f.persistent||f.lazy)?this.bind(f.event,function(h){var g=d([h.target,h.target.parentNode]).filter(e)[0];g&&a(h,g,f)}):this.find("a,area").filter(e).bind(f.event,function(g){a(g,this,f)}).end().end();function e(){return !!this.href&&!!this.hash&&this.href.replace(this.hash,"")==b&&(!f.filter||d(this).is(f.filter))}};function a(j,i,g){var k=i.hash.slice(1),h=document.getElementById(k)||document.getElementsByName(k)[0];if(h){j&&j.preventDefault();var f=d(g.target||d.scrollTo.window());if(g.lock&&f.is(":animated")||g.onBefore&&g.onBefore.call(i,j,h,f)===false){return}if(g.stop){f.queue("fx",[]).stop()}f.scrollTo(h,g).trigger("notify.serialScroll",[h]);if(g.hash){f.queue(function(){location=i.hash;d(this).dequeue()})}}}})(jQuery);