| 3386 | }; |
| 3387 | |
| 3388 | function supportsTouchEvents() { |
| 3389 | if ('_cached' in supportsTouchEvents) { |
| 3390 | return supportsTouchEvents._cached; |
| 3391 | } |
| 3392 | if (!window.document.createTouch || !window.document.createTouchList) { |
| 3393 | supportsTouchEvents._cached = false; |
| 3394 | return false; |
| 3395 | } |
| 3396 | try { |
| 3397 | window.document.createEvent('TouchEvent'); |
| 3398 | } catch (e) { |
| 3399 | supportsTouchEvents._cached = false; |
| 3400 | return false; |
| 3401 | } |
| 3402 | supportsTouchEvents._cached = true; |
| 3403 | return true; |
| 3404 | } |
| 3405 | |
| 3406 | function createTouchEvent(element, eventType, x, y) { |
| 3407 | var evnt = new window.Event(eventType); |