function FDCPClient(){
this.divid="2106";
this.tmplid="3420";
this.refid="2361";
this.rt="i;";
this.cpstatus="y";
this.fdDebug=false;
this.insType="c";
if(typeof cleanprintConfiguration=="undefined"){
this.cpc=null;
}else{
this.cpc=cleanprintConfiguration;
}
this.escCom=function(st){
st=new st.constructor(st);
st=st.replace(/:/g,"::");
st=st.replace(/,/g,":,");
return st;
};
this.getSegment=function(){
var _2=window.location.href;
var _3="Other";
var _4="Other";
var r=new RegExp(".*[/]{2}[^/]*[/]");
_2=_2.replace(r,"");
r=new RegExp("([^/]+).*$");
_3=_2.replace(r,"$1");
r=new RegExp("([^/]+/){2}([^/]+).*$");
_4=_2.replace(r,"$1");
r=new RegExp("/");
_4=_4.replace(r,"");
if(_4=="articles"){
_4="Other";
}
return this.escCom(_3)+","+this.escCom(_4);
};
this.getPFF=function(){
var _6="0";
return _6;
};
this.getVR=function(){
var ph="";
return {ph:ph};
};
this.getCfg=function(_8,_9){
if(this.cpc!=null&&typeof this.cpc[_8]!="undefined"){
return this.cpc[_8];
}
return _9;
};
this.getcpStat=function(){
return this.getCfg("cpStatus",this.cpstatus);
};
this.getDiv=function(){
return this.getCfg("divisionId",this.divid);
};
this.getTmpl=function(){
return this.getCfg("templateId",this.tmplid);
};
this.getRfmt=function(){
return this.getCfg("templateId",this.refid);
};
this.getTPath=function(){
return this.getCfg("tPath","/cp/t");
};
this.getLPath=function(){
return this.getCfg("lPath","/cp/l");
};
this.getPCTag=function(){
return this.getCfg("pcTag","span");
};
this.getPCEndTag=function(){
return this.getCfg("pcEndTag","span");
};
this.getTO=function(){
return this.getCfg("timeout",10000);
};
this.getFDDebug=function(){
return this.getCfg("fdDebug",this.fdDebug);
};
this.getIDAttribute=function(){
return this.getCfg("pcIDAttr","fd-id");
};
this.getEndAttribute=function(){
return this.getCfg("pcEndAttr","fd-type");
};
this.getStartAttribute=function(){
return this.getCfg("pcStartAttr","fd-type");
};
this.getRType=function(){
return this.rt;
};
}
function FormatDynamicsPT(_a){
this.clnt=_a;
this.pcol="ht"+"tp:"+"//";
this.cstr="cleanprint.net/pt/t/";
this.dtstr=(new Date()).getTime();
this.div="&d="+this.clnt.getDiv();
this.ua="&a="+escape(navigator.appName+" "+navigator.userAgent);
this.seg="&s="+escape(this.clnt.getSegment());
this.ustr="&u="+escape(window.location.href);
this.pf="&p="+this.clnt.getPFF();
this.version="&q=1.1";
this.rtype="&rt="+this.clnt.getRType();
this.qstr=this.div+this.ua+this.seg+this.ustr+this.pf+this.version;
this.turl=this.pcol+this.cstr+this.dtstr+"?"+this.qstr;
this.pthosts="formatdynamics.com,cleanprint.net";
this.isPtCss=function(_b){
var _c=this.pthosts.split(",");
for(var i=0;i<_c.length;i++){
if(_b.indexOf(_c[i])!=-1){
return true;
}
}
return false;
};
this.changePrintStyleSheet=function(){
for(i=0;i<document.styleSheets.length;i++){
try{
var _e=document.styleSheets[i];
var _f=navigator.userAgent.toLowerCase();
if((navigator.appName.indexOf("Netscape")!=-1||_f.indexOf("firefox")!=-1||_f.indexOf("safari")!=-1)&&this.isPtCss(_e.cssRules[0].style.content)){
_e.cssRules[0].style.content="url("+this.turl+");";
break;
}else{
if(this.isPtCss(_e.cssRules[0].style.getPropertyValue("content"))){
if(navigator.appName.indexOf("Opera")!=-1){
_e.deleteRule(0);
}else{
if(navigator.appName.indexOf("Konqueror")==-1){
_e.cssRules[0].style.setProperty("content","url("+this.turl+")",null);
}
}
break;
}
}
}
catch(err){
}
}
};
this.getFDImage=function(){
if(this.clnt.getRType()=="s"){
var hs=document.documentElement.getElementsByTagName("head");
var h=null;
if(hs&&hs.length>0){
h=hs[0];
var _12=document.createElement("script");
_12.type="text/javascript";
_12.src=this.turl+"&rnd="+Math.random();
}
}else{
var _13=new Image();
_13.src=this.turl;
}
};
}
function FDCPBridge(_14){
this.count=0;
this.ifc=null;
this.oform;
this.tid=0;
this.fdcp=_14.fdcp;
this.pcallback=null;
this.fd_div_id="fd_page_main";
this.rmEl=new Array();
this.st=new Array();
this.nonescnames=["d","p","r","q","bn","bv"];
this.doesc=function(_15){
oloop:
for(var x in _15){
for(var n=0;n<this.nonescnames.length;n++){
if(x==this.nonescnames[n]){
continue oloop;
}
}
_15[x]=escape(_15[x]);
}
};
this.cleanPrint=function(_18,_19,_1a){
if(this.fdcp.clt.getFDDebug()){
alert("DocDomain : ["+document.domain+"]");
}
this.pcallback=_1a;
if(this.fdcp.browserDetect.browser=="Explorer"){
if(this.fdcp.clt.getFDDebug()){
alert("IE Printing");
}
window.print();
this.pcallback(true);
return;
}
if(typeof this.ifc!="undefined"&&this.ifc!=null){
document.body.removeChild(this.ifc);
document.body.removeChild(this.oform);
}
var _1b=this.fdcp.getCpUrl();
var _1c="fDContentFrame";
this.ifc=document.createElement("iframe");
this.ifc.setAttribute("src","about:blank");
this.ifc.setAttribute("id",_1c);
this.ifc.setAttribute("NAME",_1c);
this.ifc.setAttribute("loaded",false);
this.ifc.onload=function(){
loaded=true;
};
this.ifc.style.width="0px";
this.ifc.style.height="0px";
this.ifc.style.border="0px";
document.body.appendChild(this.ifc);
if(self.frames[_1c].name!=_1c){
self.frames[_1c].name=_1c;
}
this.oform=document.createElement("form");
document.body.appendChild(this.oform);
this.oform.action=_1b;
this.oform.name="FDForm";
this.oform.method="post";
this.oform.target=_1c;
for(var k in _18){
var pc=document.createElement("input");
pc.type="hidden";
pc.name=k;
pc.value=_18[k];
this.oform.appendChild(pc);
}
this.count=0;
if(this.fdcp.clt.getFDDebug()){
alert("CP Submit");
}
this.oform.submit();
this.tid=setInterval(function(){
this.fdcp.bridge.checkcontent();
},1000);
};
this.log=function(_1f,_20,url,_22){
var _23="rtype=log&";
_23+="LOG_LEVEL="+_1f+"&";
_23+="LOG_MSG="+_20+"&";
if(typeof _22!="undefined"&&_22!=null){
for(var p in _22){
_23+="&"+p+"="+_22[p];
}
}
if(typeof Ajax=="undefined"){
return;
}
if(typeof Prototype!="undefined"){
myAjax=new Ajax.Request(this.fdcp.getCpUrl(),{method:"post",asynchronous:true,postBody:_23});
}else{
myAjax=new Ajax(this.fdcp.getCpUrl(),{method:"post",async:true,postBody:_23}).request();
}
};
this.checkcontent=function(){
try{
if(this.count<10){
if(this.ifc!=null&&typeof this.ifc.contentDocument!="undefined"){
if(typeof this.ifc.contentDocument.forms["EOC"]!="undefined"){
clearInterval(this.tid);
this.fdcp.enPt(false);
if(this.fdcp.clt.getFDDebug()){
alert("CP Content Pass - Print");
}
this.ifc.contentWindow.print();
this.fdcp.enPt(true);
this.pcallback(true);
return true;
}else{
this.count=this.count+1;
}
}else{
this.count=this.count+1;
}
}else{
clearInterval(this.tid);
this.pcallback(false);
return false;
}
}
catch(e){
if(this.fdcp.clt.getFDDebug()){
alert("CP Content Fail : ["+e.message+"]");
}
this.count=10;
clearInterval(this.tid);
this.pcallback(false);
}
};
this.removeelements=function(){
var _25=new RegExp("^(?:(http[s]?)://([^/:]+)(:[0-9]+)?)?(.*)");
var _26=this.fdcp.getCpUrl();
var _27=_25.exec(_26);
if(_27==null){
return false;
}
if(_27[2]!=""){
var d=_25.exec(window.location);
if(_27[1]+_27[2]+_27[3]!=d[1]+d[2]+d[3]){
return false;
}
}
var _29=this.fdcp.getCpPostData();
if(_29==null){
if(this.fdcp.clt.getFDDebug()){
alert("CP Content Fail");
}
return false;
}else{
if(this.fdcp.clt.getFDDebug()){
alert("CP Content Pass");
}
}
var _2a="";
this.doesc(_29);
for(var x in _29){
_2a+=x+"="+_29[x]+"&";
}
var _2c;
if(typeof Ajax=="undefined"){
return false;
}
if(typeof Prototype!="undefined"){
_2c=new Ajax.Request(this.fdcp.getCpUrl(),{method:"post",asynchronous:false,postBody:_2a});
}else{
_2c=new Ajax(this.fdcp.getCpUrl(),{method:"post",async:false,postBody:_2a}).request();
}
var _2d="";
if(_2c!=undefined){
if(_2c.transport.status==200){
var _2e=document.getElementById(this.fd_div_id);
if(_2e!=null){
this.togEl(true);
_2e.style.display="block";
_2e.innerHTML=_2c.transport.responseText;
}
}
}
};
this.revertback=function(){
var _2f=document.getElementById(this.fd_div_id);
if(_2f!=null){
_2f.innerHTML="";
_2f.style.display="none";
}
this.togEl(false);
};
this.togEl=function(bp){
var d=document;
var _32=d.body;
if(bp){
var i=0;
for(i=0;i<_32.childNodes.length;i++){
if(typeof _32.childNodes[i].id!="undefined"&&_32.childNodes[i].id==this.fd_div_id){
continue;
}
this.rmEl.push(_32.childNodes[i]);
}
for(i=0;i<this.rmEl.length;i++){
_32.removeChild(this.rmEl[i]);
}
this.st=[];
if(d.styleSheets){
var ss;
for(var i=0;i<d.styleSheets.length;i++){
ss=d.styleSheets[i];
if(this.fdcp.clt.cpc.stylesheets!=undefined){
var _35=false;
for(var cps=0;cps<this.fdcp.clt.cpc.stylesheets.length;cps++){
if(ss.href==this.fdcp.clt.cpc.stylesheets[cps]){
_35=true;
break;
}
}
if(!_35){
if(ss.disabled==false){
ss.disabled=true;
this.st.push(ss);
}
}
}else{
if(ss.disabled==false){
ss.disabled=true;
this.st.push(ss);
}
}
}
}
}else{
for(var i=0;i<this.rmEl.length;i++){
_32.appendChild(this.rmEl[i]);
}
this.rmEl.length=0;
for(var i=0;i<this.st.length;i++){
this.st[i].disabled=false;
}
}
};
this.loadHandler=function(_37){
if(navigator.appName.indexOf("Microsoft")!=-1&&parseInt(navigator.appVersion)>=4&&navigator.userAgent.indexOf("Windows")!=-1){
if(document.body!=null){
var div=document.createElement("div");
div.setAttribute("id",this.fd_div_id);
div.style["display"]="none";
document.body.appendChild(div);
div.innerHTML="FD HIDDEN DIV";
}
if(_37.clt.cpc!=null&&_37.clt.getcpStat()=="y"){
window.attachEvent("onbeforeprint",function(){
_37.bridge.removeelements();
});
window.attachEvent("onafterprint",function(){
_37.bridge.revertback();
});
}
}
if(typeof Ajax=="undefined"){
var _39=this.fdcp.clt.getCfg("ajaxlib");
if(typeof _39=="undefined"||_39==null){
return;
}
var e=document.createElement("script");
e.src=_39;
e.type="text/javascript";
document.getElementsByTagName("head")[0].appendChild(e);
}
};
}
function FDCPUrl(_3b){
return fdcp.linkPrintHandler(_3b);
}
function FDCP(){
this.clt=new FDCPClient();
this.bridge=new FDCPBridge({fdcp:this});
this.fdser=new FDSerializer(this.clt);
this.tstr=this.clt.getTPath();
this.logUrl=this.clt.getLPath();
this.pfLink=null;
this.linkClicked=false;
this.fdpt=null;
if(this.clt.getFDDebug()){
alert("TPath : ["+this.clt.getTPath()+"] Tmpl : ["+this.clt.getTmpl()+"] Div : ["+this.clt.getDiv()+"]");
}
if(this.clt.insType=="c"){
this.fdpt=new FormatDynamicsPT(this.clt);
}
this.cpEn=function(){
return fdcp.clt.cpc!=null&&fdcp.clt.getcpStat()=="y";
};
this.browserSupported=function(){
if(this.browserDetect.browser=="Opera"){
return false;
}else{
if((this.browserDetect.browser=="Safari")&&(this.browserDetect.OS=="Windows")){
return false;
}else{
return true;
}
}
};
this.getCpUrl=function(){
return this.tstr+"?"+(new Date()).getTime();
};
this.linkPrintHandler=function(_3c){
if(_3c!=undefined){
this.pfLink=_3c;
}
if(this.cpEn()==false||!this.browserSupported()){
this.CPFailover(false);
return true;
}
try{
if(fdcp.linkClicked!=true){
fdcp.linkClicked=true;
var _3d=this.getCpPostData();
if(_3d!=null){
if(this.clt.getFDDebug()){
alert("CPPostData - Pass");
}
this.bridge.cleanPrint(_3d,this.clt.getTO(),function(_3e){
fdcp.CPFailover(_3e);
});
}else{
if(this.clt.getFDDebug()){
alert("CPPostData - Fail");
}
this.CPFailover(false);
}
}
}
catch(e){
if(this.clt.getFDDebug()){
alert("CPPostData - Fail");
}
fdcp.CPFailover(false);
}
return true;
};
this.getCpPostData=function(){
if(typeof this.clt.getDiv()=="undefined"||this.clt.getDiv()==null||this.clt.getDiv().length==0){
this.bridge.log("ERROR","No division defined",this.logUrl);
return null;
}
if(typeof this.clt.getSegment()=="undefined"||this.clt.getSegment()==null){
this.log("ERROR","No segment defined",this.logUrl);
return null;
}
var pc=null;
try{
pc=this.getPC();
}
catch(e){
this.log("ERROR","Error parsing primary content.",this.logUrl);
return null;
}
if(pc!=null&&pc.length==0){
pc=null;
}
var _40=null;
try{
_40=this.getImages();
}
catch(e){
this.log("ERROR","Error parsing for image data.",this.logUrl);
return null;
}
var _41=this.clt.getTmpl();
if(typeof _41=="undefined"||_41==null||_41.length==0){
pc="";
this.tmpl="";
}
var _42={d:this.clt.getDiv(),a:navigator.appName+" "+navigator.userAgent,s:this.clt.getSegment(),u:window.location.href,p:this.clt.getPFF(),r:this.clt.getRfmt(),q:"1.0",bn:this.browserDetect.browser,bv:this.browserDetect.version,template:_41,ci:_40};
if(pc!=null){
_42.pc=pc;
}
var qp=this.clt.getVR();
if(typeof qp!="undefined"&&qp!=null){
for(var ki in qp){
_42[ki]=qp[ki];
}
}
return _42;
};
this.getPC=function(){
var str=new String();
var pc=new Object();
var _47="";
var _48=new Object();
var _49=null;
var _4a=new String("");
var _4b=document.getElementsByTagName(this.clt.getPCTag());
var _4c=this.clt.getPCEndTag();
var _4d=this.clt.getIDAttribute();
var _4e=this.clt.getEndAttribute();
var _4f=this.clt.getStartAttribute();
var _50="false";
pc["default"]=new Array();
for(var m=0;m<_4b.length;m++){
_4b[m].processing_id=m;
if(_4b[m].getAttribute(_4d)!=null){
_4b[m].setAttribute("fd_id",_4b[m].getAttribute(_4d));
}
}
for(var m=0;m<_4b.length;m++){
if((_4b[m].getAttribute(_4e)==null||typeof _4b[m].getAttribute(_4e)=="undefined")&&(_4b[m].getAttribute(_4f)==null||typeof _4b[m].getAttribute(_4f)=="undefined")){
continue;
}else{
if(_4b[m].nodeName.toLowerCase()==_4c&&(_4b[m].getAttribute(_4e)!=null||typeof _4b[m].getAttribute(_4e)!="undefined")&&_4b[m].getAttribute(_4e)=="end"){
continue;
}
}
_47=_4b[m].processing_id;
if(_4b[m].getAttribute("fd_id")!=null&&typeof _4b[m].getAttribute("fd_id")!="undefined"&&_4b[m].getAttribute("fd_id").length>0){
if(typeof pc[_4b[m].getAttribute("fd_id")]=="undefined"||pc[_4b[m].getAttribute("fd_id")]==null){
pc[_4b[m].getAttribute("fd_id")]=new Array();
_49=pc[_4b[m].getAttribute("fd_id")];
}else{
_49=pc[_4b[m].getAttribute("fd_id")];
}
}else{
_49=pc["default"];
}
if(typeof _4b[m].getAttribute("inlineDiv")!="undefined"&&_4b[m].getAttribute("inlineDiv")!=null){
if(_4b[m].getAttribute("inlineDiv")=="false"){
_50="true";
}else{
_50="false";
}
}else{
_50="false";
}
var _52;
var _53=false;
try{
_52=_4b[m].nextSibling;
}
catch(e){
_53=true;
}
try{
var _54="";
while(_53!=true){
if(_52==null||typeof _52=="undefined"){
_4c=true;
break;
}
if(_52.nodeName.toLowerCase()==_4c){
if(_52.getAttribute(_4e)!=null&&typeof _52.getAttribute(_4e)!="undefined"){
this.fdser.newpg(_49);
_53=true;
break;
}
}
try{
if(typeof _48[_47]=="undefined"||_48[_47]==null){
if(_54=="P"&&_52.nodeType==3){
this.fdser.newpg(_49);
}
_54=_52.nodeName;
this.fdser.serializeNode(_52,_49,_48,_50);
try{
_52=_52.nextSibling;
}
catch(e){
_53=true;
break;
}
}
}
catch(e){
_53=true;
break;
}
}
}
catch(e){
}
}
var _55=0;
for(var key in pc){
_4a+="<subcontent content_id=\""+key+"\"><paragraph>";
for(var i=0;i<pc[key].length;i++){
_4a+=pc[key][i];
_55++;
}
_4a+="</paragraph></subcontent>";
}
if(_55==0){
return null;
}else{
if(this.clt.getFDDebug()){
alert("ContentCount : ["+_55+"]");
}
}
return "<content>"+_4a+"</content>";
};
this.getImages=function(){
var _58=new Array();
var _59="<images>";
if(typeof fdImages!="undefined"){
for(var n=0;n<fdImages.length;n++){
var img=document.getElementById(fdImages[n]);
if(img!=null){
this.fdser.serializeNode(img,_58,false);
}
}
for(var i=0;i<_58.length;i++){
_59+=_58[i];
}
}
_59+="</images>";
return _59;
};
this.enPt=function(_5d){
if(typeof formatDynamicsPT!="undefined"){
for(i=0;i<document.styleSheets.length;i++){
try{
var _5e=document.styleSheets[i];
if(navigator.appName.indexOf("Netscape")!=-1&&formatDynamicsPT.isPtCss(_5e.cssRules[0].style.content)){
_5e.disabled=!_5d;
break;
}
}
catch(e){
}
}
}
};
this.CPFailover=function(_5f){
this.linkClicked=false;
if(_5f==false){
if(this.pfLink!=null){
var _60=this.clt.getCfg("pfType",null);
if(_60==null||_60.toLowerCase()=="replace"){
window.open(this.pfLink,"_self");
return false;
}else{
window.open(this.pfLink);
return false;
}
}
window.print();
}
};
this.browserDetect={init:function(){
this.browser=this.searchString(this.dataBrowser)||"An unknown browser";
this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";
this.OS=this.searchString(this.dataOS)||"an unknown OS";
},searchString:function(_61){
for(var i=0;i<_61.length;i++){
var _63=_61[i].string;
var _64=_61[i].prop;
this.versionSearchString=_61[i].versionSearch||_61[i].identity;
if(_63){
if(_63.indexOf(_61[i].subString)!=-1){
return _61[i].identity;
}
}else{
if(_64){
return _61[i].identity;
}
}
}
},searchVersion:function(_65){
var _66=_65.indexOf(this.versionSearchString);
if(_66==-1){
return;
}
return parseFloat(_65.substring(_66+this.versionSearchString.length+1));
},dataBrowser:[{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]};
this.loadHandler=function(){
var _67=this.browserDetect.browser=="Explorer"&&this.browserDetect.OS=="Windows";
if(!this.cpEn()){
if(_67&&this.browserDetect.version>=4&&this.clt.insType=="c"){
window.attachEvent("onbeforeprint",function(){
fdcp.fdpt.getFDImage();
});
}
}else{
fdcp.bridge.loadHandler(this);
}
if(!_67&&this.clt.insType=="c"){
fdcp.fdpt.changePrintStyleSheet();
}
};
this.browserDetect.init();
}
var fdcp=new FDCP();
if(typeof FDCPLoader!="undefined"){
fdcp.loadHandler();
}else{
if(window.addEventListener){
window.addEventListener("load",function(){
fdcp.loadHandler();
},false);
}else{
if(window.attachEvent){
window.attachEvent("onload",function(){
fdcp.loadHandler();
});
}
}
}
function FDSerializer(_68){
this.fdclient=_68;
this._bxs="border-style";
this._bbs="border-bottom-style";
this._bts="border-top-style";
this._bls="border-left-style";
this._brs="border-right-style";
this._bxw="border-width";
this._bbw="border-bottom-width";
this._btw="border-top-width";
this._blw="border-left-width";
this._brw="border-right-width";
this._bxc="border-color";
this._bbc="border-bottom-color";
this._btc="border-top-color";
this._blc="border-left-color";
this._brc="border-right-color";
this._ffam="font-family";
this._fsiz="font-size";
this._fwei="font-weight";
this._fsty="font-style";
this._fcol="color";
this._bgc="background-color";
this._bgi="background-image";
this._bgr="background-repeat";
this._mta="text-align";
this._brcl="border-collapse";
this._brsp="border-spacing";
this.sm=new Array();
this.sm[this._bxs]="borderStyle";
this.sm[this._bbs]="borderBottomStyle";
this.sm[this._bts]="borderTopStyle";
this.sm[this._bls]="borderLeftStyle";
this.sm[this._brs]="borderRightStyle";
this.sm[this._bxw]="borderWidth";
this.sm[this._bbw]="borderBottomWidth";
this.sm[this._btw]="borderTopWidth";
this.sm[this._blw]="borderLeftWidth";
this.sm[this._brw]="borderRightWidth";
this.sm[this._bxc]="borderColor";
this.sm[this._bbc]="borderBottomColor";
this.sm[this._btc]="borderTopColor";
this.sm[this._blc]="borderLeftColor";
this.sm[this._brc]="borderRightColor";
this.sm[this._ffam]="fontFamily";
this.sm[this._fsiz]="fontSize";
this.sm[this._fwei]="fontWeight";
this.sm[this._fsty]="fontStyle";
this.sm[this._fcol]="color";
this.sm[this._bgc]="backgroundColor";
this.sm[this._bgi]="backgroundImage";
this.sm[this._bgr]="backgroundRepeat";
this.sm[this._mta]="textAlign";
this.sm[this._brcl]="borderCollapse";
this.sm[this._brsp]="borderSpacing";
this.sz=new Array();
this.sz["xx-small"]="8pt";
this.sz["x-small"]="10pt";
this.sz["small"]="12pt";
this.sz["medium"]="14pt";
this.sz["large"]="18pt";
this.sz["x-large"]="24pt";
this.sz["xx-large"]="35pt";
this.sz["auto"]="10pt";
this.text_only_state={off:0,on:1,once:2};
this.getHeadingLevel=function(_69){
if(_69=="H1"){
return "24pt";
}else{
if(_69=="H2"){
return "18pt";
}else{
if(_69=="H3"){
return "14pt";
}else{
if(_69=="H4"){
return "12pt";
}else{
if(_69=="H5"){
return "10pt";
}else{
if(_69=="H6"){
return "8pt";
}else{
return "12pt";
}
}
}
}
}
}
};
this.translateStyle=function(_6a){
var v=this.sm[_6a];
if(v){
return v;
}
return _6a;
};
this.isMT=function(val){
return val==null||typeof val=="undefined"||val=="";
};
this.isRelFont=function(sz){
return sz.indexOf("%")>0||sz.indexOf("em")>0||sz.indexOf("ex")>0;
};
this.getStyleValue=function(_6e,_6f,_70){
var _71=this.translateStyle(_6f);
if(typeof _70!="undefined"&&_70==true){
if(_6e.style[_71].length>0){
return _6e.style[_71];
}else{
return null;
}
}
if(_6f=="width"&&_6e.offsetWidth){
return _6e.offsetWidth;
}
if(_6f=="height"&&_6e.offsetHeight){
return _6e.offsetHeight;
}
if(_6e.currentStyle&&fdcp.browserDetect.browser=="Explorer"){
return _6e.currentStyle[_71];
}else{
try{
var _72=document.defaultView.getComputedStyle(_6e,"");
var ret=_72[_71];
return ret;
}
catch(e){
try{
var _72=document.defaultView.getComputedStyle(_6e.parentNode,"");
var ret=_72[_71];
return ret;
}
catch(e2){
return _6e.parentNode.currentStyle[_71];
}
}
}
};
this.getBorderStyles=function(_74){
var bxs,bbs,bts,bls,brs;
var bxw,bbw,btw,blw,brw;
var bxc,bbc,btc,blc,brc;
bxs=this.getStyleValue(_74,this._bxs);
bbs=this.getStyleValue(_74,this._bbs);
bts=this.getStyleValue(_74,this._bts);
bls=this.getStyleValue(_74,this._bls);
brs=this.getStyleValue(_74,this._brs);
var _84=bbs||bts||bls||brs;
if(!bxs&&!_84){
return "";
}
var _85="";
if(_84&&!(bbs==bts&&bts==bls&&bls==brs)){
if(bbs&&bbs!=null&&bbs.length>0){
_85+=this._bbs+":"+bbs+";";
}
if(bts&&bts!=null&&bts.length>0){
_85+=this._bts+":"+bts+";";
}
if(bls&&bls!=null&&bls.length>0){
_85+=this._bls+":"+bls+";";
}
if(brs&&brs!=null&&brs.length>0){
_85+=this._brs+":"+brs+";";
}
}else{
if(_84=="none"){
return "";
}else{
if(_84&&(bbs==bts&&bts==bls&&bls==brs)){
_85+=this._bxs+":"+bbs+";";
}else{
if(bxs&&bxs!=null&&bxs.length>0){
_85+=this._bxs+":"+bxs+";";
}
}
}
}
bxw=this.getStyleValue(_74,this._bxw);
bbw=this.getStyleValue(_74,this._bbw);
btw=this.getStyleValue(_74,this._btw);
blw=this.getStyleValue(_74,this._blw);
brw=this.getStyleValue(_74,this._brw);
var _86=bbw||btw||blw||brw;
bxc=this.getStyleValue(_74,this._bxc);
bbc=this.getStyleValue(_74,this._bbc);
btc=this.getStyleValue(_74,this._btc);
blc=this.getStyleValue(_74,this._blc);
brc=this.getStyleValue(_74,this._brc);
var _87=bbc||btc||blc||brc;
if(_86&&!(bbw==btw&&btw==blw&&blw==brw)){
if(bbw&&bbw!=null&&bbw.length>0){
_85+=this._bbw+":"+bbw+";";
}
if(btw&&btw!=null&&btw.length>0){
_85+=this._btw+":"+btw+";";
}
if(blw&&blw!=null&&blw.length>0){
_85+=this._blw+":"+blw+";";
}
if(brw&&brw!=null&&brw.length>0){
_85+=this._brw+":"+brw+";";
}
}else{
if(_86&&(bbw==btw&&btw==blw&&blw==brw)){
_85+=this._bxw+":"+bbw+";";
}else{
if(bxw&&bxw!=null&&bxw.length>0){
_85+=this._bxw+":"+bxw+";";
}
}
}
if(_87&&!(bbc==btc&&btc==blc&&blc==brc)){
if(bbc&&bbc!=null&&bbc.length>0){
_85+=this._bbc+":"+bbc+";";
}
if(btc&&btc!=null&&btc.length>0){
_85+=this._btc+":"+btc+";";
}
if(blc&&blc!=null&&blc.length>0){
_85+=this._blc+":"+blc+";";
}
if(brc&&brc!=null&&brc.length>0){
_85+=this._brc+":"+brc+";";
}
}else{
if(_87&&(bbc==btc&&btc==blc&&blc==brc)){
_85+=this._bxc+":"+bbc+";";
}else{
if(bxc&&bxc!=null&&bxc.length>0){
_85+=this._bxc+":"+bxc+";";
}
}
}
return _85;
};
this.getMultiplier=function(str){
if(str.indexOf("%")>0){
var num=str.substring(0,str.indexOf("%"));
return num/100;
}
if(str.indexOf("em")>0){
var num=str.substring(0,str.indexOf("em"));
return num;
}
if(str.indexOf("ex")>0){
var num=str.substring(0,str.indexOf("ex"));
return num*0.4;
}
};
this.calculateFontSize=function(_8a){
var _8b=new Array();
var _8c;
var _8d;
_8b.push(this.getStyleValue(_8a,"font-size"));
_8a=_8a.parentNode;
while(_8a!=null){
if(_8a.nodeType==3){
_8a=_8a.parentNode;
continue;
}
_8d=this.getStyleValue(_8a,"font-size",true);
if(_8d!=null){
if(this.isRelFont(_8d)){
_8b.push(_8d);
}else{
break;
}
}else{
_8d=this.getStyleValue(_8a,"font-size");
if(this.isRelFont(_8d)==false){
break;
}else{
if(_8d!=_8b[_8b.length-1]){
_8b.push(_8d);
}
}
}
_8a=_8a.parentNode;
}
if(this.sz[_8d]!=null){
_8d=this.sz[_8d];
}
_8c=_8d.substring(_8d.length-2);
_8d=_8d.substring(0,_8d.length-2);
for(var i=0;i<_8b.length;i++){
_8d=_8d*this.getMultiplier(_8b[i]);
}
return Math.round(_8d)+_8c;
};
this.getImageStyle=function(_8f){
var _90=_8f.width;
var _91=_8f.height;
var _92=this.getBorderStyles(_8f);
var _93;
if(!_90){
_90=this.getStyleValue(_8f,"width");
}
if(!_91){
_91=this.getStyleValue(_8f,"height");
}
_93="style=\""+"width:"+_90+";height:"+_91+";";
if(_92){
_93+=_92;
}
_93+="\"";
return _93;
};
this.getNodeStyle=function(_94,blk){
var _96="style=\"";
var _97=this.getStyleValue(_94,this._ffam);
var _98=this.getStyleValue(_94,this._fsiz);
var _99=this.getStyleValue(_94,this._fwei);
var _9a=this.getStyleValue(_94,this._fsty);
var _9b=this.getStyleValue(_94,this._fcol);
if(_97.indexOf("\"")>=0){
_97=_97.replace(/\"/g,"");
}
if(this.isRelFont(_98)){
_98=this.calculateFontSize(_94);
}
_96+=this._ffam+":"+_97+";"+this._fsiz+":"+_98+";"+this._fwei+":"+_99+";"+this._fsty+":"+_9a+";"+this._fcol+":"+_9b+";";
if(blk){
var _9c=this.getStyleValue(_94,"width");
var _9d=this.getStyleValue(_94,"height");
var _9e=this.getBorderStyles(_94);
var _9f=this.getStyleValue(_94,this._mta);
var _a0=this.getStyleValue(_94,this._bgc);
var _a1=this.getStyleValue(_94,this._bgi).replace(/\"/g,"'");
var _a2=this.getStyleValue(_94,this._bgr);
_96+=_9e;
if(_9c!="auto"){
_96+="width: "+_9c+";";
}
if(_9d!="auto"){
_96+="height: "+_9d+";";
}
if(_a0!="transparent"){
_96+=this._bgc+":"+_a0+";";
}
if(_a1!="none"){
if(fdcp.browserDetect.browser=="Firefox"){
var _a3=_a1.replace("url(","url('");
var _a4=_a3.replace(")","')");
_a1=_a4;
_96+=this._bgi+":"+_a1+";";
}else{
_96+=this._bgi+":"+_a1+";";
}
}
if(_a2!="repeat"){
_96+=this._bgr+":"+_a2+";";
}
_96+=this._mta+":"+_9f+";";
if(_94.nodeName=="TABLE"){
var v=this.getStyleValue(_94,this._brcl);
if(!this.isMT(v)){
_96+=this._brcl+":"+v+";";
}
v=this.getStyleValue(_94,this._brsp);
if(!this.isMT(v)){
_96+=this._brsp+":"+v+";";
}
}
}
return _96+"\"";
};
this.serializeText=function(_a6){
if(_a6.nodeValue&&_a6.nodeValue.match(/^\s*$/)==null){
var st=this.getNodeStyle(_a6,false);
return "<text "+st+"> "+C2E(_a6.nodeValue)+"</text>";
}
return "";
};
function C2E(str){
var acc="";
for(var i=0;i<str.length;i++){
if(str.charCodeAt(i)>31&&str.charCodeAt(i)<127){
acc+=str.charAt(i);
}else{
acc+="&#"+str.charCodeAt(i)+";";
}
}
acc=acc.replace(/&/g,"&#38;");
acc=acc.replace(/'/g,"&#39;");
acc=acc.replace(/"/g,"&#34;");
acc=acc.replace(/\\/g,"&#92;");
acc=acc.replace(/\+/g,"&#43;");
acc=acc.replace(/</g,"&#60;");
acc=acc.replace(/>/g,"&#62;");
return acc;
}
this.serializeCDATA=function(_ab){
return "<![CDATA["+_ab.nodeValue+"]]>";
};
this.serializeBR=function(_ac){
return "<text "+this.getNodeStyle(_ac,false)+"><"+_ac.nodeName+" /></text>";
};
this.serializeImage=function(_ad){
var _ae;
var st=this.getImageStyle(_ad,true);
_ae="<image ";
if(_ad.id){
_ae+="id='"+_ad.id+"' ";
}
var i=new Image();
i.src=_ad.getAttribute("src");
return _ae+st+" src='"+C2E(i.src)+"' />";
};
this.serializeParagraph=function(_b1){
return this.serializeBR(_b1);
};
this.serializeInlineElement=function(_b2,_b3){
var _b4="";
if(_b2.nodeName=="SCRIPT"){
return _b4;
}
var to=_b3;
if(_b3==this.text_only_state.once){
to=this.text_only_state.off;
}
if(_b2.nodeName.charAt(0)=="/"){
return _b4;
}
if(_b3==this.text_only_state.off&&_b2.nodeName!=""){
_b4="<"+_b2.nodeName+" ";
if(_b2.id){
_b4+="id=\""+_b2.id+"\" ";
}
if(_b2.className){
_b4+="class=\""+_b2.className+"\" ";
}
if(_b2.nodeName=="TABLE"){
if(!this.isMT(_b2.border)){
_b4+="border=\""+_b2.border+"\" ";
}
if(!this.isMT(_b2.cellPadding)){
_b4+="cellpadding=\""+_b2.cellPadding+"\" ";
}
if(!this.isMT(_b2.cellSpacing)){
_b4+="cellspacing=\""+_b2.cellSpacing+"\" ";
}
}else{
if(_b2.nodeName=="TD"){
if(!this.isMT(_b2.colSpan)){
_b4+="colspan=\""+_b2.colSpan+"\" ";
}
if(!this.isMT(_b2.rowSpan)){
_b4+="rowspan=\""+_b2.rowSpan+"\" ";
}
if(!this.isMT(_b2.noWrap)){
_b4+="nowrap=\""+_b2.noWrap+"\" ";
}
}
}
_b4+=this.getNodeStyle(_b2,true)+">";
}
for(var i=0;i<_b2.childNodes.length;i++){
var _b7=_b2.childNodes[i];
if(_b7.nodeType==3){
_b4+=this.serializeText(_b7);
}else{
if(_b7.nodeType==4){
_b4+=this.serializeCDATA(_b7);
}else{
if(_b7.nodeType==1){
if(_b7.nodeName=="BR"){
_b4+=this.serializeBR(_b7);
}else{
if(_b7.nodeName=="P"){
_b4+=this.serializeInlineElement(_b7,this.text_only_state.on);
}else{
if(_b7.nodeName=="IMG"||_b2.nodeName=="IMAGE"){
_b4+=this.serializeImage(_b7);
}else{
_b4+=this.serializeInlineElement(_b7,to);
}
}
}
}
}
}
}
if(_b3==this.text_only_state.off&&_b2.nodeName!=""){
_b4+="</"+_b2.nodeName+">";
}
return _b4;
};
this.newpg=function(_b8){
_b8.push("</paragraph><paragraph>");
};
this._serNode=function(_b9,_ba,_bb){
var v;
var _bd=false;
if(this.isExcluded(_b9)){
return;
}
if(typeof _bb=="undefined"||_bb==null){
_bb=this.text_only_state.off;
}
if(_b9.nodeType==3){
v=this.serializeText(_b9);
if(v!=null&&v.length>0){
_ba.push(v);
}
}else{
if(_b9.nodeType==4){
_ba.push(this.serializeCDATA(_b9));
}else{
if(_b9.nodeType==1){
if(_b9.nodeName=="SCRIPT"){
return;
}
if(_b9.nodeName=="BR"){
_ba.push(this.serializeBR(_b9));
}else{
if(_b9.nodeName=="IMG"||_b9.nodeName=="IMAGE"){
_ba.push(this.serializeImage(_b9));
}else{
if(_b9.nodeName=="P"){
if(_ba.length>0){
this.newpg(_ba);
}
}else{
if(_b9.nodeName=="TR"){
this.newpg(_ba);
}else{
if(_b9.nodeName.match(/^H\d$/)!=null){
_bd=true;
this.newpg(_ba);
}
}
}
var _be=_b9.offsetWidth;
var _bf=new Boolean(true);
var _c0=this.fdclient.getCfg("blockThreshold",500);
if((typeof _be!="undefined"&&_be!=null&&_be>_c0)||_bb>0){
_bf=false;
}
if(((_b9.nodeName=="DIV"&&_bf)||_b9.nodeName=="TABLE"&&_bb!=this.text_only_state.on)||_b9.nodeName=="UL"){
if(_b9.nodeName=="UL"){
_bb=0;
}
_ba.push(this.serializeInlineElement(_b9,_bb));
}else{
try{
if(_b9.nodeName=="SPAN"){
if(_b9.getAttribute("inlineDiv")=="true"){
var _c1=_b9.firstChild;
_ba.push(this.serializeInlineElement(_c1,_bb));
}else{
if(_b9.getAttribute("inlineDiv")=="false"){
this.newpg(_ba);
this._serNode(_b9.nextSibling,_ba,this.text_only_state.on);
}else{
if(_b9.getAttribute("formatdynamics")=="content"){
for(var m=_b9.firstChild;m!=null;m=m.nextSibling){
this._serNode(m,_ba,this.text_only_state.off);
}
}else{
for(var m=_b9.firstChild;m!=null;m=m.nextSibling){
this._serNode(m,_ba,this.text_only_state.off);
}
}
}
}
}else{
if(_b9.nodeName=="DIV"){
if(_ba.length>0){
this.newpg(_ba);
}
}
for(var m=_b9.firstChild;m!=null;m=m.nextSibling){
this._serNode(m,_ba,_bb);
}
}
}
catch(e){
for(var m=_b9.firstChild;m!=null;m=m.nextSibling){
this._serNode(m,_ba,this.text_only_state.once);
}
}
}
if(_bd){
this.newpg(_ba);
}
}
}
}
}
}
};
this.serializeNode=function(_c3,_c4,_c5,_c6){
var _c7=this.text_only_state.off;
if(_c6=="true"){
_c7=this.text_only_state.on;
}
this._serNode(_c3,_c4,_c7);
};
this.isExcluded=function(_c8){
var _c9=this.fdclient.getCfg("excludes");
if(typeof _c9=="undefined"||_c9==null){
return false;
}
var _ca="";
var _cb="";
var id="";
if(typeof _c8.nodeName!="undefined"&&_c8.nodeName!=null){
_ca=_c8.nodeName.toLowerCase();
}
if(typeof _c8.className!="undefined"&&_c8.className!=null){
_cb=_c8.className.toLowerCase();
}
if(typeof _c8.id!="undefined"&&_c8.id!=null){
id=_c8.id.toLowerCase();
}
for(var i=0;i<_c9.length;i++){
var e=_c9[i].toLowerCase();
var _cf=_cb.split(/\s+/);
for(var cl in _cf){
if(_cf[cl]==e||("."+_cf[cl])==e){
return true;
}
if((_ca+"."+_cf[cl])==e){
return true;
}
if(id==e||("#"+id)==e){
return true;
}
if((_ca+"."+id)==e||(_ca+"#"+id)==e){
return true;
}
}
}
return false;
};
}

