/*!
 * 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(d){var b="1.4.1",e={exclude:[],excludeWithin:[],offset:0,direction:"top",scrollElement:null,scrollTarget:null,beforeScroll:null,afterScroll:null,easing:"swing",speed:400},g=f(location.pathname),a=function(j){var k=[],i=false,h=j.dir&&j.dir=="left"?"scrollLeft":"scrollTop";this.each(function(){if(this==document||this==window){return}var l=d(this);if(l[h]()>0){k.push(this);return}l[h](1);i=l[h]()>0;l[h](0);if(i){k.push(this);return}});if(j.el==="first"&&k.length){k=[k.shift()]}return k};d.fn.extend({scrollable:function(h){var i=a.call(this,{dir:h});return this.pushStack(i)},firstScrollable:function(h){var i=a.call(this,{el:"first",dir:h});return this.pushStack(i)},smoothScroll:function(h){h=h||{};var i=d.extend({},d.fn.smoothScroll.defaults,h);this.die("click.smoothscroll").live("click.smoothscroll",function(k){var t=this,s=d(this),p=((location.hostname===t.hostname)||!t.hostname),j=i.scrollTarget||(f(t.pathname)||g)===g,r=c(t.hash),l=true;if(!i.scrollTarget&&(!p||!j||!r)){l=false}else{var m=i.exclude,v=0,n=m.length;while(l&&v<n){if(s.is(c(m[v++]))){l=false}}var q=i.excludeWithin,o=0,u=q.length;while(l&&o<u){if(s.closest(q[o++]).length){l=false}}}if(l){i.scrollTarget=h.scrollTarget||r;i.link=t;k.preventDefault();d.smoothScroll(i)}});return this}});d.smoothScroll=function(p,m){var h,j,o,n=0,k="offset",l="scrollTop",i={};if(typeof p==="number"){h=d.fn.smoothScroll.defaults;o=p}else{h=d.extend({},d.fn.smoothScroll.defaults,p||{});if(h.scrollElement){k="position";if(h.scrollElement.css("position")=="static"){h.scrollElement.css("position","relative")}}o=m||(d(h.scrollTarget)[k]()&&d(h.scrollTarget)[k]()[h.direction])||0}h=d.extend({link:null},h);l=h.direction=="left"?"scrollLeft":l;if(h.scrollElement){j=h.scrollElement;n=j[l]()}else{j=d("html, body").firstScrollable()}i[l]=o+n+h.offset;if(d.isFunction(h.beforeScroll)){h.beforeScroll.call(j,h)}j.animate(i,{duration:h.speed,easing:h.easing,complete:function(){if(h.afterScroll&&d.isFunction(h.afterScroll)){h.afterScroll.call(h.link,h)}}})};d.smoothScroll.version=b;d.fn.smoothScroll.defaults=e;function f(h){return h.replace(/^\//,"").replace(/(index|default).[a-zA-Z]{3,4}$/,"").replace(/\/$/,"")}function c(h){return h.replace(/(:|\.)/g,"\\$1")}})(jQuery);

