(function(a){"function"===typeof define&&define.amd?define(["jquery","./effect"],a):a(jQuery)})(function(a){return a.effects.effect.fold=function(e,t){var c=a(this),h="position top bottom left right height width".split(" "),b=a.effects.setMode(c,e.mode||"hide"),g="show"===b,k="hide"===b,b=e.size||15,l=/([0-9]+)%/.exec(b),m=!!e.horizFirst,f=g!==m,n=f?["width","height"]:["height","width"],p=e.duration/2,d,q={},r={};a.effects.save(c,h);c.show();d=a.effects.createWrapper(c).css({overflow:"hidden"});f=
f?[d.width(),d.height()]:[d.height(),d.width()];l&&(b=parseInt(l[1],10)/100*f[k?0:1]);g&&d.css(m?{height:0,width:b}:{height:b,width:0});q[n[0]]=g?f[0]:b;r[n[1]]=g?f[1]:0;d.animate(q,p,e.easing).animate(r,p,e.easing,function(){k&&c.hide();a.effects.restore(c,h);a.effects.removeWrapper(c);t()})}});