(function(a){a.effects.fold=function(b){return this.queue(function(){var c=a(this),n=["position","top","left"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.size||15,j=!!b.options.horizFirst,l=b.duration?b.duration/2:a.fx.speeds._default/2;a.effects.save(c,n);c.show();var d=a.effects.createWrapper(c).css({overflow:"hidden"}),k=e=="show"!=j,o=k?["width","height"]:["height","width"],g=k?[d.width(),d.height()]:[d.height(),d.width()],m=/([0-9]+)%/.exec(f);if(m)f=parseInt(m[1],10)/100*g[e=="hide"?0:1];e=="show"&&d.css(j?{height:0,width:f}:{height:f,width:0});var h={},i={};h[o[0]]=e=="show"?g[0]:f;i[o[1]]=e=="show"?g[1]:0;d.animate(h,l,b.options.easing).animate(i,l,b.options.easing,function(){e=="hide"&&c.hide();a.effects.restore(c,n);a.effects.removeWrapper(c);b.callback&&b.callback.apply(c[0],arguments);c.dequeue()})})}})(jQuery)