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