// TeaLeafCfg.js - @version 7.0.0001 if(typeof TeaLeaf == "undefined"){ var TeaLeaf = {}; TeaLeaf.tlStartLoad = new Date(); if(typeof TeaLeaf.Configuration == "undefined"){ TeaLeaf.Configuration = { "tlversion" : "2008.3.24.1", "tlSDK" : false }; } } // TeaLeaf.js - @version 7.0.0001 if(TeaLeaf && TeaLeaf.Configuration){ if( ! Array.prototype.push ) { Array.prototype.stackEnd = 0; /** * Add push if the browser does not supply * them with the Array object (IE6 and earlier) * @addon */ Array.prototype.push = function(obj) { this[this.stackEnd] = obj; this.stackEnd++; } } if( ! Array.prototype.pop ) { /** * Add pop if the browser does not supply * them with the Array object (IE6 and earlier) * @addon */ Array.prototype.pop = function(obj) { this.stackEnd--; return this[this.stackEnd]; } } /** * Set TeaLeaf UI Client Event Capture as an SDK. * The default behavior is not set as an SDK * @requires * TeaLeafCfg.js * @addon */ TeaLeaf.settlSDK = function(){ TeaLeaf.Configuration.tlSDK = true; } /** * Reset TeaLeaf UI Client Event Capture not to act as an SDK. * The default behavior is not set as an SDK * @requires * TeaLeafCfg.js * @addon */ TeaLeaf.resettlSDK = function(){ TeaLeaf.Configuration.tlSDK = false; } /** * Array to store all the object that need to be loaded after the page is rendered. * NOTE: This will not be used if the UI Client Event Capture is used as an SDK. */ TeaLeaf.tLoadObjs = new Array(); /** * This function is used for the other javascript files to register their * onload functions to be called * @param obj object that is registered from other JavaScript to be loaded * @param functionName object function that is registered from other JavaScript to be loaded * @requires * TeaLeafCfg.js * @addon */ TeaLeaf.addOnLoad = function(obj, functionName){ if(arguments.length == 1) { TeaLeaf.tLoadObjs.push(obj); } else if(arguments.length > 1) { TeaLeaf.tLoadObjs.push(obj[functionName]); } } /** * This function is used to load UI Client Event Caputre or the * UI Client Event Capture SDK. * @requires * TeaLeafCfg.js * @addon */ TeaLeaf.PageSetup = function() { if(TeaLeaf.Configuration.tlSDK == false ){ for(var i=0; i 0){ winWidth = elems[0].clientWidth; winHeight = elems[0].clientHeight; } } var retType = TeaLeaf.Event.tlResolutionType(winWidth, winHeight); return retType; } /** * Get the page render time. * @requires * TeaLeaf.js * TeaLeafCfg.js * TeaLeafEventCfg.js * @addon */ TeaLeaf.Event.tlGetRenderTime = function(){ return TeaLeaf.Event.PageLoadMilliSecs; } /** * Get element count. * @param element DOM element name * @addon */ TeaLeaf.Event.tlGetElementCount = function(element){ return document.getElementsByName(element).length; } /** * Get count of broaken images. * @addon */ TeaLeaf.Event.tlBadImageCount = function() { var cnt = 0; var ind; for(ind = 0; ind < document.images.length; ind++) { var img = document.images[ind]; // IE correctly identifies any images that weren't downloaded as // not complete. Others should too. Gecko-based browsers act // like NS4 in that they report this incorrectly. if (!img.complete) { cnt++; continue; } // However, they do have two very useful properties: naturalWidth and // naturalHeight. These give the true size of the image. If it failed // to load, either of these should be zero. if (typeof img.naturalWidth != "undefined" && img.naturalWidth == 0) { cnt++; } } return cnt; } /** * Get TeaLeaf current event count. * @addon */ TeaLeaf.Event.tlGetEventCount = function(){ return TeaLeaf.Event.Configuration.tleventcount; } /** * Get sent sting length. * @param sendStr get lenght of sendStr * @addon */ TeaLeaf.Event.tlGetSendStringBytes = function(sendStr){ return sendStr.length; } /** * Get user dwell time on a page. * @requires * TeaLeaf.js * TeaLeafCfg.js * TeaLeafEventCfg.js * @addon */ TeaLeaf.Event.tlGetDwellTime = function(){ return TeaLeaf.Event.tlDateDiff(TeaLeaf.tlStartLoad, TeaLeaf.Event.Configuration.tllastdwelltime); } /** * Get the ID of the last visited DOM element that we have listeners attached. * @requires * TeaLeafEventCfg.js * @addon */ TeaLeaf.Event.tlGetLastVisitedElementID = function(){ return TeaLeaf.Event.Configuration.tlidoflastvisitedcontrol; } /** * Get the date difference between two values. * @param v1 first time value * @param v2 second time value * @addon */ TeaLeaf.Event.tlDateDiff = function(v1, v2) { return Math.abs(v1-v2); } /** * Re-format the XML. * @param Str containing XML to be re-formated * @addon */ TeaLeaf.Event.tlFormatXML = function(Str) { if (Str) { if( Str.replace ) { return Str.replace(/&/g, "&").replace(/\"/g, """).replace(//g, ">"); } return Str; } return ""; } /** * Get cookie value. * @param name cookie name * @addon */ TeaLeaf.Event.tlGetCookie = function(name){ var dc = document.cookie; var prefix = name + "="; var begin = dc.indexOf("; " + prefix); if (begin == -1) { begin = dc.indexOf(prefix); if (begin != 0) { return ""; } } else { begin += 2; } var end = document.cookie.indexOf(";", begin); if (end == -1) { end = dc.length; } return unescape(dc.substring(begin + prefix.length, end)); } /** * Set HTTP headers. * @param tlreq XMLHTTPRequest object * @param tlheaderconfig JSON array with the HTTP header field values. * @requires * TeaLeaf.js * TeaLeafCfg.js * TeaLeafEventCfg.js * @addon */ TeaLeaf.Event.tlSetHTTPHeaders = function(tlreq, tlheaderconfig){ for(var i=0; i\r\n"; // Send the request try { var tlExceptionEvent = new TeaLeaf.Event("INFO", "EXCEPTION"); tlExceptionEvent.tlSendXML(tlsendStr, true); } catch(exc) { if( TeaLeaf.Event.Configuration.tlshowexceptions ) { alert(exc.name + ": " + exc.message + "\r\n\r\nPos 4"); } } } /** * Create the XMLHTTPRequest transport object. * @addon */ TeaLeaf.Event.tlGetTransport = function(){ var tlreq; if(window.XMLHttpRequest) { try { tlreq = new XMLHttpRequest(); } catch(e) { tlreq = null; } } else if(window.ActiveXObject) { try { tlreq = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { tlreq = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { tlreq = null; } } } return tlreq; } TeaLeaf.Event.TransportArray = new Array(); /** * Get the XMLHTTPRequest transport object from the Transport Array if not create one. * @addon */ TeaLeaf.Event.tlXMLHTTPObj = function(){ var i = 0; for(; i < TeaLeaf.Event.TransportArray.length; i++) { if( TeaLeaf.Event.TransportArray[i] && TeaLeaf.Event.TransportArray[i].readyState > 0 ) { if( TeaLeaf.Event.TransportArray[i].readyState == 4 ) { TeaLeaf.Event.TransportArray[i].abort(); TeaLeaf.Event.TransportArray[i].onreadystatechange = new function() {}; return TeaLeaf.Event.TransportArray[i]; } } else { TeaLeaf.Event.TransportArray[i] = TeaLeaf.Event.tlGetTransport(); return TeaLeaf.Event.TransportArray[i]; } } // Nope, we need another TeaLeaf.Event.TransportArray[i] = TeaLeaf.Event.tlGetTransport(); return TeaLeaf.Event.TransportArray[i]; } /** * Clean the XMLHTTPRequest Transport Array. * @addon */ TeaLeaf.Event.tlCleanXMLHTTPObj = function(obj){ // Zap this one! var i = 0; for(; i < TeaLeaf.Event.TransportArray.length; i++) { if( obj == TeaLeaf.Event.TransportArray[i] ) { TeaLeaf.Event.TransportArray[i] = null; } } } /** * Add event handler. * @param tlitem element that we attach a listener * @param tlevt event that we listen for * @param tlhandler event handler * @addon */ TeaLeaf.Event.tlAddHandler = function(tlitem, tlevt, tlhandler, tlcapture) { try { if( tlitem.addEventListener ) { tlitem.addEventListener(tlevt, tlhandler, tlcapture); } else if( tlitem.attachEvent ) { tlitem.attachEvent('on'+tlevt, tlhandler); } } catch(exc) { if( TeaLeaf.Event.Configuration.tlshowexceptions ) { alert(exc.name + ": " + exc.message + "\r\n\r\nPos 4"); } } } /** * Remove event handler. * @param tlitem element that we attached a listener * @param tlevt event that we listened * @param tlhandler event handler * @addon */ TeaLeaf.Event.tlRemoveHandler = function(tlitem, tlevt, tlhandler, tlcapture) { try { if( tlitem.removeEventListener ) { tlitem.removeEventListener(tlevt, tlhandler, tlcapture); } else if( tlitem.detachEvent ) { tlitem.detachEvent('on'+tlevt, tlhandler); } } catch(exc) { if( TeaLeaf.Event.Configuration.tlshowexceptions ) { alert(exc.name + ": " + exc.message + "\r\n\r\nPos 5"); } } } /** * Flush the event queue. * @param force forces the flush if true * @requires * TeaLeaf.js * TeaLeafCfg.js * TeaLeafEventCfg.js * @addon */ TeaLeaf.Event.tlFlushQueue = function(force) { var dataToSend = null; var queueTime = TeaLeaf.Event.Configuration.tlqueueeventstimer; var maxTime = queueTime * 3; // Nothing to send if(TeaLeaf.Event.Configuration.tlusetopqueue) { var now = new Date(); var diff = (now - top.TeaLeaf.Event.TimeSent); // If we have queued data, let's send it if appropriate if( top.TeaLeaf.Event.tlQueuedXML ) { if( force || diff >= queueTime ) { dataToSend = top.TeaLeaf.Event.tlQueuedXML; top.TeaLeaf.Event.tlQueuedXML = ""; top.TeaLeaf.Event.TimeSent = now; } } // Nothing to send if( ! dataToSend ) { if( ! force && diff < (queueTime / 2) ) { // A little heuristics here--If the time is less than // 1/2 the standard time, then assume another frame // is handling the send. Slow down the transmission // time for this frame. // we need to do this so we do not end up waiting infinately. if(queueTime >= maxTime){ queueTime = maxTime; } else{ queueTime = (queueTime * 3) / 2; } } return queueTime; } } else { if( ! TeaLeaf.Event.tlQueuedXML ) { return queueTime; } dataToSend = TeaLeaf.Event.tlQueuedXML; TeaLeaf.Event.tlQueuedXML = ""; } // Get the Event var evt = new TeaLeaf.Event("GUI", "QUEUED"); evt.tlSendXML(dataToSend); return queueTime; } /** * Push XML on the stack. * @param tag tag name * @addon */ TeaLeaf.Event.prototype.tlPushXML = function(tag){ if( ! this.XMLStack ) { this.XMLStack = new Array(); } var strTag = " <" + tag; if(this.XMLData){ this.XMLData += strTag; } else{ this.XMLData = strTag; } } /** * Pop XML from the stack. * @param tag tag name * @addon */ TeaLeaf.Event.prototype.tlPopXML = function(){ if(this.XMLData){ this.XMLData += " />\r\n"; } else{ return false; } } /** * Add data tot he XML stack. * @param name0 name of the XML attribute. * @param value0 value of the XML attribute. * @addon */ TeaLeaf.Event.prototype.tlAddData = function(nameValueArray){ var ind; var offset = ""; if( this.XMLStack ) { for(ind = 0; ind < this.XMLStack.length; ind++) { offset += " "; } } for(ind = 1; ind < nameValueArray.length; ind += 2){ var name = nameValueArray[ind-1]; var tlValue = TeaLeaf.Event.tlFormatXML(nameValueArray[ind]); if( name && tlValue ) { var strXMLData = offset + " " + name + "=" +"\""+tlValue+"\""; if(this.XMLData){ this.XMLData += strXMLData; } else{ this.XMLData = strXMLData; } } } delete nameValueArray; } /** * Send the XML with the UI Client Events including the HTTP headers if set. * @param tlsendStr XML message * @requires * TeaLeafEventCfg.js * @addon */ TeaLeaf.Event.prototype.tlSendXML = function(tlsendStr, tlignoresendfailure){ // Get an the request object var tlreq = TeaLeaf.Event.tlXMLHTTPObj(); if( ! tlreq ) { return; } // Send the request try { var tlurl = this.theUrl; tlreq.onreadystatechange = function(code) { if( tlreq.readyState == 4 ) { // The try/catch is to catch a netscape bug // https://bugzilla.mozilla.org/show_bug.cgi?id=238559#c0 // Thanks to JS for the help try { if( tlreq.status != 200 && tlreq.status != 304 ) { TeaLeaf.Event.tlSendFailure(tlurl, tlurl, "Status " + tlreq.status + ": " + tlreq.statusText); } } catch(e) { } } } tlreq.open("POST", tlurl, true); TeaLeaf.Event.tlSetHTTPHeaders(tlreq, TeaLeaf.Event.Configuration.tlHTTPRequestHeadersSet); //Set the TeaLeaf HTTP Header Values if( TeaLeaf.Event.Configuration.tlinitflag == true ){ TeaLeaf.Event.tlSetHTTPHeaders(tlreq, TeaLeaf.Event.Configuration.tlHTTPRequestHeadersEvalInit); } if( TeaLeaf.Event.Configuration.tlbeforeunloadflag == true ){ TeaLeaf.Event.tlSetHTTPHeaders(tlreq, TeaLeaf.Event.Configuration.tlHTTPRequestHeadersEvalBeforeUnload); } tlreq.send(tlsendStr); } catch(exc) { if( TeaLeaf.Event.Configuration.tlshowexceptions ) { if( exc.name ) { alert(exc.name + ": " + exc.message + "\r\n\r\nURL: " + this.theUrl + "\r\n\r\nPos 3 "); } else { alert(exc + "\r\n\r\nURL: " + this.theUrl + "\r\n\r\nPos 3 "); } } if(tlignoresendfailure == true){ TeaLeaf.Event.tlSendFailure(this.theUrl, this.theUrl, exc); } TeaLeaf.Event.tlCleanXMLHTTPObj(tlreq); } } /** * Depending on the configuration settings send the XML or queue the XML message. * @requires * TeaLeaf.js * TeaLeafCfg.js * TeaLeafEventCfg.js * @addon */ TeaLeaf.Event.prototype.tlSend = function(bRoot){ // Pop everything on the queue if( this.XMLStack ) { while( this.XMLStack.length > 0 ) { this.tlPopXML() } } var t1970 = Date.UTC(this.date.getUTCFullYear(),this.date.getUTCMonth(),this.date.getUTCDate(), this.date.getUTCHours(),this.date.getUTCMinutes(),this.date.getUTCSeconds(), this.date.getUTCMilliseconds()); var timeDur; if( TeaLeaf.tlStartLoad ) { timeDur = TeaLeaf.Event.tlDateDiff(this.date, TeaLeaf.tlStartLoad); } TeaLeaf.Event.Configuration.tleventcount++; sendStr = "\r\n" + this.XMLData + "\r\n"; } else{ sendStr = sendStr + " PageId=\"" + TeaLeaf.Event.tlGetPageId() +"\""+ this.XMLData + " TimeDuration=\"" + timeDur + "\""+ " DateSince1970=\"" + t1970 + "\" />\r\n"; } // Queue the event if( TeaLeaf.Event.Configuration.tlqueueevents ) { if( TeaLeaf.Event.Configuration.tlusetopqueue ) { if( top.TeaLeaf.Event.tlQueuedXML ) { top.TeaLeaf.Event.tlQueuedXML += sendStr; } else { top.TeaLeaf.Event.tlQueuedXML = sendStr; } } else { if( TeaLeaf.Event.tlQueuedXML ) { TeaLeaf.Event.tlQueuedXML += sendStr; } else { TeaLeaf.Event.tlQueuedXML = sendStr; } } // Check the size of the XML. IF it is getting too // big, send it if( TeaLeaf.Event.Configuration.tlqueueeventsmaxsz < TeaLeaf.Event.tlQueuedXML.length ) { TeaLeaf.Event.tlFlushQueue(); } return; } // Send the request try { this.tlSendXML(sendStr); this.XMLData = ""; } catch(exp) { } this.XMLData = ""; } /** * Enable HTTP Headers defined in the TeaLeafEventCfg.js. * @param obj determines what set of HTTP headers to be set. * @requires * TeaLeafEventCfg.js * @addon */ TeaLeaf.Event.tlEnableAllHTTPHeaders = function(obj) { if(obj){ if(obj == "info"){ TeaLeaf.Event.tlEventJSONCfgUtil(TeaLeaf.Event.Configuration.tlHTTPRequestHeadersSet, true, "all"); } else if(obj == "init"){ TeaLeaf.Event.tlEventJSONCfgUtil(TeaLeaf.Event.Configuration.tlHTTPRequestHeadersEvalInit, true, "all"); } else if(obj == "beforeunload"){ TeaLeaf.Event.tlEventJSONCfgUtil(TeaLeaf.Event.Configuration.tlHTTPRequestHeadersEvalBeforeUnload, true, "all"); } } else{ TeaLeaf.Event.tlEventJSONCfgUtil(TeaLeaf.Event.Configuration.tlHTTPRequestHeadersSet, true, "all"); TeaLeaf.Event.tlEventJSONCfgUtil(TeaLeaf.Event.Configuration.tlHTTPRequestHeadersEvalInit, true, "all"); TeaLeaf.Event.tlEventJSONCfgUtil(TeaLeaf.Event.Configuration.tlHTTPRequestHeadersEvalBeforeUnload, true, "all"); } } /** * Enable HTTP Headers defined in the TeaLeafEventCfg.js. * @param obj determines what set of HTTP headers to be set. * @requires * TeaLeafEventCfg.js * @addon */ TeaLeaf.Event.tlEnableHTTPHeader = function(obj, headerName) { if(obj == "info"){ TeaLeaf.Event.tlEventJSONCfgUtil(TeaLeaf.Event.Configuration.tlHTTPRequestHeadersSet, true, headerName); } else if(obj == "init"){ TeaLeaf.Event.tlEventJSONCfgUtil(TeaLeaf.Event.Configuration.tlHTTPRequestHeadersEvalInit, true, headerName); } else if(obj == "beforeunload"){ TeaLeaf.Event.tlEventJSONCfgUtil(TeaLeaf.Event.Configuration.tlHTTPRequestHeadersEvalBeforeUnload, true, headerName); } } /** * Disable HTTP Headers defined in the TeaLeafEventCfg.js. * @param obj determines what set of HTTP headers to be set. * @requires * TeaLeafEventCfg.js * @addon */ TeaLeaf.Event.tlDisableAllHTTPHeaders = function(obj) { if(obj){ if(obj == "info"){ TeaLeaf.Event.tlEventJSONCfgUtil(TeaLeaf.Event.Configuration.tlHTTPRequestHeadersSet, false, "all"); } else if(obj == "init"){ TeaLeaf.Event.tlEventJSONCfgUtil(TeaLeaf.Event.Configuration.tlHTTPRequestHeadersEvalInit, false, "all"); } else if(obj == "beforeunload"){ TeaLeaf.Event.tlEventJSONCfgUtil(TeaLeaf.Event.Configuration.tlHTTPRequestHeadersEvalBeforeUnload, false, "all"); } } else{ TeaLeaf.Event.tlEventJSONCfgUtil(TeaLeaf.Event.Configuration.tlHTTPRequestHeadersSet, false, "all"); TeaLeaf.Event.tlEventJSONCfgUtil(TeaLeaf.Event.Configuration.tlHTTPRequestHeadersEvalInit, false, "all"); TeaLeaf.Event.tlEventJSONCfgUtil(TeaLeaf.Event.Configuration.tlHTTPRequestHeadersEvalBeforeUnload, false, "all"); } } /** * Enable queuing of events. * @requires * TeaLeafEventCfg.js * @addon */ TeaLeaf.Event.tlEnableQueueEvents = function() { TeaLeaf.Event.Configuration.tlqueueevents = true; } /** * Disable queuing of events. * @requires * TeaLeafEventCfg.js * @addon */ TeaLeaf.Event.tlDisableQueueEvents = function() { TeaLeaf.Event.Configuration.tlqueueevents = false; } /** * Enable showing of exception in an alert message. * @requires * TeaLeafEventCfg.js * @addon */ TeaLeaf.Event.tlEnableShowExceptions = function() { TeaLeaf.Event.Configuration.tlshowexceptions = true; } /** * Disable showing of exception in an alert message. * @requires * TeaLeafEventCfg.js * @addon */ TeaLeaf.Event.tlDisableShowExceptions = function() { TeaLeaf.Event.Configuration.tlshowexceptions = false; } /** * Set queue event flush time. * @requires * TeaLeafEventCfg.js * @addon */ TeaLeaf.Event.tlSetQueueEventTime = function(tlvalue) { TeaLeaf.Event.Configuration.tlqueueeventstimer = tlvalue; } /** * Get queue event flush time. * @requires * TeaLeafEventCfg.js * @addon */ TeaLeaf.Event.tlGetQueueEventTime = function() { return TeaLeaf.Event.Configuration.tlqueueeventstimer; } /** * Set queue event maximum size. * @requires * TeaLeafEventCfg.js * @addon */ TeaLeaf.Event.tlSetQueueEventMaxSize = function(tlvalue) { TeaLeaf.Event.Configuration.tlqueueeventsmaxsz = tlvalue; } /** * Get queue event maximum size. * @requires * TeaLeafEventCfg.js * @addon */ TeaLeaf.Event.tlGetQueueEventMaxSize = function() { return TeaLeaf.Event.Configuration.tlqueueeventsmaxsz; } /** * Set the url where TeaLeaf posts. * @requires * TeaLeafEventCfg.js * @addon */ TeaLeaf.Event.tlSetPostURL = function(tlvalue) { TeaLeaf.Event.Configuration.tlurl = tlvalue; } /** * Get the url where TeaLeaf posts. * @requires * TeaLeafEventCfg.js * @addon */ TeaLeaf.Event.tlGetPostURL = function() { return TeaLeaf.Event.Configuration.tlurl; } /** * Set page id cookie value. * @requires * TeaLeafEventCfg.js * @addon */ TeaLeaf.Event.tlSetPageIDCookie = function(tlvalue) { TeaLeaf.Event.Configuration.tlpageidcookie = tlvalue; } /** * Get page id cookie value. * @requires * TeaLeafEventCfg.js * @addon */ TeaLeaf.Event.tlGetPageIDCookie = function(tlvalue) { return TeaLeaf.Event.Configuration.tlpageidcookie; } /** * JSON configuration utility allowing to enable/disable certain DOM events * @requires * TeaLeafEventCfg.js * @addon */ TeaLeaf.Event.tlEventJSONCfgUtil = function(tlJSONConfig, tlEnable, domEventName) { for(var i = 0; i -1){ _url += '&nocache=' + date.getTime(); } else{ _url += '?nocache=' + date.getTime(); } return _url; } function Ajax_UpdateInnerHtml(){ if (xmlHttp.readyState == 4) { if (is404Page(xmlHttp.responseText)) eval(handler + '(\'\')'); else if (xmlHttp.status == 200) { document.getElementById(element).innerHTML = xmlHttp.responseText; } } } function AJ_SC() { if (xmlHttp.readyState == 4) { if (is404Page(xmlHttp.responseText)) eval(handler + '(\'\')'); else if (xmlHttp.status == 200) { var re = new RegExp('\'', 'gi'); var r = xmlHttp.responseText.replace(re,'\\\''); var reNL = new RegExp('\n', 'g'); r = r.replace(reNL,''); var reCR = new RegExp('\r', 'g'); r = r.replace(reCR,''); eval(handler + '(\'' + r + '\')'); } } } function AJ_X() { var oX = null; try { oX = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { oX = new ActiveXObject("Microsoft.XMLHTTP"); } catch(E) { oX = null; } } if((oX == null) && (typeof XMLHttpRequest != 'undefined')) { oX = new XMLHttpRequest(); } return oX; } function is404Page(sText) { return sText.indexOf("The page you requested has been moved or does not exist") >= 0; } }//This function required prototype.js or /daily/js/ajax.js to already be included function Dedup() { var url = window.location.href; var fDelete = false; //Checking for SEM links. if( (ParamExists("kword", url)) || (ParamExists("semcid", url)) ) { fDelete = true; } //Checking for Email links else if ( (ParamExists("emlcid", url)) || ( (ParamExists("eml", url)) && (GetParam("tpid", url) == "1") ) ) { fDelete = true; } // Trip Advisor links or other Distribution Partners else if ( ParamExists("mdpcid", url) ) { fDelete = true; } // Online Advertising links else if ( ParamExists("olacid", url) ) { fDelete = true; } // MSN links else if ( ParamExists("mdpcid", url) && ParamExists("msncid", url) ) { fDelete = true; } // Affinity Marketing else if ( ParamExists("afmcid", url) ) { fDelete = true; } // EAPs - may need to check cookie else if ( ParamExists("eapid", url) && (GetParam("eapid", url) != "0" ) ) { fDelete = true; } // affcid: if affcid param is present and not cjXXX then dedupe else if ( ParamExists("affcid", url) && (GetParam("affcid", url).indexOf("cj") != 0) ) { fDelete = true; } if (fDelete) { try{ if(typeof(Prototype) != 'undefined'){ var ajax = new Ajax.Request('/pub/agent.dll',{method: 'get', parameters: 'qscr=uasc&flag=d', onFailure: DeleteError}); } else{ var ajax = new Ajax(); ajax.SendRequest('/pub/agent.dll?qscr=uasc&flag=d'); ajax = null; } } catch(e){ } } } function DeleteSuccess() {} function DeleteError() {} function ParamExists(strParameterAnyCase, strQueryAnyCase) { return GetParam(strParameterAnyCase, strQueryAnyCase).length > 0; } // from LaunchKanaRealtime.js. Made the comparisons case insensitive. // The returned query parameter value is always in lower case function GetParam( strParameterAnyCase, strQueryAnyCase ) { var strQuery = strQueryAnyCase.toLowerCase(); var strParameter = strParameterAnyCase.toLowerCase(); // the value string var strValue = "" ; // can we find the specified parameter in the query string? (first try with "?") var strParamEquals = "?" + strParameter + "=" ; var iParamStart = strQuery.indexOf( strParamEquals ) ; if ( iParamStart == -1 ) { // no - can we find the specified parameter in the query string? (now try with "&") strParamEquals = "&" + strParameter + "=" ; iParamStart = strQuery.indexOf( strParamEquals ) ; } // did we find the specified parameter? if ( iParamStart != -1 ) { // yes - get the starting location for the value string var iValueStart = iParamStart + strParamEquals.length ; // get the value string pointed to by the parameter strValue = strQuery.substring( iValueStart, strQuery.length ) ; // is there another parameter in the value string? var iNextParameter = strValue.indexOf( "&" ) ; if ( iNextParameter != -1 ) { // yes - truncate the value string before that parameter strValue = strValue.substring( 0, iNextParameter ) ; } } // unescape the value string strValue = unescape( strValue ) ; return( strValue ) ; } //Make function call Dedup();