!function(y){y.touchyOptions={useDelegation:!1,longpress:{preventDefault:{start:!0,move:!0,end:!0},requiredTouches:1,msThresh:800,triggerStartPhase:!1,data:{startDate:null},proxyEvents:["TouchStart","TouchEnd"]},drag:{preventDefault:{start:!0,move:!0,end:!0},requiredTouches:1,msHoldThresh:100,data:{startPoint:null,startDate:null,movePoint:null,moveDate:null,held:!1},proxyEvents:["TouchStart","TouchMove","TouchEnd"]},pinch:{preventDefault:{start:!0,move:!0,end:!0},requiredTouches:2,pxThresh:0,data:{startPoint:null,startDate:null,movePoint:null,moveDate:null},proxyEvents:["TouchStart","TouchMove","GestureChange","TouchEnd"]},rotate:{preventDefault:{start:!0,move:!0,end:!0},requiredTouches:1,data:{},proxyEvents:["TouchStart","TouchMove","GestureChange","TouchEnd"]},swipe:{preventDefault:{start:!0,move:!0,end:!0},requiredTouches:1,velocityThresh:1,triggerOn:"touchmove",data:{startPoint:null,startDate:null,movePoint:null,moveDate:null},proxyEvents:["TouchStart","TouchMove","TouchEnd"]}};var r={handleTouchStart:function(t){var e=this.context,a=L(t,e);if(a){var o=t.originalEvent,r=o.targetTouches,n="touchy"+e.charAt(0).toUpperCase()+e.slice(1),s=a.data(n),i=s.settings;if(i.preventDefault.start&&o.preventDefault(),r.length===i.requiredTouches)switch(e){case"drag":S(s,r,t.timeStamp);var l=s.startPoint;a.trigger("touchy-drag",["start",a,{movePoint:l,lastMovePoint:l,startPoint:l,velocity:0}]);break;case"swipe":C(s,r,t.timeStamp);break;case"pinch":(c=k(t))&&(s.startPoint={x:c.centerX,y:c.centerY},s.startDistance=Math.sqrt(Math.pow(c.x2-c.x1,2)+Math.pow(c.y2-c.y1,2)));break;case"longpress":s.startPoint={x:r[0].pageX,y:r[0].pageY},s.startDate=t.timeStamp,i.triggerStartPhase&&a.trigger("touchy-longpress",["start",a]),s.timer=setTimeout(y.proxy(function(){a.trigger("touchy-longpress",["end",a])},this),i.msThresh);break;case"rotate":if(1===r.length)h(s,r,t.timeStamp);else{var c=k(t);s.startPoint={x:c.centerX,y:c.centerY},s.startDate=t.timeStamp}l=s.startPoint;a.trigger("touchy-rotate",["start",a,{startPoint:l,movePoint:l,lastMovePoint:l,velocity:0,degrees:0}])}}},handleTouchMove:function(t){var e=this.context,a=L(t,e);if(a){var o=t.originalEvent,r=o.targetTouches,n="touchy"+e.charAt(0).toUpperCase()+e.slice(1),s=a.data(n),i=s.settings;if(i.preventDefault.move&&o.preventDefault(),r.length===i.requiredTouches)switch(e){case"drag":S(s,r,t.timeStamp);var l=s.movePoint,c=s.lastMovePoint,u=l.x===c.x&&l.y===c.y?0:Math.sqrt(Math.pow(l.x-c.x,2)+Math.pow(l.y-c.y,2)),h=0===(m=s.moveDate-s.lastMoveDate)?0:u/m;s.held&&a.trigger("touchy-drag",["move",a,{movePoint:l,lastMovePoint:c,startPoint:s.startPoint,velocity:h}]);break;case"swipe":C(s,r,t.timeStamp),!s.swipeExecuted&&s.swiped&&"touchmove"===i.triggerOn&&(s.swipeExecuted=!0,E(s,a));break;case"pinch":if((b=k(t))&&(s.currentPoint={x:b.centerX,y:b.centerY},!Y())){var v=Math.sqrt(Math.pow(b.x2-b.x1,2)+Math.pow(b.y2-b.y1,2)),d=s.previousScale=s.scale||1,p=s.startDistance,g=s.scale=v/p;g*p>i.pxThresh&&a.trigger("touchy-pinch",[a,{scale:g,previousScale:d,currentPoint:s.currentPoint,startPoint:s.startPoint,startDistance:p}])}break;case"rotate":var y,P,m,D,f,x,M,T,w;if(c=s.lastMovePoint=s.movePoint||s.startPoint,P=s.lastMoveDate=s.moveDate||s.startDate,l=s.movePoint={x:r[0].pageX,y:r[0].pageY},y=s.moveDate=t.timeStamp,1===r.length)D=s.targetPageCoords=s.targetPageCoords||I(t.target),f=s.centerCoords=s.centerCoords||{x:D.x+.5*a.width(),y:D.y+.5*a.height()};else{var b=k(t);if(f=s.centerCoords={x:b.centerX,y:b.centerY},Y())break}x=Math.atan2(l.y-f.y,l.x-f.x),T=s.lastDegrees=s.degrees,M=s.degrees=x*(180/Math.PI),w=T?M-T:0,m=y-P,h=s.velocity=0===m?0:w/m,a.trigger("touchy-rotate",["move",a,{startPoint:s.startPoint,startDate:s.startDate,movePoint:l,lastMovePoint:c,centerCoords:f,degrees:M,degreeDelta:w,velocity:h}])}}},handleGestureChange:function(t){var e=this.context;if(a=L(t,e)){var a=y(t.target),o=t.originalEvent,r=(o.touches,"touchy"+e.charAt(0).toUpperCase()+e.slice(1)),n=a.data(r);switch(n.preventDefault.move&&o.preventDefault(),e){case"pinch":var s=n.previousScale=n.scale||1,i=n.scale=o.scale,l=n.startPoint,c=n.currentPoint||l,u=n.startDistance;i*u>n.settings.pxThresh&&a.trigger("touchy-pinch",[a,{scale:i,previousScale:s,currentPoint:c,startPoint:l,startDistance:u}]);break;case"rotate":var h=n.lastDegrees=n.degrees,v=n.degrees=o.rotation,d=h?v-h:0,p=n.moveDate-n.lastMoveDate,g=n.velocity=0===p?0:d/p;a.trigger("touchy-rotate",["move",a,{startPoint:n.startPoint,startDate:n.startDate,movePoint:n.movePoint,lastMovePoint:n.lastMovePoint,centerCoords:n.centerCoords,degrees:v,degreeDelta:d,velocity:g}])}}},handleTouchEnd:function(t){var e=this.context,a=L(t,e);if(a){var o=t.originalEvent,r="touchy"+e.charAt(0).toUpperCase()+e.slice(1),n=a.data(r),s=n.settings;switch(s.preventDefault.end&&o.preventDefault(),e){case"drag":if(n.held){var i=n.movePoint||n.startPoint,l=n.lastMovePoint||n.startPoint,c=i.x===l.x&&i.y===l.y?0:Math.sqrt(Math.pow(i.x-l.x,2)+Math.pow(i.y-l.y,2)),u=n.moveDate-n.lastMoveDate,h=0===u?0:c/u;a.trigger("touchy-drag",["end",a,{movePoint:i,lastMovePoint:l,startPoint:n.startPoint,velocity:h}])}y.extend(n,{startPoint:null,startDate:null,movePoint:null,moveDate:null,lastMovePoint:null,lastMoveDate:null,held:!1});break;case"swipe":n.swiped&&"touchend"===s.triggerOn&&E(n,a),y.extend(n,{startPoint:null,startDate:null,movePoint:null,moveDate:null,lastMovePoint:null,lastMoveDate:null,swiped:!1,swipeExecuted:!1});break;case"pinch":y.extend(n,{startPoint:null,startDistance:0,currentPoint:null,pinched:!1,scale:1,previousScale:null});break;case"longpress":clearTimeout(n.timer),y.extend(n,{startDate:null});break;case"rotate":var v=n.lastDegrees?n.degrees-n.lastDegrees:0;a.trigger("touchy-rotate",["end",a,{startPoint:n.startPoint,startDate:n.startDate,movePoint:n.movePoint,lastMovePoint:n.lastMovePoint,degrees:n.degrees,degreeDelta:v,velocity:n.velocity}]),y.extend(n,{startPoint:null,startDate:null,movePoint:null,moveDate:null,lastMovePoint:null,lastMoveDate:null,targetPageCoords:null,centerCoords:null,degrees:null,lastDegrees:null,velocity:null})}}}},S=function(t,e,a){h(t,e,a);var o=t.moveDate||t.startDate,r=a;t.held||r-o>t.settings.msHoldThresh?y.extend(t,{held:!0,lastMoveDate:o,lastMovePoint:t.movePoint&&t.movePoint.x?t.movePoint:t.startPoint,moveDate:r,movePoint:{x:e[0].pageX,y:e[0].pageY}}):y.extend(t,{held:!1,lastMoveDate:0,lastMovePoint:t.startPoint,moveDate:0,movePoint:t.startPoint})},C=function(t,e,a){h(t,e,a);var o=t.settings,r=(t.startDate,t.startPoint),n=t.moveDate||t.startDate,s=a,i={x:e[0].pageX,y:e[0].pageY},l=i.x-r.x,c=i.y-r.y,u=s-n;y.extend(t,{lastMoveDate:n,lastMovePoint:t.movePoint&&t.movePoint.x?t.movePoint:t.startPoint,moveDate:s,movePoint:i,hDistance:l,vDistance:c}),!t.swiped&&(Math.abs(l)/u>o.velocityThresh||Math.abs(c)/u>o.velocityThresh)&&(t.swiped=!0)},E=function(t,e){var a,o=t.movePoint,r=t.lastMovePoint,n=o.x===r.x&&o.y===r.y?0:Math.sqrt(Math.pow(o.x-r.x,2)+Math.pow(o.y-r.y,2)),s=t.moveDate-t.lastMoveDate,i=0===s?0:n/s,l=t.hDistance,c=t.vDistance;i>t.settings.velocityThresh&&(a=Math.abs(l)>Math.abs(c)?0