(function(a){a.effects.shake=function(b){return this.queue(function(){var c=a(this),l=["position","top","left"],o=a.effects.setMode(c,b.options.mode||"effect"),e=b.options.direction||"left",h=b.options.distance||20,n=b.options.times||3,d=b.duration||b.options.duration||140;a.effects.save(c,l);c.show();a.effects.createWrapper(c);var j=e=="up"||e=="down"?"top":"left",i=e=="up"||e=="left"?"pos":"neg",g={},f={},k={};g[j]=(i=="pos"?"-=":"+=")+h;f[j]=(i=="pos"?"+=":"-=")+h*2;k[j]=(i=="pos"?"-=":"+=")+h*2;c.animate(g,d,b.options.easing);for(var m=1;m<n;m++)c.animate(f,d,b.options.easing).animate(k,d,b.options.easing);c.animate(f,d,b.options.easing).animate(g,d/2,b.options.easing,function(){a.effects.restore(c,l);a.effects.removeWrapper(c);b.callback&&b.callback.apply(this,arguments)});c.queue("fx",function(){c.dequeue()});c.dequeue()})}})(jQuery)