function FDCPClient(){
this.cpServletPath="";
this.divid="2275";
this.tmplid="2500";
this.refid="";
this.rt="i;";
this.cpstatus="n";
this.printSpecId="0";
this.fdDebug=false;
this.cpc=null;
this.xpathLib="";
this.hosted="customer";
this.templateTest=false;
this.insType="c";
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.pathname;
var _3="Other";
if(_2.indexOf("story")>=0){
_3="Story";
}
var _4=_2.split("/")[1];
if(_4==""){
_4="Other";
}
var _5=_4+","+_3;
return _5;
};
this.getPFF=function(){
var _6="0";
var _7=window.location.href;
if(_7.indexOf("print=true")>=0){
_6="1";
}
return _6;
};
this.getVR=function(){
return {};
};
this.onPrint=function(){
};
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.getTO=function(){
return this.getCfg("timeout",10000);
};
this.getTemplateTest=function(){
return this.getCfg("templateTest",this.templateTest);
};
this.getXpathLib=function(){
return this.getCfg("xpathLib",this.xpathLib);
};
this.getFDDebug=function(){
return this.getCfg("fdDebug",this.fdDebug);
};
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;
}
};
}
var formatDynamicsPT=new FormatDynamicsPT(new FDCPClient());
if(navigator.appName.indexOf("Microsoft")!=-1&&parseInt(navigator.appVersion)>=4&&navigator.userAgent.indexOf("Windows")!=-1){
window.attachEvent("onbeforeprint",function(){
formatDynamicsPT.getFDImage();
});
}else{
formatDynamicsPT.changePrintStyleSheet();
}

