function FDCPClient(){
this.cpServletPath="http://cnnmoney.cleanprint.net/cp/psj";
this.divid="2323";
this.refid="2361";
this.rt="i;";
this.cpstatus=false;
this.ptstatus="y";
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(){
if(window.location.hostname.indexOf("blogs")!=-1){
var _2=window.location.hostname.split(".");
if(typeof _2=="undefined"||typeof _2[0]=="undefined"||_2[0]==""||_2[0]=="blogs"){
return "blogs,other";
}else{
return "blogs,"+_2[0];
}
}
var _3="";
var _4="";
if(typeof s_prop1!="undefined"&&s_prop1!=null&&s_prop1!=""){
_3=s_prop1;
if(typeof s_prop2!="undefined"&&s_prop2!=null&&s_prop2!=""){
_4=s_prop2;
}
}else{
var _5=document.getElementsByTagName("head").item(0);
var _6=_5.getElementsByTagName("META");
for(var i=0;i<_6.length;i++){
var _8=_6[i];
if(typeof _8.getAttribute("name")!="undefined"&&_8.getAttribute("name")!=""){
var _9=_8.getAttribute("name");
if(_9=="SECTION"){
_3=_8.getAttribute("content");
}else{
if(_9=="SUBSECTION"){
_4=_8.getAttribute("content");
}
}
}
}
}
if(_3==""){
_3="other";
}
if(_4==""){
_4="other";
}
var _a=document.getElementsByTagName("a");
for(var i=0;i<_a.length;i++){
var _b=_a[i];
if(_b.innerHTML=="Print"||_b.innerHTML=="PRINT"){
if(window.addEventListener){
_b.addEventListener("click",function(){
formatDynamicsPT.pf="&p=1";
formatDynamicsPT.qstr=formatDynamicsPT.div+formatDynamicsPT.ua+formatDynamicsPT.seg+formatDynamicsPT.ustr+formatDynamicsPT.pf+formatDynamicsPT.version;
formatDynamicsPT.turl=formatDynamicsPT.pcol+formatDynamicsPT.cstr+formatDynamicsPT.dtstr+"?"+formatDynamicsPT.qstr;
formatDynamicsPT.getFDImage();
},true);
}else{
if(window.attachEvent){
_b.attachEvent("onclick",function(){
formatDynamicsPT.pf="&p=1";
formatDynamicsPT.qstr=formatDynamicsPT.div+formatDynamicsPT.ua+formatDynamicsPT.seg+formatDynamicsPT.ustr+formatDynamicsPT.pf+formatDynamicsPT.version;
formatDynamicsPT.turl=formatDynamicsPT.pcol+formatDynamicsPT.cstr+formatDynamicsPT.dtstr+"?"+formatDynamicsPT.qstr;
formatDynamicsPT.getFDImage();
});
}
}
}
}
return _3+","+_4;
};
this.getPFF=function(){
return "0";
};
this.getVR=function(){
return {};
};
this.onPrint=function(){
};
this.getBlockThreshold=function(){
return 500;
};
this.getCfg=function(_c,_d){
if(this.cpc!=null&&typeof this.cpc[_c]!="undefined"){
return this.cpc[_c];
}
return _d;
};
this.getTHost=function(){
return "cnnmoney.cleanprint.net";
};
this.getcpStat=function(){
return this.getCfg("cpStatus",this.cpstatus);
};
this.getptStat=function(){
return this.getCfg("ptStatus",this.ptstatus);
};
this.getDiv=function(){
return this.getCfg("divisionId",this.divid);
};
this.getTmpl=function(){
return this.getCfg("templateId",null);
};
this.getRfmt=function(){
return this.getCfg("templateId",this.refid);
};
this.getTPath=function(){
return this.getCfg("tPath",null);
};
this.getLPath=function(){
return this.getCfg("lPath",null);
};
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(_e){
this.clnt=_e;
this.pcol="ht"+"tp:"+"//";
this.cstr=_e.getTHost()+"/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(_f){
var _10=this.pthosts.split(",");
for(var i=0;i<_10.length;i++){
if(_f.indexOf(_10[i])!=-1){
return true;
}
}
return false;
};
this.changePrintStyleSheet=function(){
for(i=0;i<document.styleSheets.length;i++){
try{
var _12=document.styleSheets[i];
var _13=navigator.userAgent.toLowerCase();
if((navigator.appName.indexOf("Netscape")!=-1||_13.indexOf("firefox")!=-1||_13.indexOf("safari")!=-1)&&this.isPtCss(_12.cssRules[0].style.content)){
_12.cssRules[0].style.content="url("+this.turl+");";
return;
}else{
if(this.isPtCss(_12.cssRules[0].style.getPropertyValue("content"))){
if(navigator.appName.indexOf("Opera")!=-1){
_12.deleteRule(0);
}else{
if(navigator.appName.indexOf("Konqueror")==-1){
_12.cssRules[0].style.setProperty("content","url("+this.turl+")",null);
}
}
return;
}
}
}
catch(err){
}
}
try{
var _13=navigator.userAgent.toLowerCase();
if((navigator.appName.indexOf("Netscape")!=-1||_13.indexOf("firefox")!=-1||_13.indexOf("safari")!=-1)){
var s=document.createElement("style");
s.type="text/css";
s.rel="stylesheet";
s.media="print";
s.appendChild(document.createTextNode("body:before {content: url("+this.turl+")};"));
document.getElementsByTagName("head")[0].appendChild(s);
}
}
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 _17=document.createElement("script");
_17.type="text/javascript";
_17.src=this.turl+"&rnd="+Math.random();
}
}else{
var _18=new Image();
_18.src=this.turl;
}
};
}
var formatDynamicsPT;
function loadHandler(){
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();
}
}
if(typeof window.addEventListener!="undefined"){
window.addEventListener("load",loadHandler,false);
}else{
if(typeof window.attachEvent!="undefined"){
window.attachEvent("onload",loadHandler);
}else{
if(window.onload!=null){
var oldOnload=window.onload;
window.onload=function(e){
oldOnload(e);
window[loadHandler]();
};
}else{
window.onload=loadHandler;
}
}
}

