public/javascripts/jq/jquery.ui.touch.js
function iPadTouchStart(event) {
	var touches = event.changedTouches,
		first = touches[0],
		type = "mouseover",
		simulatedEvent = document.createEvent("MouseEvent");
	//
	// Mouse over first - I have live events attached on mouse over
	//
	simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
                            false, false, false, false, 0, null);
	first.target.dispatchEvent(simulatedEvent);

	type = "mousedown";
	simulatedEvent = document.createEvent("MouseEvent");

	simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
                            false, false, false, false, 0, null);
	first.target.dispatchEvent(simulatedEvent);


	if (!tapValid) {
		lastTap = first.target;
		tapValid = true;
		tapTimeout = window.setTimeout("cancelTap();", 600);
		startHold(event);
	}
	else {
		window.clearTimeout(tapTimeout);

		//
		// If a double tap is still a possibility and the elements are the same
		//	Then perform a double click
		//
		if (first.target == lastTap) {
			lastTap = null;
			tapValid = false;

			type = "click";
			simulatedEvent = document.createEvent("MouseEvent");

			simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
                         	false, false, false, false, 0/*left*/, null);
			first.target.dispatchEvent(simulatedEvent);

			type = "dblclick";
			simulatedEvent = document.createEvent("MouseEvent");

			simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
                         	false, false, false, false, 0/*left*/, null);
			first.target.dispatchEvent(simulatedEvent);
		}
		else {
			lastTap = first.target;
			tapValid = true;
			tapTimeout = window.setTimeout("cancelTap();", 600);
			startHold(event);
		}
	}
}
function iPadTouchStart(event) {
	var touches = event.changedTouches,
		first = touches[0],
		type = "mouseover",
		simulatedEvent = document.createEvent("MouseEvent");
	//
	// Mouse over first - I have live events attached on mouse over
	//
	simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
                            false, false, false, false, 0, null);
	first.target.dispatchEvent(simulatedEvent);

	type = "mousedown";
	simulatedEvent = document.createEvent("MouseEvent");

	simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
                            false, false, false, false, 0, null);
	first.target.dispatchEvent(simulatedEvent);


	if (!tapValid) {
		lastTap = first.target;
		tapValid = true;
		tapTimeout = window.setTimeout("cancelTap();", 600);
		startHold(event);
	}
	else {
		window.clearTimeout(tapTimeout);

		//
		// If a double tap is still a possibility and the elements are the same
		//	Then perform a double click
		//
		if (first.target == lastTap) {
			lastTap = null;
			tapValid = false;

			type = "click";
			simulatedEvent = document.createEvent("MouseEvent");

			simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
                         	false, false, false, false, 0/*left*/, null);
			first.target.dispatchEvent(simulatedEvent);

			type = "dblclick";
			simulatedEvent = document.createEvent("MouseEvent");

			simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
                         	false, false, false, false, 0/*left*/, null);
			first.target.dispatchEvent(simulatedEvent);
		}
		else {
			lastTap = first.target;
			tapValid = true;
			tapTimeout = window.setTimeout("cancelTap();", 600);
			startHold(event);
		}
	}
}
function iPadTouchStart ( event ) { var touches = event . changedTouches , first = touches [ 0 ] , type = "mouseover" , simulatedEvent = document . createEvent ( "MouseEvent" ) ; //
 // Mouse over first - I have live events attached on mouse over
 //
 simulatedEvent . initMouseEvent ( type , true , true , window , 1 , first . screenX , first . screenY , first . clientX , first . clientY , false , false , false , false , 0 , null ) ; first . target . dispatchEvent ( simulatedEvent ) ; type = "mousedown" ; simulatedEvent = document . createEvent ( "MouseEvent" ) ; simulatedEvent . initMouseEvent ( type , true , true , window , 1 , first . screenX , first . screenY , first . clientX , first . clientY , false , false , false , false , 0 , null ) ; first . target . dispatchEvent ( simulatedEvent ) ; if ( ! tapValid ) { lastTap = first . target ; tapValid = true ; tapTimeout = window . setTimeout ( "cancelTap();" , 600 ) ; startHold ( event ) ; } else { window . clearTimeout ( tapTimeout ) ; //
 // If a double tap is still a possibility and the elements are the same
 //	Then perform a double click
 //
 if ( first . target == lastTap ) { lastTap = null ; tapValid = false ; type = "click" ; simulatedEvent = document . createEvent ( "MouseEvent" ) ; simulatedEvent . initMouseEvent ( type , true , true , window , 1 , first . screenX , first . screenY , first . clientX , first . clientY , false , false , false , false , 0 /*left*/ , null ) ; first . target . dispatchEvent ( simulatedEvent ) ; type = "dblclick" ; simulatedEvent = document . createEvent ( "MouseEvent" ) ; simulatedEvent . initMouseEvent ( type , true , true , window , 1 , first . screenX , first . screenY , first . clientX , first . clientY , false , false , false , false , 0 /*left*/ , null ) ; first . target . dispatchEvent ( simulatedEvent ) ; } else { lastTap = first . target ; tapValid = true ; tapTimeout = window . setTimeout ( "cancelTap();" , 600 ) ; startHold ( event ) ; } } }
mouse over event then mouse down
mouse over event then mouse down