/*
 * jSwipe - jQuery Plugin
 * http://plugins.jquery.com/project/swipe
 * http://www.ryanscherf.com/demos/swipe/
 *
 * Copyright (c) 2009 Ryan Scherf (www.ryanscherf.com)
 * Licensed under the MIT license
 *
 * $Date: 2009-07-14 (Tue, 14 Jul 2009) $
 * $version: 0.1.2
 * 
 * This jQuery plugin will only run on devices running Mobile Safari
 * on iPhone or iPod Touch devices running iPhone OS 2.0 or later. 
 * http://developer.apple.com/iphone/library/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html#//apple_ref/doc/uid/TP40006511-SW5
 */
(function(a){a.fn.swipe=function(b){var c={threshold:{x:30,y:10},swipeLeft:function(){alert("swiped left")},swipeRight:function(){alert("swiped right")}},b=a.extend(c,b);return this?this.each(function(){function f(a){d.x=a.targetTouches[0].pageX,d.y=a.targetTouches[0].pageY}function g(a){a.preventDefault(),e.x=a.targetTouches[0].pageX,e.y=a.targetTouches[0].pageY}function h(a){var b=d.y-e.y;b<c.threshold.y&&b>c.threshold.y*-1&&(changeX=d.x-e.x,changeX>c.threshold.x&&c.swipeLeft(),changeX<c.threshold.x*-1&&c.swipeRight())}function f(a){d.x=a.targetTouches[0].pageX,d.y=a.targetTouches[0].pageY,e.x=d.x,e.y=d.y}function i(a){}var b=a(this),d={x:0,y:0},e={x:0,y:0};this.addEventListener("touchstart",f,!1),this.addEventListener("touchmove",g,!1),this.addEventListener("touchend",h,!1),this.addEventListener("touchcancel",i,!1)}):!1}})(jQuery)
