/////////////////// Global Vars /////////////////// var eidValue_Global=''; var bidValue_Global=''; //////////// Basic cookie functions /////////////// function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; var ck = name+"="+value+expires+"; path=/"; document.cookie = ck; } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i 0) && (bidValue_Global.length > 0)){ CreateCookieForEmailID(eidValue_Global); CreateCookieForCampaignID(bidValue_Global); }else{ //eidValue_Global and bidValue_Global are NULL so use the existing Cookie Value } } /////////// Get Conversion param data from URL /////////// function getConversionParams(){ var sURL = window.document.URL.toString(); var bidValue = ""; var eidValue = ""; if (sURL.indexOf("?") > 0) { var arrParams = sURL.split("?"); var arrURLParams = arrParams[1].split("&"); var arrParamNames = new Array(arrURLParams.length); var arrParamValues = new Array(arrURLParams.length); var i = 0; for (i=0;i 0 && eidValue_Global.length > 0){ if(!(bidValue == bidValue_Global) || !(eidValue == eidValue_Global)){ CreateConversionCookies(); } }else{ //bidValue / eidValue are null / no params. so use existing cookies } } //Get the cookie values again. They might be different. bidValue = readCookie("bid"); eidValue = readCookie("eid"); if (bidValue != null && eidValue != null && bidValue!="" && eidValue!="") { var origURL = sURL.split("bid="); conversionURL = "https://www.ecn5.com/ecn.communicator/engines/conversion.aspx?b="+bidValue+"&e="+eidValue+"&oLink="+origURL[0]; } else { conversionURL = "/images/spacer.gif"; } return conversionURL; } /////////// POST Value from Hidden directly//////// function PostRevenueConversionData_Direct() { var sURL = window.document.URL.toString(); var conversionURL = ""; var bidValue = readCookie("bid"); var eidValue = readCookie("eid"); var totalValue = getobjValue('ecnConv_total'); if (bidValue != null && eidValue != null && bidValue!="" && eidValue!="") { var origURL = sURL.split("bid="); conversionURL = "https://www.ecn5.com/ecn.communicator/engines/conversion.aspx?b="+bidValue+"&e="+eidValue+"&total="+totalValue+"&oLink="+origURL[0]; } else { conversionURL = ""; } return conversionURL; } /////////// POST Value from COOKIE directly//////// function PostRevenueConversionData_Cookie() { var sURL = window.document.URL.toString(); var conversionURL = ""; var bidValue = readCookie("bid"); var eidValue = readCookie("eid"); var totalValue = readCookie("revTotal"); if (bidValue != null && eidValue != null && bidValue!="" && eidValue!="") { var origURL = sURL.split("bid="); conversionURL = "https://www.ecn5.com/ecn.communicator/engines/conversion.aspx?b="+bidValue+"&e="+eidValue+"&total="+totalValue+"&oLink="+origURL[0]; } else { conversionURL = ""; } return conversionURL; } /////////// Convertion Value from Hidden/////////// function getobjValue(id) { if (document.all && !document.getElementById) obj = eval('document.all.' + id); else if (document.layers) obj = eval('document.' + id); else if (document.getElementById) obj = document.getElementById(id); return obj.value; }