function FDCPClient()
{
this.cpHost = "cache-01.cleanprint.net";
this.divid="2556";
this.refid="2361";
this.rt = "i";
this.cpstatus = false;
this.ptstatus = "y";
this.printSpecId = 0;
this.outputFormat = "text/html";
this.fdDebug = false;
this.cpc = null;
this.blkwidth=0;
this.xpathLib = "";
this.shost = "formatdynamics.com";
this.hosted = "customer";
this.blockThreshold = 500;
this.trackerHost = "cleanprint.net";
this.modes = {unset:0, printLink:1, filePrint:2, printerFriendlyViewer:3};
this.mode = 0;//modes.unset
this.resetMode = function(){this.mode = this.modes.unset;};
this.cookie_flags = "pv";
this.category = "UNKNOWN";
this.site = "UNKNOWN";
// moved from the printtracker FormatDynamicsPT object
this.pthosts = "formatdynamics.com,cleanprint.net,formatdyn.hs.llnwd.net";
this.autoRefreshCSS = "true";
this.autoRefreshTime = "30000";
// quantcast tracking: n => turn off qc tracking, anything else leaves it on
this.enableQC = "y";
// templatetest var to pull templates from a directory
this.templateTest = true;
// 's' for standalone and 'c' for combined. A standalone install turns off registration for
// PrintTracker events
this.insType = "c";
this.colre = new RegExp(":", "g");
this.comre = new RegExp(",", "g");
this.isPtCss=function(content) {
var phosts = this.pthosts.split(',');
for(var i = 0; i < phosts.length; i++) {
if(content.indexOf(phosts[i]) != -1)
return true;
}
return false;
}
// templatetest var to pull templates from a directory
this.templateTest = false;
// 's' for standalone and 'c' for combined. A standalone install turns off registration for
// PrintTracker events
this.insType = "c";
this.escCom = function(st) {
st = new st.constructor(st);
st = st.replace(this.colre, "::");
st = st.replace(this.comre, ":,");
return st;
}
this.getSegment=function () {
var section = "other";
try {
var url = window.location.pathname;
if (url == null || url.length == 0 || url == "/") {
return section;
}
if(window.location.host.indexOf("today") >= 0){
return "today";
}
if (url.indexOf("/print/") == -1) {
if (url.lastIndexOf("/") == url.length - 1) {
url = url.substring(0, url.length - 1);
}
} else {
url = url.substring(0, url.indexOf("/print/"));
}
url = url.substring(url.lastIndexOf("/") + 1);
var regex = new RegExp("^([^-]*)");
var res = regex.exec(url);
if (res.length > 0) {
section = res[1];
}
} catch (e) {}
try {
if (parseInt(section)) {
var regex = new RegExp("^([^-]*)-.*$");
var segs = window.location.pathname.split("/");
for ( var i = 0; i < segs.length; i++) {
if ((res = segs[i].match(regex)) != null) {
section = res[1];
}
}
}
if (parseInt(section)) {
section = "numeric";
}
} catch (e) {}
return section;
}
this.getCPViewerId=function(){
}
this.getPFF = function() {
if(window.location.href.indexOf('print') > 0){
return "1";
}
return "0";
}
this.getVR = function() {
var section = "other";
try {
var url = window.location.pathname;
if (url == null || url.length == 0 || url == "/") {
return {
section :section
};
}
if(window.location.host.indexOf("today") >= 0){
return { section: "today" };
}
if (url.indexOf("/print/") == -1) {
if (url.lastIndexOf("/") == url.length - 1) {
url = url.substring(0, url.length - 1);
}
} else {
url = url.substring(0, url.indexOf("/print/"));
}
url = url.substring(url.lastIndexOf("/") + 1);
var regex = new RegExp("^([^-]*)");
var res = regex.exec(url);
if (res.length > 0) {
section = res[1];
}
} catch (e) {
}
return {
section :section
};
}
this.onPrint = function(cpdata) {
//if(window.location.host.indexOf("nbcsports") >= 0){
//return false;
//}
var isTodayShow = false;
try{
if(document.getElementById("todayShow") != null){
isTodayShow = true;
}
}catch(e){}
if(window.location.host == "www.msnbc.msn.com" && isTodayShow == false){
if(window.location.href.indexOf("/print") > 0){
cpdata.template = "7640";
}
else {
cpdata.template = "7480";
}
}
else if(window.location.host == "today.msnbc.msn.com" || isTodayShow == true){
if(window.location.href.indexOf("/print") > 0){
cpdata.template = "7641";
}
else {
cpdata.template = "7481";
}
}
if(window.location.host == "sys7.msnbc.msn.com"){
if(window.location.href.indexOf("/print") > 0){
cpdata.template = "7640";
}
else {
cpdata.template = "7480";
}
}
else if(window.location.href.indexOf("sys7-today") > 0){
if(window.location.href.indexOf("/print") > 0){
cpdata.template = "7641";
}
else {
cpdata.template = "7481";
}
}
if(window.location.host == "int.msnbc.msn.com"){
if(window.location.href.indexOf("/print") > 0){
cpdata.template = "7640";
}
else {
cpdata.template = "7480";
}
}
if(window.location.host == "ppe.msnbc.msn.com"){
if(window.location.href.indexOf("/print") > 0){
cpdata.template = "7640";
}
else {
cpdata.template = "7480";
}
}
try{
var regex = new RegExp(" ","g");
cpdata.pc = cpdata.pc.replace(regex, "");
var regex = new RegExp(" ","g");
cpdata.pc = cpdata.pc.replace(regex, "");
regex = new RegExp("]*>[ ]*","g");
cpdata.pc = cpdata.pc.replace(regex, "");
regex = new RegExp("]*>[ ]*","g");
cpdata.pc = cpdata.pc.replace(regex, "");
}catch(e){}
}
this.getBlockThreshold = function() {
return this.getCfg('blockThreshold', this.blockThreshold);
}
this.getCfg=function(ckey, cdef) {
if(this.cpc != null && typeof this.cpc[ckey] != 'undefined')
return this.cpc[ckey];
return cdef;
}
this.getTHost=function() {
if(this.shost.length > 0 && document.location.protocol == "https:")
return this.shost;
else
return this.cpHost;
}
this.getTrackerHost=function() {
return this.trackerHost;
}
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.getOutputFormat=function() { return this.getCfg('mimeType', this.outputFormat); }
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.getAutoRefreshCSS = function() { return this.getCfg('autoRefreshCSS', this.autoRefreshCSS); }
this.getAutoRefreshTime = function() { return this.getCfg('autoRefreshTime', this.autoRefreshTime); }
this.getPtHosts = function() { return this.getCfg('pthosts', this.pthosts); }
this.getFDDebug = function() { return this.getCfg('fdDebug', this.fdDebug); }
this.getRType= function() {
return this.rt;
}
this.getIframeUrls=function(){
}
this.onCpLoad = function(){
try {
if (navigator.appName == "Microsoft Internet Explorer") {
var ua = navigator.userAgent;
var re = new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");
var res = re.exec(ua);
if (res != null)
rv = parseFloat(res[1]);
if (rv >= 8.0) {
if(typeof FDCPLoader.browserDetect != 'undefined'){
FDCPLoader.browserDetect.browser = "Firefox";
}
else {
fdcp.browserDetect.browser = "Firefox";
}
FDCPLoader.fdPrintWrapper = function(theContext)
{
window.detachEvent("onbeforeprint", fdcp.bridge.handleOnBeforePrint);
document.fDContentFrame.focus();
document.fDContentFrame.document.execCommand('print', false, null);
window.attachEvent("onbeforeprint", fdcp.bridge.handleOnBeforePrint);
};
}
}
}
catch (e) {window.print();}
try{
if(window.navigator.userAgent.indexOf("MSIE") > 0 || window.navigator.userAgent.indexOf("Firefox") > 0){
var formatdynamics_dl_load = document.createElement('script');
formatdynamics_dl_load.setAttribute('type', 'text/javascript');
formatdynamics_dl_load.setAttribute('charset', 'utf-8');
var st = 'http://cleanprint.net/cs/dl/script.jsp?unique=' + (new Date()).getTime();
formatdynamics_dl_load.setAttribute('src', st);
document.getElementsByTagName('body').item(0).appendChild(formatdynamics_dl_load);
}
}catch(e){}
}
this.cpServletPath=document.location.protocol + "//" + this.getTHost() + "/cp/psj";
this.logUrl=document.location.protocol + "//" + this.getTHost() + "/cp/l";
this.getCalculatedPrintSpecId = function(){
try{
return "651";
}catch(e){}
}
this.onBeforeContentSerialization = function(){
this.flipElements = new Array();
if (document.getElementById('fullstory'))
{
if($("#fullstory").css("display") == "none"){
$("#fullstory").css("display", "block");
this.flipElements.push($("#fullstory"));
}
}
}
this.onAfterContentSerialization = function(){
if (this.flipElements.length > 0)
{
$("#fullstory").css("display", "");
}
}
this.onPrintSpecLoad = function(){
}
this.onBeforeCleanPrint = function(data){
//try {
// var url = window.location.href;
// if (navigator.appName == "Microsoft Internet Explorer") {
// var ua = navigator.userAgent;
// var re = new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");
// var res = re.exec(ua);
// if (res != null)
// rv = parseFloat(res[1]);
// if (rv >= 8.0) {
// data = data.replace(/line-height:1.23/g, "line-height:1.1");
// }
// }
//} catch (e) {}
return data;
}
this.calculateCacheKey = function(){
return cacheKey;
}
this.onAfterCleanPrint = function(){
// standard behavior
if(this.enableQC == 'y')
this.appendQC();
// customizations
}
this.appendQC = function() {
}
this.getRequestObject = function(){
var act = "Unknown";
if (this.mode == this.modes.filePrint) {
act = "Chrome";
} else if (this.mode == this.modes.printLink
|| this.mode == this.modes.printerFriendlyViewer) {
act = "Link";
}
var logdata = {
d : this.getDiv(),
a : navigator.appName + " " + navigator.userAgent,
s : this.getSegment(),
u : window.location.href,
p : this.getPFF(),
r : this.getRfmt(),
q : "1.0",
template : this.getTmpl(),
act : act
};
return logdata;
}
}
function FormatDynamicsPT(client) {
this.clnt = client;
this.pcol = document.location.protocol + "//";
this.cstr = client.getTrackerHost() + "/pt/t/";
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.pthosts = this.clnt.getPtHosts();
this.autoRefreshCSS = this.clnt.getAutoRefreshCSS();
this.autoRefreshTime = this.clnt.getAutoRefreshTime();
this.cssRefreshInterval = null;
this.rcount = 0;
this.ptssfound = false;
this.getTURL = function() {
return this.pcol + this.cstr + (new Date()).getTime() + '?' + this.qstr;
}
this.isPtCss=function(content) {
var phosts = this.pthosts.split(',');
for(var i = 0; i < phosts.length; i++) {
if(content.indexOf(phosts[i]) != -1)
return true;
}
return false;
}
this.changePrintStyleSheet=function() {
this.rcount++;
// Change fdprint stylesheet if found
for(i=0;i 0) {
h = hs[0];
var script = document.createElement("script");
script.type = 'text/javascript';
script.src = this.getTURL() + '&rnd=' + Math.random();
}
}
else {
var fdloader = new Image();
fdloader.src = this.getTURL();
}
}
this.initIE = function()
{
try {
if (navigator.appName.indexOf("Microsoft")!=-1 && parseInt(navigator.appVersion)>=4 && navigator.userAgent.indexOf("Windows") != -1)
window.attachEvent("onbeforeprint", function() { formatDynamicsPT.getFDImage(); } );
}
catch(e)
{}
}
this.initX = function()
{
try {
if(navigator.appName.indexOf("Konqueror") != -1) {
formatDynamicsPT.changePrintStyleSheet();
}
else if (navigator.appName.indexOf("Microsoft") == -1) {
formatDynamicsPT.changePrintStyleSheet();
formatDynamicsPT.cssRefreshInterval = setInterval("formatDynamicsPT.refreshCSS()", formatDynamicsPT.autoRefreshTime);
}
}
catch(e)
{}
}
this.initAll = function() {
try {
this.initIE();
this.initX();
}
catch(e)
{}
}
this.refreshCSS = function()
{
if (formatDynamicsPT.autoRefreshCSS == "true")
formatDynamicsPT.changePrintStyleSheet();
else
clearInterval(formatDynamicsPT.cssRefreshInterval);
}
}
// TODO: add 'script' mode back. also add 'auto' mode to load everything without waiting
// TODO: run through rhino
// TODO: in the print spec js, we use '1' and '0', 'y' and 'n' and true and false for boolean values. clean this up.
var FDCPLoader = {
count: 0,
tint: 500,
tmax: 10000,
tagg: 0,
incyc: false,
loaded: false, // TODO: rename to printSpecLoaded?
divId: 0, // TODO: redundant
printSpecId: 0, // TODO: have a PrintSpec class? In any case, isn't needed as an instance var
cpDef:{}, // TODO: can print spec come back as a JSON object?
FDCPClient:new FDCPClient(),
printPreviewWindow: null, // TODO: remove
printPreviewWindowOpen: false, // TODO: remove
tester: false, // TODO: still used?
slre: new RegExp("[^/]*$"),
// TODO: this should go away
getCfg: function(ckey, cdef) {
if(this.cpc != null && typeof this.cpc[ckey] != 'undefined')
return this.cpc[ckey];
return cdef;
},
loadcp: function() {
if(typeof FDCPLoader.FDCPClient.onPrintSpecLoad != "undefined"){
FDCPLoader.FDCPClient.onPrintSpecLoad();
}
// TODO: this is stupid
this.cpc = FDCPLoader.FDCPClient.cpc;
if(this.cpc.cpStatus == 'n'){
FDCPLoader.tagg = FDCPLoader.tmax + 1;
return;
}
var jsloc = this.FDCPClient.cpc.codeBase;
if(jsloc == null || jsloc.length == 0)
{
jsloc = document.location.protocol + '//' + this.FDCPClient.trackerHost + '/cpjs';
jsloc += "?d=" + FDCPLoader.FDCPClient.divid +
"&bn=" + FDCPLoader.browserDetect.browser +
"&bv=" + FDCPLoader.browserDetect.version +
"&fs=" + (FDCPLoader.hasFlash() ? "true" : "false") +
"&rp=" + FDCPLoader.FDCPClient.cpc.rpOk
}
var e = document.createElement('script');
// TODO: assume a good codeBase value and get rid of this call
e.src = this.validatePath(jsloc , "cp.js");
e.type = 'text/javascript';
document.getElementsByTagName("head")[0].appendChild(e);
this.loadXPathLib();
},
loadFFjs: function() {
if(FDCPLoader.FDCPClient.cpc.cpStatus == 'n'){
FDCPLoader.tagg = FDCPLoader.tmax + 1;
return;
}
var jsloc = this.getCfg('codeBase', null);
jsloc = this.removeFileFromPath(jsloc, "cp.js");
var e = document.createElement('script');
e.src = this.validatePath(jsloc , "FDFF.js");
e.type = 'text/javascript';
document.getElementsByTagName("head")[0].appendChild(e);
setTimeout(function(thisObj) { thisObj.checkFFjs(false); },2000,this);
},
checkFFjs: function(expire) {
if (expire)
return false;
if (typeof FDFF == 'undefined')
setTimeout(function(thisObj) { thisObj.checkFFjs(true); },2000,this);
else
FDFF.load();
},
// TODO: needs cleanup
loadXPathLib: function() {
if (navigator.appName == "Microsoft Internet Explorer")
{
var xpathUrl = null;
if (typeof this.FDCPClient.xpathLib == "undefined" || this.FDCPClient.xpathLib == null || this.FDCPClient.xpathLib == "")
{
// TODO: xpath.js never used in cpc, get rid of this call
xpathUrl = this.getCfg('xpathLib', null);
if (xpathUrl == null){
xpathUrl = this.getCfg('codeBase', null);
xpathUrl = this.removeFileFromPath(xpathUrl, "cp.js");
}
}
else
xpathUrl = this.FDCPClient.xpathLib;
var e = document.createElement('script');
e.src = this.validatePath(xpathUrl , "xpath.js");
e.type = 'text/javascript';
document.getElementsByTagName("head")[0].appendChild(e);
}
else{
if (navigator.userAgent.indexOf("Firefox") != -1){
//FDCPLoader.loadFFjs();
}
}
},
removeFileFromPath: function(path, file){
if (path.indexOf(file) > 1)
{
var lastSlashIndex = path.search(this.slre);
return path.substr(0, lastSlashIndex);
}
else
{
return path;
}
},
getPDScriptUrl: function(){
var snodes = document.getElementsByName('cleanprintloader');
var url = "";
if(snodes.length > 0) {
url = snodes[0].src;
}
else {
snodes = document.getElementsByTagName('SCRIPT');
for(var i = 0; i < snodes.length; i++) {
if(snodes[i].name == 'cleanprintloader') {
url = snodes[i].src;
break;
}
}
}
return url;
},
loadPrintSpec: function(){
try
{
formatDynamicsPT = new FormatDynamicsPT(new FDCPClient());
formatDynamicsPT.initX();
var psfailed = false;
if(!this.loaded) {
this.loaded = true; // TODO: shouldn't we set this after a successful load?
var pdSrc = this.getPDScriptUrl();
// TODO: is this still necessary?
if (this.FDCPClient.hosted == "fd" && pdSrc.length > 0)
this.divId = this.getDivisionId(pdSrc);
else
this.divId = this.FDCPClient.divid;
// TODO: get this from the client now
this.printSpecId = this.getPrintSpecId(pdSrc);
var url = this.FDCPClient.cpServletPath;
url += "?useCache=false";
url += "&divId=" + this.divId;
var psid = null;
// TODO: this function is now required. clean up this logic accordingly
if(typeof this.FDCPClient.getCalculatedPrintSpecId != "undefined" && this.tester == false)
{
try
{
psid = this.FDCPClient.getCalculatedPrintSpecId();
if(psid == false){
psfailed = true;
}
}
catch(err)
{
psfailed = true;
}
}
if(psfailed)
{
// TODO: can we always register the PT handler, and disable by setting a flag on fdcp or something? then we don't need to mess with this logic on all cp load failures
formatDynamicsPT.initIE();
}
else
{
url += "&printSpecId=" + ((typeof psid == 'undefined' || psid == null) ? this.printSpecId : psid);
var cpDefScript = document.createElement('script');
cpDefScript.src = url;
cpDefScript.type = 'text/javascript';
document.getElementsByTagName("head")[0].appendChild(cpDefScript);
}
}
}
catch(e)
{
// TODO: something. anything.
}
},
// TODO: get rid of this
validatePath: function(path , jsFile)
{
if (path.indexOf(jsFile) > 1)
return path;
else
{
if (path.charAt(path.length -1) == "/")
return path + jsFile;
else
return path + "/" + jsFile;
}
},
// TODO: get rid of this?
getPrintSpecId: function(pdSrc)
{
var pdre = new RegExp("^[^?]+\\??");
var queryString = pdSrc.replace(pdre,'');
var params = this.parseQuery( queryString );
return params['ps'];
},
// TODO: get rid of this
getDivisionId: function(pdSrc)
{
var tmpUrl = pdSrc.replace(this.slre, "");
var lastSlashIndex = tmpUrl.search(this.slre);
var divId = tmpUrl.substr(0, lastSlashIndex -1);
lastSlashIndex = divId.search(this.slre);
divId = divId.substr(lastSlashIndex, divId.length);
return divId;
},
// TODO: get rid of this if you get rid of getPrintSpecId
parseQuery: function( query ) {
var Params = new Object ();
if ( ! query ) return Params; // return empty object
var pre = new RegExp("[;&]");
var plusre = new RegExp("\\+", "g");
var Pairs = query.split(pre);
for ( var i = 0; i < Pairs.length; i++ ) {
var KeyVal = Pairs[i].split('=');
if ( ! KeyVal || KeyVal.length != 2 ) continue;
var key = unescape( KeyVal[0] );
var val = unescape( KeyVal[1] );
val = val.replace(plusre, ' ');
Params[key] = val;
}
return Params;
},
cpJsLoaded:false,
xpathJsLoaded:navigator.appName != "Microsoft Internet Explorer",
registerModuleLoaded: function(moduleName){
if(moduleName == "cp.js"){
this.cpJsLoaded = true;
}
else if(moduleName == "xpath.js"){
this.xpathJsLoaded = true;
}
if(this.xpathJsLoaded && this.cpJsLoaded){
fdcp.replacePrintLinks();
}
},
fdPrintWrapper: function(theContext){
theContext = typeof theContext == "undefined" ? window : theContext;
theContext.print();
},
// TODO: still used?
ptFailover: function() {
formatDynamicsPT = new FormatDynamicsPT(new FDCPClient());
formatDynamicsPT.initAll();
},
hasFlash : function() {
// Flash Player Version Detection - Rev 1.6
// Detect Client Browser type
// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
var nn = navigator;
var np = nn.plugins;
var isIE = (nn.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (nn.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (nn.userAgent.indexOf("Opera") != -1) ? true : false;
// NS/Opera version >= 3 check for Flash plugin in plugin array
var flashVer;
if (nn.plugins != null && np.length > 0) {
if (np["Shockwave Flash 2.0"] || np["Shockwave Flash"]) {
var swVer2 = np["Shockwave Flash 2.0"] ? " 2.0" : "";
var descArray = np["Shockwave Flash" + swVer2].description.split(" ");
var tempArrayMajor = descArray[2].split(".");
flashVer = tempArrayMajor[0] > 5 ? tempArrayMajor[0] : -1;
}
}
else if ( isIE && isWin && !isOpera ) {
var axo;
var e;
// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
try {
// version will be set for 7.X or greater players
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
flashVer = axo.GetVariable("$version");
} catch (e) {
}
if (!flashVer)
{
try {
// version will be set for 6.X players only
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
flashVer = "6";
} catch (e) {
}
}
}
return flashVer && flashVer > 0;
},
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 (data) {
for (var i=0;i FDCPLoader.tmax) {
FDCPLoader.incyc = false;
FDCPLoader.fdPrintWrapper();
FDCPLoader.tagg = 0;
return false;
}
FDCPLoader.tagg += FDCPLoader.tint;
setTimeout("FDCPUrl('" + pfLink + "', " + isViewer + ")", FDCPLoader.tint);
return false;
}
else
FDCPLoader.incyc = false;
if(isViewer)
{
var continueCp = FDCPLoader.browserDetect.browser == "Firefox" || FDCPLoader.browserDetect.browser == "Explorer" || (FDCPLoader.browserDetect.browser == "Safari" && FDCPLoader.browserDetect.OS == "Mac");
if(!continueCp)
{
window.open(pfLink, "pf", "");
return false;
}
}
fdcp.clt.mode = isViewer ? fdcp.clt.modes.printerFriendlyViewer : fdcp.clt.modes.printLink;
fdcp.linkPrintHandler(pfLink);
// TODO: why not use the browserDetect object?
if(navigator.appName != "Microsoft Internet Explorer") {
fdcp.clt.resetMode();
}
return false;
}
catch(e)
{}
}
// a simple ajax object getter
function fdGetAjaxObj() {
if(window.XMLHttpRequest){
return new XMLHttpRequest(); //Not IE
}else if(window.ActiveXObject){
return new ActiveXObject("Microsoft.XMLHTTP"); //IE
}else{
// TODO: check to see if there are others we need to support
return null;
}
}
if (window.addEventListener) {
window.addEventListener("load", function() { FDCPLoader.loadPrintSpec(); }, true);
}
else if (window.attachEvent) {
window.attachEvent("onload", function() { FDCPLoader.loadPrintSpec(); });
}