var emutouch = (function(){	var touchId = 1;	var mouseIsDown = false;	var mouse2TouchMap = {		"mouseup" : "touchend",		"mousedown" : "touchstart",		"mousemove" : "touchmove"	};	return function(e){				e.preventDefault();		e.stopPropagation();				 if (e.type == "mousedown") touchId++;		 		if (e.type == "mouseup") {			mouseIsDown = false;		}		if (e.type == "mousedown") {			mouseIsDown = true;		}				if(e.type=='mousemove' && !mouseIsDown) return;		 		var touch = {			identifier: touchId,			target: e.target,			clientX: e.clientX,			clientY: e.clientY,			pageX: e.clientX,			pageY: e.clientY,			screenX: e.screenX,			screenY: e.screenY		}				var touchEvent = document.createEvent('MouseEvents');		touchEvent.initMouseEvent(			mouse2TouchMap[e.type], 			true, 			true, 			e.view, 			e.detail, 			e.screenX, 			e.screenY, 			e.clientX, 			e.clientY, 			e.ctrlKey, 			e.altKey, 			e.shiftKey, 			e.metaKey,			0,			null		);		touchEvent.touches = [touch];				document.dispatchEvent(touchEvent);	}})();window.addEventListener('mouseup',emutouch,false);window.addEventListener('mousedown',emutouch,false);window.addEventListener('mousemove',emutouch,false);