(function(D){var B="serialScroll",A="."+B,F="bind",E=D[B]=function(C){D.scrollTo.window()[B](C)};E.defaults={duration:1000,axis:"x",event:"click",start:0,step:1,lock:1,cycle:1,constant:1};D.fn[B]=function(I){I=D.extend({},E.defaults,I);var G=I.event,C=I.step,H=I.lazy;return this.each(function(){var Q=I.target?this:document,P=D(I.target||this,Q),O=P[0],N=I.items,M=I.start,L=I.interval,K=I.navigation,J;if(!H){N=S()}if(I.force){V({},M)}D(I.prev||[],Q)[F](G,-C,W);D(I.next||[],Q)[F](G,C,W);if(!O.ssbound){P[F]("prev"+A,-C,W)[F]("next"+A,C,W)[F]("goto"+A,V)}if(L){P[F]("start"+A,function(X){if(!L){T();L=1;U()}})[F]("stop"+A,function(){T();L=0})}P[F]("notify"+A,function(Z,X){var Y=R(X);if(Y>-1){M=Y}});O.ssbound=1;if(I.jump){(H?P:S())[F](G,function(X){V(X,R(X.target))})}if(K){K=D(K,Q)[F](G,function(X){X.data=Math.round(S().length/K.length)*K.index(this);V(X,this)})}function W(X){X.data+=M;V(X,this)}function V(k,o){if(!isNaN(o)){k.data=o;o=O}var m=k.data,X,l=k.type,j=I.exclude?S().slice(0,-I.exclude):S(),b=j.length,Z=j[m],Y=I.duration;if(l){k.preventDefault()}if(L){T();J=setTimeout(U,I.interval)}if(!Z){X=m<0?0:X=b-1;if(M!=X){m=X}else{if(!I.cycle){return }else{m=b-X-1}}Z=j[m]}if(!Z||l&&M==m||I.lock&&P.is(":animated")||l&&I.onBefore&&I.onBefore.call(o,k,Z,P,S(),m)===!1){return }if(I.stop){P.queue("fx",[]).stop()}if(I.constant){Y=Math.abs(Y/C*(M-m))}P.scrollTo(Z,Y,I).trigger("notify"+A,[m])}function U(){P.trigger("next"+A)}function T(){clearTimeout(J)}function S(){return D(N,O)}function R(Y){if(!isNaN(Y)){return Y}var X=S(),Z;while((Z=X.index(Y))==-1&&Y!=O){Y=Y.parentNode}return Z}})}})(jQuery);