/**
 * jQuery[a] - Animated scrolling of series
 * Copyright (c) 2007-2008 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 3/10/2008
 * @author Ariel Flesler
 * @version 1.2.0
 *
 * http://flesler.blogspot.com/2008/02/jqueryserialscroll.html
 */
 ;(function($){var a='serialScroll',b='.'+a,c='bind',B=$[a]=function(b){$.scrollTo.window()[a](b)};B.defaults={duration:1e3,axis:'x',event:'click',start:0,step:1,lock:1,cycle:1,constant:1};$.fn[a]=function(x){x=$.extend({},B.defaults,x);var y=x.event,z=x.step,A=x.lazy;return this.each(function(){var j=x.target?this:document,k=$(x.target||this,j),l=k[0],m=x.items,n=x.start,o=x.interval,p=x.navigation,q;if(!A)m=v();if(x.force)s({},n);$(x.prev||[],j)[c](y,-z,r);$(x.next||[],j)[c](y,z,r);if(!l.ssbound)k[c]('prev'+b,-z,r)[c]('next'+b,z,r)[c]('goto'+b,s);if(o)k[c]('start'+b,function(e){if(!o){u();o=1;t()}})[c]('stop'+b,function(){u();o=0});k[c]('notify'+b,function(e,a){var i=w(a);if(i>-1)n=i});l.ssbound=1;if(x.jump)(A?k:v())[c](y,function(e){s(e,w(e.target))});if(p)p=$(p,j)[c](y,function(e){e.data=Math.round(v().length/p.length)*p.index(this);s(e,this)});function r(e){e.data+=n;s(e,this)};function s(e,a){if(!isNaN(a)){e.data=a;a=l}var c=e.data,d,f=e.type,g=v(),h=g.length,i=x.duration;if(f)e.preventDefault();c%=h;if(c<0)c+=h;d=g[c];if(o){u();q=setTimeout(t,x.interval)}if(isNaN(c)||f&&n==c||x.lock&&k.is(':animated')||!x.cycle&&!g[e.data]||f&&x.onBefore&&x.onBefore.call(a,e,d,k,g,c)===!1)return;if(x.stop)k.queue('fx',[]).stop();if(x.constant)i=Math.abs(i/z*(n-c));k.scrollTo(d,i,x).trigger('notify'+b,[c])};function t(){k.trigger('next'+b)};function u(){clearTimeout(q)};function v(){return $(m,k)};function w(a){if(!isNaN(a))return a;var b=v(),i;while((i=b.index(a))==-1&&a!=l)a=a.parentNode;return i}})}})(jQuery);