Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

v1.2.0

Added touch support for ie10 surface tablets. When touching the slider,
horizontal browser movement is disabled and horizontal sliding is
enabled. Ref issue #230
  • Loading branch information...
commit adb0b692ec625e5faff09f4f8ec0f24f368bb5f1 1 parent 9ac05fd
@marcwhitbread marcwhitbread authored
Showing with 5 additions and 4 deletions.
  1. +3 −2 _src/jquery.iosslider.js
  2. +2 −2 _src/jquery.iosslider.min.js
View
5 _src/jquery.iosslider.js
@@ -6,7 +6,7 @@
*
* Copyright (c) 2012 Marc Whitbread
*
- * Version: v1.1.68 (03/20/2013)
+ * Version: v1.2.0 (03/23/2013)
* Minimum requirements: jQuery v1.4+
*
* Advanced requirements:
@@ -1170,6 +1170,7 @@
zIndex: settings.stageCSS.zIndex,
'webkitPerspective': 1000,
'webkitBackfaceVisibility': 'hidden',
+ '-ms-touch-action': 'pan-y',
width: stageWidth
});
@@ -1702,7 +1703,7 @@
}
$(touchSelection).bind('mousedown.iosSliderEvent touchstart.iosSliderEvent', function(e) {
-
+
if(touchStartFlag) return true;
touchStartFlag = true;
View
4 _src/jquery.iosslider.min.js
@@ -6,7 +6,7 @@
*
* Copyright (c) 2012 Marc Whitbread
*
- * Version: v1.1.68 (03/20/2013)
+ * Version: v1.2.0 (03/23/2013)
* Minimum requirements: jQuery v1.4+
*
* Advanced requirements:
@@ -36,4 +36,4 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-(function(a){var oa=0,Y=0,ba=0,V=0,Da="ontouchstart"in window,Ea="onorientationchange"in window,ca=!1,Z=!1,$=!1,pa=!1,ia="pointer",ua="pointer",ja=[],N=[],va=[],da=[],I=[],aa=[],z=[],g=[],q=[],wa=[],ea=[],f={showScrollbar:function(d,f){d.scrollbarHide&&a("."+f).css({opacity:d.scrollbarOpacity,filter:"alpha(opacity:"+100*d.scrollbarOpacity+")"})},hideScrollbar:function(a,n,b,s,c,t,g,q,C,x){if(a.scrollbar&&a.scrollbarHide)for(var z=b;z<b+25;z++)n[n.length]=f.hideScrollbarIntervalTimer(10*z,s[b],(b+ 24-z)/24,c,t,g,q,C,x,a)},hideScrollbarInterval:function(d,n,b,s,c,t,g,z,C){V=-1*d/q[z]*(c-t-g-s);f.setSliderOffset("."+b,V);a("."+b).css({opacity:C.scrollbarOpacity*n,filter:"alpha(opacity:"+100*C.scrollbarOpacity*n+")"})},slowScrollHorizontalInterval:function(d,n,b,s,c,t,T,K,C,x,O,y,r,w,u,j,k,A,h){if(h.infiniteSlider){if(b<=-1*q[j]){var D=a(d).width();if(b<=-1*wa[j]){var p=-1*O[0];a(n).each(function(b){f.setSliderOffset(a(n)[b],p+k);b<y.length&&(y[b]=-1*p);p+=u[b]});b+=-1*y[0];g[j]=-1*y[0]+k;q[j]= g[j]+D-t;z[j]=0}else{var m=0,M=f.getSliderOffset(a(n[0]),"x");a(n).each(function(a){f.getSliderOffset(this,"x")<M&&(M=f.getSliderOffset(this,"x"),m=a)});r=g[j]+D;f.setSliderOffset(a(n)[m],r);g[j]=-1*y[1]+k;q[j]=g[j]+D-t;y.splice(0,1);y.splice(y.length,0,-1*r+k);z[j]++}}if(b>=-1*g[j]||0<=b){D=a(d).width();if(0<=b){p=-1*O[0];a(n).each(function(b){f.setSliderOffset(a(n)[b],p+k);b<y.length&&(y[b]=-1*p);p+=u[b]});b-=-1*y[0];g[j]=-1*y[0]+k;q[j]=g[j]+D-t;for(z[j]=w;0<-1*y[0]-D+k;){var v=0,E=f.getSliderOffset(a(n[0]), "x");a(n).each(function(a){f.getSliderOffset(this,"x")>E&&(E=f.getSliderOffset(this,"x"),v=a)});r=g[j]-u[v];f.setSliderOffset(a(n)[v],r);y.splice(0,0,-1*r+k);y.splice(y.length-1,1);g[j]=-1*y[0]+k;q[j]=g[j]+D-t;z[j]--;I[j]++}}0>b&&(v=0,E=f.getSliderOffset(a(n[0]),"x"),a(n).each(function(a){f.getSliderOffset(this,"x")>E&&(E=f.getSliderOffset(this,"x"),v=a)}),r=g[j]-u[v],f.setSliderOffset(a(n)[v],r),y.splice(0,0,-1*r+k),y.splice(y.length-1,1),g[j]=-1*y[0]+k,q[j]=g[j]+D-t,z[j]--)}}O=!1;t=f.calcActiveOffset(h, b,y,t,z[j],w,x,j);r=(t+z[j]+w)%w;h.infiniteSlider?r!=aa[j]&&(O=!0):t!=I[j]&&(O=!0);if(O&&(w=new f.args("change",h,d,a(d).children(":eq("+r+")"),r,A),a(d).parent().data("args",w),""!=h.onSlideChange))h.onSlideChange(w);I[j]=t;aa[j]=r;b=Math.floor(b);f.setSliderOffset(d,b);h.scrollbar&&(V=Math.floor((-1*b-g[j]+k)/(q[j]-g[j]+k)*(T-K-c)),d=c-C,b>=-1*g[j]+k?(d=c-C- -1*V,f.setSliderOffset(a("."+s),0)):(b<=-1*q[j]+1&&(d=T-K-C-V),f.setSliderOffset(a("."+s),V)),a("."+s).css({width:d+"px"}))},slowScrollHorizontal:function(d, n,b,s,c,t,T,K,C,x,O,y,r,w,u,j,k,A,h,D,p){t=[];var m=f.getSliderOffset(d,"x"),M=0,v=25/1024*K;frictionCoefficient=p.frictionCoefficient;elasticFrictionCoefficient=p.elasticFrictionCoefficient;snapFrictionCoefficient=p.snapFrictionCoefficient;5<c&&p.snapToChildren&&!h?M=1:-5>c&&(p.snapToChildren&&!h)&&(M=-1);c<-1*v?c=-1*v:c>v&&(c=v);a(d)[0]!==a(A)[0]&&(M*=-1,c*=-2);A=z[u];if(p.infiniteSlider)var E=g[u],l=q[u];h=[];for(var v=[],F=0;F<r.length;F++)h[F]=r[F],F<n.length&&(v[F]=f.getSliderOffset(a(n[F]), "x"));for(;1<c||-1>c;){c*=frictionCoefficient;m+=c;if((m>-1*g[u]||m<-1*q[u])&&!p.infiniteSlider)c*=elasticFrictionCoefficient,m+=c;if(p.infiniteSlider){if(m<=-1*l){for(var l=a(d).width(),N=0,P=v[0],F=0;F<v.length;F++)v[F]<P&&(P=v[F],N=F);F=E+l;v[N]=F;E=-1*h[1]+D;l=E+l-K;h.splice(0,1);h.splice(h.length,0,-1*F+D);A++}if(m>=-1*E){l=a(d).width();N=0;P=v[0];for(F=0;F<v.length;F++)v[F]>P&&(P=v[F],N=F);F=E-w[N];v[N]=F;h.splice(0,0,-1*F+D);h.splice(h.length-1,1);E=-1*h[0]+D;l=E+l-K;A--}}t[t.length]=m}v=!1; c=f.calcActiveOffset(p,m,h,K,A,k,I[u],u);E=(c+A+k)%k;p.snapToChildren&&(p.infiniteSlider?E!=aa[u]&&(v=!0):c!=I[u]&&(v=!0),0>M&&!v?(c++,c>=r.length&&!p.infinteSlider&&(c=r.length-1)):0<M&&!v&&(c--,0>c&&!p.infinteSlider&&(c=0)));if(p.snapToChildren||(m>-1*g[u]||m<-1*q[u])&&!p.infiniteSlider){m=f.getSliderOffset(d,"x");for(t.splice(0,t.length);m<h[c]-0.5||m>h[c]+0.5;)m=(m-h[c])*snapFrictionCoefficient+h[c],t[t.length]=m;t[t.length]=h[c]}M=1;0!=t.length%2&&(M=0);for(m=0;m<b.length;m++)clearTimeout(b[m]); A=(c+A+k)%k;E=0;for(m=M;m<t.length;m+=2)if(m==M||1<Math.abs(t[m]-E)||m>=t.length-2)E=t[m],b[b.length]=f.slowScrollHorizontalIntervalTimer(10*m,d,n,t[m],s,T,K,C,x,O,c,y,r,j,k,w,u,D,A,p);E=(c+z[u]+k)%k;""!=p.onSlideComplete&&(b[b.length]=f.onSlideCompleteTimer(10*(m+1),p,d,a(d).children(":eq("+E+")"),E,u));da[u]=b;f.hideScrollbar(p,b,m,t,s,T,K,x,O,u)},onSlideComplete:function(d,n,b,s){b=new f.args("complete",d,a(n),b,s,s);a(n).parent().data("args",b);if(""!=d.onSlideComplete)d.onSlideComplete(b)},getSliderOffset:function(d, f){var b=0;f="x"==f?4:5;if(ca&&!Z&&!$){for(var b=["-webkit-transform","-moz-transform","transform"],s=0;s<b.length;s++)if(void 0!=a(d).css(b[s])&&0<a(d).css(b[s]).length){var c=a(d).css(b[s]).split(",");break}b=parseInt(c[f],10)}else b=parseInt(a(d).css("left"),10);return b},setSliderOffset:function(d,f){ca&&!Z&&!$?a(d).css({webkitTransform:"matrix(1,0,0,1,"+f+",0)",MozTransform:"matrix(1,0,0,1,"+f+",0)",transform:"matrix(1,0,0,1,"+f+",0)"}):a(d).css({left:f+"px"})},setBrowserInfo:function(){null!= navigator.userAgent.match("WebKit")?(ia="-webkit-grab",ua="-webkit-grabbing"):null!=navigator.userAgent.match("Gecko")?(ia="move",ua="-moz-grabbing"):null!=navigator.userAgent.match("MSIE 7")?pa=Z=!0:null!=navigator.userAgent.match("MSIE 8")?pa=$=!0:null!=navigator.userAgent.match("MSIE 9")&&(pa=!0)},has3DTransform:function(){var d=!1,f=a("<div />").css({webkitTransform:"matrix(1,1,1,1,1,1)",MozTransform:"matrix(1,1,1,1,1,1)",transform:"matrix(1,1,1,1,1,1)"});""==f.attr("style")?d=!1:void 0!=f.attr("style")&& (d=!0);return d},getSlideNumber:function(a,f,b){return(a-z[f]+b)%b},calcActiveOffset:function(a,f,b,s){var c=!1;a=[];for(var t,g=0;g<b.length;g++)b[g]<=f&&b[g]>f-s&&(!c&&b[g]!=f&&(a[a.length]=b[g-1]),a[a.length]=b[g],c=!0);0==a.length&&(a[0]=b[b.length-1]);for(g=c=0;g<a.length;g++){var q=Math.abs(f-a[g]);q<s&&(c=a[g],s=q)}for(g=0;g<b.length;g++)c==b[g]&&(t=g);return t},changeSlide:function(d,n,b,g,c,t,q,K,C,x,O,y,r,w,u,j,k,A){f.autoSlidePause(w);for(var h=0;h<g.length;h++)clearTimeout(g[h]);var D= Math.ceil(A.autoSlideTransTimer/10)+1,p=f.getSliderOffset(n,"x"),m=y[d],M=m-p;if(A.infiniteSlider){d=(d-z[w]+2*j)%j;h=!1;0==d&&2==j&&(d=j,y[d]=y[d-1]-a(b).eq(0).outerWidth(!0),h=!0);m=y[d];M=m-p;m=[y[d]-a(n).width(),y[d]+a(n).width()];h&&y.splice(y.length-1,1);for(h=0;h<m.length;h++)Math.abs(m[h]-p)<Math.abs(M)&&(M=m[h]-p)}var m=[],v;f.showScrollbar(A,c);for(h=0;h<=D;h++)v=h,v/=D,v--,v=p+M*(Math.pow(v,5)+1),m[m.length]=v;for(h=p=0;h<m.length;h++){if(0==h||1<Math.abs(m[h]-p)||h>=m.length-2)p=m[h], g[h]=f.slowScrollHorizontalIntervalTimer(10*(h+1),n,b,m[h],c,t,q,K,C,x,d,O,y,u,j,r,w,k,d,A);0==h&&""!=A.onSlideStart&&(D=(I[w]+z[w]+j)%j,A.onSlideStart(new f.args("start",A,n,a(n).children(":eq("+D+")"),D,d)))}p=!1;D=(d+z[w]+j)%j;A.infiniteSlider?D!=aa[w]&&(p=!0):d!=I[w]&&(p=!0);p&&""!=A.onSlideComplete&&(g[g.length]=f.onSlideCompleteTimer(10*(h+1),A,n,a(n).children(":eq("+D+")"),D,w));da[w]=g;f.hideScrollbar(A,g,h,m,c,t,q,C,x,w);f.autoSlide(n,b,g,c,t,q,K,C,x,O,y,r,w,u,j,k,A)},autoSlide:function(a, g,b,s,c,t,q,K,C,x,O,y,r,w,u,j,k){if(!N[r].autoSlide)return!1;f.autoSlidePause(r);ja[r]=setTimeout(function(){!k.infiniteSlider&&I[r]>O.length-1&&(I[r]-=u);f.changeSlide((I[r]+z[r]+u+1)%u,a,g,b,s,c,t,q,K,C,x,O,y,r,w,u,j,k);f.autoSlide(a,g,b,s,c,t,q,K,C,x,O,y,r,w,u,j,k)},k.autoSlideTimer+k.autoSlideTransTimer)},autoSlidePause:function(a){clearTimeout(ja[a])},isUnselectable:function(f,g){return""!=g.unselectableSelector&&1==a(f).closest(g.unselectableSelector).size()?!0:!1},slowScrollHorizontalIntervalTimer:function(a, g,b,s,c,t,q,z,C,x,I,y,r,w,u,j,k,A,h,D){return setTimeout(function(){f.slowScrollHorizontalInterval(g,b,s,c,t,q,z,C,x,I,y,r,w,u,j,k,A,h,D)},a)},onSlideCompleteTimer:function(a,g,b,s,c,t){return setTimeout(function(){f.onSlideComplete(g,b,s,c,t)},a)},hideScrollbarIntervalTimer:function(a,g,b,s,c,t,q,z,C,x){return setTimeout(function(){f.hideScrollbarInterval(g,b,s,c,t,q,z,C,x)},a)},args:function(d,g,b,s,c){this.prevSlideNumber=void 0==a(b).parent().data("args")?void 0:a(b).parent().data("args").prevSlideNumber; this.prevSlideObject=void 0==a(b).parent().data("args")?void 0:a(b).parent().data("args").prevSlideObject;this.targetSlideObject=this.targetSlideNumber=void 0;this.slideChanged=!1;"load"!=d&&"start"!=d&&("change"==d?(this.slideChanged=!0,this.prevSlideNumber=void 0==a(b).parent().data("args")?g.startAtSlide:a(b).parent().data("args").currentSlideNumber,this.prevSlideObject=a(b).children(":eq("+this.prevSlideNumber+")")):"complete"==d&&(this.slideChanged=a(b).parent().data("args").slideChanged));this.settings= g;this.data=a(b).parent().data("iosslider");this.sliderObject=b;this.sliderContainerObject=a(b).parent();this.currentSlideObject=s;this.currentSlideNumber=c+1;this.currentSliderOffset=-1*f.getSliderOffset(b,"x")},preventDrag:function(a){a.preventDefault()},preventClick:function(a){a.stopImmediatePropagation();return!1},enableClick:function(){return!0}};f.setBrowserInfo();var S={init:function(d,n){ca=f.has3DTransform();var b=a.extend(!0,{elasticPullResistance:0.6,frictionCoefficient:0.92,elasticFrictionCoefficient:0.6, snapFrictionCoefficient:0.92,snapToChildren:!1,snapSlideCenter:!1,startAtSlide:1,scrollbar:!1,scrollbarDrag:!1,scrollbarHide:!0,scrollbarLocation:"top",scrollbarContainer:"",scrollbarOpacity:0.4,scrollbarHeight:"4px",scrollbarBorder:"0",scrollbarMargin:"5px",scrollbarBackground:"#000",scrollbarBorderRadius:"100px",scrollbarShadow:"0 0 0 #000",scrollbarElasticPullResistance:0.9,desktopClickDrag:!1,keyboardControls:!1,tabToAdvance:!1,responsiveSlideContainer:!0,responsiveSlides:!0,navSlideSelector:"", navPrevSelector:"",navNextSelector:"",autoSlideToggleSelector:"",autoSlide:!1,autoSlideTimer:5E3,autoSlideTransTimer:750,infiniteSlider:!1,stageCSS:{position:"relative",top:"0",left:"0",overflow:"hidden",zIndex:1},unselectableSelector:"",onSliderLoaded:"",onSliderUpdate:"",onSliderResize:"",onSlideStart:"",onSlideChange:"",onSlideComplete:""},d);void 0==n&&(n=this);return a(n).each(function(){function d(){f.autoSlidePause(c);xa=a(G).find("a");Ba=a(G).find("[onclick]");qa=a(G).find("*");a(A).css("width", "");a(A).css("height","");a(G).css("width","");B=a(G).children().not("script").get();ka=[];L=[];a(B).css("width","");q[c]=0;l=[];u=a(A).parent().width();h=a(A).outerWidth(!0);b.responsiveSlideContainer&&(h=a(A).outerWidth(!0)>u?u:a(A).outerWidth(!0));a(A).css({position:b.stageCSS.position,top:b.stageCSS.top,left:b.stageCSS.left,overflow:b.stageCSS.overflow,zIndex:b.stageCSS.zIndex,webkitPerspective:1E3,webkitBackfaceVisibility:"hidden",width:h});a(b.unselectableSelector).css({cursor:"default"});for(var H= 0;H<B.length;H++){ka[H]=a(B[H]).width();L[H]=a(B[H]).outerWidth(!0);var s=L[H];b.responsiveSlides&&(s=L[H]>h?h+-1*(L[H]-ka[H]):ka[H],a(B[H]).css({width:s}));a(B[H]).css({webkitBackfaceVisibility:"hidden",position:"absolute",top:0});l[H]=-1*q[c];q[c]=q[c]+s+(L[H]-ka[H])}b.snapSlideCenter&&(k=0.5*(h-L[0]),b.responsiveSlides&&L[0]>h&&(k=0));wa[c]=2*q[c];for(H=0;H<B.length;H++)f.setSliderOffset(a(B[H]),-1*l[H]+q[c]+k),l[H]-=q[c];if(!b.infiniteSlider&&!b.snapSlideCenter){for(H=0;H<l.length&&!(l[H]<=-1* (2*q[c]-h));H++)ja=H;l.splice(ja+1,l.length);l[l.length]=-1*(2*q[c]-h)}for(H=0;H<l.length;H++)F[H]=l[H];v&&(b.startAtSlide=N[c].startAtSlide>l.length?l.length:N[c].startAtSlide,b.infiniteSlider?(b.startAtSlide=(N[c].startAtSlide-1+J)%J,I[c]=N[c].startAtSlide):(b.startAtSlide=0>N[c].startAtSlide-1?l.length-1:N[c].startAtSlide,I[c]=N[c].startAtSlide-1),aa[c]=I[c]);g[c]=q[c]+k;a(G).css({position:"relative",cursor:ia,webkitPerspective:"0",webkitBackfaceVisibility:"hidden",width:q[c]+"px"});X=q[c];q[c]= 2*q[c]-h+2*k;(U=X<h?!0:!1)&&a(G).css({cursor:"default"});j=a(A).parent().outerHeight(!0);D=a(A).height();b.responsiveSlideContainer&&(D=D>j?j:D);a(A).css({height:D});f.setSliderOffset(G,l[I[c]]);if(b.infiniteSlider&&!U){H=f.getSliderOffset(a(G),"x");for(s=-1*((z[c]+J)%J);0>s;){var E=0,la=f.getSliderOffset(a(B[0]),"x");a(B).each(function(a){f.getSliderOffset(this,"x")<la&&(la=f.getSliderOffset(this,"x"),E=a)});var K=g[c]+X;f.setSliderOffset(a(B)[E],K);g[c]=-1*l[1]+k;q[c]=g[c]+X-h;l.splice(0,1);l.splice(l.length, 0,-1*K+k);s++}for(;0<-1*l[0]-X+k&&b.snapSlideCenter&&v;){var M=0,P=f.getSliderOffset(a(B[0]),"x");a(B).each(function(a){f.getSliderOffset(this,"x")>P&&(P=f.getSliderOffset(this,"x"),M=a)});K=g[c]-L[M];f.setSliderOffset(a(B)[M],K);l.splice(0,0,-1*K+k);l.splice(l.length-1,1);g[c]=-1*l[0]+k;q[c]=g[c]+X-h;z[c]--;I[c]++}for(;H<=-1*q[c];)E=0,la=f.getSliderOffset(a(B[0]),"x"),a(B).each(function(a){f.getSliderOffset(this,"x")<la&&(la=f.getSliderOffset(this,"x"),E=a)}),K=g[c]+X,f.setSliderOffset(a(B)[E],K), g[c]=-1*l[1]+k,q[c]=g[c]+X-h,l.splice(0,1),l.splice(l.length,0,-1*K+k),z[c]++,I[c]--}f.setSliderOffset(G,l[I[c]]);b.desktopClickDrag||a(G).css({cursor:"default"});b.scrollbar&&(a("."+C).css({margin:b.scrollbarMargin,overflow:"hidden",display:"none"}),a("."+C+" ."+x).css({border:b.scrollbarBorder}),p=parseInt(a("."+C).css("marginLeft"))+parseInt(a("."+C).css("marginRight")),m=parseInt(a("."+C+" ."+x).css("borderLeftWidth"),10)+parseInt(a("."+C+" ."+x).css("borderRightWidth"),10),r=""!=b.scrollbarContainer? a(b.scrollbarContainer).width():h,w=(r-p)/J,b.scrollbarHide||(S=b.scrollbarOpacity),a("."+C).css({position:"absolute",left:0,width:r-p+"px",margin:b.scrollbarMargin}),"top"==b.scrollbarLocation?a("."+C).css("top","0"):a("."+C).css("bottom","0"),a("."+C+" ."+x).css({borderRadius:b.scrollbarBorderRadius,background:b.scrollbarBackground,height:b.scrollbarHeight,width:w-m+"px",minWidth:b.scrollbarHeight,border:b.scrollbarBorder,webkitPerspective:1E3,webkitBackfaceVisibility:"hidden",position:"relative", opacity:S,filter:"alpha(opacity:"+100*S+")",boxShadow:b.scrollbarShadow}),f.setSliderOffset(a("."+C+" ."+x),Math.floor((-1*l[I[c]]-g[c]+k)/(q[c]-g[c]+k)*(r-p-w))),a("."+C).css({display:"block"}),O=a("."+C+" ."+x),y=a("."+C));b.scrollbarDrag&&!U&&a("."+C+" ."+x).css({cursor:ia});b.infiniteSlider&&(R=(q[c]+h)/3);""!=b.navSlideSelector&&a(b.navSlideSelector).each(function(d){a(this).css({cursor:"pointer"});a(this).unbind(Q).bind(Q,function(H){"touchstart"==H.type?a(this).unbind("click.iosSliderEvent"): a(this).unbind("touchstart.iosSliderEvent");Q=H.type+".iosSliderEvent";f.changeSlide(d,G,B,n,x,w,h,r,p,m,F,l,L,c,R,J,k,b)})});""!=b.navPrevSelector&&(a(b.navPrevSelector).css({cursor:"pointer"}),a(b.navPrevSelector).unbind(Q).bind(Q,function(d){"touchstart"==d.type?a(this).unbind("click.iosSliderEvent"):a(this).unbind("touchstart.iosSliderEvent");Q=d.type+".iosSliderEvent";d=(I[c]+z[c]+J)%J;(0<d||b.infiniteSlider)&&f.changeSlide(d-1,G,B,n,x,w,h,r,p,m,F,l,L,c,R,J,k,b)}));""!=b.navNextSelector&&(a(b.navNextSelector).css({cursor:"pointer"}), a(b.navNextSelector).unbind(Q).bind(Q,function(d){"touchstart"==d.type?a(this).unbind("click.iosSliderEvent"):a(this).unbind("touchstart.iosSliderEvent");Q=d.type+".iosSliderEvent";d=(I[c]+z[c]+J)%J;(d<l.length-1||b.infiniteSlider)&&f.changeSlide(d+1,G,B,n,x,w,h,r,p,m,F,l,L,c,R,J,k,b)}));b.autoSlide&&!U&&(""!=b.autoSlideToggleSelector&&(a(b.autoSlideToggleSelector).css({cursor:"pointer"}),a(b.autoSlideToggleSelector).unbind(Q).bind(Q,function(){"touchstart"==e.type?a(this).unbind("click.iosSliderEvent"): a(this).unbind("touchstart.iosSliderEvent");Q=e.type+".iosSliderEvent";fa?(f.autoSlide(G,B,n,x,w,h,r,p,m,F,l,L,c,R,J,k,b),fa=!1,a(b.autoSlideToggleSelector).removeClass("on")):(f.autoSlidePause(c),fa=!0,a(b.autoSlideToggleSelector).addClass("on"))})),!fa&&!U&&f.autoSlide(G,B,n,x,w,h,r,p,m,F,l,L,c,R,J,k,b),a(A).bind("mouseenter.iosSliderEvent",function(){f.autoSlidePause(c)}),a(A).bind("mouseleave.iosSliderEvent",function(){!fa&&!U&&f.autoSlide(G,B,n,x,w,h,r,p,m,F,l,L,c,R,J,k,b)}),a(A).bind("touchend.iosSliderEvent", function(){!fa&&!U&&f.autoSlide(G,B,n,x,w,h,r,p,m,F,l,L,c,R,J,k,b)}));a(A).data("iosslider",{obj:Ca,settings:b,scrollerNode:G,slideNodes:B,numberOfSlides:J,centeredSlideOffset:k,sliderNumber:c,originalOffsets:F,childrenOffsets:l,sliderMax:q[c],scrollbarClass:x,scrollbarWidth:w,scrollbarStageWidth:r,stageWidth:h,scrollMargin:p,scrollBorder:m,infiniteSliderOffset:z[c],infiniteSliderWidth:R,slideNodeOuterWidths:L});v=!1;return!0}oa++;var c=oa,n=[];N[c]=b;g[c]=0;q[c]=0;var T=[0,0],K=[0,0],C="scrollbarBlock"+ oa,x="scrollbar"+oa,O,y,r,w,u,j,k=0,A=a(this),h,D,p,m,M,v=!0,E=-1,l,F=[],S=0,P=0,ca=0,G=a(this).children(":first-child"),B,ka,L,J=a(G).children().not("script").size(),W=!1,ja=0,ya=!1,ra=void 0,R;z[c]=0;var U=!1,fa=!1;va[c]=!1;var sa,ta=!1,ma=!1,Q="touchstart.iosSliderEvent click.iosSliderEvent",X,xa,Ba,qa;ea[c]=!1;da[c]=[];b.scrollbarDrag&&(b.scrollbar=!0,b.scrollbarHide=!1);var Ca=a(this);if(void 0!=Ca.data("iosslider"))return!0;a(this).find("img").bind("dragstart.iosSliderEvent",function(a){a.preventDefault()}); b.infiniteSlider&&(b.scrollbar=!1);b.scrollbar&&(""!=b.scrollbarContainer?a(b.scrollbarContainer).append("<div class = '"+C+"'><div class = '"+x+"'></div></div>"):a(G).parent().append("<div class = '"+C+"'><div class = '"+x+"'></div></div>"));if(!d())return!0;a(this).find("a").bind("mousedown",f.preventDrag);a(this).find("[onclick]").bind("click",f.preventDrag).each(function(){a(this).data("onclick",this.onclick)});E=f.calcActiveOffset(b,f.getSliderOffset(a(G),"x"),l,h,z[c],J,void 0,c);E=(E+z[c]+ J)%J;E=new f.args("load",b,G,a(G).children(":eq("+E+")"),E,E);a(A).data("args",E);if(""!=b.onSliderLoaded)b.onSliderLoaded(E);if(N[c].responsiveSlides||N[c].responsiveSlideContainer)E=Ea?"orientationchange":"resize",a(window).bind(E+".iosSliderEvent",function(){if(!d())return!0;var c=a(A).data("args");if(""!=b.onSliderResize)b.onSliderResize(c)});(b.keyboardControls||b.tabToAdvance)&&!U&&a(document).bind("keydown.iosSliderEvent",function(a){!Z&&!$&&(a=a.originalEvent);if(37==a.keyCode&&b.keyboardControls)a.preventDefault(), a=(I[c]+z[c]+J)%J,(0<a||b.infiniteSlider)&&f.changeSlide(a-1,G,B,n,x,w,h,r,p,m,F,l,L,c,R,J,k,b);else if(39==a.keyCode&&b.keyboardControls||9==a.keyCode&&b.tabToAdvance)a.preventDefault(),a=(I[c]+z[c]+J)%J,(a<l.length-1||b.infiniteSlider)&&f.changeSlide(a+1,G,B,n,x,w,h,r,p,m,F,l,L,c,R,J,k,b)});if(Da||b.desktopClickDrag){var ga=!1,ha=a(G),na=a(G),za=!1;b.scrollbarDrag&&(ha=ha.add(O),na=na.add(y));a(ha).bind("mousedown.iosSliderEvent touchstart.iosSliderEvent",function(d){if(ga)return!0;ga=!0;"touchstart"== d.type?a(na).unbind("mousedown.iosSliderEvent"):a(na).unbind("touchstart.iosSliderEvent");if(ea[c]||U)return!0;if(za=f.isUnselectable(d.target,b))return W=ga=!1,!0;sa=a(this)[0]===a(O)[0]?O:G;!Z&&!$&&(d=d.originalEvent);f.autoSlidePause(c);qa.unbind(".disableClick");"touchstart"==d.type?(eventX=d.touches[0].pageX,eventY=d.touches[0].pageY):(window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&& document.selection.empty(),eventX=d.pageX,eventY=d.pageY,ya=!0,ra=G,a(this).css({cursor:ua}));T=[0,0];K=[0,0];Y=0;W=!1;for(d=0;d<n.length;d++)clearTimeout(n[d]);d=f.getSliderOffset(G,"x");d>-1*g[c]+k+X?(d=-1*g[c]+k+X,f.setSliderOffset(a("."+x),d),a("."+x).css({width:w-m+"px"})):d<-1*q[c]&&(f.setSliderOffset(a("."+x),r-p-w),a("."+x).css({width:w-m+"px"}));T[1]=eventX;K[1]=eventY;ma=!1});a(na).bind("touchmove.iosSliderEvent mousemove.iosSliderEvent",function(d){!Z&&!$&&(d=d.originalEvent);if(ea[c]|| U||za)return!0;var n=0;if("touchmove"==d.type)eventX=d.touches[0].pageX,eventY=d.touches[0].pageY;else if(window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty(),eventX=d.pageX,eventY=d.pageY,!ya||!pa&&("undefined"!=typeof d.webkitMovementX||"undefined"!=typeof d.webkitMovementY)&&0===d.webkitMovementY&&0===d.webkitMovementX)return!0;T[0]=T[1];T[1]=eventX; Y=(T[1]-T[0])/2;K[0]=K[1];K[1]=eventY;ba=(K[1]-K[0])/2;if(!W){var s=a(this)[0]===a(O)[0]?g[c]:0;P=-1*(f.getSliderOffset(this,"x")-eventX-s);f.getSliderOffset(this,"y");var j=(I[c]+z[c]+J)%J,j=new f.args("start",b,G,a(G).children(":eq("+j+")"),j,j);a(A).data("args",j);if(""!=b.onSlideStart)b.onSlideStart(j)}if((3<ba||-3>ba)&&3>Y&&-3<Y&&"touchmove"==d.type&&!W)ta=!0;(5<Y||-5>Y)&&"touchmove"==d.type?(d.preventDefault(),W=!0):"touchmove"!=d.type&&(W=!0);if(W&&!ta){var j=f.getSliderOffset(G,"x"),s=a(this)[0]=== a(y)[0]?g[c]:k,t=a(this)[0]===a(y)[0]?(g[c]-q[c]-k)/(r-p-w):1,v=a(this)[0]===a(y)[0]?b.scrollbarElasticPullResistance:b.elasticPullResistance,C=b.snapSlideCenter&&a(this)[0]===a(y)[0]?0:k,E=b.snapSlideCenter&&a(this)[0]===a(y)[0]?k:0;"touchmove"==d.type&&(ca!=d.touches.length&&(P=-1*j+eventX),ca=d.touches.length);if(b.infiniteSlider){if(j<=-1*q[c]){var u=a(G).width();if(j<=-1*wa[c]){var D=-1*F[0];a(B).each(function(b){f.setSliderOffset(a(B)[b],D+k);b<l.length&&(l[b]=-1*D);D+=L[b]});P-=-1*l[0];g[c]= -1*l[0]+k;q[c]=g[c]+u-h;z[c]=0}else{var N=0,R=f.getSliderOffset(a(B[0]),"x");a(B).each(function(a){f.getSliderOffset(this,"x")<R&&(R=f.getSliderOffset(this,"x"),N=a)});v=g[c]+u;f.setSliderOffset(a(B)[N],v);g[c]=-1*l[1]+k;q[c]=g[c]+u-h;l.splice(0,1);l.splice(l.length,0,-1*v+k);z[c]++}}if(j>=-1*g[c]||0<=j)if(u=a(G).width(),0<=j){D=-1*F[0];a(B).each(function(b){f.setSliderOffset(a(B)[b],D+k);b<l.length&&(l[b]=-1*D);D+=L[b]});P+=-1*l[0];g[c]=-1*l[0]+k;q[c]=g[c]+u-h;for(z[c]=J;0<-1*l[0]-u+k;){var Q=0, S=f.getSliderOffset(a(B[0]),"x");a(B).each(function(a){f.getSliderOffset(this,"x")>S&&(S=f.getSliderOffset(this,"x"),Q=a)});v=g[c]-L[Q];f.setSliderOffset(a(B)[Q],v);l.splice(0,0,-1*v+k);l.splice(l.length-1,1);g[c]=-1*l[0]+k;q[c]=g[c]+u-h;z[c]--;I[c]++}}else Q=0,S=f.getSliderOffset(a(B[0]),"x"),a(B).each(function(a){f.getSliderOffset(this,"x")>S&&(S=f.getSliderOffset(this,"x"),Q=a)}),v=g[c]-L[Q],f.setSliderOffset(a(B)[Q],v),l.splice(0,0,-1*v+k),l.splice(l.length-1,1),g[c]=-1*l[0]+k,q[c]=g[c]+u-h,z[c]--}else u= a(G).width(),j>-1*g[c]+k&&(n=-1*(g[c]+-1*(P-s-eventX+C)*t-s)*v/t),j<-1*q[c]&&(n=-1*(q[c]+E+-1*(P-s-eventX)*t-s)*v/t);f.setSliderOffset(G,-1*(P-s-eventX-n)*t-s+E);b.scrollbar&&(f.showScrollbar(b,x),V=Math.floor((P-eventX-n-g[c]+C)/(q[c]-g[c]+k)*(r-p-w)*t),s=w,j>=-1*g[c]+C+u?(s=w-m- -1*V,f.setSliderOffset(a("."+x),0),a("."+x).css({width:s+"px"})):j<=-1*q[c]+1?(s=r-p-m-V,f.setSliderOffset(a("."+x),V),a("."+x).css({width:s+"px"})):f.setSliderOffset(a("."+x),V));"touchmove"==d.type&&(M=d.touches[0].pageX); d=!1;n=f.calcActiveOffset(b,-1*(P-eventX-n),l,h,z[c],J,void 0,c);u=(n+z[c]+J)%J;b.infiniteSlider?u!=aa[c]&&(d=!0):n!=I[c]&&(d=!0);if(d&&(I[c]=n,aa[c]=u,ma=!0,j=new f.args("change",b,G,a(G).children(":eq("+u+")"),u,u),a(A).data("args",j),""!=b.onSlideChange))b.onSlideChange(j)}ga=!1});var Aa=a(window);if($||Z)Aa=a(document);a(ha).bind("touchend.iosSliderEvent",function(d){a(Aa).unbind("mouseup.iosSliderEvent"+c);d=d.originalEvent;if(ea[c]||U||za)return!0;if(0!=d.touches.length)for(var g=0;g<d.touches.length;g++)d.touches[g].pageX== M&&f.slowScrollHorizontal(G,B,n,x,Y,ba,w,h,r,p,m,F,l,L,c,R,J,sa,ma,k,b);else f.slowScrollHorizontal(G,B,n,x,Y,ba,w,h,r,p,m,F,l,L,c,R,J,sa,ma,k,b);ga=ta=!1});a(Aa).bind("mouseup.iosSliderEvent"+c,function(){a(ha).unbind("touchend.iosSliderEvent");W?xa.unbind("click.disableClick").bind("click.disableClick",f.preventClick):xa.unbind("click.disableClick").bind("click.disableClick",f.enableClick);Ba.each(function(){this.onclick=function(b){if(W)return!1;a(this).data("onclick").call(this,b||window.event)}}); 1.8<=parseFloat(a().jquery)?qa.each(function(){var b=a._data(this,"events");if(void 0!=b&&void 0!=b.click&&"iosSliderEvent"!=b.click[0].namespace){if(!W)return!1;a(this).one("click.disableClick",f.preventClick);var b=a._data(this,"events").click,c=b.pop();b.splice(0,0,c)}}):1.6<=parseFloat(a().jquery)&&qa.each(function(){var b=a(this).data("events");if(void 0!=b&&void 0!=b.click&&"iosSliderEvent"!=b.click[0].namespace){if(!W)return!1;a(this).one("click.disableClick",f.preventClick);var b=a(this).data("events").click, c=b.pop();b.splice(0,0,c)}});if(!va[c]){if(U)return!0;a(ha).css({cursor:ia});ya=!1;if(void 0==ra)return!0;f.slowScrollHorizontal(ra,B,n,x,Y,ba,w,h,r,p,m,F,l,L,c,R,J,sa,ma,k,b);ra=void 0}ga=ta=!1})}})},destroy:function(d,g){void 0==g&&(g=this);return a(g).each(function(){var b=a(this),g=b.data("iosslider");if(void 0==g)return!1;void 0==d&&(d=!0);f.autoSlidePause(g.sliderNumber);va[g.sliderNumber]=!0;a(window).unbind(".iosSliderEvent-"+g.sliderNumber);a(window).unbind(".iosSliderEvent");a(document).unbind(".iosSliderEvent-"+ g.sliderNumber);a(document).unbind("keydown.iosSliderEvent");a(this).unbind(".iosSliderEvent");a(this).children(":first-child").unbind(".iosSliderEvent");a(this).children(":first-child").children().unbind(".iosSliderEvent");d&&(a(this).attr("style",""),a(this).children(":first-child").attr("style",""),a(this).children(":first-child").children().attr("style",""),a(g.settings.navSlideSelector).attr("style",""),a(g.settings.navPrevSelector).attr("style",""),a(g.settings.navNextSelector).attr("style", ""),a(g.settings.autoSlideToggleSelector).attr("style",""),a(g.settings.unselectableSelector).attr("style",""));g.settings.scrollbar&&a(".scrollbarBlock"+g.sliderNumber).remove();for(var g=da[g.sliderNumber],c=0;c<g.length;c++)clearTimeout(g[c]);b.removeData("iosslider");b.removeData("args")})},update:function(d){void 0==d&&(d=this);return a(d).each(function(){var d=a(this),b=d.data("iosslider");if(void 0==b)return!1;b.settings.startAtSlide=d.data("args").currentSlideNumber;S.destroy(!1,this);1!= b.numberOfSlides&&b.settings.infiniteSlider&&(b.settings.startAtSlide=(I[b.sliderNumber]+1+z[b.sliderNumber]+b.numberOfSlides)%b.numberOfSlides);S.init(b.settings,this);d=new f.args("update",b.settings,b.scrollerNode,a(b.scrollerNode).children(":eq("+(b.settings.startAtSlide-1)+")"),b.settings.startAtSlide-1,b.settings.startAtSlide-1);a(b.stageNode).data("args",d);if(""!=b.settings.onSliderUpdate)b.settings.onSliderUpdate(d)})},addSlide:function(d,f){return this.each(function(){var b=a(this),g=b.data("iosslider"); if(void 0==g)return!1;0==a(g.scrollerNode).children().size()?(a(g.scrollerNode).append(d),b.data("args").currentSlideNumber=1):g.settings.infiniteSlider?(1==f?a(g.scrollerNode).children(":eq(0)").before(d):a(g.scrollerNode).children(":eq("+(f-2)+")").after(d),-1>z[g.sliderNumber]&&I[g.sliderNumber]--,b.data("args").currentSlideNumber>=f&&I[g.sliderNumber]++):(f<=g.numberOfSlides?a(g.scrollerNode).children(":eq("+(f-1)+")").before(d):a(g.scrollerNode).children(":eq("+(f-2)+")").after(d),b.data("args").currentSlideNumber>= f&&b.data("args").currentSlideNumber++);b.data("iosslider").numberOfSlides++;S.update(this)})},removeSlide:function(d){return this.each(function(){var f=a(this).data("iosslider");if(void 0==f)return!1;a(f.scrollerNode).children(":eq("+(d-1)+")").remove();I[f.sliderNumber]>d-1&&I[f.sliderNumber]--;S.update(this)})},goToSlide:function(d,g){void 0==g&&(g=this);return a(g).each(function(){var b=a(this).data("iosslider");if(void 0==b)return!1;d=d>b.childrenOffsets.length?b.childrenOffsets.length-1:d-1; f.changeSlide(d,a(b.scrollerNode),a(b.slideNodes),da[b.sliderNumber],b.scrollbarClass,b.scrollbarWidth,b.stageWidth,b.scrollbarStageWidth,b.scrollMargin,b.scrollBorder,b.originalOffsets,b.childrenOffsets,b.slideNodeOuterWidths,b.sliderNumber,b.infiniteSliderWidth,b.numberOfSlides,b.centeredSlideOffset,b.settings);I[b.sliderNumber]=d})},lock:function(){return this.each(function(){var d=a(this).data("iosslider");if(void 0==d)return!1;ea[d.sliderNumber]=!0})},unlock:function(){return this.each(function(){var d= a(this).data("iosslider");if(void 0==d)return!1;ea[d.sliderNumber]=!1})},getData:function(){return this.each(function(){var d=a(this).data("iosslider");return void 0==d?!1:d})},autoSlidePause:function(){return this.each(function(){var d=a(this).data("iosslider");if(void 0==d)return!1;f.autoSlidePause(d.sliderNumber);return d})},autoSlidePlay:function(){return this.each(function(){var d=a(this).data("iosslider");if(void 0==d)return!1;N[d.sliderNumber].autoSlide=!0;f.autoSlide(a(d.scrollerNode),a(d.slideNodes), da[d.sliderNumber],d.scrollbarClass,d.scrollbarWidth,d.stageWidth,d.scrollbarStageWidth,d.scrollMargin,d.scrollBorder,d.originalOffsets,d.childrenOffsets,d.slideNodeOuterWidths,d.sliderNumber,d.infiniteSliderWidth,d.numberOfSlides,d.centeredSlideOffset,d.settings);return d})}};a.fn.iosSlider=function(d){if(S[d])return S[d].apply(this,Array.prototype.slice.call(arguments,1));if("object"===typeof d||!d)return S.init.apply(this,arguments);a.error("invalid method call!")}})(jQuery);
+(function(a){var oa=0,Y=0,ba=0,V=0,Da="ontouchstart"in window,Ea="onorientationchange"in window,ca=!1,Z=!1,$=!1,pa=!1,ia="pointer",ua="pointer",ja=[],N=[],va=[],da=[],I=[],aa=[],z=[],g=[],q=[],wa=[],ea=[],f={showScrollbar:function(d,f){d.scrollbarHide&&a("."+f).css({opacity:d.scrollbarOpacity,filter:"alpha(opacity:"+100*d.scrollbarOpacity+")"})},hideScrollbar:function(a,n,b,s,c,t,g,q,C,x){if(a.scrollbar&&a.scrollbarHide)for(var z=b;z<b+25;z++)n[n.length]=f.hideScrollbarIntervalTimer(10*z,s[b],(b+ 24-z)/24,c,t,g,q,C,x,a)},hideScrollbarInterval:function(d,n,b,s,c,t,g,z,C){V=-1*d/q[z]*(c-t-g-s);f.setSliderOffset("."+b,V);a("."+b).css({opacity:C.scrollbarOpacity*n,filter:"alpha(opacity:"+100*C.scrollbarOpacity*n+")"})},slowScrollHorizontalInterval:function(d,n,b,s,c,t,T,K,C,x,O,y,r,w,u,j,k,A,h){if(h.infiniteSlider){if(b<=-1*q[j]){var D=a(d).width();if(b<=-1*wa[j]){var p=-1*O[0];a(n).each(function(b){f.setSliderOffset(a(n)[b],p+k);b<y.length&&(y[b]=-1*p);p+=u[b]});b+=-1*y[0];g[j]=-1*y[0]+k;q[j]= g[j]+D-t;z[j]=0}else{var m=0,M=f.getSliderOffset(a(n[0]),"x");a(n).each(function(a){f.getSliderOffset(this,"x")<M&&(M=f.getSliderOffset(this,"x"),m=a)});r=g[j]+D;f.setSliderOffset(a(n)[m],r);g[j]=-1*y[1]+k;q[j]=g[j]+D-t;y.splice(0,1);y.splice(y.length,0,-1*r+k);z[j]++}}if(b>=-1*g[j]||0<=b){D=a(d).width();if(0<=b){p=-1*O[0];a(n).each(function(b){f.setSliderOffset(a(n)[b],p+k);b<y.length&&(y[b]=-1*p);p+=u[b]});b-=-1*y[0];g[j]=-1*y[0]+k;q[j]=g[j]+D-t;for(z[j]=w;0<-1*y[0]-D+k;){var v=0,E=f.getSliderOffset(a(n[0]), "x");a(n).each(function(a){f.getSliderOffset(this,"x")>E&&(E=f.getSliderOffset(this,"x"),v=a)});r=g[j]-u[v];f.setSliderOffset(a(n)[v],r);y.splice(0,0,-1*r+k);y.splice(y.length-1,1);g[j]=-1*y[0]+k;q[j]=g[j]+D-t;z[j]--;I[j]++}}0>b&&(v=0,E=f.getSliderOffset(a(n[0]),"x"),a(n).each(function(a){f.getSliderOffset(this,"x")>E&&(E=f.getSliderOffset(this,"x"),v=a)}),r=g[j]-u[v],f.setSliderOffset(a(n)[v],r),y.splice(0,0,-1*r+k),y.splice(y.length-1,1),g[j]=-1*y[0]+k,q[j]=g[j]+D-t,z[j]--)}}O=!1;t=f.calcActiveOffset(h, b,y,t,z[j],w,x,j);r=(t+z[j]+w)%w;h.infiniteSlider?r!=aa[j]&&(O=!0):t!=I[j]&&(O=!0);if(O&&(w=new f.args("change",h,d,a(d).children(":eq("+r+")"),r,A),a(d).parent().data("args",w),""!=h.onSlideChange))h.onSlideChange(w);I[j]=t;aa[j]=r;b=Math.floor(b);f.setSliderOffset(d,b);h.scrollbar&&(V=Math.floor((-1*b-g[j]+k)/(q[j]-g[j]+k)*(T-K-c)),d=c-C,b>=-1*g[j]+k?(d=c-C- -1*V,f.setSliderOffset(a("."+s),0)):(b<=-1*q[j]+1&&(d=T-K-C-V),f.setSliderOffset(a("."+s),V)),a("."+s).css({width:d+"px"}))},slowScrollHorizontal:function(d, n,b,s,c,t,T,K,C,x,O,y,r,w,u,j,k,A,h,D,p){t=[];var m=f.getSliderOffset(d,"x"),M=0,v=25/1024*K;frictionCoefficient=p.frictionCoefficient;elasticFrictionCoefficient=p.elasticFrictionCoefficient;snapFrictionCoefficient=p.snapFrictionCoefficient;5<c&&p.snapToChildren&&!h?M=1:-5>c&&(p.snapToChildren&&!h)&&(M=-1);c<-1*v?c=-1*v:c>v&&(c=v);a(d)[0]!==a(A)[0]&&(M*=-1,c*=-2);A=z[u];if(p.infiniteSlider)var E=g[u],l=q[u];h=[];for(var v=[],F=0;F<r.length;F++)h[F]=r[F],F<n.length&&(v[F]=f.getSliderOffset(a(n[F]), "x"));for(;1<c||-1>c;){c*=frictionCoefficient;m+=c;if((m>-1*g[u]||m<-1*q[u])&&!p.infiniteSlider)c*=elasticFrictionCoefficient,m+=c;if(p.infiniteSlider){if(m<=-1*l){for(var l=a(d).width(),N=0,P=v[0],F=0;F<v.length;F++)v[F]<P&&(P=v[F],N=F);F=E+l;v[N]=F;E=-1*h[1]+D;l=E+l-K;h.splice(0,1);h.splice(h.length,0,-1*F+D);A++}if(m>=-1*E){l=a(d).width();N=0;P=v[0];for(F=0;F<v.length;F++)v[F]>P&&(P=v[F],N=F);F=E-w[N];v[N]=F;h.splice(0,0,-1*F+D);h.splice(h.length-1,1);E=-1*h[0]+D;l=E+l-K;A--}}t[t.length]=m}v=!1; c=f.calcActiveOffset(p,m,h,K,A,k,I[u],u);E=(c+A+k)%k;p.snapToChildren&&(p.infiniteSlider?E!=aa[u]&&(v=!0):c!=I[u]&&(v=!0),0>M&&!v?(c++,c>=r.length&&!p.infinteSlider&&(c=r.length-1)):0<M&&!v&&(c--,0>c&&!p.infinteSlider&&(c=0)));if(p.snapToChildren||(m>-1*g[u]||m<-1*q[u])&&!p.infiniteSlider){m=f.getSliderOffset(d,"x");for(t.splice(0,t.length);m<h[c]-0.5||m>h[c]+0.5;)m=(m-h[c])*snapFrictionCoefficient+h[c],t[t.length]=m;t[t.length]=h[c]}M=1;0!=t.length%2&&(M=0);for(m=0;m<b.length;m++)clearTimeout(b[m]); A=(c+A+k)%k;E=0;for(m=M;m<t.length;m+=2)if(m==M||1<Math.abs(t[m]-E)||m>=t.length-2)E=t[m],b[b.length]=f.slowScrollHorizontalIntervalTimer(10*m,d,n,t[m],s,T,K,C,x,O,c,y,r,j,k,w,u,D,A,p);E=(c+z[u]+k)%k;""!=p.onSlideComplete&&(b[b.length]=f.onSlideCompleteTimer(10*(m+1),p,d,a(d).children(":eq("+E+")"),E,u));da[u]=b;f.hideScrollbar(p,b,m,t,s,T,K,x,O,u)},onSlideComplete:function(d,n,b,s){b=new f.args("complete",d,a(n),b,s,s);a(n).parent().data("args",b);if(""!=d.onSlideComplete)d.onSlideComplete(b)},getSliderOffset:function(d, f){var b=0;f="x"==f?4:5;if(ca&&!Z&&!$){for(var b=["-webkit-transform","-moz-transform","transform"],s=0;s<b.length;s++)if(void 0!=a(d).css(b[s])&&0<a(d).css(b[s]).length){var c=a(d).css(b[s]).split(",");break}b=parseInt(c[f],10)}else b=parseInt(a(d).css("left"),10);return b},setSliderOffset:function(d,f){ca&&!Z&&!$?a(d).css({webkitTransform:"matrix(1,0,0,1,"+f+",0)",MozTransform:"matrix(1,0,0,1,"+f+",0)",transform:"matrix(1,0,0,1,"+f+",0)"}):a(d).css({left:f+"px"})},setBrowserInfo:function(){null!= navigator.userAgent.match("WebKit")?(ia="-webkit-grab",ua="-webkit-grabbing"):null!=navigator.userAgent.match("Gecko")?(ia="move",ua="-moz-grabbing"):null!=navigator.userAgent.match("MSIE 7")?pa=Z=!0:null!=navigator.userAgent.match("MSIE 8")?pa=$=!0:null!=navigator.userAgent.match("MSIE 9")&&(pa=!0)},has3DTransform:function(){var d=!1,f=a("<div />").css({webkitTransform:"matrix(1,1,1,1,1,1)",MozTransform:"matrix(1,1,1,1,1,1)",transform:"matrix(1,1,1,1,1,1)"});""==f.attr("style")?d=!1:void 0!=f.attr("style")&& (d=!0);return d},getSlideNumber:function(a,f,b){return(a-z[f]+b)%b},calcActiveOffset:function(a,f,b,s){var c=!1;a=[];for(var t,g=0;g<b.length;g++)b[g]<=f&&b[g]>f-s&&(!c&&b[g]!=f&&(a[a.length]=b[g-1]),a[a.length]=b[g],c=!0);0==a.length&&(a[0]=b[b.length-1]);for(g=c=0;g<a.length;g++){var q=Math.abs(f-a[g]);q<s&&(c=a[g],s=q)}for(g=0;g<b.length;g++)c==b[g]&&(t=g);return t},changeSlide:function(d,n,b,g,c,t,q,K,C,x,O,y,r,w,u,j,k,A){f.autoSlidePause(w);for(var h=0;h<g.length;h++)clearTimeout(g[h]);var D= Math.ceil(A.autoSlideTransTimer/10)+1,p=f.getSliderOffset(n,"x"),m=y[d],M=m-p;if(A.infiniteSlider){d=(d-z[w]+2*j)%j;h=!1;0==d&&2==j&&(d=j,y[d]=y[d-1]-a(b).eq(0).outerWidth(!0),h=!0);m=y[d];M=m-p;m=[y[d]-a(n).width(),y[d]+a(n).width()];h&&y.splice(y.length-1,1);for(h=0;h<m.length;h++)Math.abs(m[h]-p)<Math.abs(M)&&(M=m[h]-p)}var m=[],v;f.showScrollbar(A,c);for(h=0;h<=D;h++)v=h,v/=D,v--,v=p+M*(Math.pow(v,5)+1),m[m.length]=v;for(h=p=0;h<m.length;h++){if(0==h||1<Math.abs(m[h]-p)||h>=m.length-2)p=m[h], g[h]=f.slowScrollHorizontalIntervalTimer(10*(h+1),n,b,m[h],c,t,q,K,C,x,d,O,y,u,j,r,w,k,d,A);0==h&&""!=A.onSlideStart&&(D=(I[w]+z[w]+j)%j,A.onSlideStart(new f.args("start",A,n,a(n).children(":eq("+D+")"),D,d)))}p=!1;D=(d+z[w]+j)%j;A.infiniteSlider?D!=aa[w]&&(p=!0):d!=I[w]&&(p=!0);p&&""!=A.onSlideComplete&&(g[g.length]=f.onSlideCompleteTimer(10*(h+1),A,n,a(n).children(":eq("+D+")"),D,w));da[w]=g;f.hideScrollbar(A,g,h,m,c,t,q,C,x,w);f.autoSlide(n,b,g,c,t,q,K,C,x,O,y,r,w,u,j,k,A)},autoSlide:function(a, g,b,s,c,t,q,K,C,x,O,y,r,w,u,j,k){if(!N[r].autoSlide)return!1;f.autoSlidePause(r);ja[r]=setTimeout(function(){!k.infiniteSlider&&I[r]>O.length-1&&(I[r]-=u);f.changeSlide((I[r]+z[r]+u+1)%u,a,g,b,s,c,t,q,K,C,x,O,y,r,w,u,j,k);f.autoSlide(a,g,b,s,c,t,q,K,C,x,O,y,r,w,u,j,k)},k.autoSlideTimer+k.autoSlideTransTimer)},autoSlidePause:function(a){clearTimeout(ja[a])},isUnselectable:function(f,g){return""!=g.unselectableSelector&&1==a(f).closest(g.unselectableSelector).size()?!0:!1},slowScrollHorizontalIntervalTimer:function(a, g,b,s,c,t,q,z,C,x,I,y,r,w,u,j,k,A,h,D){return setTimeout(function(){f.slowScrollHorizontalInterval(g,b,s,c,t,q,z,C,x,I,y,r,w,u,j,k,A,h,D)},a)},onSlideCompleteTimer:function(a,g,b,s,c,t){return setTimeout(function(){f.onSlideComplete(g,b,s,c,t)},a)},hideScrollbarIntervalTimer:function(a,g,b,s,c,t,q,z,C,x){return setTimeout(function(){f.hideScrollbarInterval(g,b,s,c,t,q,z,C,x)},a)},args:function(d,g,b,s,c){this.prevSlideNumber=void 0==a(b).parent().data("args")?void 0:a(b).parent().data("args").prevSlideNumber; this.prevSlideObject=void 0==a(b).parent().data("args")?void 0:a(b).parent().data("args").prevSlideObject;this.targetSlideObject=this.targetSlideNumber=void 0;this.slideChanged=!1;"load"!=d&&"start"!=d&&("change"==d?(this.slideChanged=!0,this.prevSlideNumber=void 0==a(b).parent().data("args")?g.startAtSlide:a(b).parent().data("args").currentSlideNumber,this.prevSlideObject=a(b).children(":eq("+this.prevSlideNumber+")")):"complete"==d&&(this.slideChanged=a(b).parent().data("args").slideChanged));this.settings= g;this.data=a(b).parent().data("iosslider");this.sliderObject=b;this.sliderContainerObject=a(b).parent();this.currentSlideObject=s;this.currentSlideNumber=c+1;this.currentSliderOffset=-1*f.getSliderOffset(b,"x")},preventDrag:function(a){a.preventDefault()},preventClick:function(a){a.stopImmediatePropagation();return!1},enableClick:function(){return!0}};f.setBrowserInfo();var S={init:function(d,n){ca=f.has3DTransform();var b=a.extend(!0,{elasticPullResistance:0.6,frictionCoefficient:0.92,elasticFrictionCoefficient:0.6, snapFrictionCoefficient:0.92,snapToChildren:!1,snapSlideCenter:!1,startAtSlide:1,scrollbar:!1,scrollbarDrag:!1,scrollbarHide:!0,scrollbarLocation:"top",scrollbarContainer:"",scrollbarOpacity:0.4,scrollbarHeight:"4px",scrollbarBorder:"0",scrollbarMargin:"5px",scrollbarBackground:"#000",scrollbarBorderRadius:"100px",scrollbarShadow:"0 0 0 #000",scrollbarElasticPullResistance:0.9,desktopClickDrag:!1,keyboardControls:!1,tabToAdvance:!1,responsiveSlideContainer:!0,responsiveSlides:!0,navSlideSelector:"", navPrevSelector:"",navNextSelector:"",autoSlideToggleSelector:"",autoSlide:!1,autoSlideTimer:5E3,autoSlideTransTimer:750,infiniteSlider:!1,stageCSS:{position:"relative",top:"0",left:"0",overflow:"hidden",zIndex:1},unselectableSelector:"",onSliderLoaded:"",onSliderUpdate:"",onSliderResize:"",onSlideStart:"",onSlideChange:"",onSlideComplete:""},d);void 0==n&&(n=this);return a(n).each(function(){function d(){f.autoSlidePause(c);xa=a(G).find("a");Ba=a(G).find("[onclick]");qa=a(G).find("*");a(A).css("width", "");a(A).css("height","");a(G).css("width","");B=a(G).children().not("script").get();ka=[];L=[];a(B).css("width","");q[c]=0;l=[];u=a(A).parent().width();h=a(A).outerWidth(!0);b.responsiveSlideContainer&&(h=a(A).outerWidth(!0)>u?u:a(A).outerWidth(!0));a(A).css({position:b.stageCSS.position,top:b.stageCSS.top,left:b.stageCSS.left,overflow:b.stageCSS.overflow,zIndex:b.stageCSS.zIndex,webkitPerspective:1E3,webkitBackfaceVisibility:"hidden","-ms-touch-action":"pan-y",width:h});a(b.unselectableSelector).css({cursor:"default"}); for(var H=0;H<B.length;H++){ka[H]=a(B[H]).width();L[H]=a(B[H]).outerWidth(!0);var s=L[H];b.responsiveSlides&&(s=L[H]>h?h+-1*(L[H]-ka[H]):ka[H],a(B[H]).css({width:s}));a(B[H]).css({webkitBackfaceVisibility:"hidden",position:"absolute",top:0});l[H]=-1*q[c];q[c]=q[c]+s+(L[H]-ka[H])}b.snapSlideCenter&&(k=0.5*(h-L[0]),b.responsiveSlides&&L[0]>h&&(k=0));wa[c]=2*q[c];for(H=0;H<B.length;H++)f.setSliderOffset(a(B[H]),-1*l[H]+q[c]+k),l[H]-=q[c];if(!b.infiniteSlider&&!b.snapSlideCenter){for(H=0;H<l.length&& !(l[H]<=-1*(2*q[c]-h));H++)ja=H;l.splice(ja+1,l.length);l[l.length]=-1*(2*q[c]-h)}for(H=0;H<l.length;H++)F[H]=l[H];v&&(b.startAtSlide=N[c].startAtSlide>l.length?l.length:N[c].startAtSlide,b.infiniteSlider?(b.startAtSlide=(N[c].startAtSlide-1+J)%J,I[c]=N[c].startAtSlide):(b.startAtSlide=0>N[c].startAtSlide-1?l.length-1:N[c].startAtSlide,I[c]=N[c].startAtSlide-1),aa[c]=I[c]);g[c]=q[c]+k;a(G).css({position:"relative",cursor:ia,webkitPerspective:"0",webkitBackfaceVisibility:"hidden",width:q[c]+"px"}); X=q[c];q[c]=2*q[c]-h+2*k;(U=X<h?!0:!1)&&a(G).css({cursor:"default"});j=a(A).parent().outerHeight(!0);D=a(A).height();b.responsiveSlideContainer&&(D=D>j?j:D);a(A).css({height:D});f.setSliderOffset(G,l[I[c]]);if(b.infiniteSlider&&!U){H=f.getSliderOffset(a(G),"x");for(s=-1*((z[c]+J)%J);0>s;){var E=0,la=f.getSliderOffset(a(B[0]),"x");a(B).each(function(a){f.getSliderOffset(this,"x")<la&&(la=f.getSliderOffset(this,"x"),E=a)});var K=g[c]+X;f.setSliderOffset(a(B)[E],K);g[c]=-1*l[1]+k;q[c]=g[c]+X-h;l.splice(0, 1);l.splice(l.length,0,-1*K+k);s++}for(;0<-1*l[0]-X+k&&b.snapSlideCenter&&v;){var M=0,P=f.getSliderOffset(a(B[0]),"x");a(B).each(function(a){f.getSliderOffset(this,"x")>P&&(P=f.getSliderOffset(this,"x"),M=a)});K=g[c]-L[M];f.setSliderOffset(a(B)[M],K);l.splice(0,0,-1*K+k);l.splice(l.length-1,1);g[c]=-1*l[0]+k;q[c]=g[c]+X-h;z[c]--;I[c]++}for(;H<=-1*q[c];)E=0,la=f.getSliderOffset(a(B[0]),"x"),a(B).each(function(a){f.getSliderOffset(this,"x")<la&&(la=f.getSliderOffset(this,"x"),E=a)}),K=g[c]+X,f.setSliderOffset(a(B)[E], K),g[c]=-1*l[1]+k,q[c]=g[c]+X-h,l.splice(0,1),l.splice(l.length,0,-1*K+k),z[c]++,I[c]--}f.setSliderOffset(G,l[I[c]]);b.desktopClickDrag||a(G).css({cursor:"default"});b.scrollbar&&(a("."+C).css({margin:b.scrollbarMargin,overflow:"hidden",display:"none"}),a("."+C+" ."+x).css({border:b.scrollbarBorder}),p=parseInt(a("."+C).css("marginLeft"))+parseInt(a("."+C).css("marginRight")),m=parseInt(a("."+C+" ."+x).css("borderLeftWidth"),10)+parseInt(a("."+C+" ."+x).css("borderRightWidth"),10),r=""!=b.scrollbarContainer? a(b.scrollbarContainer).width():h,w=(r-p)/J,b.scrollbarHide||(S=b.scrollbarOpacity),a("."+C).css({position:"absolute",left:0,width:r-p+"px",margin:b.scrollbarMargin}),"top"==b.scrollbarLocation?a("."+C).css("top","0"):a("."+C).css("bottom","0"),a("."+C+" ."+x).css({borderRadius:b.scrollbarBorderRadius,background:b.scrollbarBackground,height:b.scrollbarHeight,width:w-m+"px",minWidth:b.scrollbarHeight,border:b.scrollbarBorder,webkitPerspective:1E3,webkitBackfaceVisibility:"hidden",position:"relative", opacity:S,filter:"alpha(opacity:"+100*S+")",boxShadow:b.scrollbarShadow}),f.setSliderOffset(a("."+C+" ."+x),Math.floor((-1*l[I[c]]-g[c]+k)/(q[c]-g[c]+k)*(r-p-w))),a("."+C).css({display:"block"}),O=a("."+C+" ."+x),y=a("."+C));b.scrollbarDrag&&!U&&a("."+C+" ."+x).css({cursor:ia});b.infiniteSlider&&(R=(q[c]+h)/3);""!=b.navSlideSelector&&a(b.navSlideSelector).each(function(d){a(this).css({cursor:"pointer"});a(this).unbind(Q).bind(Q,function(H){"touchstart"==H.type?a(this).unbind("click.iosSliderEvent"): a(this).unbind("touchstart.iosSliderEvent");Q=H.type+".iosSliderEvent";f.changeSlide(d,G,B,n,x,w,h,r,p,m,F,l,L,c,R,J,k,b)})});""!=b.navPrevSelector&&(a(b.navPrevSelector).css({cursor:"pointer"}),a(b.navPrevSelector).unbind(Q).bind(Q,function(d){"touchstart"==d.type?a(this).unbind("click.iosSliderEvent"):a(this).unbind("touchstart.iosSliderEvent");Q=d.type+".iosSliderEvent";d=(I[c]+z[c]+J)%J;(0<d||b.infiniteSlider)&&f.changeSlide(d-1,G,B,n,x,w,h,r,p,m,F,l,L,c,R,J,k,b)}));""!=b.navNextSelector&&(a(b.navNextSelector).css({cursor:"pointer"}), a(b.navNextSelector).unbind(Q).bind(Q,function(d){"touchstart"==d.type?a(this).unbind("click.iosSliderEvent"):a(this).unbind("touchstart.iosSliderEvent");Q=d.type+".iosSliderEvent";d=(I[c]+z[c]+J)%J;(d<l.length-1||b.infiniteSlider)&&f.changeSlide(d+1,G,B,n,x,w,h,r,p,m,F,l,L,c,R,J,k,b)}));b.autoSlide&&!U&&(""!=b.autoSlideToggleSelector&&(a(b.autoSlideToggleSelector).css({cursor:"pointer"}),a(b.autoSlideToggleSelector).unbind(Q).bind(Q,function(){"touchstart"==e.type?a(this).unbind("click.iosSliderEvent"): a(this).unbind("touchstart.iosSliderEvent");Q=e.type+".iosSliderEvent";fa?(f.autoSlide(G,B,n,x,w,h,r,p,m,F,l,L,c,R,J,k,b),fa=!1,a(b.autoSlideToggleSelector).removeClass("on")):(f.autoSlidePause(c),fa=!0,a(b.autoSlideToggleSelector).addClass("on"))})),!fa&&!U&&f.autoSlide(G,B,n,x,w,h,r,p,m,F,l,L,c,R,J,k,b),a(A).bind("mouseenter.iosSliderEvent",function(){f.autoSlidePause(c)}),a(A).bind("mouseleave.iosSliderEvent",function(){!fa&&!U&&f.autoSlide(G,B,n,x,w,h,r,p,m,F,l,L,c,R,J,k,b)}),a(A).bind("touchend.iosSliderEvent", function(){!fa&&!U&&f.autoSlide(G,B,n,x,w,h,r,p,m,F,l,L,c,R,J,k,b)}));a(A).data("iosslider",{obj:Ca,settings:b,scrollerNode:G,slideNodes:B,numberOfSlides:J,centeredSlideOffset:k,sliderNumber:c,originalOffsets:F,childrenOffsets:l,sliderMax:q[c],scrollbarClass:x,scrollbarWidth:w,scrollbarStageWidth:r,stageWidth:h,scrollMargin:p,scrollBorder:m,infiniteSliderOffset:z[c],infiniteSliderWidth:R,slideNodeOuterWidths:L});v=!1;return!0}oa++;var c=oa,n=[];N[c]=b;g[c]=0;q[c]=0;var T=[0,0],K=[0,0],C="scrollbarBlock"+ oa,x="scrollbar"+oa,O,y,r,w,u,j,k=0,A=a(this),h,D,p,m,M,v=!0,E=-1,l,F=[],S=0,P=0,ca=0,G=a(this).children(":first-child"),B,ka,L,J=a(G).children().not("script").size(),W=!1,ja=0,ya=!1,ra=void 0,R;z[c]=0;var U=!1,fa=!1;va[c]=!1;var sa,ta=!1,ma=!1,Q="touchstart.iosSliderEvent click.iosSliderEvent",X,xa,Ba,qa;ea[c]=!1;da[c]=[];b.scrollbarDrag&&(b.scrollbar=!0,b.scrollbarHide=!1);var Ca=a(this);if(void 0!=Ca.data("iosslider"))return!0;a(this).find("img").bind("dragstart.iosSliderEvent",function(a){a.preventDefault()}); b.infiniteSlider&&(b.scrollbar=!1);b.scrollbar&&(""!=b.scrollbarContainer?a(b.scrollbarContainer).append("<div class = '"+C+"'><div class = '"+x+"'></div></div>"):a(G).parent().append("<div class = '"+C+"'><div class = '"+x+"'></div></div>"));if(!d())return!0;a(this).find("a").bind("mousedown",f.preventDrag);a(this).find("[onclick]").bind("click",f.preventDrag).each(function(){a(this).data("onclick",this.onclick)});E=f.calcActiveOffset(b,f.getSliderOffset(a(G),"x"),l,h,z[c],J,void 0,c);E=(E+z[c]+ J)%J;E=new f.args("load",b,G,a(G).children(":eq("+E+")"),E,E);a(A).data("args",E);if(""!=b.onSliderLoaded)b.onSliderLoaded(E);if(N[c].responsiveSlides||N[c].responsiveSlideContainer)E=Ea?"orientationchange":"resize",a(window).bind(E+".iosSliderEvent",function(){if(!d())return!0;var c=a(A).data("args");if(""!=b.onSliderResize)b.onSliderResize(c)});(b.keyboardControls||b.tabToAdvance)&&!U&&a(document).bind("keydown.iosSliderEvent",function(a){!Z&&!$&&(a=a.originalEvent);if(37==a.keyCode&&b.keyboardControls)a.preventDefault(), a=(I[c]+z[c]+J)%J,(0<a||b.infiniteSlider)&&f.changeSlide(a-1,G,B,n,x,w,h,r,p,m,F,l,L,c,R,J,k,b);else if(39==a.keyCode&&b.keyboardControls||9==a.keyCode&&b.tabToAdvance)a.preventDefault(),a=(I[c]+z[c]+J)%J,(a<l.length-1||b.infiniteSlider)&&f.changeSlide(a+1,G,B,n,x,w,h,r,p,m,F,l,L,c,R,J,k,b)});if(Da||b.desktopClickDrag){var ga=!1,ha=a(G),na=a(G),za=!1;b.scrollbarDrag&&(ha=ha.add(O),na=na.add(y));a(ha).bind("mousedown.iosSliderEvent touchstart.iosSliderEvent",function(d){if(ga)return!0;ga=!0;"touchstart"== d.type?a(na).unbind("mousedown.iosSliderEvent"):a(na).unbind("touchstart.iosSliderEvent");if(ea[c]||U)return!0;if(za=f.isUnselectable(d.target,b))return W=ga=!1,!0;sa=a(this)[0]===a(O)[0]?O:G;!Z&&!$&&(d=d.originalEvent);f.autoSlidePause(c);qa.unbind(".disableClick");"touchstart"==d.type?(eventX=d.touches[0].pageX,eventY=d.touches[0].pageY):(window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&& document.selection.empty(),eventX=d.pageX,eventY=d.pageY,ya=!0,ra=G,a(this).css({cursor:ua}));T=[0,0];K=[0,0];Y=0;W=!1;for(d=0;d<n.length;d++)clearTimeout(n[d]);d=f.getSliderOffset(G,"x");d>-1*g[c]+k+X?(d=-1*g[c]+k+X,f.setSliderOffset(a("."+x),d),a("."+x).css({width:w-m+"px"})):d<-1*q[c]&&(f.setSliderOffset(a("."+x),r-p-w),a("."+x).css({width:w-m+"px"}));T[1]=eventX;K[1]=eventY;ma=!1});a(na).bind("touchmove.iosSliderEvent mousemove.iosSliderEvent",function(d){!Z&&!$&&(d=d.originalEvent);if(ea[c]|| U||za)return!0;var n=0;if("touchmove"==d.type)eventX=d.touches[0].pageX,eventY=d.touches[0].pageY;else if(window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty(),eventX=d.pageX,eventY=d.pageY,!ya||!pa&&("undefined"!=typeof d.webkitMovementX||"undefined"!=typeof d.webkitMovementY)&&0===d.webkitMovementY&&0===d.webkitMovementX)return!0;T[0]=T[1];T[1]=eventX; Y=(T[1]-T[0])/2;K[0]=K[1];K[1]=eventY;ba=(K[1]-K[0])/2;if(!W){var s=a(this)[0]===a(O)[0]?g[c]:0;P=-1*(f.getSliderOffset(this,"x")-eventX-s);f.getSliderOffset(this,"y");var j=(I[c]+z[c]+J)%J,j=new f.args("start",b,G,a(G).children(":eq("+j+")"),j,j);a(A).data("args",j);if(""!=b.onSlideStart)b.onSlideStart(j)}if((3<ba||-3>ba)&&3>Y&&-3<Y&&"touchmove"==d.type&&!W)ta=!0;(5<Y||-5>Y)&&"touchmove"==d.type?(d.preventDefault(),W=!0):"touchmove"!=d.type&&(W=!0);if(W&&!ta){var j=f.getSliderOffset(G,"x"),s=a(this)[0]=== a(y)[0]?g[c]:k,t=a(this)[0]===a(y)[0]?(g[c]-q[c]-k)/(r-p-w):1,v=a(this)[0]===a(y)[0]?b.scrollbarElasticPullResistance:b.elasticPullResistance,C=b.snapSlideCenter&&a(this)[0]===a(y)[0]?0:k,E=b.snapSlideCenter&&a(this)[0]===a(y)[0]?k:0;"touchmove"==d.type&&(ca!=d.touches.length&&(P=-1*j+eventX),ca=d.touches.length);if(b.infiniteSlider){if(j<=-1*q[c]){var u=a(G).width();if(j<=-1*wa[c]){var D=-1*F[0];a(B).each(function(b){f.setSliderOffset(a(B)[b],D+k);b<l.length&&(l[b]=-1*D);D+=L[b]});P-=-1*l[0];g[c]= -1*l[0]+k;q[c]=g[c]+u-h;z[c]=0}else{var N=0,R=f.getSliderOffset(a(B[0]),"x");a(B).each(function(a){f.getSliderOffset(this,"x")<R&&(R=f.getSliderOffset(this,"x"),N=a)});v=g[c]+u;f.setSliderOffset(a(B)[N],v);g[c]=-1*l[1]+k;q[c]=g[c]+u-h;l.splice(0,1);l.splice(l.length,0,-1*v+k);z[c]++}}if(j>=-1*g[c]||0<=j)if(u=a(G).width(),0<=j){D=-1*F[0];a(B).each(function(b){f.setSliderOffset(a(B)[b],D+k);b<l.length&&(l[b]=-1*D);D+=L[b]});P+=-1*l[0];g[c]=-1*l[0]+k;q[c]=g[c]+u-h;for(z[c]=J;0<-1*l[0]-u+k;){var Q=0, S=f.getSliderOffset(a(B[0]),"x");a(B).each(function(a){f.getSliderOffset(this,"x")>S&&(S=f.getSliderOffset(this,"x"),Q=a)});v=g[c]-L[Q];f.setSliderOffset(a(B)[Q],v);l.splice(0,0,-1*v+k);l.splice(l.length-1,1);g[c]=-1*l[0]+k;q[c]=g[c]+u-h;z[c]--;I[c]++}}else Q=0,S=f.getSliderOffset(a(B[0]),"x"),a(B).each(function(a){f.getSliderOffset(this,"x")>S&&(S=f.getSliderOffset(this,"x"),Q=a)}),v=g[c]-L[Q],f.setSliderOffset(a(B)[Q],v),l.splice(0,0,-1*v+k),l.splice(l.length-1,1),g[c]=-1*l[0]+k,q[c]=g[c]+u-h,z[c]--}else u= a(G).width(),j>-1*g[c]+k&&(n=-1*(g[c]+-1*(P-s-eventX+C)*t-s)*v/t),j<-1*q[c]&&(n=-1*(q[c]+E+-1*(P-s-eventX)*t-s)*v/t);f.setSliderOffset(G,-1*(P-s-eventX-n)*t-s+E);b.scrollbar&&(f.showScrollbar(b,x),V=Math.floor((P-eventX-n-g[c]+C)/(q[c]-g[c]+k)*(r-p-w)*t),s=w,j>=-1*g[c]+C+u?(s=w-m- -1*V,f.setSliderOffset(a("."+x),0),a("."+x).css({width:s+"px"})):j<=-1*q[c]+1?(s=r-p-m-V,f.setSliderOffset(a("."+x),V),a("."+x).css({width:s+"px"})):f.setSliderOffset(a("."+x),V));"touchmove"==d.type&&(M=d.touches[0].pageX); d=!1;n=f.calcActiveOffset(b,-1*(P-eventX-n),l,h,z[c],J,void 0,c);u=(n+z[c]+J)%J;b.infiniteSlider?u!=aa[c]&&(d=!0):n!=I[c]&&(d=!0);if(d&&(I[c]=n,aa[c]=u,ma=!0,j=new f.args("change",b,G,a(G).children(":eq("+u+")"),u,u),a(A).data("args",j),""!=b.onSlideChange))b.onSlideChange(j)}ga=!1});var Aa=a(window);if($||Z)Aa=a(document);a(ha).bind("touchend.iosSliderEvent",function(d){a(Aa).unbind("mouseup.iosSliderEvent"+c);d=d.originalEvent;if(ea[c]||U||za)return!0;if(0!=d.touches.length)for(var g=0;g<d.touches.length;g++)d.touches[g].pageX== M&&f.slowScrollHorizontal(G,B,n,x,Y,ba,w,h,r,p,m,F,l,L,c,R,J,sa,ma,k,b);else f.slowScrollHorizontal(G,B,n,x,Y,ba,w,h,r,p,m,F,l,L,c,R,J,sa,ma,k,b);ga=ta=!1});a(Aa).bind("mouseup.iosSliderEvent"+c,function(){a(ha).unbind("touchend.iosSliderEvent");W?xa.unbind("click.disableClick").bind("click.disableClick",f.preventClick):xa.unbind("click.disableClick").bind("click.disableClick",f.enableClick);Ba.each(function(){this.onclick=function(b){if(W)return!1;a(this).data("onclick").call(this,b||window.event)}}); 1.8<=parseFloat(a().jquery)?qa.each(function(){var b=a._data(this,"events");if(void 0!=b&&void 0!=b.click&&"iosSliderEvent"!=b.click[0].namespace){if(!W)return!1;a(this).one("click.disableClick",f.preventClick);var b=a._data(this,"events").click,c=b.pop();b.splice(0,0,c)}}):1.6<=parseFloat(a().jquery)&&qa.each(function(){var b=a(this).data("events");if(void 0!=b&&void 0!=b.click&&"iosSliderEvent"!=b.click[0].namespace){if(!W)return!1;a(this).one("click.disableClick",f.preventClick);var b=a(this).data("events").click, c=b.pop();b.splice(0,0,c)}});if(!va[c]){if(U)return!0;a(ha).css({cursor:ia});ya=!1;if(void 0==ra)return!0;f.slowScrollHorizontal(ra,B,n,x,Y,ba,w,h,r,p,m,F,l,L,c,R,J,sa,ma,k,b);ra=void 0}ga=ta=!1})}})},destroy:function(d,g){void 0==g&&(g=this);return a(g).each(function(){var b=a(this),g=b.data("iosslider");if(void 0==g)return!1;void 0==d&&(d=!0);f.autoSlidePause(g.sliderNumber);va[g.sliderNumber]=!0;a(window).unbind(".iosSliderEvent-"+g.sliderNumber);a(window).unbind(".iosSliderEvent");a(document).unbind(".iosSliderEvent-"+ g.sliderNumber);a(document).unbind("keydown.iosSliderEvent");a(this).unbind(".iosSliderEvent");a(this).children(":first-child").unbind(".iosSliderEvent");a(this).children(":first-child").children().unbind(".iosSliderEvent");d&&(a(this).attr("style",""),a(this).children(":first-child").attr("style",""),a(this).children(":first-child").children().attr("style",""),a(g.settings.navSlideSelector).attr("style",""),a(g.settings.navPrevSelector).attr("style",""),a(g.settings.navNextSelector).attr("style", ""),a(g.settings.autoSlideToggleSelector).attr("style",""),a(g.settings.unselectableSelector).attr("style",""));g.settings.scrollbar&&a(".scrollbarBlock"+g.sliderNumber).remove();for(var g=da[g.sliderNumber],c=0;c<g.length;c++)clearTimeout(g[c]);b.removeData("iosslider");b.removeData("args")})},update:function(d){void 0==d&&(d=this);return a(d).each(function(){var d=a(this),b=d.data("iosslider");if(void 0==b)return!1;b.settings.startAtSlide=d.data("args").currentSlideNumber;S.destroy(!1,this);1!= b.numberOfSlides&&b.settings.infiniteSlider&&(b.settings.startAtSlide=(I[b.sliderNumber]+1+z[b.sliderNumber]+b.numberOfSlides)%b.numberOfSlides);S.init(b.settings,this);d=new f.args("update",b.settings,b.scrollerNode,a(b.scrollerNode).children(":eq("+(b.settings.startAtSlide-1)+")"),b.settings.startAtSlide-1,b.settings.startAtSlide-1);a(b.stageNode).data("args",d);if(""!=b.settings.onSliderUpdate)b.settings.onSliderUpdate(d)})},addSlide:function(d,f){return this.each(function(){var b=a(this),g=b.data("iosslider"); if(void 0==g)return!1;0==a(g.scrollerNode).children().size()?(a(g.scrollerNode).append(d),b.data("args").currentSlideNumber=1):g.settings.infiniteSlider?(1==f?a(g.scrollerNode).children(":eq(0)").before(d):a(g.scrollerNode).children(":eq("+(f-2)+")").after(d),-1>z[g.sliderNumber]&&I[g.sliderNumber]--,b.data("args").currentSlideNumber>=f&&I[g.sliderNumber]++):(f<=g.numberOfSlides?a(g.scrollerNode).children(":eq("+(f-1)+")").before(d):a(g.scrollerNode).children(":eq("+(f-2)+")").after(d),b.data("args").currentSlideNumber>= f&&b.data("args").currentSlideNumber++);b.data("iosslider").numberOfSlides++;S.update(this)})},removeSlide:function(d){return this.each(function(){var f=a(this).data("iosslider");if(void 0==f)return!1;a(f.scrollerNode).children(":eq("+(d-1)+")").remove();I[f.sliderNumber]>d-1&&I[f.sliderNumber]--;S.update(this)})},goToSlide:function(d,g){void 0==g&&(g=this);return a(g).each(function(){var b=a(this).data("iosslider");if(void 0==b)return!1;d=d>b.childrenOffsets.length?b.childrenOffsets.length-1:d-1; f.changeSlide(d,a(b.scrollerNode),a(b.slideNodes),da[b.sliderNumber],b.scrollbarClass,b.scrollbarWidth,b.stageWidth,b.scrollbarStageWidth,b.scrollMargin,b.scrollBorder,b.originalOffsets,b.childrenOffsets,b.slideNodeOuterWidths,b.sliderNumber,b.infiniteSliderWidth,b.numberOfSlides,b.centeredSlideOffset,b.settings);I[b.sliderNumber]=d})},lock:function(){return this.each(function(){var d=a(this).data("iosslider");if(void 0==d)return!1;ea[d.sliderNumber]=!0})},unlock:function(){return this.each(function(){var d= a(this).data("iosslider");if(void 0==d)return!1;ea[d.sliderNumber]=!1})},getData:function(){return this.each(function(){var d=a(this).data("iosslider");return void 0==d?!1:d})},autoSlidePause:function(){return this.each(function(){var d=a(this).data("iosslider");if(void 0==d)return!1;f.autoSlidePause(d.sliderNumber);return d})},autoSlidePlay:function(){return this.each(function(){var d=a(this).data("iosslider");if(void 0==d)return!1;N[d.sliderNumber].autoSlide=!0;f.autoSlide(a(d.scrollerNode),a(d.slideNodes), da[d.sliderNumber],d.scrollbarClass,d.scrollbarWidth,d.stageWidth,d.scrollbarStageWidth,d.scrollMargin,d.scrollBorder,d.originalOffsets,d.childrenOffsets,d.slideNodeOuterWidths,d.sliderNumber,d.infiniteSliderWidth,d.numberOfSlides,d.centeredSlideOffset,d.settings);return d})}};a.fn.iosSlider=function(d){if(S[d])return S[d].apply(this,Array.prototype.slice.call(arguments,1));if("object"===typeof d||!d)return S.init.apply(this,arguments);a.error("invalid method call!")}})(jQuery);

0 comments on commit adb0b69

Please sign in to comment.
Something went wrong with that request. Please try again.