/**
 * jQuery.LocalScroll - Animated scrolling navigation, using anchors.
 * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 3/11/2009
 * @author Ariel Flesler
 * @version 1.2.7
 **/
(function(b){function k(e){var c=[],a=false;this.each(function(){if(!(this==document||this==window)){var d=b(this);if(d.scrollTop()>0)c.push(this);else{d.scrollTop(1);a=d.scrollTop()>0;d.scrollTop(0);a&&c.push(this)}}});if(e==="first"&&c.length)c=[c.shift()];return c}function l(e){return e.replace(/^\//,"").replace(/(index|default).[a-zA-Z]{3,4}$/,"").replace(/\/$/,"")}var m=l(location.pathname);b.fn.extend({scrollable:function(){return this.pushStack(k.call(this))},firstScrollable:function(){return this.pushStack(k.call(this,
"first"))},smoothScroll:function(e){e=e||{};var c=b.extend({},b.fn.smoothScroll.defaults,e);this.die("click.smoothscroll").live("click.smoothscroll",function(a){var d=b(this),f=location.hostname===this.hostname||!this.hostname,g=c.scrollTarget||(l(this.pathname)||m)===m,i=this.hash,h=true;if(!c.scrollTarget&&(!f||!g||!i))h=false;else{f=c.exclude;g=0;for(var j=f.length;h&&g<j;)if(d.is(f[g++]))h=false;f=c.excludeWithin;g=0;for(j=f.length;h&&g<j;)if(d.closest(f[g++]).length)h=false}if(h){c.scrollTarget=
e.scrollTarget||i;c.link=this;a.preventDefault();b.smoothScroll(c)}});return this}});b.smoothScroll=function(e,c){var a,d,f,g=0;d="offset";var i={};if(typeof e==="number"){a=b.fn.smoothScroll.defaults;f=e}else{a=b.extend({},b.fn.smoothScroll.defaults,e||{});if(a.scrollElement){d="position";a.scrollElement.css("position")=="static"&&a.scrollElement.css("position","relative")}f=c||b(a.scrollTarget)[d]()&&b(a.scrollTarget)[d]()[a.direction]||0}a=b.extend({link:null},a);if(a.scrollElement){d=a.scrollElement;
g=d.scrollTop()}else d=b("html, body").firstScrollable();i["scroll"+{top:"Top",left:"Left"}[a.direction]]=f+g+a.offset;d.animate(i,{duration:a.speed,easing:a.easing,complete:function(){a.afterScroll&&b.isFunction(a.afterScroll)&&a.afterScroll.call(a.link,a)}})};b.smoothScroll.version="1.3.1";b.fn.smoothScroll.defaults={exclude:[],excludeWithin:[],offset:0,direction:"top",scrollElement:null,scrollTarget:null,afterScroll:null,easing:"swing",speed:400}})(jQuery);

