(function(d){var n="left",m="right",c="up",u="down",b="in",v="out",k="none",q="auto",j="swipe",r="pinch",e="click",x="horizontal",s="vertical",h="all",f="start",i="move",g="end",o="cancel",a="ontouchstart" in window,w="TouchSwipe";var l={fingers:1,threshold:75,pinchThreshold:20,maxTimeThreshold:null,fingerReleaseThreshold:250,swipe:null,swipeLeft:null,swipeRight:null,swipeUp:null,swipeDown:null,swipeStatus:null,pinchIn:null,pinchOut:null,pinchStatus:null,click:null,triggerOnTouchEnd:true,triggerOnTouchLeave:false,allowPageScroll:"auto",fallbackToMouseEvents:true,excludedElements:"button, input, select, textarea, a, .noSwipe"};d.fn.swipe=function(A){var z=d(this),y=z.data(w);if(y&&typeof A==="string"){if(y[A]){return y[A].apply(this,Array.prototype.slice.call(arguments,1))}else{d.error("Method "+A+" does not exist on jQuery.swipe")}}else{if(!y&&(typeof A==="object"||!A)){return t.apply(this,arguments)}}return z};d.fn.swipe.defaults=l;d.fn.swipe.phases={PHASE_START:f,PHASE_MOVE:i,PHASE_END:g,PHASE_CANCEL:o};d.fn.swipe.directions={LEFT:n,RIGHT:m,UP:c,DOWN:u,IN:b,OUT:v};d.fn.swipe.pageScroll={NONE:k,HORIZONTAL:x,VERTICAL:s,AUTO:q};d.fn.swipe.fingers={ONE:1,TWO:2,THREE:3,ALL:h};function t(y){if(y&&(y.allowPageScroll===undefined&&(y.swipe!==undefined||y.swipeStatus!==undefined))){y.allowPageScroll=k}if(!y){y={}}y=d.extend({},d.fn.swipe.defaults,y);return this.each(function(){var A=d(this);var z=A.data(w);if(!z){z=new p(this,y);A.data(w,z)}})}function p(S,af){var aG=(a||!af.fallbackToMouseEvents),ax=aG?"touchstart":"mousedown",U=aG?"touchmove":"mousemove",au=aG?"touchend":"mouseup",D=aG?null:"mouseleave",R="touchcancel";var ac=0,N=null,ag=0,aC=0,A=0,ai=1,ay=0,aI=0;var H=d(S);var O="start";var aF=0;var ah=null;var I=0,Y=0,aB=0,aK=0;try{H.bind(ax,ar);H.bind(R,M)}catch(aD){d.error("events not supported "+ax+","+R+" on jQuery.swipe")}this.enable=function(){H.bind(ax,ar);H.bind(R,M);return H};this.disable=function(){Q();return H};this.destroy=function(){Q();H.data(w,null);return H};function ar(aN){if(X()){return}if(d(aN.target).closest(af.excludedElements,H).length>0){return}var aO=aN.originalEvent;var aM,aL=a?aO.touches[0]:aO;O=f;if(a){aF=aO.touches.length}else{aN.preventDefault()}ac=0;N=null;aI=null;ag=0;aC=0;A=0;ai=1;ay=0;ah=T();z();if(!a||(aF===af.fingers||af.fingers===h)||ao()){aJ(0,aL);I=B();if(aF==2){aJ(1,aO.touches[1]);aC=A=Z(ah[0].start,ah[1].start)}if(af.swipeStatus||af.pinchStatus){aM=aE(aO,O)}}else{aM=false}if(aM===false){O=o;aE(aO,O);return aM}else{aj(true)}}function P(aO){var aR=aO.originalEvent;if(O===g||O===o||ae()){return}var aN,aM=a?aR.touches[0]:aR;var aP=V(aM);Y=B();if(a){aF=aR.touches.length}O=i;if(aF==2){if(aC==0){aJ(1,aR.touches[1]);aC=A=Z(ah[0].start,ah[1].start)}else{V(aR.touches[1]);A=Z(ah[0].end,ah[1].end);aI=an(ah[0].end,ah[1].end)}ai=y(aC,A);ay=Math.abs(aC-A)}if((aF===af.fingers||af.fingers===h)||!a||ao()){N=aq(aP.start,aP.end);C(aO,N);ac=G(aP.start,aP.end);ag=L();if(af.swipeStatus||af.pinchStatus){aN=aE(aR,O)}if(!af.triggerOnTouchEnd||af.triggerOnTouchLeave){var aL=true;if(af.triggerOnTouchLeave){var aQ=at(this);aL=aA(aP.end,aQ)}if(!af.triggerOnTouchEnd&&aL){O=aH(i)}else{if(af.triggerOnTouchLeave&&!aL){O=aH(g)}}if(O==o||O==g){aE(aR,O)}}}else{O=o;aE(aR,O)}if(aN===false){O=o;aE(aR,O)}}function aa(aN){var aP=aN.originalEvent;if(a){if(aP.touches.length>0){av();return true}}if(ae()){aF=aK}aN.preventDefault();Y=B();if(af.triggerOnTouchEnd||(af.triggerOnTouchEnd==false&&O===i)){O=g;var aM=((aF===af.fingers||af.fingers===h)||!a);var aL=ah[0].end.x!==0;var aO=aM&&aL&&(am()||az());if(aO){aE(aP,O)}else{O=o;aE(aP,O)}}else{if(O===i){O=o;aE(aP,O)}}aj(false)}function M(){aF=0;Y=0;I=0;aC=0;A=0;ai=1;z();aj(false)}function W(aL){var aM=aL.originalEvent;if(af.triggerOnTouchLeave){O=aH(g);aE(aM,O)}}function Q(){H.unbind(ax,ar);H.unbind(R,M);H.unbind(U,P);H.unbind(au,aa);if(D){H.unbind(D,W)}aj(false)}function aH(aO){var aN=aO;var aM=ap();var aL=ad();if(!aM){aN=o}else{if(aL&&aO==i&&(!af.triggerOnTouchEnd||af.triggerOnTouchLeave)){aN=g}else{if(!aL&&aO==g&&af.triggerOnTouchLeave){aN=o}}}return aN}function aE(aN,aL){var aM=undefined;if(ab()){aM=al(aN,aL,j)}if(ao()&&aM!==false){aM=al(aN,aL,r)}if(K()&&aM!==false){aM=al(aN,aL,e)}if(aL===o){M(aN)}if(aL===g){if(a){if(aN.touches.length==0){M(aN)}}else{M(aN)}}return aM}function al(aO,aL,aN){var aM=undefined;if(aN==j){if(af.swipeStatus){aM=af.swipeStatus.call(H,aO,aL,N||null,ac||0,ag||0,aF);if(aM===false){return false}}if(aL==g&&az()){if(af.swipe){aM=af.swipe.call(H,aO,N,ac,ag,aF);if(aM===false){return false}}switch(N){case n:if(af.swipeLeft){aM=af.swipeLeft.call(H,aO,N,ac,ag,aF)}break;case m:if(af.swipeRight){aM=af.swipeRight.call(H,aO,N,ac,ag,aF)}break;case c:if(af.swipeUp){aM=af.swipeUp.call(H,aO,N,ac,ag,aF)}break;case u:if(af.swipeDown){aM=af.swipeDown.call(H,aO,N,ac,ag,aF)}break}}}if(aN==r){if(af.pinchStatus){aM=af.pinchStatus.call(H,aO,aL,aI||null,ay||0,ag||0,aF,ai);if(aM===false){return false}}if(aL==g&&am()){switch(aI){case b:if(af.pinchIn){aM=af.pinchIn.call(H,aO,aI||null,ay||0,ag||0,aF,ai)}break;case v:if(af.pinchOut){aM=af.pinchOut.call(H,aO,aI||null,ay||0,ag||0,aF,ai)}break}}}if(aN==e){if(aL===o){if(af.click&&(aF===1||!a)&&(isNaN(ac)||ac===0)){aM=af.click.call(H,aO,aO.target)}}}return aM}function ad(){if(af.threshold!==null){return ac>=af.threshold}return true}function ak(){if(af.pinchThreshold!==null){return ay>=af.pinchThreshold}return true}function ap(){var aL;if(af.maxTimeThreshold){if(ag>=af.maxTimeThreshold){aL=false}else{aL=true}}else{aL=true}return aL}function C(aL,aM){if(af.allowPageScroll===k||ao()){aL.preventDefault()}else{var aN=af.allowPageScroll===q;switch(aM){case n:if((af.swipeLeft&&aN)||(!aN&&af.allowPageScroll!=x)){aL.preventDefault()}break;case m:if((af.swipeRight&&aN)||(!aN&&af.allowPageScroll!=x)){aL.preventDefault()}break;case c:if((af.swipeUp&&aN)||(!aN&&af.allowPageScroll!=s)){aL.preventDefault()}break;case u:if((af.swipeDown&&aN)||(!aN&&af.allowPageScroll!=s)){aL.preventDefault()}break}}}function am(){return ak()}function ao(){return !!(af.pinchStatus||af.pinchIn||af.pinchOut)}function aw(){return !!(am()&&ao())}function az(){var aL=ap();var aN=ad();var aM=aN&&aL;return aM}function ab(){return !!(af.swipe||af.swipeStatus||af.swipeLeft||af.swipeRight||af.swipeUp||af.swipeDown)}function E(){return !!(az()&&ab())}function K(){return !!(af.click)}function av(){aB=B();aK=event.touches.length+1}function z(){aB=0;aK=0}function ae(){var aL=false;if(aB){var aM=B()-aB;if(aM<=af.fingerReleaseThreshold){aL=true}}return aL}function X(){return !!(H.data(w+"_intouch")===true)}function aj(aL){if(aL===true){H.bind(U,P);H.bind(au,aa);if(D){H.bind(D,W)}}else{H.unbind(U,P,false);H.unbind(au,aa,false);if(D){H.unbind(D,W,false)}}H.data(w+"_intouch",aL===true)}function aJ(aM,aL){var aN=aL.identifier!==undefined?aL.identifier:0;ah[aM].identifier=aN;ah[aM].start.x=ah[aM].end.x=aL.pageX||aL.clientX;ah[aM].start.y=ah[aM].end.y=aL.pageY||aL.clientY;return ah[aM]}function V(aL){var aN=aL.identifier!==undefined?aL.identifier:0;var aM=J(aN);aM.end.x=aL.pageX||aL.clientX;aM.end.y=aL.pageY||aL.clientY;return aM}function J(aM){for(var aL=0;aL=0)){return n}else{if((aN<=360)&&(aN>=315)){return n}else{if((aN>=135)&&(aN<=225)){return m}else{if((aN>45)&&(aN<135)){return u}else{return c}}}}}function B(){var aL=new Date();return aL.getTime()}function at(aL){aL=d(aL);var aN=aL.offset();var aM={left:aN.left,right:aN.left+aL.outerWidth(),top:aN.top,bottom:aN.top+aL.outerHeight()};return aM}function aA(aL,aM){return(aL.x>aM.left&&aL.xaM.top&&aL.y