(function(a){a.effects.shake=function(b){return this.queue(function(){var u=a(this),n=["position","top","bottom","left","right"];a.effects.setMode(u,b.options.mode||"effect");var t=b.options.direction||"left",s=b.options.distance||20,d=b.options.times||3,r=b.duration||b.options.duration||140;a.effects.save(u,n);u.show();a.effects.createWrapper(u);var q=t=="up"||t=="down"?"top":"left",p=t=="up"||t=="left"?"pos":"neg";t={};var o={},m={};t[q]=(p=="pos"?"-=":"+=")+s;o[q]=(p=="pos"?"+=":"-=")+s*2;m[q]=(p=="pos"?"-=":"+=")+s*2;u.animate(t,r,b.options.easing);for(s=1;s<d;s++){u.animate(o,r,b.options.easing).animate(m,r,b.options.easing)}u.animate(o,r,b.options.easing).animate(t,r/2,b.options.easing,function(){a.effects.restore(u,n);a.effects.removeWrapper(u);b.callback&&b.callback.apply(this,arguments)});u.queue("fx",function(){u.dequeue()});u.dequeue()})}})(jQuery);
