function swipe(m,e){var f=function(){};var u=function(e){settimeout(e||f,0)};var x=navigator.useragent.tolowercase();var d={addeventlistener:!!window.addeventlistener,touch:("ontouchstart" in window)||window.documenttouch&&document instanceof documenttouch,transitions:(function(e){var g=["transitionproperty","webkittransition","moztransition","otransition","mstransition"];for(var f in g){if(e.style[g[f]]!==undefined){return true}}return false})(document.createelement("swipe"))};if(!m){return}var v=false;var c=m.children[0];var s,d,r,g;e=e||{};var k=parseint(e.startslide,10)||0;var w=e.speed||300;e.continuous=(e.continuous!==undefined)?e.continuous:true;e.disabletouch=(e.disabletouch!==undefined)?e.disabletouch:false;function n(){s=c.children;g=s.length;if(s.length<2){e.continuous=false}if(d.transitions&&e.continuous&&s.length<3){c.appendchild(s[0].clonenode(true));c.appendchild(c.children[1].clonenode(true));s=c.children;v=true}d=new array(s.length);r=m.getboundingclientrect().width||m.offsetwidth;c.style.width=(s.length*r)+"px";var f=s.length;while(f--){var e=s[f];e.style.width=r+"px";e.setattribute("data-index",f);if(d.transitions){e.style.left=(f*-r)+"px";if(x.indexof("gt-")!=-1){e.style.webkitbackfacevisibility="hidden"}q(f,k>f?-r:(kk?j:k)-h-1),r*i,0)}j=i(j);q(k,r*i,f||w);q(j,0,f||w);if(e.continuous){q(i(j-i),-(r*i),0)}}else{j=i(j);j(k*-r,j*-r,f||w)}k=j;var g=k;if(v&&(k>1)){g=k-2}u(e.callback&&e.callback(g,s[k]))}function q(e,g,f){l(e,g,f);d[e]=g}function l(f,i,h){var e=s[f];var g=e&&e.style;if(!g){return}g.webkittransitionduration=g.moztransitionduration=g.mstransitionduration=g.otransitionduration=g.transitionduration=h+"ms";if(x.indexof("gt-")!=-1){g.webkittransform="translatex("+i+"px)"}else{g.webkittransform="translate("+i+"px,0)translatez(0)"}g.mstransform=g.moztransform=g.otransform="translatex("+i+"px)"}function j(i,h,e){if(!e){c.style.left=h+"px";return}var g=+new date;var f=setinterval(function(){var k=+new date-g;if(k>e){c.style.left=h+"px";if(c){z()}var j=k;if(v&&(k>1)){j=k-2}e.transitionend&&e.transitionend.call(event,j,s[k]);clearinterval(f);return}c.style.left=(((h-i)*(math.floor((k/e)*100)/100))+i)+"px"},4)}var c=e.auto||0;var y;function z(){y=settimeout(p,c)}function t(){c=0;cleartimeout(y)}var h={};var a={};var b;var b={handleevent:function(e){switch(e.type){case"touchstart":this.start(e);break;case"touchmove":this.move(e);break;case"touchend":u(this.end(e));break;case"webkittransitionend":case"mstransitionend":case"otransitionend":case"otransitionend":case"transitionend":u(this.transitionend(e));break;case"resize":u(n.call());break}if(e.stoppropagation){e.stoppropagation()}},start:function(e){if(e.disabletouch){return}var f=e.touches[0];h={x:f.pagex,y:f.pagey,time:+new date};b=undefined;c.addeventlistener("touchmove",this,false);c.addeventlistener("touchend",this,false)},move:function(e){if(e.disabletouch){return}if(e.touches.length>1||e.scale&&e.scale!==1){return}if(e.disablescroll){e.preventdefault()}var f=e.touches[0];a={x:f.pagex-h.x,y:f.pagey-h.y};if(!e.continuous&&((!k&&a.x>0)||(k==s.length-1&&a.x<0))){return}if(typeof b=="undefined"){b=!!(b||math.abs(a.x)0||k==s.length-1&&a.x<0)?(math.abs(a.x)/r+1):1);l(k-1,a.x+d[k-1],0);l(k,a.x+d[k],0);l(k+1,a.x+d[k+1],0)}}},end:function(h){if(e.disabletouch){return}if(typeof b=="undefined"){return}var j=+new date-h.time;var g=number(j)<250&&math.abs(a.x)>20||math.abs(a.x)>r/2;var f=!k&&a.x>0||k==s.length-1&&a.x<0;if(e.continuous){f=false}var i=a.x<0;if(!b){if(g&&!f){if(i){if(e.continuous){q(i(k-1),-r,0);q(i(k+2),r,0)}else{q(k-1,-r,0)}q(k,d[k]-r,w);q(i(k+1),d[i(k+1)]-r,w);k=i(k+1)}else{if(e.continuous){q(i(k+1),r,0);q(i(k-2),-r,0)}else{q(k+1,r,0)}q(k,d[k]+r,w);q(i(k-1),d[i(k-1)]+r,w);k=i(k-1)}var e=k;if(v&&(k>1)){e=k-2}e.callback&&e.callback(e,s[k])}else{if(e.continuous){q(i(k-1),-r,w);q(k,0,w);q(i(k+1),r,w)}else{q(k-1,-r,w);q(k,0,w);q(k+1,r,w)}}}c.removeeventlistener("touchmove",b,false);c.removeeventlistener("touchend",b,false)},transitionend:function(f){if(parseint(f.target.getattribute("data-index"),10)==k){if(c){z()}var e=k;if(v&&(k>1)){e=k-2}e.transitionend&&e.transitionend.call(f,e,s[k])}}};n();if(c){z()}if(d.addeventlistener){if(d.touch){c.addeventlistener("touchstart",b,false)}if(d.transitions){c.addeventlistener("webkittransitionend",b,false);c.addeventlistener("mstransitionend",b,false);c.addeventlistener("otransitionend",b,false);c.addeventlistener("otransitionend",b,false);c.addeventlistener("transitionend",b,false)}window.addeventlistener("resize",b,false)}else{window.onresize=function(){n()}}return{setup:function(){n()},slide:function(f,e){t();a(f,e)},prev:function(){t();o()},next:function(){t();p()},getpos:function(){return k},getnumslides:function(){return g},kill:function(){t();c.style.width="auto";c.style.left=0;var f=s.length;while(f--){var e=s[f];e.style.width="100%";e.style.left=0;if(d.transitions){l(f,0,0)}}if(d.addeventlistener){c.removeeventlistener("touchstart",b,false);c.removeeventlistener("webkittransitionend",b,false);c.removeeventlistener("mstransitionend",b,false);c.removeeventlistener("otransitionend",b,false);c.removeeventlistener("otransitionend",b,false);c.removeeventlistener("transitionend",b,false);window.removeeventlistener("resize",b,false)}else{window.onresize=null}}}}if(window.jquery||window.zepto){(function(a){a.fn.swipe=function(b){return this.each(function(){a(this).data("swipe",new swipe(a(this)[0],b))})}})(window.jquery||window.zepto)};