/**
 * jQuery.LocalScroll - Animated scrolling navigation, using anchors.
 * Copyright (c) 2007-2008 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 6/3/2008
 * @author Ariel Flesler
 * @version 1.2.6
 **/
(function(a){function d(b,c,d){var e=c.hash.slice(1),f=document.getElementById(e)||document.getElementsByName(e)[0],g;if(f){b&&b.preventDefault(),g=a(d.target||a.scrollTo.window());if(d.lock&&g.is(":animated")||d.onBefore&&d.onBefore.call(c,b,f,g)===!1)return;d.stop&&g.queue("fx",[]).stop(),g.scrollTo(f,d).trigger("notify.serialScroll",[f]),d.hash&&g.queue(function(){location=c.hash,a(this).dequeue()})}}var b=location.href.replace(/#.*/,""),c=a.localScroll=function(b){a("body").localScroll(b)};c.defaults={duration:1e3,axis:"y",event:"click",stop:1},c.hash=function(b){b=a.extend({},c.defaults,b),b.hash=0,location.hash&&setTimeout(function(){d(0,location,b)},0)},a.fn.localScroll=function(e){function f(){var c=this;return!!c.href&&!!c.hash&&c.href.replace(c.hash,"")==b&&(!e.filter||a(c).is(e.filter))}e=a.extend({},c.defaults,e);return e.persistent||e.lazy?this.bind(e.event,function(b){var c=a([b.target,b.target.parentNode]).filter(f)[0];c&&d(b,c,e)}):this.find("a,area").filter(f).bind(e.event,function(a){d(a,this,e)}).end().end()}})(jQuery)
