(function(b){"function"===typeof define&&define.amd?define(["jquery","./effect"],b):b(jQuery)})(function(b){return b.effects.effect.shake=function(c,t){var a=b(this),m="position top bottom left right height width".split(" "),u=b.effects.setMode(a,c.mode||"effect"),d=c.direction||"left",e=c.distance||20,n=c.times||3,p=2*n+1,f=Math.round(c.duration/p),h="up"===d||"down"===d?"top":"left",k="up"===d||"left"===d,d={},l={},q={},g=a.queue(),r=g.length;b.effects.save(a,m);a.show();b.effects.createWrapper(a);
d[h]=(k?"-=":"+=")+e;l[h]=(k?"+=":"-=")+2*e;q[h]=(k?"-=":"+=")+2*e;a.animate(d,f,c.easing);for(e=1;e<n;e++)a.animate(l,f,c.easing).animate(q,f,c.easing);a.animate(l,f,c.easing).animate(d,f/2,c.easing).queue(function(){"hide"===u&&a.hide();b.effects.restore(a,m);b.effects.removeWrapper(a);t()});1<r&&g.splice.apply(g,[1,0].concat(g.splice(r,p+1)));a.dequeue()}});