function FDCPClient(){
this.cpHost="cleanprint.net";
this.divid="2400";
this.refid="";
this.rt="i;";
this.cpstatus=false;
this.ptstatus="y";
this.printSpecId=0;
this.fdDebug=false;
this.cpc=null;
this.blkwidth=0;
this.xpathLib="";
this.shost="";
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 u=window.location.href;
var _3="Other";
if(u.indexOf("homes-for-sale.aspx")>0||u.indexOf("newhomes.aspx")>0){
_3="Search";
}else{
if(u.indexOf("/Property/")>0){
_3="Property";
}else{
if(u.indexOf("/homepricecheck/")>0){
_3="Home Values";
}else{
if(u.indexOf("/tipsandtools/")>0){
_3="Articles";
}
}
}
}
return this.escCom(_3);
};
this.getPFF=function(){
return "0";
};
this.getVR=function(){
return {};
};
this.onPrint=function(){
};
this.getBlockThreshold=function(){
return 500;
};
this.getCfg=function(_4,_5){
if(this.cpc!=null&&typeof this.cpc[_4]!="undefined"){
return this.cpc[_4];
}
return _5;
};
this.getTHost=function(){
if(this.shost.length>0&&document.location.protocol=="https:"){
return this.shost;
}else{
return this.cpHost;
}
};
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;
};
this.getIframeUrls=function(){
};
this.cpServletPath=document.location.protocol+"//"+this.getTHost()+"/cp/psj";
}
function FormatDynamicsPT(_6){
this.clnt=_6;
this.pcol=document.location.protocol+"//";
this.cstr=_6.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(_7){
var _8=this.pthosts.split(",");
for(var i=0;i<_8.length;i++){
if(_7.indexOf(_8[i])!=-1){
return true;
}
}
return false;
};
this.changePrintStyleSheet=function(){
for(i=0;i<document.styleSheets.length;i++){
try{
var _a=document.styleSheets[i];
var _b=navigator.userAgent.toLowerCase();
if((navigator.appName.indexOf("Netscape")!=-1||_b.indexOf("firefox")!=-1||_b.indexOf("safari")!=-1)&&this.isPtCss(_a.cssRules[0].style.content)){
_a.cssRules[0].style.content="url("+this.turl+");";
return;
}else{
if(this.isPtCss(_a.cssRules[0].style.getPropertyValue("content"))){
if(navigator.appName.indexOf("Opera")!=-1){
_a.deleteRule(0);
}else{
if(navigator.appName.indexOf("Konqueror")==-1){
_a.cssRules[0].style.setProperty("content","url("+this.turl+")",null);
}
}
return;
}
}
}
catch(err){
}
}
try{
var _b=navigator.userAgent.toLowerCase();
if((navigator.appName.indexOf("Netscape")!=-1||_b.indexOf("firefox")!=-1||_b.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 _f=document.createElement("script");
_f.type="text/javascript";
_f.src=this.turl+"&rnd="+Math.random();
}
}else{
var _10=new Image();
_10.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;
}
}
}

