(function(n){"use strict";var t={rotateText:null,fontSizeFactor:.8,maximumFontSize:null,limitingDimension:"both",horizontalAlign:"center",verticalAlign:"center",textAlign:"center",whiteSpace:"nowrap"};n.fn.bigText=function(i){return this.each(function(){var r,f,o,v,y,s,h,e,c,u;i=n.extend({},t,i);r=n(this);f=r.parent();r.css("visibility","hidden");r.css({display:"inline-block",clear:"both",float:"left","font-size":1e3*i.fontSizeFactor+"px","line-height":"1000px","white-space":i.whiteSpace,"text-align":i.textAlign,position:"relative",padding:0,margin:0,left:"50%",top:"50%"});var l={left:parseInt(f.css("padding-left")),top:parseInt(f.css("padding-top")),right:parseInt(f.css("padding-right")),bottom:parseInt(f.css("padding-bottom"))},a={width:r.outerWidth(),height:r.outerHeight()},p={};if(i.rotateText!==null){if(typeof i.rotateText!="number")throw"bigText error: rotateText value must be a number";o="rotate("+i.rotateText+"deg)";p={"-webkit-transform":o,"-ms-transform":o,"-moz-transform":o,"-o-transform":o,transform:o};r.css(p);v=Math.abs(Math.sin(i.rotateText*Math.PI/180));y=Math.abs(Math.cos(i.rotateText*Math.PI/180));a.width=r.outerWidth()*y+r.outerHeight()*v;a.height=r.outerWidth()*v+r.outerHeight()*y}s=(f.innerWidth()-l.left-l.right)/a.width;h=(f.innerHeight()-l.top-l.bottom)/a.height;i.limitingDimension.toLowerCase()==="width"?(e=Math.floor(s*1e3),f.height(e)):i.limitingDimension.toLowerCase()==="height"?e=Math.floor(h*1e3):s<h?e=Math.floor(s*1e3):s>=h&&(e=Math.floor(h*1e3));c=e*i.fontSizeFactor;i.maximumFontSize!==null&&c>i.maximumFontSize&&(c=i.maximumFontSize,e=c/i.fontSizeFactor);r.css({"font-size":Math.floor(c)+"px","line-height":Math.ceil(e)+"px","margin-bottom":"0px","margin-right":"0px"});i.limitingDimension.toLowerCase()==="height"&&f.width(r.width()+4+"px");u={};switch(i.verticalAlign.toLowerCase()){case"top":u.top="0%";break;case"bottom":u.top="100%";u["margin-top"]=Math.floor(-r.innerHeight())+"px";break;default:u["margin-top"]=Math.floor(-r.innerHeight()/2)+"px"}switch(i.horizontalAlign.toLowerCase()){case"left":u.left="0%";break;case"right":u.left="100%";u["margin-left"]=Math.floor(-r.innerWidth())+"px";break;default:u["margin-left"]=Math.floor(-r.innerWidth()/2)+"px"}r.css(u);r.css("visibility","visible")})}})(jQuery)