(function(e,t,n){typeof define=="function"&&define.amd?define(["jquery"],function(r){return n(r,e,t),r.mobile}):n(e.jquery,e,t)})(this,document,function(e,t,n,r){(function(e,t,n,r){function x(e){while(e&&typeof e.originalevent!="undefined")e=e.originalevent;return e}function t(t,n){var i=t.type,s,o,a,l,c,h,p,d,v;t=e.event(t),t.type=n,s=t.originalevent,o=e.event.props,i.search(/^(mouse|click)/)>-1&&(o=f);if(s)for(p=o.length,l;p;)l=o[--p],t[l]=s[l];i.search(/mouse(down|up)|click/)>-1&&!t.which&&(t.which=1);if(i.search(/^touch/)!==-1){a=x(s),i=a.touches,c=a.changedtouches,h=i&&i.length?i[0]:c&&c.length?c[0]:r;if(h)for(d=0,v=u.length;di||math.abs(n.pagey-p)>i,d&&!r&&d("vmousecancel",t,s),d("vmousemove",t,s),m()}function f(e){if(g)return;l();var t=n(e.target),n;d("vmouseup",e,t);if(!d){var r=d("vclick",e,t);r&&r.isdefaultprevented()&&(n=x(e).changedtouches[0],v.push({touchid:e,x:n.clientx,y:n.clienty}),m=!0)}d("vmouseout",e,t),d=!1,m()}function i(t){var n=e.data(t,i),r;if(n)for(r in n)if(n[r])return!0;return!1}function q(){}function r(t){var n=t.substr(1);return{setup:function(r,s){i(this)||e.data(this,i,{});var o=e.data(this,i);o[t]=!0,l[t]=(l[t]||0)+1,l[t]===1&&b.bind(n,p),e(this).bind(n,q),y&&(l.touchstart=(l.touchstart||0)+1,l.touchstart===1&&b.bind("touchstart",h).bind("touchend",f).bind("touchmove",j).bind("scroll",b))},teardown:function(r,s){--l[t],l[t]||b.unbind(n,p),y&&(--l.touchstart,l.touchstart||b.unbind("touchstart",h).unbind("touchmove",j).unbind("touchend",f).unbind("scroll",b));var o=e(this),u=e.data(this,i);u&&(u[t]=!1),o.unbind(n,q),i(this)||o.removedata(i)}}}var i="virtualmousebindings",s="virtualtouchid",o="vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split(" "),u="clientx clienty pagex pagey screenx screeny".split(" "),a=e.event.mousehooks?e.event.mousehooks.props:[],f=e.event.props.concat(a),l={},c=0,h=0,p=0,d=!1,v=[],m=!1,g=!1,y="addeventlistener"in n,b=e(n),w=1,e=0,s;e.vmouse={movedistancethreshold:10,clickdistancethreshold:10,resettimerduration:1500};for(var u=0;ue.event.special.swipe.horizontaldistancethreshold&&math.abs(t.coords[1]-n.coords[1])n.coords[0]?"swipeleft":"swiperight")},setup:function(){var t=this,n=e(t);n.bind(u,function(t){function o(t){if(!i)return;s=e.event.special.swipe.stop(t),math.abs(i.coords[0]-s.coords[0])>e.event.special.swipe.scrollsupressionthreshold&&t.preventdefault()}var i=e.event.special.swipe.start(t),s;n.bind(f,o).one(a,function(){n.unbind(f,o),i&&s&&e.event.special.swipe.handleswipe(i,s),i=s=r})})}},e.each({scrollstop:"scrollstart",taphold:"tap",swipeleft:"swipe",swiperight:"swipe"},function(t,n){e.event.special[t]={setup:function(){e(this).bind(n,e.noop)}}})}(e,this)});