/*! jQuery Mobile v1.5.0-rc1 (mod by ajar) | Copyright 2010, 2013 jQuery Foundation, Inc. | jquery.org/license */ !function(t){"function"==typeof define&&define.amd?define("vmouse",["jquery"],t):t(jQuery)}(function(t){var e,n,o="virtualMouseBindings",a="virtualTouchID",u="clientX clientY pageX pageY screenX screenY".split(" "),i="vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split(" "),r="altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),c=t.event.mouseHooks?t.event.mouseHooks.props:[],s=r.concat(c),h={},l=0,d=0,v=0,f=!1,m=[],p=!1,g=!1,T="addEventListener"in document,y=t(document),b=1,D=0;function k(t){for(;t&&void 0!==t.originalEvent;)t=t.originalEvent;return t}function w(e){for(var n,a,u={};e;){for(a in n=t.data(e,o))n[a]&&(u[a]=u.hasVirtualBinding=!0);e=e.parentNode}return u}function P(){g=!0}function X(){D=0,m.length=0,p=!1,P()}function Y(){g=!1}function E(){l&&(clearTimeout(l),l=0)}function B(){E(),l=setTimeout(function(){l=0,X()},t.vmouse.resetTimerDuration)}function I(e,n,a){var i;return(a&&a[e]||!a&&function(e,n){for(var a;e;){if((a=t.data(e,o))&&(!n||a[n]))return e;e=e.parentNode}return null}(n.target,e))&&(i=function(e,n){var o,a,i,c,h,l,d,v,f,m=e.type;if((e=t.Event(e)).type=n,o=e.originalEvent,a=r,m.search(/^(mouse|click)/)>-1&&(a=s),o)for(d=a.length;d;)e[c=a[--d]]=o[c];if(m.search(/mouse(down|up)|click/)>-1&&!e.which&&(e.which=1),-1!==m.search(/^touch/)&&(m=(i=k(o)).touches,h=i.changedTouches,l=m&&m.length?m[0]:h&&h.length?h[0]:void 0))for(v=0,f=u.length;va||Math.abs(n.pageY-v)>a)&&!o&&I("vmousecancel",e,u),I("vmousemove",e,u),B()}}function S(e){if(!g&&void 0!==t.data(e.target,"lastTouchType")){P(),delete t.data(e.target).lastTouchType;var n,o,a=w(e.target);I("vmouseup",e,a),f||(n=I("vclick",e,a))&&n.isDefaultPrevented()&&(o=k(e).changedTouches[0],m.push({touchID:D,x:o.clientX,y:o.clientY}),p=!0),I("vmouseout",e,a),f=!1,B()}}function j(e){var n,a=t.data(e,o);if(a)for(n in a)if(a[n])return!0;return!1}function H(){}function L(e){var n=e.substr(1);return{setup:function(){j(this)||t.data(this,o,{}),t.data(this,o)[e]=!0,h[e]=(h[e]||0)+1,1===h[e]&&y.on(n,M),t(this).on(n,H),T&&(h.touchstart=(h.touchstart||0)+1,1===h.touchstart&&y.on("touchstart",x).on("touchend",S).on("touchmove",N).on("scroll",K))},teardown:function(){--h[e],h[e]||y.off(n,M),T&&(--h.touchstart,h.touchstart||y.off("touchstart",x).off("touchmove",N).off("touchend",S).off("scroll",K));var a=t(this),u=t.data(this,o);u&&(u[e]=!1),a.off(n,H),j(this)||a.removeData(o)}}}for(t.vmouse={moveDistanceThreshold:10,clickDistanceThreshold:10,resetTimerDuration:1500,maximumTimeBetweenTouches:100},n=0;n