/*!
 * jQuery Smooth Scroll Plugin v1.4.1
 *
 * Date: Thu Oct 20 17:05:46 2011 EDT
 * Requires: jQuery v1.3+
 *
 * Copyright 2010, Karl Swedberg
 * Dual licensed under the MIT and GPL licenses (just like jQuery):
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 *
 *
 *
*/
(function(b){function k(c){return c.replace(/^\//,"").replace(/(index|default).[a-zA-Z]{3,4}$/,"").replace(/\/$/,"")}var l=k(location.pathname),m=function(c){var e=[],a=false,d=c.dir&&c.dir=="left"?"scrollLeft":"scrollTop";this.each(function(){if(!(this==document||this==window)){var f=b(this);if(f[d]()>0)e.push(this);else{f[d](1);a=f[d]()>0;f[d](0);a&&e.push(this)}}});if(c.el==="first"&&e.length)e=[e.shift()];return e};b.fn.extend({scrollable:function(c){return this.pushStack(m.call(this,{dir:c}))},
firstScrollable:function(c){return this.pushStack(m.call(this,{el:"first",dir:c}))},smoothScroll:function(c){c=c||{};var e=b.extend({},b.fn.smoothScroll.defaults,c);this.die("click.smoothscroll").live("click.smoothscroll",function(a){var d=b(this),f=location.hostname===this.hostname||!this.hostname,g=e.scrollTarget||(k(this.pathname)||l)===l,i=this.hash,h=true;if(!e.scrollTarget&&(!f||!g||!i))h=false;else{f=e.exclude;g=0;for(var j=f.length;h&&g<j;)if(d.is(f[g++]))h=false;f=e.excludeWithin;g=0;for(j=
f.length;h&&g<j;)if(d.closest(f[g++]).length)h=false}if(h){e.scrollTarget=c.scrollTarget||i;e.link=this;a.preventDefault();b.smoothScroll(e)}});return this}});b.smoothScroll=function(c,e){var a,d,f,g=0;d="offset";var i="scrollTop",h={};if(typeof c==="number"){a=b.fn.smoothScroll.defaults;f=c}else{a=b.extend({},b.fn.smoothScroll.defaults,c||{});if(a.scrollElement){d="position";a.scrollElement.css("position")=="static"&&a.scrollElement.css("position","relative")}f=e||b(a.scrollTarget)[d]()&&b(a.scrollTarget)[d]()[a.direction]||
0}a=b.extend({link:null},a);i=a.direction=="left"?"scrollLeft":i;if(a.scrollElement){d=a.scrollElement;g=d[i]()}else d=b("html, body").firstScrollable();h[i]=f+g+a.offset;b.isFunction(a.beforeScroll)&&a.beforeScroll.call(d,a);d.animate(h,{duration:a.speed,easing:a.easing,complete:function(){a.afterScroll&&b.isFunction(a.afterScroll)&&a.afterScroll.call(a.link,a)}})};b.smoothScroll.version="1.4.1";b.fn.smoothScroll.defaults={exclude:[],excludeWithin:[],offset:0,direction:"top",scrollElement:null,scrollTarget:null,
beforeScroll:null,afterScroll:null,easing:"swing",speed:400}})(jQuery);

