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