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



