(function(a,c,b){if(typeof define==="function"&&define.amd){define(["jquery"],function(d){b(d,a,c);return d.mobile})}else{b(a.jQuery,a,c)}}(this,document,function(c,b,a,d){(function(e,f){e.extend(e.support,{orientation:"orientation" in b&&"onorientationchange" in b})}(c));(function(i){i.event.special.throttledresize={setup:function(){i(this).bind("resize",g)},teardown:function(){i(this).unbind("resize",g)}};var h=250,g=function(){k=(new Date()).getTime();j=k-f;if(j>=h){f=k;i(this).trigger("throttledresize")}else{if(e){clearTimeout(e)}e=setTimeout(g,h-j)}},f=0,e,k,j})(c);(function(j,o){var m=j(o),l="orientationchange",f,k,g,p,n={"0":true,"180":true},i,e,h;if(j.support.orientation){i=o.innerWidth||m.width();e=o.innerHeight||m.height();h=50;g=i>e&&(i-e)>h;p=n[o.orientation];if((g&&p)||(!g&&!p)){n={"-90":true,"90":true}}}j.event.special.orientationchange=j.extend({},j.event.special.orientationchange,{setup:function(){if(j.support.orientation&&!j.event.special.orientationchange.disabled){return false}k=f();m.bind("throttledresize",q)},teardown:function(){if(j.support.orientation&&!j.event.special.orientationchange.disabled){return false}m.unbind("throttledresize",q)},add:function(r){var s=r.handler;r.handler=function(t){t.orientation=f();return s.apply(this,arguments)}}});function q(){var r=f();if(r!==k){k=r;m.trigger(l)}}j.event.special.orientationchange.orientation=f=function(){var s=true,r=a.documentElement;if(j.support.orientation){s=n[o.orientation]}else{s=r&&r.clientWidth/r.clientHeight<1.1}return s?"portrait":"landscape"};j.fn[l]=function(r){return r?this.bind(l,r):this.trigger(l)};if(j.attrFn){j.attrFn[l]=true}}(c,this));(function(B,K,j,q){var J="virtualMouseBindings",f="virtualTouchID",e="vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split(" "),A="clientX clientY pageX pageY screenX screenY".split(" "),G=B.event.mouseHooks?B.event.mouseHooks.props:[],C=B.event.props.concat(G),E={},L=0,w=0,v=0,t=false,O=[],l=false,V=false,y="addEventListener" in j,x=B(j),I=1,R=0,g,P;B.vmouse={moveDistanceThreshold:10,clickDistanceThreshold:10,resetTimerDuration:1500};function u(i){while(i&&typeof i.originalEvent!=="undefined"){i=i.originalEvent}return i}function m(X,Y){var ag=X.type,ah,af,Z,W,ad,ac,ab,aa,ae;X=B.Event(X);X.type=Y;ah=X.originalEvent;af=B.event.props;if(ag.search(/^(mouse|click)/)>-1){af=C}if(ah){for(ab=af.length,W;ab;){W=af[--ab];X[W]=ah[W]}}if(ag.search(/mouse(down|up)|click/)>-1&&!X.which){X.which=1}if(ag.search(/^touch/)!==-1){Z=u(ah);ag=Z.touches;ad=Z.changedTouches;ac=(ag&&ag.length)?ag[0]:((ad&&ad.length)?ad[0]:q);if(ac){for(aa=0,ae=A.length;aaY||Math.abs(X.pageY-v)>Y);if(t&&!W){r("vmousecancel",Z,i)}r("vmousemove",Z,i);z()}function k(Y){if(V){return}o();var i=T(Y.target),W,X;r("vmouseup",Y,i);if(!t){W=r("vclick",Y,i);if(W&&W.isDefaultPrevented()){X=u(Y).changedTouches[0];O.push({touchID:R,x:X.clientX,y:X.clientY});l=true}}r("vmouseout",Y,i);t=false;z()}function H(W){var X=B.data(W,J),i;if(X){for(i in X){if(X[i]){return true}}}return false}function Q(){}function p(i){var W=i.substr(1);return{setup:function(){if(!H(this)){B.data(this,J,{})}var X=B.data(this,J);X[i]=true;E[i]=(E[i]||0)+1;if(E[i]===1){x.bind(W,n)}B(this).bind(W,Q);if(y){E.touchstart=(E.touchstart||0)+1;if(E.touchstart===1){x.bind("touchstart",S).bind("touchend",k).bind("touchmove",h).bind("scroll",M)}}},teardown:function(){--E[i];if(!E[i]){x.unbind(W,n)}if(y){--E.touchstart;if(!E.touchstart){x.unbind("touchstart",S).unbind("touchmove",h).unbind("touchend",k).unbind("scroll",M)}}var X=B(this),Y=B.data(this,J);if(Y){Y[i]=false}X.unbind(W,Q);if(!H(this)){X.removeData(J)}}}}for(P=0;PMath.floor(r.pageY)||r.pageX===0&&Math.floor(o)>Math.floor(r.pageX)){o=o-q;s=s-p}else{if(s<(r.pageY-p)||o<(r.pageX-q)){o=r.pageX-q;s=r.pageY-p}}return{x:o,y:s}},start:function(p){var q=p.originalEvent.touches?p.originalEvent.touches[0]:p,o=h.event.special.swipe.getLocation(q);return{time:(new Date()).getTime(),coords:[o.x,o.y],origin:h(p.target)}},stop:function(p){var q=p.originalEvent.touches?p.originalEvent.touches[0]:p,o=h.event.special.swipe.getLocation(q);return{time:(new Date()).getTime(),coords:[o.x,o.y]}},handleSwipe:function(s,p,o,q){if(p.time-s.timeh.event.special.swipe.horizontalDistanceThreshold&&Math.abs(s.coords[1]-p.coords[1])p.coords[0]?"swipeleft":"swiperight";k(o,"swipe",h.Event("swipe",{target:q,swipestart:s,swipestop:p}),true);k(o,r,h.Event(r,{target:q,swipestart:s,swipestop:p}),true);return true}return false},eventInProgress:false,setup:function(){var q,o=this,r=h(o),p={};q=h.data(this,"mobile-events");if(!q){q={length:0};h.data(this,"mobile-events",q)}q.length++;q.swipe=p;p.start=function(u){if(h.event.special.swipe.eventInProgress){return}h.event.special.swipe.eventInProgress=true;var s,w=h.event.special.swipe.start(u),t=u.target,v=false;p.move=function(x){if(!w||x.isDefaultPrevented()){return}s=h.event.special.swipe.stop(x);if(!v){v=h.event.special.swipe.handleSwipe(w,s,o,t);if(v){h.event.special.swipe.eventInProgress=false}}if(Math.abs(w.coords[0]-s.coords[0])>h.event.special.swipe.scrollSupressionThreshold){x.preventDefault()}};p.stop=function(){v=true;h.event.special.swipe.eventInProgress=false;f.off(g,p.move);p.move=null};f.on(g,p.move).one(l,p.stop)};r.on(n,p.start)},teardown:function(){var p,o;p=h.data(this,"mobile-events");if(p){o=p.swipe;delete p.swipe;p.length--;if(p.length===0){h.removeData(this,"mobile-events")}}if(o){if(o.start){h(this).off(n,o.start)}if(o.move){f.off(g,o.move)}if(o.stop){f.off(l,o.stop)}}}};h.each({scrollstop:"scrollstart",taphold:"tap",swipeleft:"swipe.left",swiperight:"swipe.right"},function(p,o){h.event.special[p]={setup:function(){h(this).bind(o,h.noop)},teardown:function(){h(this).unbind(o)}}})})(c,this)}));