(function(d,c){d.effects.fold=function(a){return this.queue(function(){var z=d(this),t=["position","top","bottom","left","right"];var w=d.effects.setMode(z,a.options.mode||"hide");var b=a.options.size||15;var q=!(!a.options.horizFirst);var x=a.duration?a.duration/2:d.fx.speeds._default/2;d.effects.save(z,t);z.show();var A=d.effects.createWrapper(z).css({overflow:"hidden"});var v=((w=="show")!=q);var y=v?["width","height"]:["height","width"];var B=v?[A.width(),A.height()]:[A.height(),A.width()];var u=/([0-9]+)%/.exec(b);if(u){b=parseInt(u[1],10)/100*B[w=="hide"?0:1]}if(w=="show"){A.css(q?{height:0,width:b}:{height:b,width:0})}var r={},s={};r[y[0]]=w=="show"?B[0]:b;s[y[1]]=w=="show"?B[1]:0;A.animate(r,x,a.options.easing).animate(s,x,a.options.easing,function(){if(w=="hide"){z.hide()}d.effects.restore(z,t);d.effects.removeWrapper(z);if(a.callback){a.callback.apply(z[0],arguments)}z.dequeue()})})}})(jQuery);