(function(a){a.effects.puff=function(b){return this.queue(function(){var c=a(this),e=a.effects.setMode(c,b.options.mode||"hide"),f=parseInt(b.options.percent,10)||150,g=f/100,d={height:c.height(),width:c.width()};a.extend(b.options,{fade:true,mode:e,percent:e=="hide"?f:100,from:e=="hide"?d:{height:d.height*g,width:d.width*g}});c.effect("scale",b.options,b.duration,b.callback);c.dequeue()})};a.effects.scale=function(b){return this.queue(function(){var c=a(this),d=a.extend(true,{},b.options),e=a.effects.setMode(c,b.options.mode||"effect"),h=parseInt(b.options.percent,10)||(parseInt(b.options.percent,10)==0?0:e=="hide"?0:100),g=b.options.direction||"both",j=b.options.origin;if(e!="effect"){d.origin=j||["middle","center"];d.restore=true}var f={height:c.height(),width:c.width()};c.from=b.options.from||(e=="show"?{height:0,width:0}:f);var i={y:g!="horizontal"?h/100:1,x:g!="vertical"?h/100:1};c.to={height:f.height*i.y,width:f.width*i.x};if(b.options.fade){if(e=="show"){c.from.opacity=0;c.to.opacity=1}if(e=="hide"){c.from.opacity=1;c.to.opacity=0}}d.from=c.from;d.to=c.to;d.mode=e;c.effect("size",d,b.duration,b.callback);c.dequeue()})};a.effects.size=function(b){return this.queue(function(){var c=a(this),f=["position","top","left","width","height","overflow","opacity"],o=["position","top","left","overflow","opacity"],m=["width","height","overflow"],l=["fontSize"],h=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],g=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=a.effects.setMode(c,b.options.mode||"effect"),k=b.options.restore||false,i=b.options.scale||"both",n=b.options.origin,e={height:c.height(),width:c.width()};c.from=b.options.from||e;c.to=b.options.to||e;if(n){var j=a.effects.getBaseline(n,e);c.from.top=(e.height-c.from.height)*j.y;c.from.left=(e.width-c.from.width)*j.x;c.to.top=(e.height-c.to.height)*j.y;c.to.left=(e.width-c.to.width)*j.x}var d={from:{y:c.from.height/e.height,x:c.from.width/e.width},to:{y:c.to.height/e.height,x:c.to.width/e.width}};if(i=="box"||i=="both"){if(d.from.y!=d.to.y){f=f.concat(h);c.from=a.effects.setTransition(c,h,d.from.y,c.from);c.to=a.effects.setTransition(c,h,d.to.y,c.to)}if(d.from.x!=d.to.x){f=f.concat(g);c.from=a.effects.setTransition(c,g,d.from.x,c.from);c.to=a.effects.setTransition(c,g,d.to.x,c.to)}}if(i=="content"||i=="both")if(d.from.y!=d.to.y){f=f.concat(l);c.from=a.effects.setTransition(c,l,d.from.y,c.from);c.to=a.effects.setTransition(c,l,d.to.y,c.to)}a.effects.save(c,k?f:o);c.show();a.effects.createWrapper(c);c.css("overflow","hidden").css(c.from);if(i=="content"||i=="both"){h=h.concat(["marginTop","marginBottom"]).concat(l);g=g.concat(["marginLeft","marginRight"]);m=f.concat(h).concat(g);c.find("*[width]").each(function(){child=a(this);k&&a.effects.save(child,m);var c={height:child.height(),width:child.width()};child.from={height:c.height*d.from.y,width:c.width*d.from.x};child.to={height:c.height*d.to.y,width:c.width*d.to.x};if(d.from.y!=d.to.y){child.from=a.effects.setTransition(child,h,d.from.y,child.from);child.to=a.effects.setTransition(child,h,d.to.y,child.to)}if(d.from.x!=d.to.x){child.from=a.effects.setTransition(child,g,d.from.x,child.from);child.to=a.effects.setTransition(child,g,d.to.x,child.to)}child.css(child.from);child.animate(child.to,b.duration,b.options.easing,function(){k&&a.effects.restore(child,m)})})}c.animate(c.to,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){c.to.opacity===0&&c.css("opacity",c.from.opacity);p=="hide"&&c.hide();a.effects.restore(c,k?f:o);a.effects.removeWrapper(c);b.callback&&b.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery)