_UD_="undefined";var FLIR={version:"2.0Liteb1",options:{path:"",defaultStyle:null,onreplacing:null,onreplaced:null},dpi:96,init:function(a){this.options.defaultStyle=new FLIRStyle();if(typeof a!=_UD_){for(var b in a){this.options[b]=a[b]}}this.dpi()},replace:function(c,b){if(!c||c.flirReplaced){return}if(!b||!b.cssMap){b=this.options.defaultStyle}if(typeof c=="string"){return}if(typeof c.length!=_UD_){if(c.length==0){return}for(var a=0;a<c.length;a++){this.replace(c[a],b)}return}c.flirStyle=b;if(typeof FLIR.options.onreplacing=="function"){c=FLIR.options.onreplacing(c,b)}c.innerHTML=c.innerHTML.replace(/^\s+|\s+$/g,"").replace(/<\s*(\w|\/)[^>]+>/g,"");var d=b.options.output;if((typeof document.body.style.maxHeight==_UD_)&&(c.fPNG6=(d=="png"||(d=="auto"&&FLIR.style(c,"background-color")=="transparent")))){FLIR._Rimg(c,b,true)}else{FLIR._Rimg(c,b)}if(typeof FLIR.options.onreplaced=="function"){FLIR.options.onreplaced(c,b)}},_Rimg:function(e,d,b){var a=document.createElement("IMG");var c=d.URL(e);a.alt=e.innerHTML;a.onerror=function(){e.innerHTML=a.alt};a.className="flir-image";a.style.border="none";if(b){a.src=this.options.path+"spacer.png";if(e.offsetWidth){a.style.width=e.offsetWidth+"px";a.style.height=e.offsetHeight+"px"}a.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+c+'", sizingMethod="image")'}else{a.src=c}e.innerHTML="";e.appendChild(a)},style:function(a,c){if(a.currentStyle){if(c.indexOf("-")>-1){c=c.split("-")[0]+c.split("-")[1].substr(0,1).toUpperCase()+c.split("-")[1].substr(1)}var b=a.currentStyle[c]}else{if(window.getComputedStyle){var b=document.defaultView.getComputedStyle(a,"").getPropertyValue(c)}}return b},dpi:function(){if(screen.logicalXDPI){var b=parseInt(screen.logicalXDPI)}else{var d=document.cookie.match(/<dpi>(\d+)<\/dpi>/);if(d){this.dpi=d[1];return}var c=document.createElement("DIV");c.style.position="absolute";c.style.visibility="hidden";c.style.border=c.style.padding=c.style.margin="0";c.style.height=c.style.width="1in";document.body.appendChild(c);var b=parseInt(c.offsetHeight);document.body.removeChild(c);var a=new Date();a.setDate(new Date().getDate()+365);document.cookie="dpi=<dpi>"+this.dpi+"</dpi>;expires="+a.toGMTString()+";path=/"}if(b>0){this.dpi=b}}};function FLIRStyle(a){this.options={};this.defaults={mode:"static",output:"auto",fixBaseline:false,hq:false,css:{}};this.cssMap={"background-color":"Background",color:"Color","font-family":"Font","font-size":"FontSize","line-height":"LineHeight","text-align":"Default"};for(var b in this.defaults){this.options[b]=this.defaults[b]}if(a&&typeof a.css=="string"){a.css=this.pcs(a.css)}if(typeof this.loadopts==_UD_){console.log(this)}this.loadopts(a)}FLIRStyle.prototype.loadopts=function(b){for(var c in this.cssMap){c=c.replace(/[A-Z]/g,function(d){return"-"+d.toLowerCase()});this.options.css[c]=b&&b.css&&typeof b.css[c]!=_UD_?b.css[c]:null}if(typeof b!=_UD_){for(var c in b){if(b[c]==null){continue}if(typeof this[c]!=_UD_){this[c]=b[c]}else{if(c=="css"){for(var a in b[c]){this.options[c][a]=b[c][a]}}else{this.options[c]=b[c]}}}}};FLIRStyle.prototype.pcs=function(d){var e=d.split(";");var f={};var a;for(var b=0;b<e.length;b++){if(e[b].indexOf(":")<0){continue}a=e[b].split(":");f[a[0].replace(/^\s+|\s+$/,"")]=a[1].replace(/^\s+|\s+$/,"")}return cssobj};FLIRStyle.prototype.URL=function(d,c){var a=c?c:d.innerHTML;var b=this.options.css["text-transform"];if(b==null){b=FLIR.style(d,"text-transform")}switch(b){case"capitalize":a=a.replace(/\w+/g,function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()});break;case"lowercase":a=a.toLowerCase();break;case"uppercase":a=a.toUpperCase().replace(/&[a-z0-9]+;/gi,function(e){return e.toLowerCase()});break}return FLIR.options.path+"generate.php?t="+this.enc(a,d.fPNG6)+"&h="+d.offsetHeight+"&w="+d.offsetWidth+"&c="+this.fC(d)+"&d="+FLIR.dpi+"&f="+this.ser()};FLIRStyle.prototype.enc=function(b,a){b=encodeURIComponent(b.replace(/&/g,"{*A}").replace(/\+/g,"{*P}").replace(/\(/g,"{*LP}").replace(/\)/g,"{*RP}"));if(a){b=escape(b)}return b};FLIRStyle.prototype.ser=function(){var b="";for(var a in this.options){if(a=="css"||this.options[a]==this.defaults[a]){continue}b+=',"'+a+'":"'+this.options[a].toString().replace(/"/g,"'")+'"'}return encodeURIComponent("{"+b.substr(1)+"}")};FLIRStyle.prototype.fC=function(d){var b={};for(var a in this.options.css){b[a]=this.options.css[a]}for(var a in this.cssMap){this.options.css[a]=this.get(d,a,this.cssMap[a])}var c="";for(var a in this.options.css){if(this.options.css[a]==null||typeof this.options.css[a]==_UD_){this.options.css[a]=""}c+="|"+encodeURIComponent(this.options.css[a].toString().replace(/|/g,""))}c=c.substr(1);this.options.css=b;return c};FLIRStyle.prototype.get=function(g,a,d){var c="get"+d;var e=this.options.css[a];var f=!e||e==null?FLIR.style(g,a):this.options.css[a];var b=typeof this[c]=="function"?this[c](g,f):f;return b=="normal"||b=="none"||b=="start"?"":b};FLIRStyle.prototype.getBackground=function(b,a){return this.getColor(b,a)};FLIRStyle.prototype.getFont=function(b,a){if(a.indexOf(",")){a=a.split(",")[0]}return a.replace(/['"]/g,"").toLowerCase()};FLIRStyle.prototype.getColor=function(b,a){switch(a){case"transparent":case"none":return"";default:if(a.substr(0,1)=="#"){a=a.substr(1)}return a.replace(/['"\(\) ]|rgba?/g,"").toLowerCase()}};FLIRStyle.prototype.getFontSize=function(o,val){var px=this.getMeasurement(o,val,true);var prepx=px;if("*/+-".indexOf(val[0])>-1){try{px=Math.round((parseFloat(eval(px.toString().concat(val))))*10000)/10000}catch(err){px=16}}o.flirFontSize=px;return px};FLIRStyle.prototype.getMeasurement=function(g,f,d){var c,b,a;if(f=="normal"||f=="none"){return""}if(f.indexOf("px")>-1){c=Math.round(parseFloat(f))}else{if(f.indexOf("pt")>-1){var e=parseFloat(f);c=e/(72/FLIR.dpi)}else{if((b=(f.indexOf("em")>-1))||(a=(f.indexOf("%")>-1))){if(!g.flirFontSize){var h=document.createElement("DIV");h.style.padding=h.style.border="0";h.style.position="absolute";h.style.visibility="hidden";if(d){h.style.lineHeight="100%"}h.innerHTML="FlirTest";g.appendChild(h);c=h.offsetHeight;g.removeChild(h)}else{c=g.flirFontSize}}}}return c};