/*
 * jQuery UI Touch Punch 0.1.2
 *
 * Copyright 2010, Dave Furfero
 * Dual licensed under the MIT or GPL Version 2 licenses.
 *
 * Depends:
 * jquery.ui.widget.js
 * jquery.ui.mouse.js
 */
(function(d){d.support.touch=typeof Touch==="object";if(!d.support.touch){return;}var b=d(document),c=d.ui.mouse.prototype,e=c._mouseInit,i;function f(k,j){var l=k.originalEvent.changedTouches[0];return d.extend(k,{type:"mouse"+j,which:1,pageX:l.pageX,pageY:l.pageY,screenX:l.screenX,screenY:l.screenY,clientX:l.clientX,clientY:l.clientY});}function a(k){if(i||k.originalEvent.touches.length>1){return;}i=true;var j=this;d(k.target).trigger(f(k,"over"));b.bind("touchmove."+j.widgetName,j._touchMove).bind("touchend."+j.widgetName,j._touchEnd).trigger("mousedown");j._mouseDown(f(k,"down"));}function g(k){var j=this;if(k.originalEvent.touches.length>1){j._touchEnd(k);}else{j._mouseMove(f(k,"move"));}}function h(k){var j=this;j._mouseUp(f(k,"up"));b.unbind("touchmove."+j.widgetName,j._touchMove).unbind("touchend."+j.widgetName,j._touchEnd);i=false;d(k.target).trigger(f(k,"out"));}c._mouseInit=function(){var j=this;j._touchStart=d.proxy(a,j);j._touchMove=d.proxy(g,j);j._touchEnd=d.proxy(h,j);j.element.bind("touchstart."+j.widgetName,j._touchStart);e.call(j);};})(jQuery);



