/*! * jCarousel Lite - v1.9.2 - 2014-08-18 * http://kswedberg.github.com/jquery-carousel-lite/ * Copyright (c) 2014 Karl Swedberg * based on the original by Ganeshji Marwaha (gmarwaha.com) * Licensed MIT (http://kswedberg.github.com/jquery-carousel-lite/blob/master/LICENSE-MIT) */ !function(a){function b(a,b){return b.autoStop&&(b.circular?b.autoStop:Math.min(a,b.autoStop))}function c(a){this.id&&(this.id+=a)}a.jCarouselLite={version:"1.9.2",curr:0},a.fn.anim="undefined"!=typeof a.fn.velocity?a.fn.velocity:a.fn.animate,a.fn.jCarouselLite=function(d){var e=a.extend(!0,{},a.fn.jCarouselLite.defaults,d),f=Math.ceil,g=Math.abs;return this.each(function(){function d(){return n.slice(p).slice(0,G)}function h(b,c){if(v)return!1;c=c||{};var f=p,g=b>p,h="undefined"!=typeof c.speed?c.speed:e.speed,i=c.offset||0;return e.beforeStart&&e.beforeStart.call(B,d(),g),e.circular?(b>p&&b>o-G?(b-=p,p%=E,b=p+b,C.css(w,-p*u.liSize-i)):p>b&&0>b&&(p+=E,b+=E,C.css(w,-p*u.liSize-i)),p=b+b%1):(0>b?b=0:b>o-H&&(b=o-H),p=b,0===p&&e.first&&e.first.call(this,d(),g),p===o-H&&e.last&&e.last.call(this,d(),g),e.btnPrev&&e.$btnPrev.toggleClass(e.btnDisabledClass,0===p),e.btnNext&&e.$btnNext.toggleClass(e.btnDisabledClass,p===o-H)),S(p,L),a.jCarouselLite.curr=p,f!==p||c.force?(v=!0,x[w]=-(p*u.liSize),C.anim(x,h,e.easing,function(){e.afterEnd&&e.afterEnd.call(B,d(),g),v=!1}),p):(e.afterEnd&&e.afterEnd.call(B,d(),g),p)}var i,j,k,l,m,n,o,p,q,r,s,t="ontouchend"in document,u={div:{},ul:{},li:{}},v=!1,w=e.vertical?"top":"left",x={},y=e.vertical?"height":"width",z=e.vertical?"outerHeight":"outerWidth",A=this,B=a(this),C=B.find(e.containerSelector).eq(0),D=C.children(e.itemSelector),E=D.length,F=e.visible,G=f(F),H=Math.floor(F),I=Math.min(e.start,E-1),J=1,K=0,L={},M={},N={},O=e.vertical?"y":"x",P=e.vertical?"x":"y",Q=e.init.call(this,e,D);if(Q!==!1){var R=function(){i&&i.length&&(i.remove(),j.remove()),D=C.children(e.liSelector),E=D.length,i=D.slice(E-G).clone(!0).each(c),j=D.slice(0,G).clone(!0).each(c),C.prepend(i).append(j),n=C.children(e.liSelector),o=n.length};B.data("dirjc",J),B.data(w+"jc",B.css(w)),e.circular?(R(),I+=G,K=G):(n=C.children(e.liSelector),o=n.length),e.btnGo&&e.btnGo.length&&(s=a(a.isArray(e.btnGo)&&"string"==typeof e.btnGo[0]?e.btnGo.join():e.btnGo),s.each(function(b){a(this).bind("click.jc",function(a){return a.preventDefault(),h(e.circular?F+b:b)})}),L.go=1);var S=function(a,b){a=f(a),n.filter("."+e.activeClass).removeClass(e.activeClass),n.eq(a).addClass(e.activeClass);var c=(a-K)%E,d=c+H;return b.go&&(s.removeClass(e.activeClass).removeClass(e.visibleClass),s.eq(c).addClass(e.activeClass),s.slice(c,c+H).addClass(e.visibleClass),d>s.length&&s.slice(0,d-s.length).addClass(e.visibleClass)),b.pager&&(k.removeClass(e.activeClass),k.eq(f(c/F)).addClass(e.activeClass)),c};p=I,a.jCarouselLite.curr=p;var T=function(a){var b,c,d;return a?(u.div[y]="",u.li={width:"",height:""},u):(b=n[z](!0),c=b*o,d=b*F,u.div[y]=d+"px",u.ul[y]=c+"px",u.ul[w]=-(p*b)+"px",u.li={width:n.width(),height:n.height()},u.liSize=b,u)},U=function(b){var c,d,f={div:{visibility:"visible",position:"relative",zIndex:2,left:"0"},ul:{margin:"0",padding:"0",position:"relative",listStyleType:"none",zIndex:1},li:{overflow:e.vertical?"hidden":"visible","float":e.vertical?"none":"left"}};b&&(c=T(!0),B.css(c.div),C.css(c.ul),n.css(c.li)),c=T(),e.autoCSS&&a.extend(!0,c,f),e.autoWidth&&(d=parseInt(B.css(y),10),u.liSize=d/e.visible,c.li[y]=u.liSize-(n[z](!0)-parseInt(n.css(y),10)),c.ul[y]=u.liSize*o+"px",c.ul[w]=-(p*u.liSize)+"px",c.div[y]=d),e.autoCSS&&(n.css(c.li),C.css(c.ul),B.css(c.div))};U();var V=0,W=b(E,e),X="number"==typeof e.auto?e.auto:e.scroll,Y=function(){A.setAutoAdvance=setTimeout(function(){(!W||W>V)&&(J=B.data("dirjc"),h(p+J*X,{auto:!0}),V++,Y())},e.timeout)};if(a.each(["btnPrev","btnNext"],function(b,c){e[c]&&(e["$"+c]=a.isFunction(e[c])?e[c].call(B[0]):a(e[c]),e["$"+c].bind("click.jc",function(a){a.preventDefault();var c=0===b?p-e.scroll:p+e.scroll;return e.directional&&B.data("dirjc",b?1:-1),h(c)}))}),e.circular||(e.btnPrev&&0===I&&e.$btnPrev.addClass(e.btnDisabledClass),e.btnNext&&I+H>=o&&e.$btnNext.addClass(e.btnDisabledClass)),e.autoPager){l=f(E/F),k=[];for(var Z=0;l>Z;Z++)k.push('