if(typeof(formattedlabelpreviewer_js)=="undefined"){formattedlabelpreviewer_js=true;function DVTFormattedLabelPreviewer(b,c,a){this.eid=b;this.bParentEditor=c;this.bIsGridChart=a}DVTFormattedLabelPreviewer.SPACE=" ";DVTFormattedLabelPreviewer.COMMA=",";DVTFormattedLabelPreviewer.SEMI_COLON=";";DVTFormattedLabelPreviewer.getFormat=function(b){var e="";var a="";var h="normal";var g="bold";var f="italic";if(b){if(b.getAttribute("fontFamily")){e=e.concat(b.getAttribute("fontFamily"),DVTFormattedLabelPreviewer.COMMA,DVTFormattedLabelPreviewer.SPACE);a=a.concat("font-family:",b.getAttribute("fontFamily"),DVTFormattedLabelPreviewer.SEMI_COLON)}if(b.getAttribute("fontStyle")){var i=b.getAttribute("fontStyle");var k="";var d="";var j="";switch(i){case"regular":k=h;d=h;j="Regular";break;case"bold":k=g;d=h;j="Bold";break;case"italic":k=h;d=f;j="Italic";break;case"bold,italic":k=g;d=f;j="Bold Italic";break}e=e.concat(j,DVTFormattedLabelPreviewer.COMMA,DVTFormattedLabelPreviewer.SPACE);a=a.concat(DVTFormattedLabelPreviewer.SPACE,"font-weight:",k,DVTFormattedLabelPreviewer.SEMI_COLON,DVTFormattedLabelPreviewer.SPACE,"font-style:",d,DVTFormattedLabelPreviewer.SEMI_COLON)}if(b.getAttribute("fontSize")){var m=b.getAttribute("fontSize");if(m>100){m=100}e=e.concat(m,"px",DVTFormattedLabelPreviewer.COMMA,DVTFormattedLabelPreviewer.SPACE);a=a.concat(DVTFormattedLabelPreviewer.SPACE,"font-size:",m,"px",DVTFormattedLabelPreviewer.SEMI_COLON)}if(b.getAttribute("fontColor")){e=e.concat(b.getAttribute("fontColor"));a=a.concat(DVTFormattedLabelPreviewer.SPACE,"color:",b.getAttribute("fontColor"),DVTFormattedLabelPreviewer.SEMI_COLON)}var c=b.getAttribute("fontEffects");c=c?((c=="underline")?"underline":"none"):"none";a=a.concat(DVTFormattedLabelPreviewer.SPACE,"text-decoration:",DVTFormattedLabelPreviewer.SPACE,c,DVTFormattedLabelPreviewer.SEMI_COLON)}var l=new Object();l.style=a;l.formatStr=e;return l};DVTFormattedLabelPreviewer.previewFormattedLabel=function(c,e,b,f,i){var h=DVTChartUtils.getEditor(b);var d=h.element.selectSingleNode(e);var j=DVTFormattedLabelPreviewer.getFormat(d);var a=j.style;var g=j.formatStr;if(a.length>0){DVTFormattedLabelPreviewer.createPreviewHTML(c,b,f,i,g,a)}};DVTFormattedLabelPreviewer.createPreviewHTML=function(c,b,d,j,e,a){var g=DVTChartUtils.getEditor(b);var h=document.getElementById(c+"Td");if(g&&h){var f="";if(g.ctype!=null&&(g.ctype=="GaugeSetTitle"||g.ctype=="GaugeTitle"||g.ctype=="GaugeFooter")){var i=document.getElementById(c);f='<input id="'+c+'" type="text" name="'+g.ctype+'" style="'+a+'" value="'+i.value+'" '+(i.disabled?"disabled":"")+" > &nbsp; ";f=f.concat('<a href="javascript:void(null);" onclick="'+d+"('"+b+"', event); return false;\" >",'<img alt="" src="'+saw.answers.getImgUrl("answers/fontformat.png")+'" border="0" align="absmiddle" />',"</a>")}else{f=f.concat('<a id="'+c+'"  href="javascript:void(null);"',DVTFormattedLabelPreviewer.SPACE,'onclick="'+d+"( '"+b+"', event"+((j==null)?" ":", '"+j+"' ")+'); return false;"',DVTFormattedLabelPreviewer.SPACE,'style="'+a+'">',e,"</a>&nbsp;",'<a id="'+c+'Img" href="javascript:void(null);"',DVTFormattedLabelPreviewer.SPACE,'onclick="'+d+" ( '"+b+"', event"+((j==null)?" ":", '"+j+"' ")+'); return false;">','<img alt="" src="'+saw.answers.getImgUrl("answers/fontformat.png")+'" border="0" align="absmiddle"/>',"</a>")}var k=document.createElement("TD");k.id=h.id;h.parentNode.replaceChild(k,h);k.innerHTML=f}}};