(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").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(H,F,E){var J=F.hash.slice(1),I=document.getElementById(J)||document.getElementsByName(J)[0],G;
if(I){H&&H.preventDefault();
G=D(E.target||D.scrollTo.window());
if(E.lock&&G.is(":animated")||E.onBefore&&E.onBefore.call(F,H,I,G)===!1){return 
}if(E.stop){G.queue("fx",[]).stop()
}G.scrollTo(I,E).trigger("notify.serialScroll",[I]);
if(E.hash){G.queue(function(){location=F.hash
})
}}}})(jQuery);