/*!
 * jQuery UI Effects Scale 1.10.4
 * http://jqueryui.com
 *
 * Copyright 2014 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/scale-effect/
 *
 * Depends:
 *	jquery.ui.effect.js
 */
(function($,u){$.effects.effect.puff=function(o,d){var e=$(this),m=$.effects.setMode(e,o.mode||"hide"),h=m==="hide",p=parseInt(o.percent,10)||150,f=p/100,a={height:e.height(),width:e.width(),outerHeight:e.outerHeight(),outerWidth:e.outerWidth()};$.extend(o,{effect:"scale",queue:false,fade:true,mode:m,complete:d,percent:h?p:100,from:h?a:{height:a.height*f,width:a.width*f,outerHeight:a.outerHeight*f,outerWidth:a.outerWidth*f}});e.effect(o);};$.effects.effect.scale=function(o,d){var e=$(this),a=$.extend(true,{},o),m=$.effects.setMode(e,o.mode||"effect"),p=parseInt(o.percent,10)||(parseInt(o.percent,10)===0?0:(m==="hide"?0:100)),b=o.direction||"both",c=o.origin,f={height:e.height(),width:e.width(),outerHeight:e.outerHeight(),outerWidth:e.outerWidth()},g={y:b!=="horizontal"?(p/100):1,x:b!=="vertical"?(p/100):1};a.effect="size";a.queue=false;a.complete=d;if(m!=="effect"){a.origin=c||["middle","center"];a.restore=true;}a.from=o.from||(m==="show"?{height:0,width:0,outerHeight:0,outerWidth:0}:f);a.to={height:f.height*g.y,width:f.width*g.x,outerHeight:f.outerHeight*g.y,outerWidth:f.outerWidth*g.x};if(a.fade){if(m==="show"){a.from.opacity=0;a.to.opacity=1;}if(m==="hide"){a.from.opacity=1;a.to.opacity=0;}}e.effect(a);};$.effects.effect.size=function(o,d){var a,b,f,e=$(this),p=["position","top","bottom","left","right","width","height","overflow","opacity"],c=["position","top","bottom","left","right","overflow","opacity"],g=["width","height","overflow"],h=["fontSize"],P=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],i=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],m=$.effects.setMode(e,o.mode||"effect"),r=o.restore||m!=="effect",s=o.scale||"both",j=o.origin||["middle","center"],k=e.css("position"),l=r?p:c,z={height:0,width:0,outerHeight:0,outerWidth:0};if(m==="show"){e.show();}a={height:e.height(),width:e.width(),outerHeight:e.outerHeight(),outerWidth:e.outerWidth()};if(o.mode==="toggle"&&m==="show"){e.from=o.to||z;e.to=o.from||a;}else{e.from=o.from||(m==="show"?z:a);e.to=o.to||(m==="hide"?z:a);}f={from:{y:e.from.height/a.height,x:e.from.width/a.width},to:{y:e.to.height/a.height,x:e.to.width/a.width}};if(s==="box"||s==="both"){if(f.from.y!==f.to.y){l=l.concat(P);e.from=$.effects.setTransition(e,P,f.from.y,e.from);e.to=$.effects.setTransition(e,P,f.to.y,e.to);}if(f.from.x!==f.to.x){l=l.concat(i);e.from=$.effects.setTransition(e,i,f.from.x,e.from);e.to=$.effects.setTransition(e,i,f.to.x,e.to);}}if(s==="content"||s==="both"){if(f.from.y!==f.to.y){l=l.concat(h).concat(g);e.from=$.effects.setTransition(e,h,f.from.y,e.from);e.to=$.effects.setTransition(e,h,f.to.y,e.to);}}$.effects.save(e,l);e.show();$.effects.createWrapper(e);e.css("overflow","hidden").css(e.from);if(j){b=$.effects.getBaseline(j,a);e.from.top=(a.outerHeight-e.outerHeight())*b.y;e.from.left=(a.outerWidth-e.outerWidth())*b.x;e.to.top=(a.outerHeight-e.to.outerHeight)*b.y;e.to.left=(a.outerWidth-e.to.outerWidth)*b.x;}e.css(e.from);if(s==="content"||s==="both"){P=P.concat(["marginTop","marginBottom"]).concat(h);i=i.concat(["marginLeft","marginRight"]);g=p.concat(P).concat(i);e.find("*[width]").each(function(){var n=$(this),q={height:n.height(),width:n.width(),outerHeight:n.outerHeight(),outerWidth:n.outerWidth()};if(r){$.effects.save(n,g);}n.from={height:q.height*f.from.y,width:q.width*f.from.x,outerHeight:q.outerHeight*f.from.y,outerWidth:q.outerWidth*f.from.x};n.to={height:q.height*f.to.y,width:q.width*f.to.x,outerHeight:q.height*f.to.y,outerWidth:q.width*f.to.x};if(f.from.y!==f.to.y){n.from=$.effects.setTransition(n,P,f.from.y,n.from);n.to=$.effects.setTransition(n,P,f.to.y,n.to);}if(f.from.x!==f.to.x){n.from=$.effects.setTransition(n,i,f.from.x,n.from);n.to=$.effects.setTransition(n,i,f.to.x,n.to);}n.css(n.from);n.animate(n.to,o.duration,o.easing,function(){if(r){$.effects.restore(n,g);}});});}e.animate(e.to,{queue:false,duration:o.duration,easing:o.easing,complete:function(){if(e.to.opacity===0){e.css("opacity",e.from.opacity);}if(m==="hide"){e.hide();}$.effects.restore(e,l);if(!r){if(k==="static"){e.css({position:"relative",top:e.to.top,left:e.to.left});}else{$.each(["top","left"],function(n,q){e.css(q,function(_,t){var v=parseInt(t,10),w=n?e.to.left:e.to.top;if(t==="auto"){return w+"px";}return v+w+"px";});});}}$.effects.removeWrapper(e);d();}});};})(jQuery);
