JavaScript
Executed Scripts (19)
Executed Evals (13)
#1 JavaScript::Eval (size: 59) - SHA256: af3f6fff6065dde819b6236683c63956ea68165c8b7952df0fa8af6098e227cf
[{
area: 'ad_postion_601',
entity: 'c_image',
ad_type: 'public'
}]
#2 JavaScript::Eval (size: 59) - SHA256: 38f0f6aa8f7d6e73d7ea43ca391b0d03b3ca9ff7bd18cde8209e7aa87506b406
[{
area: 'ad_postion_602',
entity: 'c_image',
ad_type: 'public'
}]
#3 JavaScript::Eval (size: 138) - SHA256: 963ae1abde3786aa1542f2d3962a794914d2d66bc6bba1a80f1eeabf0eb4c559
lpRequest.prototype.MakeCallByIframe = function() {
var that = this;
lpLazy.prx('lpRequest.prototype.MakeCallByIframe', arguments, that);
}
#4 JavaScript::Eval (size: 64) - SHA256: db294798e63bf93841f1d348f6603a0aab6658af27263e6a7b27a102427f69dd
[{
area: 'ad_postion_107',
entity: 'global_image',
ad_type: 'public'
}]
#5 JavaScript::Eval (size: 46777) - SHA256: 7fa1cb550f25f4fd561d67a0c086c1883853fffe4e9d15166f48c88f304b1628
if (typeof Array.prototype.splice === 'undefined') {
Array.prototype.splice = function(a, c) {
var i = 0,
e = arguments,
d = this.copy(),
f = a;
if (!c) {
c = this.length - a
}
for (i; i < e.length - 2; i++) {
this[a + i] = e[i + 2]
}
for (a; a < this.length - c; a++) {
this[a + e.length - 2] = d[a - c]
}
this.length -= c - e.length + 2;
return d.slice(f, f + c)
}
}
function hcArrayStorage() {
this.idx = 0;
this.nArr = [];
this.vArr = []
}
hcArrayStorage.prototype.add = function(n, v, unescD) {
if (typeof(unescD) == 'undefined') {
unescD = false
}
if (typeof(v) == 'undefined') {
var temp = n.split('=');
n = temp[0];
v = temp[1]
}
if (unescD) {
this.nArr[this.idx] = unescape(n);
this.vArr[this.idx] = unescape(v)
} else {
this.nArr[this.idx] = n;
this.vArr[this.idx] = v
}
this.idx++
};
hcArrayStorage.prototype.size = function() {
return this.idx
};
hcArrayStorage.prototype.get = function(i) {
if (typeof(this.nArr[i]) == 'undefined') {
return ''
}
var tmp = escape(this.nArr[i]) + '=' + escape(this.vArr[i]);
tmp = tmp.replace(/\+/g, "%2B");
return tmp
};
hcArrayStorage.prototype.getName = function(i) {
return this.nArr[i]
};
hcArrayStorage.prototype.getValue = function(i) {
return this.vArr[i]
};
hcArrayStorage.prototype.getValueEsc = function(i) {
return escape(this.vArr[i])
};
hcArrayStorage.prototype.getByName = function(n) {
for (var i = 0; i < this.idx; i++) {
if (this.getName(i) == n) {
return i
}
}
return -1
};
hcArrayStorage.prototype.remove = function(i) {
if (typeof(i) == 'undefined' || i == null || typeof(this.nArr[i]) == 'undefined') {
return
}
this.nArr.splice(i, 1);
this.vArr.splice(i, 1);
this.idx--
};
hcArrayStorage.prototype.paramLength = function(i) {
var url = '&' + this.get(i);
return url.length
};
hcArrayStorage.prototype.fullLength = function() {
var length = 0;
for (var i = 0; i < this.idx; i++) {
length += this.paramLength(i)
}
return length
};
hcArrayStorage.prototype.getMaxLengthItem = function() {
var max = 0,
maxItemId = -1;
for (var i = 0; i < this.idx; i++) {
if (this.paramLength(i) > max) {
max = this.paramLength(i);
maxItemId = i
}
}
return maxItemId
};
hcArrayStorage.prototype.clone = function() {
var cObj = new hcArrayStorage();
cObj.idx = this.idx;
for (var i = 0; i < this.idx; i++) {
cObj.nArr[i] = this.nArr[i];
cObj.vArr[i] = this.vArr[i]
}
return cObj
};
function lpRequest(protocolVer, Url, params, Callback, requireConfirm, maxretries, prunId, lpjson, enc, browser, postAutoConfirm, spImmediateCleanup, partial, part, outOf, forceget, forcePost, encodingBlankUrl, minPost, minPostMaxGets, allowTruncate) {
this.headLoc = document.getElementsByTagName("head").item(0);
this.timeStamp = new Date();
this.callId = this.getCID();
this.protocolVer = protocolVer;
this.scriptId = 'lpScriptId' + this.callId;
this.callbackFunc = Callback;
this.requireConfirm = requireConfirm;
this.spImmediateCleanup = spImmediateCleanup;
this.postAutoConfirm = postAutoConfirm;
this.params = params;
this.BaseUrl = Url;
this.fullUrl = '';
if (typeof(enc) != 'undefined' && enc != '' && enc != null) {
this.dataEncoding = enc.toUpperCase()
} else {
this.dataEncoding = "UTF-8"
}
this.retries = 0;
this.confirmed = false;
this.usedget = true;
this.usedSpecialPost = false;
this.maxretries = maxretries;
this.prunId = prunId;
this.lpjson = lpjson;
this.browser = browser;
this.spImmediateCleanup = true;
if (typeof(partial) == 'undefined') {
partial = false
}
this.partial = partial;
if (typeof(part) == 'undefined') {
part = 0
}
this.part = part;
if (typeof(outOf) == 'undefined') {
outOf = 0
}
this.outOf = outOf;
this.forceget = forceget;
this.forcePost = forcePost;
this.encodingBlankUrl = encodingBlankUrl;
this.minimizePost = minPost;
this.minimizePostMaxGets = minPostMaxGets;
this.allowTruncate = allowTruncate
}
lpRequest.prototype.getCID = function() {
var sKey = lpConnLib.getC('HumanClickKEY'),
i = 999999999999;
if (sKey == null) {
sKey = this.getPadding(Math.round(Math.random() * i), ('' + i).length)
}
return sKey + '-' + this.getPadding(Math.round(Math.random() * i), ('' + i).length)
};
lpRequest.prototype.getPadding = function(n, maxLen) {
var s = '000000000000' + n;
return s.substring(s.length - maxLen)
};
lpRequest.prototype.BuildBaseCallUrl = function() {
var url = this.BaseUrl;
if (url.indexOf('?') == -1) {
url += '?'
} else {
url += '&'
}
url += 'lpCallId=' + this.callId;
url += '&protV=' + this.protocolVer;
url += '&' + this.prunId + this.lpjson;
return url
};
lpRequest.prototype.BuildCallUrl = function(type, maxLn, nolog) {
var cUrl = this.BuildBaseCallUrl(),
urlLn = cUrl.length;
if (type == 'get') {
if (this.params.size() > 0) {
for (var i = 0; i < this.params.size(); i++) {
cUrl += '&' + this.params.get(i)
}
}
urlLn = cUrl.length;
if (urlLn > maxLn) {
if (!nolog) {
lpConnLib.log('BuildCallUrl Cut length:' + urlLn + ' m=' + maxLn, 'WARN', 'EMT')
}
cUrl = cUrl.substring(0, maxLn)
}
}
this.fullUrl = cUrl;
return urlLn
};
lpRequest.prototype.MakeCallByScript = function() {
this.scriptObj = document.createElement('script');
this.scriptObj.setAttribute('type', 'text/javascript');
this.scriptObj.setAttribute('charset', this.dataEncoding);
this.scriptObj.setAttribute('src', this.fullUrl);
this.scriptObj.setAttribute('id', this.scriptId);
this.headLoc.appendChild(this.scriptObj)
};
lpRequest.prototype.removeScriptTag = function() {
try {
this.headLoc.removeChild(this.scriptObj)
} catch (e) {
lpConnLib.log('removeScript FAILED:' + e, 'ERROR', 'EMT')
}
};
lpRequest.prototype.clone = function() {
var cRq = new lpRequest();
for (var p in this) {
if (typeof(this[p]) != 'undefined') {
if (typeof(this[p]) != 'object') {
cRq[p] = this[p]
} else if (typeof(this[p]) != 'undefined' && this[p] != null && this[p].constructor == hcArrayStorage) {
cRq[p] = this[p].clone()
} else {
cRq[p] = this[p]
}
}
}
return cRq
};
function lpConnectionLibrary() {
this.protocolVer = 20;
this.garbagePeriod = 10;
this.gcT = 0;
this.callTimeoutPeriod = 3 * this.garbagePeriod;
this.maxurllengthMZ = 2083;
this.maxurllengthIE = 2083;
this.postDeleteIfrDelay = 3;
this.iframeName = 'lpIframeContainer-' + Math.round(1000 * Math.random());
this.onPostAutoConfirm = true;
this.queue = [];
this.partialQueue = [];
this.fullForPartialQueue = {};
this.browser = this.BrowserSniff();
this.maxurlgetlength = 2083;
this.callCounter = 0;
this.garbageCollectCounter = 0;
this.forcedGet = 0;
this.reconfirmedCalls = 0;
this.resendCounter = 0;
this.partialCounter = 0;
this.lpExecuteErrors = 0;
this.lpCallbackCnt = 0;
this.lpjson = 1;
this.prunId = 'lpjson=';
this.DebugDisplay = false;
this.postParams = [];
this.spPostIframesFree = [];
this.spPostIframesBusy = []
}
lpConnectionLibrary.prototype.SortQueue = function(a, b) {
if (a.confirmed == b.confirmed) {
return a.timeStamp.getTime() - b.timeStamp.getTime()
}
if (a.confirmed && !b.confirmed) {
return -1
}
if (!a.confirmed && b.confirmed) {
return 1
}
return 0
};
lpConnectionLibrary.prototype.confirmConnection = function(idList) {
var tempList = ',' + idList + ',';
for (var i = 0; i < this.queue.length; i++) {
var myid = ',' + this.queue[i].callId + ',';
if (!this.queue[i].confirmed && tempList.indexOf(myid) > -1) {
this.queue[i].confirmed = true
}
}
};
lpConnectionLibrary.prototype.getRequestForCallId = function(callId) {
for (var i = 0; i < this.queue.length; i++) {
if (callId == this.queue[i].callId) {
return this.queue[i]
}
}
return null
};
lpConnectionLibrary.prototype.addToQueue = function(Url, params, Callback, requireConfirm, maxretries, forceget, onPostAutoConfirm, lpjson, dataEncoding, forcePost, specialPost, spImmediateCleanup, encodingBlankUrl, minimizePost, minimizePostMaxGets, allowTruncate) {
var callType = '',
postAutoConfirm = false;
if (typeof(lpjson) != 'undefined') {
this.lpjson = lpjson
}
if (typeof(onPostAutoConfirm) != 'undefined') {
postAutoConfirm = onPostAutoConfirm
} else {
postAutoConfirm = this.onPostAutoConfirm
}
if (typeof(encodingBlankUrl) == 'undefined') {
if (typeof(lpMTagConfig) != 'undefined') {
encodingBlankUrl = lpMTagConfig.lpProtocol + '://' + lpMTagConfig.lpServer + '/hcp/asp/blankenc.asp'
} else if (typeof(lpChatConfig) != 'undefined') {
encodingBlankUrl = lpChatConfig.lpProtocol + '://' + lpChatConfig.lpServer + '/hcp/asp/blankenc.asp'
}
}
this.encodingBlankUrl = encodingBlankUrl;
if (typeof(spImmediateCleanup) == 'undefined') {
spImmediateCleanup = true
}
var request = new lpRequest(this.protocolVer, Url, params, Callback, requireConfirm, maxretries, this.prunId, this.lpjson, dataEncoding, this.browser, postAutoConfirm, spImmediateCleanup, undefined, 0, 0, forceget, forcePost, encodingBlankUrl, minimizePost, minimizePostMaxGets, allowTruncate);
if (typeof(lpMTagDebug) != 'undefined' && typeof(lpMTagDebug.Display) != 'undefined') {
this.DebugDisplay = true
}
if (forceget) {
this.forcedGet++
}
var partial = '',
urlLength = request.BuildCallUrl('get', this.maxurlgetlength, true);
if (!forcePost && (urlLength <= this.maxurlgetlength || forceget)) {
callType = this.makeTheCall(request, 'get', requireConfirm)
} else {
if (typeof(minimizePost) == 'undefined') {
if (typeof(lpMTagConfig.minimizePost) == 'undefined') {
minimizePost = false
} else {
minimizePost = lpMTagConfig.minimizePost
}
}
var minPostStatus = false;
if (!forcePost && minimizePost) {
if (typeof(minimizePostMaxGets) == 'undefined') {
if (typeof(lpMTagConfig.minimizePostMaxGets) == 'undefined') {
minimizePostMaxGets = 3
} else {
minimizePostMaxGets = lpMTagConfig.minimizePostMaxGets
}
}
if (typeof(allowTruncate) == 'undefined') {
if (typeof(lpMTagConfig.allowTruncate) == 'undefined') {
allowTruncate = false
} else {
allowTruncate = lpMTagConfig.allowTruncate
}
}
var origRequest = request.clone();
this.splitRequestIntoGets(request, origRequest, minimizePostMaxGets, allowTruncate, specialPost, postAutoConfirm, spImmediateCleanup, minimizePostMaxGets, requireConfirm);
minPostStatus = true
}
if (!minPostStatus) {
if (specialPost) {
callType = this.makeTheCall(request, 'sp-post', !postAutoConfirm, spImmediateCleanup)
} else {
callType = this.makeTheCall(request, 'post', !postAutoConfirm)
}
}
}
return callType
};
lpConnectionLibrary.prototype.makeTheCall = function(r, pr) {
pr = pr.toUpperCase();
var ret, qsize;
if (pr == 'GET') {
r.BuildCallUrl('get', this.maxurlgetlength);
qsize = this.queue.length;
this.queue[qsize] = r;
this.queue[qsize].MakeCallByScript();
if (!r.requireConfirm) {
this.queue[qsize].confirmed = true
}
ret = 'GET'
} else if (pr == 'POST') {
r.BuildCallUrl('post', this.maxurlgetlength);
qsize = this.queue.length;
this.queue[qsize] = r;
this.queue[qsize].MakeCallByIframe(this.browser);
if (r.postAutoConfirm) {
this.queue[qsize].confirmed = true
}
ret = 'POST'
} else if (pr == 'SP-POST') {
r.BuildCallUrl('post', this.maxurlgetlength);
qsize = this.queue.length;
this.queue[qsize].spImmediateCleanup = r.spImmediateCleanup;
this.specialPostHandler(r.callId);
if (r.postAutoConfirm) {
this.queue[qsize].confirmed = true
}
ret = 'POST'
}
if (this.DebugDisplay) {
var cmd = '';
try {
cmd = r.params.getValue(r.params.getByName('cmd'));
if (typeof(cmd) == 'undefined') {
cmd = r.fullUrl.match(/cmd=.*?&/).toString();
if (cmd != null && cmd != 'null') {
cmd = cmd.replace(/&/g, '')
}
}
cmd = '<strong><span style="color:rgb(255,153,0);">' + cmd + '</span></strong>'
} catch (e) {}
lpConnLib.log('Making ' + pr + ' Call id=' + r.callId + ' ' + cmd, 'DEBUG', 'EMT')
}
this.callCounter++;
return ret
};
lpConnectionLibrary.prototype.hasNonLatinChars = function(params) {
for (var i = 0; i < params.size(); i++) {
if (params.get(i).indexOf("%u") != -1) {
return true
}
}
return false
};
lpConnectionLibrary.prototype.BrowserSniff = function() {
var agt = navigator.userAgent.toLowerCase();
if (agt.indexOf("safari") != -1) {
return 'SAFARI'
}
if (document.all) {
var is_opera = (agt.indexOf("opera") != -1);
if (is_opera) {
return "OPR"
} else {
return "IE"
}
}
if (document.getElementById) {
var is_ff = (agt.indexOf("firefox") != -1);
if (is_ff) {
return "FF"
}
return "MOZ"
}
return "MOZ"
};
lpConnectionLibrary.prototype.GetCallbackFunc = function(usrCallId) {
var qSize = this.queue.length;
for (var i = 0; i < qSize; i++) {
if (this.queue[i].callId == usrCallId) {
return this.queue[i].callbackFunc
}
}
return null
};
lpConnectionLibrary.prototype.CleanUpBusySpecialPost = function(callID) {
if (typeof(callID) == 'undefined') {
callID = null
}
for (var i = 0; i < this.spPostIframesBusy.length; i++) {
if ((this.spPostIframesBusy[i]['spImmediateCleanup'] && this.spPostIframesBusy[i]['callMade']) || this.spPostIframesBusy[i]['callID'] == callID) {
this.releaseIframe(this.spPostIframesBusy[i]['callID'])
}
}
};
lpConnectionLibrary.prototype.gc = function() {
lpConnLib.log('GC', 'OK', 'EMT');
this.queue.sort(this.SortQueue);
var confirmedCnt = 0,
i;
for (i = 0; i < this.queue.length; i++) {
if (this.queue[i].confirmed) {
if (this.queue[i].usedget) {
this.queue[i].removeScriptTag()
}
confirmedCnt++
}
}
this.queue.splice(0, confirmedCnt);
this.garbageCollectCounter++;
this.CleanUpBusySpecialPost();
var now = new Date().getTime();
for (i = 0; i < this.queue.length; i++) {
if (!this.queue[i].confirmed && (now - this.queue[i].timeStamp.getTime()) > this.callTimeoutPeriod * 1000) {
if (this.queue[i].retries < this.queue[i].maxretries) {
this.queue[i].retries++;
this.callCounter++;
this.reconfirmedCalls++;
lpConnLib.log('Retry ' + this.queue[i].retries + '/' + this.queue[i].maxretries + ' cId=' + this.queue[i].callId, 'DEBUG', 'EMT');
this.queue[i].timeStamp = new Date();
if (this.queue[i].usedget) {
this.queue[i].MakeCallByScript()
} else {
if (this.usedSpecialPost) {
this.CleanUpBusySpecialPost(this.queue[i].callId);
this.specialPostHandler(this.queue[i].callId)
} else {
this.queue[i].MakeCallByIframe(this.browser)
}
}
} else {
this.queue[i].confirmed = true;
lpConnLib.log('Timeout for cId=' + this.queue[i].callId, 'DEBUG', 'EMT');
var lpDataObj = {
"ResultSet": {
"lpCallId": this.queue[i].callId,
"lpCallError": "TIMEOUT"
}
};
this.UsrCFn(lpDataObj)
}
}
}
};
lpConnectionLibrary.prototype.Process = function(d) {
if (d == null) {
lpConnLib.log('Cback No data', 'ERROR', 'EMT');
return
}
this.lpCallbackCnt++;
var dRS = d.ResultSet;
d.ServiceInfo = {};
var dSI = d.ServiceInfo;
if (dRS.lpCallId == 0 || dRS.lpCallId == null || dRS.lpCallId == '') {
lpConnLib.log('Cback No Call ID', 'ERROR', 'EMT');
return
}
dSI.requestType = 'REGULAR';
dSI.resendCall = false;
dSI.origCallId = dRS.lpCallId;
if (typeof(dRS.lpData) != 'undefined' && typeof(dRS.lpData) == 'object' && typeof(dRS.lpData[0]) != 'undefined') {
if (typeof(dRS.lpData[0].TYPE) != 'undefined') {
dSI.requestType = dRS.lpData[0].TYPE
}
if (typeof(dRS.lpData[0].RESEND) != 'undefined') {
dSI.resendCall = dRS.lpData[0].RESEND
}
}
if (dSI.resendCall) {
this.resendCounter++
}
if (dSI.requestType == 'PARTIAL REQUEST') {
dRS.lpCallId = dRS.lpCallId + '!' + dRS.lpData[0].PART
}
lpConnLib.log('Cback cId=' + dRS.lpCallId, 'DEBUG', 'EMT');
if (typeof(dRS.lpCallConfirm) == 'undefined' || dRS.lpCallConfirm == '') {
dRS.lpCallConfirm = dRS.lpCallId
} else {
dRS.lpCallConfirm += ',' + dRS.lpCallId
}
var req;
if (dSI.requestType == 'PARTIAL REQUEST' && dSI.resendCall) {
req = this.fullForPartialQueue[dSI.origCallId];
delete this.fullForPartialQueue[dSI.origCallId];
lpConnLib.log('CId=' + dRS.lpCallId + ' Deleted - fullForPartialQueue[' + dSI.origCallId + ']', 'DEBUG', 'EMT')
} else {
req = this.getRequestForCallId(dRS.lpCallId);
if (req != null && req.partial) {
req = this.fullForPartialQueue[dSI.origCallId]
}
}
if (dSI.requestType != 'PARTIAL REQUEST') {
if (this.fullForPartialQueue[dSI.origCallId]) {
delete this.fullForPartialQueue[dSI.origCallId];
lpConnLib.log('CId=' + dRS.lpCallId + ' Deleted fullForPartialQueue[' + dSI.origCallId + ']', 'DEBUG', 'EMT')
}
}
if (req == null) {
lpConnLib.log('REQ is NULL callId=' + dSI.origCallId, 'ERROR', 'EMT')
}
this.confirmConnection(dRS.lpCallConfirm);
if (dSI.requestType == 'PARTIAL REQUEST') {
var callNum, outOfcalls;
if (typeof(dRS.lpData) != 'undefined' && typeof(dRS.lpData) == 'object') {
if (typeof(dRS.lpData[0].PART) != 'undefined') {
callNum = dRS.lpData[0].PART
}
if (typeof(dRS.lpData[0].OUTOF) != 'undefined') {
outOfcalls = dRS.lpData[0].OUTOF
}
}
if (dSI.resendCall) {
for (var i = (callNum + 1); i <= outOfcalls; i++) {
var cid = dSI.origCallId + '!' + i;
delete this.partialQueue[cid]
}
} else {
try {
var ncId = dSI.origCallId + '!' + (callNum + 1);
lpConnLib.log('P Call Response recieved - ' + dRS.lpCallId + ' part=' + callNum + ' outof=' + outOfcalls, 'DEBUG', 'EMT');
var r = this.partialQueue[ncId];
if (r != null) {
delete this.partialQueue[ncId];
if (r.part == r.outOf) {
r.callId = this.spPartFromStr(r.callId)
}
this.makeTheCall(r, 'get')
} else {
if (typeof(dbg) != 'undefined' && dbg.Display) {
dbg.Display('P Call NOT found for id=' + ncId, 'ERROR', 'EMT')
}
}
} catch (e) {
if (typeof(dbg) != 'undefined' && dbg.Display) {
dbg.Display('P Call Proces error for id=' + dRS.lpCallId + ' exception=' + e, 'ERROR', 'EMT')
}
}
return
}
}
if (typeof(dRS.lpJS_Execute) != 'undefined') {
var d_msg = [];
for (var MTagI = 0; MTagI < dRS.lpJS_Execute.length; MTagI++) {
var no_err_flag = true,
err_msg = '',
code_id = dRS.lpJS_Execute[MTagI].code_id;
if (!lpMTagConfig.shadow || (lpMTagConfig.shadow && lpMTagConfig.jsCodeWhiteList.indexOf(code_id) > -1)) {
try {
eval(dRS.lpJS_Execute[MTagI].js_code);
if (typeof(lpMTag) != 'undefined' && typeof(lpMTag.tmpCode) != 'undefined' && lpMTag.tmpCode != '') {
eval(lpMTag.tmpCode)
}
} catch (hcExecError) {
this.lpExecuteErrors++;
no_err_flag = false;
err_msg = hcExecError
}
if (typeof(lpMTag) != 'undefined') {
lpMTag.tmpCode = ''
}
if (this.DebugDisplay) {
if (no_err_flag) {
d_msg[d_msg.length] = 'OK Executed snippet=<strong>' + code_id + '</strong><!!>EXEC-OK'
} else {
d_msg[d_msg.length] = 'ERROR Executing snippet=<strong>' + code_id + '</strong>   #' + err_msg + '#<!!>ERROR'
}
}
}
}
if (this.DebugDisplay) {
lpMTagDebug.DisplayArray(d_msg, 'EMT')
}
}
if (typeof(dRS.lpCallError) != 'undefined') {
lpConnLib.log('ERR Recieved=' + dRS.lpCallError + '   # CallID = ' + dRS.lpCallId + '#', 'ERROR', 'EMT')
}
this.UsrCFn(d, req)
};
lpConnectionLibrary.prototype.spPartFromStr = function(str) {
var temp = str.split('!');
return temp[0]
};
lpConnectionLibrary.prototype.UsrCFn = function(d, r) {
var userCallbackFunc = this.GetCallbackFunc(d.ResultSet.lpCallId);
if (userCallbackFunc != '' && userCallbackFunc != null) {
var no_err_flag = true,
err_msg = '';
try {
userCallbackFunc(d, r)
} catch (hcExecError) {
no_err_flag = false;
err_msg = hcExecError
}
if (no_err_flag) {
lpConnLib.log('OK Exec User function - ' + d.ResultSet.lpCallId, 'EXEC-OK', 'EMT')
} else {
lpConnLib.log('ERROR Exec User function=' + userCallbackFunc + '   #' + err_msg + '#', 'ERROR', 'EMT')
}
}
};
lpConnectionLibrary.prototype.getC = function(n) {
var c = document.cookie,
start = c.indexOf(n + "=");
if (typeof(n) == 'undefined' || start == -1) {
return null
}
var len = start + n.length + 1;
if ((!start) && (n != c.substring(0, n.length))) {
return null
}
var end = c.indexOf(";", len);
if (end == -1) {
end = c.length
}
return unescape(c.substring(len, end))
};
lpConnectionLibrary.prototype.log = function(m, t, s) {
if (this.DebugDisplay) {
lpMTagDebug.Display(m, t, s)
}
};
if (typeof(lpConnLib) == 'undefined') {
function lpJSLibrary() {}
var lpJSLib = new lpJSLibrary(),
lpConnLib = new lpConnectionLibrary();
lpConnLib.gcT = setInterval('lpConnLib.gc()', lpConnLib.garbagePeriod * 1000)
}
function lpMonitorTag() {
var c = lpMTagConfig;
this.maxretries = 3;
this.maxErrorCnt = 2;
this.connErrorCnt = 0;
this.errorDelay = 10;
if (typeof(c.lpProtocol) == 'undefined') {
c.lpProtocol = (document.location.toString().indexOf("https:") == 0) ? "https" : "http"
}
this.lpURL = c.lpProtocol + '://' + c.lpServer + '/hc/' + c.lpNumber + '/';
this.lpPageLocation = this.getPageUrl();
if (typeof(c.lpUseSecureCookies) == 'undefined') {
c.lpUseSecureCookies = false
}
if (typeof(c.sendCookies) == 'undefined') {
c.sendCookies = true
}
if (typeof(c.lpSendCookies) == 'undefined') {
c.lpSendCookies = false
}
this.dCkName = 'LP_DATA_COOKIE';
this.lpVisitorStatus = 'INSITE_STATUS';
this.lpCmd = 'mTagKnockPage';
this.webServerCookie = 'LPNMT_DOMAIN-' + c.lpNumber;
this.lpPageID = this.getPId();
this.title = this.getTitle();
this.referrer = this.getRefr();
this.lpJavaEnabled = (this.lpIsJavaEnabled() ? 'true' : 'false');
this.lpLoopTimer = -1;
this.lpFirstInPage = true;
this.lpKnockPageRequestDelay = 0;
this.lpStartPageRequestDelay = 0;
this.lpFirstInPageRequestDelay = 0;
this.lpInPageRequestDelay = 30;
this.lpDelayAfterPost = 10;
this.lpBrowser = lpConnLib.browser;
this.lpDataToSend = '';
if (typeof(c.activePlugin) == 'undefined') {
c.activePlugin = 'none'
}
if (typeof(c.enableActivityMon) != 'undefined') {
this.actMon = c.enableActivityMon
} else {
this.actMon = true
}
if (typeof(c.inactivityPeriod) != 'undefined') {
this.inactPer = c.inactivityPeriod
} else {
this.inactPer = 120
}
if (typeof(c.actPollingInterval) != 'undefined') {
this.actPolInt = c.actPollingInterval
} else {
this.actPolInt = 3
}
this.lastActiveDate = new Date();
this.cookieRemovedCnt = 0;
this.prevCookie = '';
this.splitCookieLeft = '';
this.events = {
eventId: 0,
lstnrs: {},
fired: [],
prefix: 'evId_',
register: function(evName, fn) {
if (typeof(evName) == 'undefined' || typeof(fn) != 'function') {
lpConnLib.log('Ev listen has invalid params: evName=[' + evName + '] fn=[' + fn + ']', 'ERROR', 'EMT-Events');
return null
}
var evId = this.eventId++;
this.lstnrs[this.prefix + evId] = {
id: evId,
name: evName,
fn: fn
};
lpConnLib.log('Ev listen rgstr: evName=[' + evName + '] fn=[' + fn + ']', 'DEBUG', 'EMT-Events');
return evId
},
unregister: function(id) {
if (typeof(id) == 'undefined') {
lpConnLib.log('Ev listen id not spec for unregister', 'ERROR', 'EMT-Events');
return null
}
var ev = this.lstnrs[this.prefix + id];
if (typeof(ev) == 'undefined') {
lpConnLib.log('Ev listen id not Found for unregister id=' + id, 'ERROR', 'EMT-Events');
return false
} else {
delete this.lstnrs[this.prefix + id];
lpConnLib.log('Ev listen id=' + id + ' unregister', 'DEBUG', 'EMT-Events');
return true
}
},
hasFired: function(evName) {
if (typeof(evName) == 'undefined' || evName == '*') {
return this.fired
}
var ret = [];
for (var n = 0; n < this.fired.length; n++) {
if (this.fired[n].evName == evName) {
ret[ret.length] = this.fired[n]
}
}
return ret
},
publish: function(evName, pJson) {
if (typeof(evName) == 'undefined') {
lpConnLib.log('Ev name not spec for publish', 'ERROR', 'EMT-Events');
return null
}
this.fired[this.fired.length] = {
evName: evName,
evData: pJson
};
var anyLstnr = false;
for (var n in this.lstnrs) {
var l = this.lstnrs[n];
if (l.name == evName || l.name == '*') {
l.fn(evName, pJson);
anyLstnr = true;
lpConnLib.log('Ev listen=' + n + ' ev=' + evName + ' exec', 'DEBUG', 'EMT-Events')
}
}
return anyLstnr
}
}
}
lpMonitorTag.prototype.startActMon = function() {
if (this.actMon) {
lpConnLib.log('Start ActMon', 'DEBUG', 'EMT');
var c = lpMTagConfig;
c.visitorActive = true;
if (typeof(c.pageVar) == 'undefined') {
c.pageVar = []
}
c.pageVar[c.pageVar.length] = 'visitorActive=1';
if (window.attachEvent) {
document.attachEvent('onmousedown', this.MAct);
document.attachEvent('onmousemove', this.MAct);
document.attachEvent('onmouseover', this.MAct);
window.attachEvent('onresize', this.MAct);
window.attachEvent('onblur', this.MAct);
window.attachEvent('onfocus', this.MAct);
document.attachEvent('onkeydown', this.MAct);
document.attachEvent('onscroll', this.MAct)
} else {
var fn = window.addEventListener;
fn("mousedown", this.MAct, false);
fn("mousemove", this.MAct, false);
fn("mouseover", this.MAct, false);
fn("scroll", this.MAct, false);
fn("resize", this.MAct, false);
fn("blur", this.MAct, false);
fn("focus", this.MAct, false);
fn("keydown", this.MAct, false)
}
this.actT = setInterval(this.cAct, this.actPolInt * 1000)
}
};
lpMonitorTag.prototype.getPageUrl = function() {
var u = document.location.href.toString();
if (u == null || u == '') {
u = '__blank__'
}
return u
};
lpMonitorTag.prototype.getTitle = function() {
var title = '';
if (typeof(document.title) != "undefined" && document.title.length > 0) {
title = document.title
}
return title
};
lpMonitorTag.prototype.getPId = function() {
return Math.round(Math.random() * 9999999999)
};
lpMonitorTag.prototype.getRefr = function() {
var referrer = '';
if (typeof(document.referrer) != "undefined" && document.referrer.length > 0) {
referrer = document.referrer
}
return referrer
};
lpMonitorTag.prototype.MAct = function() {
lpMTag.lastActiveDate = new Date()
};
lpMonitorTag.prototype.cAct = function() {
var c = lpMTagConfig,
cTime = new Date().getTime(),
lastActTime = lpMTag.lastActiveDate.getTime(),
actSt = c.visitorActive;
actSt = (cTime - lastActTime) <= (lpMTag.inactPer * 1000);
if (actSt != c.visitorActive) {
lpConnLib.log('Visitor Act STATUS= ' + (actSt ? '1' : '0'), 'DEBUG', 'EMT');
c.pageVar[c.pageVar.length] = 'visitorActive=' + (actSt ? '1' : '0');
c.visitorActive = actSt
}
};
lpMonitorTag.prototype.removeUrlParameter = function(url, p) {
var pnt = url.indexOf('&' + p + '=');
if (pnt > -1) {
var tmp = url.substring(pnt + ('&' + p + '=').length),
endpnt = tmp.indexOf('&');
if (endpnt > -1) {
url = url.substring(0, pnt) + tmp.substring(endpnt)
} else {
url = url.substring(0, pnt)
}
}
return url
};
lpMonitorTag.prototype.addFirstPartyCookies = function(url, cmd, params) {
var c = lpMTagConfig;
if (typeof(cmd) == 'undefined') {
var pnt = url.indexOf('&cmd=');
if (pnt > -1) {
var tmp = url.substring(pnt + 5);
if (tmp.indexOf('&') > -1) {
tmp = tmp.substring(0, tmp.indexOf('&'))
}
cmd = tmp
} else {
cmd = ''
}
}
if (typeof(c.useFirstParty) != 'undefined' && c.useFirstParty || cmd == 'mTagKnockPage') {
var vid = lpConnLib.getC(c.FPC_VID_NAME ? c.FPC_VID_NAME : c.lpNumber + '-VID'),
skey = lpConnLib.getC(c.FPC_SKEY_NAME ? c.FPC_SKEY_NAME : c.lpNumber + '-SKEY'),
contId = lpConnLib.getC(c.FPC_CONT_NAME ? c.FPC_CONT_NAME : 'HumanClickSiteContainerID_' + c.lpNumber);
if (url.indexOf('?') == -1) {
url += '?'
}
if (url.indexOf('&visitor=') > -1) {
lpConnLib.log('FPC Found &v in url - remove', 'DEBUG', 'EMT');
url = this.removeUrlParameter(url, 'visitor')
}
if (url.indexOf('&msessionkey=') > -1) {
lpConnLib.log('FPC Found &m in the url - remove', 'DEBUG', 'EMT');
url = this.removeUrlParameter(url, 'msessionkey')
}
if (url.indexOf('&siteContainer=') > -1) {
lpConnLib.log('FPC Found &s in the url - remove', 'DEBUG', 'EMT');
url = this.removeUrlParameter(url, 'siteContainer')
}
if (typeof(params) != 'undefined') {
var idx;
idx = params.getByName('visitor');
if (idx > -1) {
lpConnLib.log('FPC visitor - remove', 'DEBUG', 'EMT');
params.remove(idx)
}
idx = params.getByName('msessionkey');
if (idx > -1) {
lpConnLib.log('FPC msessionkey - remove', 'DEBUG', 'EMT');
params.remove(idx)
}
idx = params.getByName('siteContainer');
if (idx > -1) {
lpConnLib.log('FPC siteContainer - remove', 'DEBUG', 'EMT');
params.remove(idx)
}
}
if (vid != null) {
url += '&visitor=' + vid
}
if (skey != null) {
url += '&msessionkey=' + skey
}
if (contId != null) {
url += '&siteContainer=' + contId
}
}
return url
};
lpMonitorTag.prototype.mtagAddReqToQueue = function(req) {
this.mtagAddToQueue(req.BaseUrl, req.params, req.callbackFunc, req.requireConfirm, req.maxretries, req.forceget, req.postAutoConfirm, req.lpjson, req.dataEncoding, req.forcePost, req.usedSpecialPost, req.spImmediateCleanup, req.encodingBlankUrl, req.minimizePost, req.minimizePostMaxGets, req.allowTruncate)
};
lpMonitorTag.prototype.mtagAddToQueue = function(Url, params, Callback, requireConfirm, maxretries, forceget, onPostAutoConfirm, lpjson, dataEncoding, forcePost, specialPost, spImmediateCleanup, encodingBlankUrl, minimizePost, minimizePostMaxGets, allowTruncate) {
var cmd = params.getValue(params.getByName('cmd'));
Url = this.addFirstPartyCookies(Url, cmd, params);
Url = this.addStatCmdToUrl(Url, params);
params = this.avoidPost(Url, params, cmd);
return lpConnLib.addToQueue(Url, params, Callback, requireConfirm, maxretries, forceget, onPostAutoConfirm, lpjson, dataEncoding, forcePost, specialPost, spImmediateCleanup, encodingBlankUrl, minimizePost, minimizePostMaxGets, allowTruncate)
};
lpMonitorTag.prototype.addStatCmdToUrl = function(url, params) {
var indx, value = '';
if (url.indexOf('?') == -1) {
url += '?'
}
indx = params.getByName('site');
if (indx != -1) {
value = params.getValue(indx);
url += '&site=' + value;
params.remove(indx)
}
indx = params.getByName('cmd');
if (indx != -1) {
value = params.getValue(indx);
url += '&cmd=' + value;
params.remove(indx)
}
return url
};
lpMonitorTag.prototype.avoidPost = function(Url, params, cmd) {
var c = lpMTagConfig,
avoidPost = this.getAPProps(),
splitCookie = c.sgpemtSplitCookie,
splitCookieMinDelta = 0;
if (splitCookie) {
splitCookieMinDelta = c.sgpemtSplitCookieMinDelta
}
if (!avoidPost.avoidPost && !splitCookie) {
return params
}
var r = new lpRequest(lpConnLib.protocolVer, Url, params, null, false, 0, lpConnLib.prunId, lpConnLib.lpjson, 'UTF-8', lpConnLib.browser, false, true, undefined, 0, 0, false, false),
baseUrl = r.BuildBaseCallUrl(),
urlLength = baseUrl.length + params.fullLength() + 1,
orgCk = '';
if (urlLength > lpConnLib.maxurlgetlength) {
var indx = params.getByName('cookie');
if (indx > -1) {
lpConnLib.log('AP ' + avoidPost.avoidPost + ' SC ' + splitCookie + ' Limit ' + urlLength + ': drop cookies', 'DEBUG', 'EMT');
orgCk = params.getValue(indx);
params.remove(indx);
this.cookieRemovedCnt++;
if (this.cookieRemovedCnt > 1) {
lpConnLib.log('AP set sendCookies to FALSE', 'DEBUG', 'EMT');
lpMTagConfig.sendCookies = false
}
} else {
lpConnLib.log('AP Limit ' + urlLength + ': cookies not FOUND', 'DEBUG', 'EMT')
}
urlLength = baseUrl.length + params.fullLength() + 1;
if (urlLength > (lpConnLib.maxurlgetlength - splitCookieMinDelta)) {
lpConnLib.log('AP Limit ' + urlLength + ': after drop cookies - trim', 'DEBUG', 'EMT');
params = this.trimParam(params, 'pageWindowName', avoidPost.maxPageWinNameLength);
urlLength = baseUrl.length + params.fullLength() + 1;
if (urlLength > lpConnLib.maxurlgetlength) {
lpConnLib.log('AP Limit ' + urlLength + ' after trim pageWindowName ', 'DEBUG', 'EMT')
} else {
return this.prSplitC(cmd, params, urlLength, orgCk)
}
params = this.trimParam(params, 'title', avoidPost.emtMaxTitleLength);
urlLength = baseUrl.length + params.fullLength() + 1;
if (urlLength > (lpConnLib.maxurlgetlength - splitCookieMinDelta)) {
lpConnLib.log('AP Limit ' + urlLength + ' after trim title ', 'DEBUG', 'EMT');
params = this.trimParam(params, 'referrer', avoidPost.emtMaxReferLength)
} else {
return this.prSplitC(cmd, params, urlLength, orgCk)
}
urlLength = baseUrl.length + params.fullLength() + 1;
if (urlLength > (lpConnLib.maxurlgetlength - splitCookieMinDelta)) {
lpConnLib.log('AP Limit ' + urlLength + 'trim page', 'DEBUG', 'EMT');
params = this.trimParam(params, 'page', avoidPost.emtMaxUrlLength)
} else {
return this.prSplitC(cmd, params, urlLength, orgCk)
}
urlLength = baseUrl.length + params.fullLength() + 1;
if (urlLength > (lpConnLib.maxurlgetlength - splitCookieMinDelta)) {
lpConnLib.log('AP Limit ' + urlLength, 'DEBUG', 'EMT');
params = this.trimParam(params, 'title', avoidPost.emtMinTitleLength)
} else {
return this.prSplitC(cmd, params, urlLength, orgCk)
}
urlLength = baseUrl.length + params.fullLength() + 1;
if (urlLength > (lpConnLib.maxurlgetlength - splitCookieMinDelta)) {
lpConnLib.log('AP Limit ' + urlLength, 'DEBUG', 'EMT');
params = this.trimParam(params, 'referrer', avoidPost.emtMinReferLength)
} else {
return this.prSplitC(cmd, params, urlLength, orgCk)
}
urlLength = baseUrl.length + params.fullLength() + 1;
if (urlLength > (lpConnLib.maxurlgetlength - splitCookieMinDelta)) {
lpConnLib.log('AP Limit ' + urlLength, 'DEBUG', 'EMT');
params = this.trimParam(params, 'page', avoidPost.emtMinUrlLength)
} else {
return this.prSplitC(cmd, params, urlLength, orgCk)
}
urlLength = baseUrl.length + params.fullLength() + 1;
if (urlLength > (lpConnLib.maxurlgetlength - splitCookieMinDelta)) {
lpConnLib.log('AP over limit ' + urlLength + ': DO POST', 'DEBUG', 'EMT');
var idx = params.getByName('page');
if (idx > -1) {
params.remove(idx);
params.add('page', this.lpPageLocation)
}
idx = params.getByName('referrer');
if (idx > -1) {
params.remove(idx);
params.add('referrer', this.referrer)
}
idx = params.getByName('title');
if (idx > -1) {
params.remove(idx);
params.add('title', this.title)
}
if (orgCk != '') {
this.cookieRemovedCnt--;
params.add('cookie', orgCk)
}
return params
} else {
return this.prSplitC(cmd, params, urlLength, orgCk)
}
} else {
return this.prSplitC(cmd, params, urlLength, orgCk)
}
} else {
return this.prSplitC(cmd, params, urlLength, orgCk)
}
};
lpMonitorTag.prototype.prSplitC = function(cmd, params, urlLength, orgCk) {
var d = lpMTagDebug;
if (!lpMTagConfig.sgpemtSplitCookie || (cmd != 'mTagStartPage' && cmd != 'mTagInPage' && cmd != 'mTagUDEsend')) {
lpConnLib.log('SplitCookie ' + lpMTagConfig.sgpemtSplitCookie + ' cmd ' + cmd, 'DEBUG', 'EMT');
return params
}
var chunk = '',
sizeLeft = lpConnLib.maxurlgetlength - urlLength - "&sc=".length;
if (typeof(orgCk) == 'undefined' || orgCk == '') {
if (this.splitCookieLeft.length == 0) {
lpConnLib.log('SplitCookie - nothing to send - DONE', 'DEBUG', 'EMT');
return params
}
sizeLeft = this.adjustForSpChars(this.splitCookieLeft, sizeLeft);
chunk = this.splitCookieLeft.substr(0, sizeLeft);
this.splitCookieLeft = this.splitCookieLeft.substr(sizeLeft);
var pname = 'ac';
if (this.splitCookieLeft == '') {
pname = 'ec'
}
lpConnLib.log('SC send ' + pname + ' chunk size=' + chunk.length + ' left=' + this.splitCookieLeft.length, 'DEBUG', 'EMT');
params.add(pname, this.specialUnescape(chunk))
} else {
var escCk = this.specialEscape(orgCk);
sizeLeft = this.adjustForSpChars(escCk, sizeLeft);
chunk = escCk.substr(0, sizeLeft);
params.add('sc', this.specialUnescape(chunk));
lpConnLib.log('SC send sc chunk size=' + chunk.length + ' total size=' + orgCk.length, 'DEBUG', 'EMT');
this.splitCookieLeft = escCk.substr(sizeLeft)
}
return params
};
lpMonitorTag.prototype.specialEscape = function(characters) {
var tmp = escape(characters);
tmp = tmp.replace(/\+/g, "%2B");
return tmp
};
lpMonitorTag.prototype.specialUnescape = function(characters) {
var tmp = characters.replace(/%2B/g, "+");
tmp = unescape(characters);
return tmp
};
lpMonitorTag.prototype.adjustForSpChars = function(escCk, sizeLeft) {
if (escCk.charAt(sizeLeft - 1) == '%') {
return sizeLeft - 1
}
if (escCk.charAt(sizeLeft - 2) == '%') {
return sizeLeft - 2
}
var chunkSlice = escCk.substr(0, sizeLeft).substr(-6),
unicodeIdx = chunkSlice.lastIndexOf("%u");
if (unicodeIdx > 0) {
return sizeLeft - (chunkSlice.length - unicodeIdx)
}
return sizeLeft
};
lpMonitorTag.prototype.trimParam = function(p, name, maxSize) {
var str = '',
indx = p.getByName(name);
if (indx > -1) {
str = p.getValueEsc(indx)
}
if (str.length > maxSize) {
lpConnLib.log('trimParam ' + name.toUpperCase() + ' length ' + str.length + ' to ' + maxSize, 'DEBUG', 'EMT');
str = this.trimLength(str, maxSize);
p.remove(indx);
if (str != '') {
p.add(name, str, true)
}
}
return p
};
lpMonitorTag.prototype.getAPProps = function() {
var ret = {
avoidPost: false
};
var c = lpMTagConfig;
if (c.emtAvoidPOST || (typeof(c.emtAvoidPOST) == 'undefined' && c.sgpemtAvoidPOST)) {
ret.avoidPost = true
} else {
return ret
}
if (typeof(c.emtMaxUrlLength) != 'undefined') {
ret.emtMaxUrlLength = c.emtMaxUrlLength
} else {
if (typeof(c.sgpemtMaxUrlLength) == 'undefined') {
ret.emtMaxUrlLength = 500
} else {
ret.emtMaxUrlLength = c.sgpemtMaxUrlLength
}
}
if (typeof(c.emtMinUrlLength) != 'undefined') {
ret.emtMinUrlLength = c.emtMinUrlLength
} else {
if (typeof(c.sgpemtMinUrlLength) == 'undefined') {
ret.emtMinUrlLength = 100
} else {
ret.emtMinUrlLength = c.sgpemtMinUrlLength
}
}
if (typeof(c.emtMaxReferLength) != 'undefined') {
ret.emtMaxReferLength = c.emtMaxReferLength
} else {
if (typeof(c.sgpemtMaxReferLength) == 'undefined') {
ret.emtMaxReferLength = 300
} else {
ret.emtMaxReferLength = c.sgpemtMaxReferLength
}
}
if (typeof(c.emtMinReferLength) != 'undefined') {
ret.emtMinReferLength = c.emtMinReferLength
} else {
if (typeof(c.sgpemtMinReferLength) == 'undefined') {
ret.emtMinReferLength = 100
} else {
ret.emtMinReferLength = c.sgpemtMinReferLength
}
}
if (typeof(c.emtMaxTitleLength) != 'undefined') {
ret.emtMaxTitleLength = c.emtMaxTitleLength
} else {
if (typeof(c.sgpemtMaxTitleLength) == 'undefined') {
ret.emtMaxTitleLength = 100
} else {
ret.emtMaxTitleLength = c.sgpemtMaxTitleLength
}
}
if (typeof(c.emtMinTitleLength) != 'undefined') {
ret.emtMinTitleLength = c.emtMinTitleLength
} else {
if (typeof(c.sgpemtMinTitleLength) == 'undefined') {
ret.emtMinTitleLength = 50
} else {
ret.emtMinTitleLength = c.sgpemtMinTitleLength
}
}
if (typeof(c.maxPageWinNameLength) != 'undefined') {
ret.maxPageWinNameLength = c.maxPageWinNameLength
}
return ret
};
lpMonitorTag.prototype.lpSetCallParams = function(lpCmd, extra) {
var c = lpMTagConfig,
i, tmpData, cPrm = new hcArrayStorage();
cPrm.add('site', c.lpNumber);
cPrm.add('cmd', lpCmd);
if (lpCmd != 'mTagKnockPage') {
cPrm.add('page', this.lpPageLocation)
}
cPrm.add('id', this.lpPageID);
cPrm.add('javaSupport', this.lpJavaEnabled);
cPrm.add('visitorStatus', this.lpVisitorStatus);
if (lpCmd == 'mTagInPage') {
var data = lpConnLib.getC(this.dCkName);
if (data != '' && data != null) {
this.lpDeleteCookie(this.dCkName);
cPrm.add(data)
}
}
if (lpCmd != 'mTagKnockPage') {
if (typeof(c.defaultChatInvite) != 'undefined') {
cPrm.add('defCInvite', c.defaultChatInvite)
}
if (typeof(c.defaultVoiceInvite) != 'undefined') {
cPrm.add('defVInvite', c.defaultVoiceInvite)
}
if (typeof(c.defaultMultiChannelInvite) != 'undefined') {
cPrm.add('defMCInvite', c.defaultMultiChannelInvite)
}
if (typeof(c.defaultInvite) != 'undefined') {
cPrm.add('defInvite', c.defaultInvite)
}
if (typeof(c.cobrowseEnabled) != 'undefined') {
if (typeof(c.lpActivePlugin) == 'undefined') {
c.lpActivePlugin = 'none'
}
cPrm.add('activePlugin', c.lpActivePlugin);
cPrm.add('cobrowse', 'true');
if (typeof(c.pageWindowName) != 'undefined') {
cPrm.add('pageWindowName', c.pageWindowName)
} else {
var name = '';
try {
if (top && typeof(top.document) != 'undefined') {
name = '' + top.name
}
} catch (e) {
name = ''
}
if (name != '') {
if (escape(name).length > c.maxPageWinNameLength) {
name = this.trimLength(name, c.maxPageWinNameLength)
}
cPrm.add('pageWindowName', name)
}
}
if (typeof(c.lpOperatorPageType) != "undefined") {
cPrm.add('cobrowsetitle', c.lpOperatorPageType)
}
if (typeof(c.lpOperatorPageUrl) != "undefined") {
cPrm.add('cobrowseurl', c.lpOperatorPageUrl)
}
}
}
if (lpCmd == 'mTagStartPage' || lpCmd == 'mTagInPage') {
if (typeof(c.pageVar) != 'undefined' && c.pageVar.length > 0) {
for (i = 0; i < c.pageVar.length; i++) {
cPrm.add('PV!' + c.pageVar[i], undefined, true);
this.addUDESt('page', c.pageVar[i])
}
c.pageVar = []
}
if (typeof(c.sessionVar) != 'undefined' && c.sessionVar.length > 0) {
for (i = 0; i < c.sessionVar.length; i++) {
cPrm.add('SV!' + c.sessionVar[i], undefined, true);
this.addUDESt('session', c.sessionVar[i])
}
c.sessionVar = []
}
if (typeof(c.visitorVar) != 'undefined' && c.visitorVar.length > 0) {
for (i = 0; i < c.visitorVar.length; i++) {
cPrm.add('VV!' + c.visitorVar[i], undefined, true);
this.addUDESt('visitor', c.visitorVar[i])
}
c.visitorVar = []
}
}
if (lpCmd == 'mTagKnockPage') {
if (typeof(c.dynButton) != 'undefined' && c.dynButton.length > 0) {
var dbut = '';
for (i = 0; i < c.dynButton.length; i++) {
if (i > 0) {
dbut += '#'
}
dbut += c.dynButton[i].name + '|';
if (typeof(c.dynButton[i].ovr) != 'undefined') {
dbut += c.dynButton[i].ovr + '|'
} else {
dbut += 'null|'
}
if (typeof(c.dynButton[i].pid) != 'undefined') {
dbut += c.dynButton[i].pid + '|'
} else {
dbut += 'null|'
}
}
cPrm.add('dbut', dbut)
}
}
if (typeof(c.sendSnippets) != 'undefined') {
cPrm.add('sendSnippets', c.sendSnippets);
c.sendSnippets = undefined
}
if (typeof(extra) != 'undefined') {
tmpData = extra.split('&');
for (i = 0; i < tmpData.length; i++) {
if (tmpData[i] != '') {
cPrm.add(tmpData[i])
}
}
}
if (lpCmd != 'mTagKnockPage') {
if (this.lpDataToSend != '') {
tmpData = this.lpDataToSend.split('&');
for (i = 0; i < tmpData.length; i++) {
if (tmpData[i] != '') {
cPrm.add(tmpData[i])
}
}
this.lpDataToSend = ''
}
}
if (lpCmd != 'mTagKnockPage' && lpCmd != 'mTagInPage') {
if (this.title != '') {
cPrm.add('title', this.title)
}
if (this.referrer != '') {
cPrm.add('referrer', this.referrer)
}
}
if (lpCmd != 'mTagKnockPage' && c.lpSendCookies && c.sendCookies) {
var cookies = null;
if (!c.cobrowseEnabled) {
cPrm.add('cobrowse', 'true')
}
if (lpCmd == 'mTagStartPage') {
if (typeof(c.GetPageCookies) == 'function') {
cookies = c.GetPageCookies()
} else {
cookies = document.cookie
}
if ((typeof(cookies) == 'undefined') || cookies == null) {
cookies = ''
}
if (cookies != '' && this.prevCookie != cookies) {
cPrm.add('cookie', cookies);
this.prevCookie = cookies
}
}
}
if (typeof(c.addToCallParams) == 'function') {
cPrm = c.addToCallParams(lpCmd, cPrm)
}
return cPrm
};
lpMonitorTag.prototype.lpIsJavaEnabled = function() {
var rc = false;
try {
var n = navigator;
if (typeof(n) != 'undefined') {
var agent = n.appName,
ver = parseInt(n.appVersion);
if (agent == "Microsoft Internet Explorer") {
if ((ver >= 4) && n.javaEnabled()) {
rc = true
}
} else if (typeof(n.plugins) != 'undefined' && n.plugins) {
for (var i = 0; i < n.plugins.length; i++) {
rc = rc || (n.plugins[i].name.toUpperCase().indexOf("JAVA") != -1)
}
}
}
} catch (e) {
lpConnLib.log('Ex:' + e, 'ERROR', 'lpIsJavaEnabled')
}
return rc
};
lpMonitorTag.prototype.trimLength = function(str, max) {
if (str.length > max && max > -1) {
return str.substring(0, max)
}
return str
};
lpMonitorTag.prototype.lpFixProtocol = function(str) {
if ((str != null) && (str.indexOf('http:') == 0) && (lpMTagConfig.lpProtocol == 'https')) {
return lpMTagConfig.lpProtocol + str.substring(4)
}
return str
};
lpMonitorTag.prototype.lpFormData = function(fName, useC, fL, excl, prfx) {
if (typeof(useC) == 'undefined') {
useC = false
}
if (typeof(fL) == 'undefined') {
fL = null
}
if (typeof(excl) == 'undefined') {
excl = false
}
var hcForm = document.forms[fName];
if (hcForm) {
var data = this.lpGetFormData(hcForm, fL, excl, prfx);
if (useC) {
this.lpAddToSetCookie(this.dCkName, data, lpMTagConfig.lpUseSecureCookies)
} else {
var cParam = new hcArrayStorage();
cParam = this.lpSetCallParams(this.lpCmd, data);
this.mtagAddToQueue(this.lpURL, cParam, this.MTagCallback, true, this.maxretries, false, 1, 1, lpMTagConfig.charSet)
}
return true
} else {
lpConnLib.log('Cannot get form=' + fName, 'ERROR', 'EMT');
return false
}
};
lpMonitorTag.prototype.lpFormField = function(formN, fldN, useC, prfx) {
return this.lpFormData(formN, useC, [fldN], false, prfx)
};
lpMonitorTag.prototype.lpGetFormData = function(f, fL, excl, prfx) {
var nvps = [];
for (var e = 0; f.length > e; e++) {
var el = f.elements[e];
if ((excl && !this.lpValueInArray(el.name, fL)) || ((!excl && this.lpValueInArray(el.name, fL)))) {
switch (el.type) {
case "text":
case "password":
case "hidden":
nvps[nvps.length] = (el.name ? escape(el.name) : "undefined" + e) + "=" + escape(el.value);
break;
case "select-one":
case "select-multiple":
{
if (el.length) {
for (var m = 0; el.length > m; m++) {
if (el[m].selected) {
nvps[nvps.length] = (el.name ? escape(el.name) : "undefined" + e) + "=" + escape(el[m].value)
}
}
}
}
break;
case "checkbox":
case "radio":
{
if (el.checked) {
nvps[nvps.length] = (el.name ? escape(el.name) : "undefined" + e) + "=" + escape(el.value)
}
}
break;
case "file":
case "image":
case "reset":
case "submit":
case "button":
default:
if (el.tagName == "BUTTON" || el.tagName == "TEXTAREA") {
nvps[nvps.length] = (el.name ? escape(el.name) : "undefined" + e) + "=" + escape(el.value)
}
break
}
}
}
var qs = '';
for (var i = 0; i < nvps.length; i++) {
if (typeof(prfx) != 'undefined' && prfx != "") {
qs += prfx
} else {
qs += "PV!"
}
qs += '' + nvps[i] + '&'
}
return qs
};
lpMonitorTag.prototype.lpValueInArray = function(v, l) {
if (typeof(l) == 'undefined') {
return false
}
for (var i = 0; i < l.length; i++) {
if (l[i] == v) {
return true
}
}
return false
};
lpMonitorTag.prototype.lpSendData = function(d, now) {
if (d.length <= 0) {
return false
}
if (typeof(now) == 'undefined') {
now = false
}
if (now) {
var send_data = new hcArrayStorage();
send_data = this.lpSetCallParams('mTagUDEsend', d);
this.mtagAddToQueue(this.lpURL, send_data, null, false, 0, false, 0, 1, lpMTagConfig.charSet)
} else {
this.lpDataToSend += d + '&'
}
};
lpMonitorTag.prototype.lpAddToSetCookie = function(n, v, s, ex, p, dom) {
var cV = lpConnLib.getC(n);
if (cV == null) {
cV = ''
}
this.lpSetCookie(n, v + cV, ex, p, dom, s)
};
lpMonitorTag.prototype.lpSetCookie = function(n, v, e, p, d) {
if (e) {
e = e * 1000 * 60 * 60 * 24
}
var eD = new Date((new Date()).getTime() + (e));
document.cookie = n + "=" + escape(v) + ((e) ? ";expires=" + eD.toGMTString() : "") + ((p) ? ";path=" + p : "") + ((d) ? ";domain=" + d : "") + ((lpMTagConfig.lpUseSecureCookies) ? ";secure" : "")
};
lpMonitorTag.prototype.lpGetCookie = function(n) {
return lpConnLib.getC(n)
};
lpMonitorTag.prototype.lpDeleteCookie = function(n, p, d) {
if (lpConnLib.getC(n)) {
document.cookie = n + "=" + ((p) ? ";path=" + p : "") + ((d) ? ";domain=" + d : "") + ";expires=Thu, 01-Jan-1970 00:00:01 GMT"
}
};
lpMonitorTag.prototype.ifVisitorActions = function(data) {
var c = lpMTagConfig;
if (typeof(c.ifVisitorCode) != 'undefined') {
for (var i = 0; i < c.ifVisitorCode.length; i++) {
var fn = c.ifVisitorCode[i];
try {
fn(data);
lpConnLib.log('OK Executing Visitor function', 'EXEC-OK', 'EMT')
} catch (e) {
lpConnLib.log('ERROR Executing Visitor function=' + fn + '   #' + e + '#', 'ERROR', 'EMT')
}
}
c.ifVisitorCode = []
}
c.isVisitor = true
};
lpMonitorTag.prototype.MTagCallback = function(d, r) {
var delay = 0;
if (typeof(lpMTagConfig.onResponse) == 'function') {
lpMTagConfig.onResponse(d, r)
}
if (typeof(d.ResultSet.lpCallError) != 'undefined') {
lpMTag.connErrorCnt++;
if (lpMTag.connErrorCnt <= lpMTag.maxErrorCnt) {
lpMTag.lpLoopTimer = setTimeout('lpMTag.lpMTagMain()', lpMTag.errorDelay * 1000)
}
return
}
lpMTag.connErrorCnt = 0;
if (d.ServiceInfo.resendCall) {
lpConnLib.log('Resend con ' + d.ResultSet.lpCallId, 'WARN', 'EMT');
if (r != null) {
lpMTag.mtagAddReqToQueue(r)
}
return
}
if (lpMTag.lpCmd == 'mTagKnockPage') {
lpMTag.lpCmd = 'mTagStartPage';
lpMTag.startActMon();
delay = lpMTag.lpStartPageRequestDelay
} else {
if (lpMTag.lpCmd == 'mTagStartPage') {
lpMTag.lpCmd = 'mTagInPage';
delay = lpMTag.lpFirstInPageRequestDelay
} else {
delay = lpMTag.lpInPageRequestDelay
}
lpMTag.ifVisitorActions()
}
if (!lpMTag.stopMTag) {
if (lpMTag.lpLoopTimer != -1) {
clearTimeout(lpMTag.lpLoopTimer)
}
if (lpMTag.lpLoopTimer != -1) {
lpMTag.lpLoopTimer = setTimeout('lpMTag.lpMTagMain()', delay * 1000)
}
}
};
lpMonitorTag.prototype.overrideLPServer = function(srvName, setCookie) {
var c = lpMTagConfig;
if (setCookie) {
this.lpSetCookie(this.webServerCookie, srvName)
}
c.lpServer = srvName;
this.lpURL = c.lpProtocol + '://' + c.lpServer + '/hc/' + c.lpNumber + '/'
};
lpMonitorTag.prototype.MTagOnLoad = function() {
var c = lpMTagConfig;
if (lpConnLib.getC(this.webServerCookie) != null) {
this.overrideLPServer(lpConnLib.getC(this.webServerCookie), false)
}
if (typeof(c.onLoadCode) != 'undefined') {
for (var i = 0; i < c.onLoadCode.length; i++) {
var tempfunc = c.onLoadCode[i];
try {
tempfunc();
lpConnLib.log('OK ONLoad fn', 'EXEC-OK', 'EMT')
} catch (e) {
lpConnLib.log('ERROR ONLoad fn=' + tempfunc + '   #' + e + '#', 'ERROR', 'EMT')
}
}
c.onLoadCode = []
}
if (typeof(lpGetVariables) != 'undefined' && typeof(lpGetVariables) == 'function') {
this.lpProcessUDEs(lpGetVariables())
}
if (typeof(lpUDEs) != 'undefined') {
this.lpProcessUDEs(lpUDEs)
}
};
lpMonitorTag.prototype.setDefaultParams = function() {
lpMTagConfig.jsCodeWhiteList = lpMTagConfig.jsCodeWhiteList || ["MTagDef", "FPCookie", "SYSTEM!firstpartycookies_compact.js", "INPAGE-DELAY-30", "FPCSetVal", "VIS-ONSTARTPAGE"]
};
lpMonitorTag.prototype.lpProcessUDEs = function(udes) {
var c = lpMTagConfig;
for (var indx in udes) {
for (var i = 0; i < udes[indx].length; i++) {
if (indx == 'session') {
if (typeof(c.sessionVar) == 'undefined') {
c.sessionVar = []
}
c.sessionVar[c.sessionVar.length] = udes[indx][i]
} else if (indx == 'page') {
if (typeof(c.pageVar) == 'undefined') {
c.pageVar = []
}
c.pageVar[c.pageVar.length] = udes[indx][i]
} else if (indx == 'visitor') {
if (typeof(c.visitorVar) == 'undefined') {
c.visitorVar = []
}
c.visitorVar[c.visitorVar.length] = udes[indx][i]
}
}
}
};
lpMonitorTag.prototype.lpMTagMain = function(forceGet) {
var cParam = new hcArrayStorage();
if (typeof(forceGet) == 'undefined') {
forceGet = false
}
cParam = this.lpSetCallParams(this.lpCmd);
var callType = this.mtagAddToQueue(this.lpURL, cParam, this.MTagCallback, true, this.maxretries, forceGet, undefined, 1, lpMTagConfig.charSet);
if (callType == 'POST') {
if (this.lpCmd == 'mTagKnockPage') {
this.lpCmd = 'mTagStartPage'
} else if (this.lpCmd == 'mTagStartPage') {
this.lpCmd = 'mTagInPage'
}
lpMTag.lpLoopTimer = setTimeout('lpMTag.lpMTagMain(true)', lpMTag.lpDelayAfterPost * 1000)
}
};
lpMTagConfig.UDEstore = {};
lpMTagConfig.UDEstore.SV = [];
lpMTagConfig.UDEstore.VV = [];
lpMTagConfig.UDEstore.PV = [];
lpMonitorTag.prototype.addUDESt = function(scope, ude) {
var c = lpMTagConfig;
if (scope == 'session') {
c.UDEstore.SV[c.UDEstore.SV.length] = ude
} else if (scope == 'visitor') {
c.UDEstore.VV[c.UDEstore.VV.length] = ude
} else if (scope == 'page') {
c.UDEstore.PV[c.UDEstore.PV.length] = ude
}
};
lpMonitorTag.prototype.regPlugins = function() {
var c = lpMTagConfig,
burl = '';
if (c.lpMTagSrc) {
burl = c.lpMTagSrc.substr(0, c.lpMTagSrc.lastIndexOf('/')) + "/plugins/"
} else if (c.lpTagSrv) {
burl = c.lpProtocol + "://" + c.lpTagSrv + "/hcp/html/plugins/"
} else {
burl = c.lpProtocol + "://" + c.lpServer + "/hcp/html/plugins/"
}
lpLazy.register('lpRequest.prototype.MakeCallByIframe', burl + 'emt_post_plugin.js');
lpLazy.register('lpConnectionLibrary.prototype.specialPostHandler', burl + 'emt_sp-post_plugin.js');
lpLazy.register('lpConnectionLibrary.prototype.splitRequestIntoGets', burl + 'emt_split-post_plugin.js');
lpLazy.register('lpConnectionLibrary.prototype.reportError', burl + 'emt_reportError_plugin.js');
lpLazy.register('lpMonitorTag.prototype.lpSetPage', burl + 'emt_lpSetPage_plugin.js')
};
var lpLazy = {
map: {},
d: {},
register: function(mS, f) {
try {
var that = this;
if (mS.indexOf('.prototype.') > -1) {
var str = mS + " = function () {var that = this; lpLazy.prx('" + mS + "', arguments, that);}";
eval(str)
} else if (mS.indexOf('.') > -1) {
var r = this.gR(mS);
r.rf[r.mt] = function() {
that.prx(mS, arguments)
}
} else {
window[mS] = function() {
that.prx(mS, arguments)
}
}
this.map[mS] = f;
this.log('register:' + mS + ' ' + f, 'DEBUG', 'LPLAZY')
} catch (e) {
this.log('Ex:' + e, 'ERROR', 'LPLAZY')
}
},
prx: function(mS, a, ctx) {
try {
var inP = true;
if (typeof(this.d[mS]) == 'undefined') {
this.d[mS] = [];
inP = false
}
this.d[mS][this.d[mS].length] = {
a: a,
ctx: ctx
};
if (!inP) {
this.lPl(this.map[mS])
}
this.log('prx:' + mS, 'DEBUG', 'LPLAZY')
} catch (e) {
this.log('Ex:' + e, 'ERROR', 'LPLAZY')
}
},
callback: function(mS) {
try {
var i;
if (mS.indexOf('.') == -1) {
ctx = window[mS];
for (i = 0; i < this.d[mS].length; i++) {
window[mS].apply(this, this.d[mS][i].a)
}
} else if (mS.indexOf('.prototype.') > -1) {
var fnN = mS.substr(mS.indexOf('.prototype.') + 11);
for (i = 0; i < this.d[mS].length; i++) {
this.d[mS][i].ctx[fnN].apply(this.d[mS][i].ctx, this.d[mS][i].a)
}
} else {
var r = this.gR(mS);
for (i = 0; i < this.d[mS].length; i++) {
r.rf[r.mt].apply(r.rf, this.d[mS][i].a)
}
}
this.d[mS] = [];
this.log('callback:' + mS, 'DEBUG', 'LPLAZY')
} catch (e) {
this.log('Ex:' + e, 'ERROR', 'LPLAZY')
}
},
lPl: function(src) {
var s = document.createElement("script");
s.setAttribute("type", "text/javascript");
s.setAttribute("charset", "iso-8859-1");
s.setAttribute("src", src);
document.getElementsByTagName("head").item(0).appendChild(s)
},
gR: function(mS) {
var d = mS.split('.'),
ref = window;
for (var i = 0; i < d.length - 1; i++) {
ref = ref[d[i]]
}
return {
rf: ref,
mt: d[d.length - 1]
};
},
log: function(msg, lvl, sys) {
lpConnLib.log(msg, lvl, sys)
}
};
if (typeof(lpOpenPlatformNS) == 'undefined') {
window.lpOpenPlatformNS = {}
}
if (typeof(lpMTagDebug) == 'undefined') {
window.lpMTagDebug = {}
}
var lpMTag = new lpMonitorTag();
lpMTag.ver = '9.5.0';
lpMTag.build = '7';
lpMTag.MTagOnLoad();
lpMTag.setDefaultParams();
lpMTag.regPlugins();
lpMTag.lpLoopTimer = setTimeout('lpMTag.lpMTagMain()', lpMTag.lpKnockPageRequestDelay * 1000);
#6 JavaScript::Eval (size: 166) - SHA256: 8f263d99e8772dc2e4b8a8a750fde9de9438cacbf8222f4852da4f773d07f23c
lpConnectionLibrary.prototype.splitRequestIntoGets = function() {
var that = this;
lpLazy.prx('lpConnectionLibrary.prototype.splitRequestIntoGets', arguments, that);
}
#7 JavaScript::Eval (size: 46432) - SHA256: f821ec2b96eed6df47830e709237d11598dd89ac2c83ea80263a982aa2bcefc2
if (typeof Array.prototype.splice === 'undefined') {
Array.prototype.splice = function(a, c) {
var i = 0,
e = arguments,
d = this.copy(),
f = a;
if (!c) {
c = this.length - a
}
for (i; i < e.length - 2; i++) {
this[a + i] = e[i + 2]
}
for (a; a < this.length - c; a++) {
this[a + e.length - 2] = d[a - c]
}
this.length -= c - e.length + 2;
return d.slice(f, f + c)
}
}
function hcArrayStorage() {
this.idx = 0;
this.nArr = [];
this.vArr = []
}
hcArrayStorage.prototype.add = function(n, v, unescD) {
if (typeof(unescD) == 'undefined') {
unescD = false
}
if (typeof(v) == 'undefined') {
var temp = n.split('=');
n = temp[0];
v = temp[1]
}
if (unescD) {
this.nArr[this.idx] = unescape(n);
this.vArr[this.idx] = unescape(v)
} else {
this.nArr[this.idx] = n;
this.vArr[this.idx] = v
}
this.idx++
};
hcArrayStorage.prototype.size = function() {
return this.idx
};
hcArrayStorage.prototype.get = function(i) {
if (typeof(this.nArr[i]) == 'undefined') {
return ''
}
var tmp = escape(this.nArr[i]) + '=' + escape(this.vArr[i]);
tmp = tmp.replace(/\+/g, "%2B");
return tmp
};
hcArrayStorage.prototype.getName = function(i) {
return this.nArr[i]
};
hcArrayStorage.prototype.getValue = function(i) {
return this.vArr[i]
};
hcArrayStorage.prototype.getValueEsc = function(i) {
return escape(this.vArr[i])
};
hcArrayStorage.prototype.getByName = function(n) {
for (var i = 0; i < this.idx; i++) {
if (this.getName(i) == n) {
return i
}
}
return -1
};
hcArrayStorage.prototype.remove = function(i) {
if (typeof(i) == 'undefined' || i == null || typeof(this.nArr[i]) == 'undefined') {
return
}
this.nArr.splice(i, 1);
this.vArr.splice(i, 1);
this.idx--
};
hcArrayStorage.prototype.paramLength = function(i) {
var url = '&' + this.get(i);
return url.length
};
hcArrayStorage.prototype.fullLength = function() {
var length = 0;
for (var i = 0; i < this.idx; i++) {
length += this.paramLength(i)
}
return length
};
hcArrayStorage.prototype.getMaxLengthItem = function() {
var max = 0,
maxItemId = -1;
for (var i = 0; i < this.idx; i++) {
if (this.paramLength(i) > max) {
max = this.paramLength(i);
maxItemId = i
}
}
return maxItemId
};
hcArrayStorage.prototype.clone = function() {
var cObj = new hcArrayStorage();
cObj.idx = this.idx;
for (var i = 0; i < this.idx; i++) {
cObj.nArr[i] = this.nArr[i];
cObj.vArr[i] = this.vArr[i]
}
return cObj
};
function lpRequest(protocolVer, Url, params, Callback, requireConfirm, maxretries, prunId, lpjson, enc, browser, postAutoConfirm, spImmediateCleanup, partial, part, outOf, forceget, forcePost, encodingBlankUrl, minPost, minPostMaxGets, allowTruncate) {
this.headLoc = document.getElementsByTagName("head").item(0);
this.timeStamp = new Date();
this.callId = this.getCID();
this.protocolVer = protocolVer;
this.scriptId = 'lpScriptId' + this.callId;
this.callbackFunc = Callback;
this.requireConfirm = requireConfirm;
this.spImmediateCleanup = spImmediateCleanup;
this.postAutoConfirm = postAutoConfirm;
this.params = params;
this.BaseUrl = Url;
this.fullUrl = '';
if (typeof(enc) != 'undefined' && enc != '' && enc != null) {
this.dataEncoding = enc.toUpperCase()
} else {
this.dataEncoding = "UTF-8"
}
this.retries = 0;
this.confirmed = false;
this.usedget = true;
this.usedSpecialPost = false;
this.maxretries = maxretries;
this.prunId = prunId;
this.lpjson = lpjson;
this.browser = browser;
this.spImmediateCleanup = true;
if (typeof(partial) == 'undefined') {
partial = false
}
this.partial = partial;
if (typeof(part) == 'undefined') {
part = 0
}
this.part = part;
if (typeof(outOf) == 'undefined') {
outOf = 0
}
this.outOf = outOf;
this.forceget = forceget;
this.forcePost = forcePost;
this.encodingBlankUrl = encodingBlankUrl;
this.minimizePost = minPost;
this.minimizePostMaxGets = minPostMaxGets;
this.allowTruncate = allowTruncate
}
lpRequest.prototype.getCID = function() {
var sKey = lpConnLib.getC('HumanClickKEY'),
i = 999999999999;
if (sKey == null) {
sKey = this.getPadding(Math.round(Math.random() * i), ('' + i).length)
}
return sKey + '-' + this.getPadding(Math.round(Math.random() * i), ('' + i).length)
};
lpRequest.prototype.getPadding = function(n, maxLen) {
var s = '000000000000' + n;
return s.substring(s.length - maxLen)
};
lpRequest.prototype.BuildBaseCallUrl = function() {
var url = this.BaseUrl;
if (url.indexOf('?') == -1) {
url += '?'
} else {
url += '&'
}
url += 'lpCallId=' + this.callId;
url += '&protV=' + this.protocolVer;
url += '&' + this.prunId + this.lpjson;
return url
};
lpRequest.prototype.BuildCallUrl = function(type, maxLn, nolog) {
var cUrl = this.BuildBaseCallUrl(),
urlLn = cUrl.length;
if (type == 'get') {
if (this.params.size() > 0) {
for (var i = 0; i < this.params.size(); i++) {
cUrl += '&' + this.params.get(i)
}
}
urlLn = cUrl.length;
if (urlLn > maxLn) {
if (!nolog) {
lpConnLib.log('BuildCallUrl Cut length:' + urlLn + ' m=' + maxLn, 'WARN', 'EMT')
}
cUrl = cUrl.substring(0, maxLn)
}
}
this.fullUrl = cUrl;
return urlLn
};
lpRequest.prototype.MakeCallByScript = function() {
this.scriptObj = document.createElement('script');
this.scriptObj.setAttribute('type', 'text/javascript');
this.scriptObj.setAttribute('charset', this.dataEncoding);
this.scriptObj.setAttribute('src', this.fullUrl);
this.scriptObj.setAttribute('id', this.scriptId);
this.headLoc.appendChild(this.scriptObj)
};
lpRequest.prototype.removeScriptTag = function() {
try {
this.headLoc.removeChild(this.scriptObj)
} catch (e) {
lpConnLib.log('removeScript FAILED:' + e, 'ERROR', 'EMT')
}
};
lpRequest.prototype.clone = function() {
var cRq = new lpRequest();
for (var p in this) {
if (typeof(this[p]) != 'undefined') {
if (typeof(this[p]) != 'object') {
cRq[p] = this[p]
} else if (typeof(this[p]) != 'undefined' && this[p] != null && this[p].constructor == hcArrayStorage) {
cRq[p] = this[p].clone()
} else {
cRq[p] = this[p]
}
}
}
return cRq
};
function lpConnectionLibrary() {
this.protocolVer = 20;
this.garbagePeriod = 10;
this.gcT = 0;
this.callTimeoutPeriod = 3 * this.garbagePeriod;
this.maxurllengthMZ = 2083;
this.maxurllengthIE = 2083;
this.postDeleteIfrDelay = 3;
this.iframeName = 'lpIframeContainer-' + Math.round(1000 * Math.random());
this.onPostAutoConfirm = true;
this.queue = [];
this.partialQueue = [];
this.fullForPartialQueue = {};
this.browser = this.BrowserSniff();
this.maxurlgetlength = 2083;
this.callCounter = 0;
this.garbageCollectCounter = 0;
this.forcedGet = 0;
this.reconfirmedCalls = 0;
this.resendCounter = 0;
this.partialCounter = 0;
this.lpExecuteErrors = 0;
this.lpCallbackCnt = 0;
this.lpjson = 1;
this.prunId = 'lpjson=';
this.DebugDisplay = false;
this.postParams = [];
this.spPostIframesFree = [];
this.spPostIframesBusy = []
}
lpConnectionLibrary.prototype.SortQueue = function(a, b) {
if (a.confirmed == b.confirmed) {
return a.timeStamp.getTime() - b.timeStamp.getTime()
}
if (a.confirmed && !b.confirmed) {
return -1
}
if (!a.confirmed && b.confirmed) {
return 1
}
return 0
};
lpConnectionLibrary.prototype.confirmConnection = function(idList) {
var tempList = ',' + idList + ',';
for (var i = 0; i < this.queue.length; i++) {
var myid = ',' + this.queue[i].callId + ',';
if (!this.queue[i].confirmed && tempList.indexOf(myid) > -1) {
this.queue[i].confirmed = true
}
}
};
lpConnectionLibrary.prototype.getRequestForCallId = function(callId) {
for (var i = 0; i < this.queue.length; i++) {
if (callId == this.queue[i].callId) {
return this.queue[i]
}
}
return null
};
lpConnectionLibrary.prototype.addToQueue = function(Url, params, Callback, requireConfirm, maxretries, forceget, onPostAutoConfirm, lpjson, dataEncoding, forcePost, specialPost, spImmediateCleanup, encodingBlankUrl, minimizePost, minimizePostMaxGets, allowTruncate) {
var callType = '',
postAutoConfirm = false;
if (typeof(lpjson) != 'undefined') {
this.lpjson = lpjson
}
if (typeof(onPostAutoConfirm) != 'undefined') {
postAutoConfirm = onPostAutoConfirm
} else {
postAutoConfirm = this.onPostAutoConfirm
}
if (typeof(encodingBlankUrl) == 'undefined') {
if (typeof(lpMTagConfig) != 'undefined') {
encodingBlankUrl = lpMTagConfig.lpProtocol + '://' + lpMTagConfig.lpServer + '/hcp/asp/blankenc.asp'
} else if (typeof(lpChatConfig) != 'undefined') {
encodingBlankUrl = lpChatConfig.lpProtocol + '://' + lpChatConfig.lpServer + '/hcp/asp/blankenc.asp'
}
}
this.encodingBlankUrl = encodingBlankUrl;
if (typeof(spImmediateCleanup) == 'undefined') {
spImmediateCleanup = true
}
var request = new lpRequest(this.protocolVer, Url, params, Callback, requireConfirm, maxretries, this.prunId, this.lpjson, dataEncoding, this.browser, postAutoConfirm, spImmediateCleanup, undefined, 0, 0, forceget, forcePost, encodingBlankUrl, minimizePost, minimizePostMaxGets, allowTruncate);
if (typeof(lpMTagDebug) != 'undefined' && typeof(lpMTagDebug.Display) != 'undefined') {
this.DebugDisplay = true
}
if (forceget) {
this.forcedGet++
}
var partial = '',
urlLength = request.BuildCallUrl('get', this.maxurlgetlength, true);
if (!forcePost && (urlLength <= this.maxurlgetlength || forceget)) {
callType = this.makeTheCall(request, 'get', requireConfirm)
} else {
if (typeof(minimizePost) == 'undefined') {
if (typeof(lpMTagConfig.minimizePost) == 'undefined') {
minimizePost = false
} else {
minimizePost = lpMTagConfig.minimizePost
}
}
var minPostStatus = false;
if (!forcePost && minimizePost) {
if (typeof(minimizePostMaxGets) == 'undefined') {
if (typeof(lpMTagConfig.minimizePostMaxGets) == 'undefined') {
minimizePostMaxGets = 3
} else {
minimizePostMaxGets = lpMTagConfig.minimizePostMaxGets
}
}
if (typeof(allowTruncate) == 'undefined') {
if (typeof(lpMTagConfig.allowTruncate) == 'undefined') {
allowTruncate = false
} else {
allowTruncate = lpMTagConfig.allowTruncate
}
}
var origRequest = request.clone();
this.splitRequestIntoGets(request, origRequest, minimizePostMaxGets, allowTruncate, specialPost, postAutoConfirm, spImmediateCleanup, minimizePostMaxGets, requireConfirm);
minPostStatus = true
}
if (!minPostStatus) {
if (specialPost) {
callType = this.makeTheCall(request, 'sp-post', !postAutoConfirm, spImmediateCleanup)
} else {
callType = this.makeTheCall(request, 'post', !postAutoConfirm)
}
}
}
return callType
};
lpConnectionLibrary.prototype.makeTheCall = function(r, pr) {
pr = pr.toUpperCase();
var ret, qsize;
if (pr == 'GET') {
r.BuildCallUrl('get', this.maxurlgetlength);
qsize = this.queue.length;
this.queue[qsize] = r;
this.queue[qsize].MakeCallByScript();
if (!r.requireConfirm) {
this.queue[qsize].confirmed = true
}
ret = 'GET'
} else if (pr == 'POST') {
r.BuildCallUrl('post', this.maxurlgetlength);
qsize = this.queue.length;
this.queue[qsize] = r;
this.queue[qsize].MakeCallByIframe(this.browser);
if (r.postAutoConfirm) {
this.queue[qsize].confirmed = true
}
ret = 'POST'
} else if (pr == 'SP-POST') {
r.BuildCallUrl('post', this.maxurlgetlength);
qsize = this.queue.length;
this.queue[qsize].spImmediateCleanup = r.spImmediateCleanup;
this.specialPostHandler(r.callId);
if (r.postAutoConfirm) {
this.queue[qsize].confirmed = true
}
ret = 'POST'
}
if (this.DebugDisplay) {
var cmd = '';
try {
cmd = r.params.getValue(r.params.getByName('cmd'));
if (typeof(cmd) == 'undefined') {
cmd = r.fullUrl.match(/cmd=.*?&/).toString();
if (cmd != null && cmd != 'null') {
cmd = cmd.replace(/&/g, '')
}
}
cmd = '<strong><span style="color:rgb(255,153,0);">' + cmd + '</span></strong>'
} catch (e) {}
lpConnLib.log('Making ' + pr + ' Call id=' + r.callId + ' ' + cmd, 'DEBUG', 'EMT')
}
this.callCounter++;
return ret
};
lpConnectionLibrary.prototype.hasNonLatinChars = function(params) {
for (var i = 0; i < params.size(); i++) {
if (params.get(i).indexOf("%u") != -1) {
return true
}
}
return false
};
lpConnectionLibrary.prototype.BrowserSniff = function() {
var agt = navigator.userAgent.toLowerCase();
if (agt.indexOf("safari") != -1) {
return 'SAFARI'
}
if (document.all) {
var is_opera = (agt.indexOf("opera") != -1);
if (is_opera) {
return "OPR"
} else {
return "IE"
}
}
if (document.getElementById) {
var is_ff = (agt.indexOf("firefox") != -1);
if (is_ff) {
return "FF"
}
return "MOZ"
}
return "MOZ"
};
lpConnectionLibrary.prototype.GetCallbackFunc = function(usrCallId) {
var qSize = this.queue.length;
for (var i = 0; i < qSize; i++) {
if (this.queue[i].callId == usrCallId) {
return this.queue[i].callbackFunc
}
}
return null
};
lpConnectionLibrary.prototype.CleanUpBusySpecialPost = function(callID) {
if (typeof(callID) == 'undefined') {
callID = null
}
for (var i = 0; i < this.spPostIframesBusy.length; i++) {
if ((this.spPostIframesBusy[i]['spImmediateCleanup'] && this.spPostIframesBusy[i]['callMade']) || this.spPostIframesBusy[i]['callID'] == callID) {
this.releaseIframe(this.spPostIframesBusy[i]['callID'])
}
}
};
lpConnectionLibrary.prototype.gc = function() {
lpConnLib.log('GC', 'OK', 'EMT');
this.queue.sort(this.SortQueue);
var confirmedCnt = 0,
i;
for (i = 0; i < this.queue.length; i++) {
if (this.queue[i].confirmed) {
if (this.queue[i].usedget) {
this.queue[i].removeScriptTag()
}
confirmedCnt++
}
}
this.queue.splice(0, confirmedCnt);
this.garbageCollectCounter++;
this.CleanUpBusySpecialPost();
var now = new Date().getTime();
for (i = 0; i < this.queue.length; i++) {
if (!this.queue[i].confirmed && (now - this.queue[i].timeStamp.getTime()) > this.callTimeoutPeriod * 1000) {
if (this.queue[i].retries < this.queue[i].maxretries) {
this.queue[i].retries++;
this.callCounter++;
this.reconfirmedCalls++;
lpConnLib.log('Retry ' + this.queue[i].retries + '/' + this.queue[i].maxretries + ' cId=' + this.queue[i].callId, 'DEBUG', 'EMT');
this.queue[i].timeStamp = new Date();
if (this.queue[i].usedget) {
this.queue[i].MakeCallByScript()
} else {
if (this.usedSpecialPost) {
this.CleanUpBusySpecialPost(this.queue[i].callId);
this.specialPostHandler(this.queue[i].callId)
} else {
this.queue[i].MakeCallByIframe(this.browser)
}
}
} else {
this.queue[i].confirmed = true;
lpConnLib.log('Timeout for cId=' + this.queue[i].callId, 'DEBUG', 'EMT');
var lpDataObj = {
"ResultSet": {
"lpCallId": this.queue[i].callId,
"lpCallError": "TIMEOUT"
}
};
this.UsrCFn(lpDataObj)
}
}
}
};
lpConnectionLibrary.prototype.Process = function(d) {
if (d == null) {
lpConnLib.log('Cback No data', 'ERROR', 'EMT');
return
}
this.lpCallbackCnt++;
var dRS = d.ResultSet;
d.ServiceInfo = {};
var dSI = d.ServiceInfo;
if (dRS.lpCallId == 0 || dRS.lpCallId == null || dRS.lpCallId == '') {
lpConnLib.log('Cback No Call ID', 'ERROR', 'EMT');
return
}
dSI.requestType = 'REGULAR';
dSI.resendCall = false;
dSI.origCallId = dRS.lpCallId;
if (typeof(dRS.lpData) != 'undefined' && typeof(dRS.lpData) == 'object' && typeof(dRS.lpData[0]) != 'undefined') {
if (typeof(dRS.lpData[0].TYPE) != 'undefined') {
dSI.requestType = dRS.lpData[0].TYPE
}
if (typeof(dRS.lpData[0].RESEND) != 'undefined') {
dSI.resendCall = dRS.lpData[0].RESEND
}
}
if (dSI.resendCall) {
this.resendCounter++
}
if (dSI.requestType == 'PARTIAL REQUEST') {
dRS.lpCallId = dRS.lpCallId + '!' + dRS.lpData[0].PART
}
lpConnLib.log('Cback cId=' + dRS.lpCallId, 'DEBUG', 'EMT');
if (typeof(dRS.lpCallConfirm) == 'undefined' || dRS.lpCallConfirm == '') {
dRS.lpCallConfirm = dRS.lpCallId
} else {
dRS.lpCallConfirm += ',' + dRS.lpCallId
}
var req;
if (dSI.requestType == 'PARTIAL REQUEST' && dSI.resendCall) {
req = this.fullForPartialQueue[dSI.origCallId];
delete this.fullForPartialQueue[dSI.origCallId];
lpConnLib.log('CId=' + dRS.lpCallId + ' Deleted - fullForPartialQueue[' + dSI.origCallId + ']', 'DEBUG', 'EMT')
} else {
req = this.getRequestForCallId(dRS.lpCallId);
if (req != null && req.partial) {
req = this.fullForPartialQueue[dSI.origCallId]
}
}
if (dSI.requestType != 'PARTIAL REQUEST') {
if (this.fullForPartialQueue[dSI.origCallId]) {
delete this.fullForPartialQueue[dSI.origCallId];
lpConnLib.log('CId=' + dRS.lpCallId + ' Deleted fullForPartialQueue[' + dSI.origCallId + ']', 'DEBUG', 'EMT')
}
}
if (req == null) {
lpConnLib.log('REQ is NULL callId=' + dSI.origCallId, 'ERROR', 'EMT')
}
this.confirmConnection(dRS.lpCallConfirm);
if (dSI.requestType == 'PARTIAL REQUEST') {
var callNum, outOfcalls;
if (typeof(dRS.lpData) != 'undefined' && typeof(dRS.lpData) == 'object') {
if (typeof(dRS.lpData[0].PART) != 'undefined') {
callNum = dRS.lpData[0].PART
}
if (typeof(dRS.lpData[0].OUTOF) != 'undefined') {
outOfcalls = dRS.lpData[0].OUTOF
}
}
if (dSI.resendCall) {
for (var i = (callNum + 1); i <= outOfcalls; i++) {
var cid = dSI.origCallId + '!' + i;
delete this.partialQueue[cid]
}
} else {
try {
var ncId = dSI.origCallId + '!' + (callNum + 1);
lpConnLib.log('P Call Response recieved - ' + dRS.lpCallId + ' part=' + callNum + ' outof=' + outOfcalls, 'DEBUG', 'EMT');
var r = this.partialQueue[ncId];
if (r != null) {
delete this.partialQueue[ncId];
if (r.part == r.outOf) {
r.callId = this.spPartFromStr(r.callId)
}
this.makeTheCall(r, 'get')
} else {
if (typeof(dbg) != 'undefined' && dbg.Display) {
dbg.Display('P Call NOT found for id=' + ncId, 'ERROR', 'EMT')
}
}
} catch (e) {
if (typeof(dbg) != 'undefined' && dbg.Display) {
dbg.Display('P Call Proces error for id=' + dRS.lpCallId + ' exception=' + e, 'ERROR', 'EMT')
}
}
return
}
}
if (typeof(dRS.lpJS_Execute) != 'undefined') {
var d_msg = [];
for (var MTagI = 0; MTagI < dRS.lpJS_Execute.length; MTagI++) {
var no_err_flag = true,
err_msg = '',
code_id = dRS.lpJS_Execute[MTagI].code_id;
try {
eval(dRS.lpJS_Execute[MTagI].js_code);
if (typeof(lpMTag) != 'undefined' && typeof(lpMTag.tmpCode) != 'undefined' && lpMTag.tmpCode != '') {
eval(lpMTag.tmpCode)
}
} catch (hcExecError) {
this.lpExecuteErrors++;
no_err_flag = false;
err_msg = hcExecError
}
if (typeof(lpMTag) != 'undefined') {
lpMTag.tmpCode = ''
}
if (this.DebugDisplay) {
if (no_err_flag) {
d_msg[d_msg.length] = 'OK Executed snippet=<strong>' + code_id + '</strong><!!>EXEC-OK'
} else {
d_msg[d_msg.length] = 'ERROR Executing snippet=<strong>' + code_id + '</strong>   #' + err_msg + '#<!!>ERROR'
}
}
}
if (this.DebugDisplay) {
lpMTagDebug.DisplayArray(d_msg, 'EMT')
}
}
if (typeof(dRS.lpCallError) != 'undefined') {
lpConnLib.log('ERR Recieved=' + dRS.lpCallError + '   # CallID = ' + dRS.lpCallId + '#', 'ERROR', 'EMT')
}
this.UsrCFn(d, req)
};
lpConnectionLibrary.prototype.spPartFromStr = function(str) {
var temp = str.split('!');
return temp[0]
};
lpConnectionLibrary.prototype.UsrCFn = function(d, r) {
var userCallbackFunc = this.GetCallbackFunc(d.ResultSet.lpCallId);
if (userCallbackFunc != '' && userCallbackFunc != null) {
var no_err_flag = true,
err_msg = '';
try {
userCallbackFunc(d, r)
} catch (hcExecError) {
no_err_flag = false;
err_msg = hcExecError
}
if (no_err_flag) {
lpConnLib.log('OK Exec User function - ' + d.ResultSet.lpCallId, 'EXEC-OK', 'EMT')
} else {
lpConnLib.log('ERROR Exec User function=' + userCallbackFunc + '   #' + err_msg + '#', 'ERROR', 'EMT')
}
}
};
lpConnectionLibrary.prototype.getC = function(n) {
var c = document.cookie,
start = c.indexOf(n + "=");
if (typeof(n) == 'undefined' || start == -1) {
return null
}
var len = start + n.length + 1;
if ((!start) && (n != c.substring(0, n.length))) {
return null
}
var end = c.indexOf(";", len);
if (end == -1) {
end = c.length
}
return unescape(c.substring(len, end))
};
lpConnectionLibrary.prototype.log = function(m, t, s) {
if (this.DebugDisplay) {
lpMTagDebug.Display(m, t, s)
}
};
if (typeof(lpConnLib) == 'undefined') {
function lpJSLibrary() {}
var lpJSLib = new lpJSLibrary(),
lpConnLib = new lpConnectionLibrary();
lpConnLib.gcT = setInterval('lpConnLib.gc()', lpConnLib.garbagePeriod * 1000)
}
function lpMonitorTag() {
var c = lpMTagConfig;
this.maxretries = 3;
this.maxErrorCnt = 2;
this.connErrorCnt = 0;
this.errorDelay = 10;
if (typeof(c.lpProtocol) == 'undefined') {
c.lpProtocol = (document.location.toString().indexOf("https:") == 0) ? "https" : "http"
}
this.lpURL = c.lpProtocol + '://' + c.lpServer + '/hc/' + c.lpNumber + '/';
this.lpPageLocation = this.getPageUrl();
if (typeof(c.lpUseSecureCookies) == 'undefined') {
c.lpUseSecureCookies = false
}
if (typeof(c.sendCookies) == 'undefined') {
c.sendCookies = true
}
if (typeof(c.lpSendCookies) == 'undefined') {
c.lpSendCookies = false
}
this.dCkName = 'LP_DATA_COOKIE';
this.lpVisitorStatus = 'INSITE_STATUS';
this.lpCmd = 'mTagKnockPage';
this.webServerCookie = 'LPNMT_DOMAIN-' + c.lpNumber;
this.lpPageID = this.getPId();
this.title = this.getTitle();
this.referrer = this.getRefr();
this.lpJavaEnabled = (this.lpIsJavaEnabled() ? 'true' : 'false');
this.lpLoopTimer = -1;
this.lpFirstInPage = true;
this.lpKnockPageRequestDelay = 0;
this.lpStartPageRequestDelay = 0;
this.lpFirstInPageRequestDelay = 0;
this.lpInPageRequestDelay = 30;
this.lpDelayAfterPost = 10;
this.lpBrowser = lpConnLib.browser;
this.lpDataToSend = '';
if (typeof(c.activePlugin) == 'undefined') {
c.activePlugin = 'none'
}
if (typeof(c.enableActivityMon) != 'undefined') {
this.actMon = c.enableActivityMon
} else {
this.actMon = true
}
if (typeof(c.inactivityPeriod) != 'undefined') {
this.inactPer = c.inactivityPeriod
} else {
this.inactPer = 120
}
if (typeof(c.actPollingInterval) != 'undefined') {
this.actPolInt = c.actPollingInterval
} else {
this.actPolInt = 3
}
this.lastActiveDate = new Date();
this.cookieRemovedCnt = 0;
this.prevCookie = '';
this.splitCookieLeft = '';
this.events = {
eventId: 0,
lstnrs: {},
fired: [],
prefix: 'evId_',
register: function(evName, fn) {
if (typeof(evName) == 'undefined' || typeof(fn) != 'function') {
lpConnLib.log('Ev listen has invalid params: evName=[' + evName + '] fn=[' + fn + ']', 'ERROR', 'EMT-Events');
return null
}
var evId = this.eventId++;
this.lstnrs[this.prefix + evId] = {
id: evId,
name: evName,
fn: fn
};
lpConnLib.log('Ev listen rgstr: evName=[' + evName + '] fn=[' + fn + ']', 'DEBUG', 'EMT-Events');
return evId
},
unregister: function(id) {
if (typeof(id) == 'undefined') {
lpConnLib.log('Ev listen id not spec for unregister', 'ERROR', 'EMT-Events');
return null
}
var ev = this.lstnrs[this.prefix + id];
if (typeof(ev) == 'undefined') {
lpConnLib.log('Ev listen id not Found for unregister id=' + id, 'ERROR', 'EMT-Events');
return false
} else {
delete this.lstnrs[this.prefix + id];
lpConnLib.log('Ev listen id=' + id + ' unregister', 'DEBUG', 'EMT-Events');
return true
}
},
hasFired: function(evName) {
if (typeof(evName) == 'undefined' || evName == '*') {
return this.fired
}
var ret = [];
for (var n = 0; n < this.fired.length; n++) {
if (this.fired[n].evName == evName) {
ret[ret.length] = this.fired[n]
}
}
return ret
},
publish: function(evName, pJson) {
if (typeof(evName) == 'undefined') {
lpConnLib.log('Ev name not spec for publish', 'ERROR', 'EMT-Events');
return null
}
this.fired[this.fired.length] = {
evName: evName,
evData: pJson
};
var anyLstnr = false;
for (var n in this.lstnrs) {
var l = this.lstnrs[n];
if (l.name == evName || l.name == '*') {
l.fn(evName, pJson);
anyLstnr = true;
lpConnLib.log('Ev listen=' + n + ' ev=' + evName + ' exec', 'DEBUG', 'EMT-Events')
}
}
return anyLstnr
}
}
}
lpMonitorTag.prototype.startActMon = function() {
if (this.actMon) {
lpConnLib.log('Start ActMon', 'DEBUG', 'EMT');
var c = lpMTagConfig;
c.visitorActive = true;
if (typeof(c.pageVar) == 'undefined') {
c.pageVar = []
}
c.pageVar[c.pageVar.length] = 'visitorActive=1';
if (window.attachEvent) {
document.attachEvent('onmousedown', this.MAct);
document.attachEvent('onmousemove', this.MAct);
document.attachEvent('onmouseover', this.MAct);
window.attachEvent('onresize', this.MAct);
window.attachEvent('onblur', this.MAct);
window.attachEvent('onfocus', this.MAct);
document.attachEvent('onkeydown', this.MAct);
document.attachEvent('onscroll', this.MAct)
} else {
var fn = window.addEventListener;
fn("mousedown", this.MAct, false);
fn("mousemove", this.MAct, false);
fn("mouseover", this.MAct, false);
fn("scroll", this.MAct, false);
fn("resize", this.MAct, false);
fn("blur", this.MAct, false);
fn("focus", this.MAct, false);
fn("keydown", this.MAct, false)
}
this.actT = setInterval(this.cAct, this.actPolInt * 1000)
}
};
lpMonitorTag.prototype.getPageUrl = function() {
var u = document.location.href.toString();
if (u == null || u == '') {
u = '__blank__'
}
return u
};
lpMonitorTag.prototype.getTitle = function() {
var title = '';
if (typeof(document.title) != "undefined" && document.title.length > 0) {
title = document.title
}
return title
};
lpMonitorTag.prototype.getPId = function() {
return Math.round(Math.random() * 9999999999)
};
lpMonitorTag.prototype.getRefr = function() {
var referrer = '';
if (typeof(document.referrer) != "undefined" && document.referrer.length > 0) {
referrer = document.referrer
}
return referrer
};
lpMonitorTag.prototype.MAct = function() {
lpMTag.lastActiveDate = new Date()
};
lpMonitorTag.prototype.cAct = function() {
var c = lpMTagConfig,
cTime = new Date().getTime(),
lastActTime = lpMTag.lastActiveDate.getTime(),
actSt = c.visitorActive;
actSt = (cTime - lastActTime) <= (lpMTag.inactPer * 1000);
if (actSt != c.visitorActive) {
lpConnLib.log('Visitor Act STATUS= ' + (actSt ? '1' : '0'), 'DEBUG', 'EMT');
c.pageVar[c.pageVar.length] = 'visitorActive=' + (actSt ? '1' : '0');
c.visitorActive = actSt
}
};
lpMonitorTag.prototype.removeUrlParameter = function(url, p) {
var pnt = url.indexOf('&' + p + '=');
if (pnt > -1) {
var tmp = url.substring(pnt + ('&' + p + '=').length),
endpnt = tmp.indexOf('&');
if (endpnt > -1) {
url = url.substring(0, pnt) + tmp.substring(endpnt)
} else {
url = url.substring(0, pnt)
}
}
return url
};
lpMonitorTag.prototype.addFirstPartyCookies = function(url, cmd, params) {
var c = lpMTagConfig;
if (typeof(cmd) == 'undefined') {
var pnt = url.indexOf('&cmd=');
if (pnt > -1) {
var tmp = url.substring(pnt + 5);
if (tmp.indexOf('&') > -1) {
tmp = tmp.substring(0, tmp.indexOf('&'))
}
cmd = tmp
} else {
cmd = ''
}
}
if (typeof(c.useFirstParty) != 'undefined' && c.useFirstParty || cmd == 'mTagKnockPage') {
var vid = lpConnLib.getC(c.FPC_VID_NAME ? c.FPC_VID_NAME : c.lpNumber + '-VID'),
skey = lpConnLib.getC(c.FPC_SKEY_NAME ? c.FPC_SKEY_NAME : c.lpNumber + '-SKEY'),
contId = lpConnLib.getC(c.FPC_CONT_NAME ? c.FPC_CONT_NAME : 'HumanClickSiteContainerID_' + c.lpNumber);
if (url.indexOf('?') == -1) {
url += '?'
}
if (url.indexOf('&visitor=') > -1) {
lpConnLib.log('FPC Found &v in url - remove', 'DEBUG', 'EMT');
url = this.removeUrlParameter(url, 'visitor')
}
if (url.indexOf('&msessionkey=') > -1) {
lpConnLib.log('FPC Found &m in the url - remove', 'DEBUG', 'EMT');
url = this.removeUrlParameter(url, 'msessionkey')
}
if (url.indexOf('&siteContainer=') > -1) {
lpConnLib.log('FPC Found &s in the url - remove', 'DEBUG', 'EMT');
url = this.removeUrlParameter(url, 'siteContainer')
}
if (typeof(params) != 'undefined') {
var idx;
idx = params.getByName('visitor');
if (idx > -1) {
lpConnLib.log('FPC visitor - remove', 'DEBUG', 'EMT');
params.remove(idx)
}
idx = params.getByName('msessionkey');
if (idx > -1) {
lpConnLib.log('FPC msessionkey - remove', 'DEBUG', 'EMT');
params.remove(idx)
}
idx = params.getByName('siteContainer');
if (idx > -1) {
lpConnLib.log('FPC siteContainer - remove', 'DEBUG', 'EMT');
params.remove(idx)
}
}
if (vid != null) {
url += '&visitor=' + vid
}
if (skey != null) {
url += '&msessionkey=' + skey
}
if (contId != null) {
url += '&siteContainer=' + contId
}
}
return url
};
lpMonitorTag.prototype.mtagAddReqToQueue = function(req) {
this.mtagAddToQueue(req.BaseUrl, req.params, req.callbackFunc, req.requireConfirm, req.maxretries, req.forceget, req.postAutoConfirm, req.lpjson, req.dataEncoding, req.forcePost, req.usedSpecialPost, req.spImmediateCleanup, req.encodingBlankUrl, req.minimizePost, req.minimizePostMaxGets, req.allowTruncate)
};
lpMonitorTag.prototype.mtagAddToQueue = function(Url, params, Callback, requireConfirm, maxretries, forceget, onPostAutoConfirm, lpjson, dataEncoding, forcePost, specialPost, spImmediateCleanup, encodingBlankUrl, minimizePost, minimizePostMaxGets, allowTruncate) {
var cmd = params.getValue(params.getByName('cmd'));
Url = this.addFirstPartyCookies(Url, cmd, params);
Url = this.addStatCmdToUrl(Url, params);
params = this.avoidPost(Url, params, cmd);
return lpConnLib.addToQueue(Url, params, Callback, requireConfirm, maxretries, forceget, onPostAutoConfirm, lpjson, dataEncoding, forcePost, specialPost, spImmediateCleanup, encodingBlankUrl, minimizePost, minimizePostMaxGets, allowTruncate)
};
lpMonitorTag.prototype.addStatCmdToUrl = function(url, params) {
var indx, value = '';
if (url.indexOf('?') == -1) {
url += '?'
}
indx = params.getByName('site');
if (indx != -1) {
value = params.getValue(indx);
url += '&site=' + value;
params.remove(indx)
}
indx = params.getByName('cmd');
if (indx != -1) {
value = params.getValue(indx);
url += '&cmd=' + value;
params.remove(indx)
}
return url
};
lpMonitorTag.prototype.avoidPost = function(Url, params, cmd) {
var c = lpMTagConfig,
avoidPost = this.getAPProps(),
splitCookie = c.sgpemtSplitCookie,
splitCookieMinDelta = 0;
if (splitCookie) {
splitCookieMinDelta = c.sgpemtSplitCookieMinDelta
}
if (!avoidPost.avoidPost && !splitCookie) {
return params
}
var r = new lpRequest(lpConnLib.protocolVer, Url, params, null, false, 0, lpConnLib.prunId, lpConnLib.lpjson, 'UTF-8', lpConnLib.browser, false, true, undefined, 0, 0, false, false),
baseUrl = r.BuildBaseCallUrl(),
urlLength = baseUrl.length + params.fullLength() + 1,
orgCk = '';
if (urlLength > lpConnLib.maxurlgetlength) {
var indx = params.getByName('cookie');
if (indx > -1) {
lpConnLib.log('AP ' + avoidPost.avoidPost + ' SC ' + splitCookie + ' Limit ' + urlLength + ': drop cookies', 'DEBUG', 'EMT');
orgCk = params.getValue(indx);
params.remove(indx);
this.cookieRemovedCnt++;
if (this.cookieRemovedCnt > 1) {
lpConnLib.log('AP set sendCookies to FALSE', 'DEBUG', 'EMT');
lpMTagConfig.sendCookies = false
}
} else {
lpConnLib.log('AP Limit ' + urlLength + ': cookies not FOUND', 'DEBUG', 'EMT')
}
urlLength = baseUrl.length + params.fullLength() + 1;
if (urlLength > (lpConnLib.maxurlgetlength - splitCookieMinDelta)) {
lpConnLib.log('AP Limit ' + urlLength + ': after drop cookies - trim', 'DEBUG', 'EMT');
params = this.trimParam(params, 'pageWindowName', avoidPost.maxPageWinNameLength);
urlLength = baseUrl.length + params.fullLength() + 1;
if (urlLength > lpConnLib.maxurlgetlength) {
lpConnLib.log('AP Limit ' + urlLength + ' after trim pageWindowName ', 'DEBUG', 'EMT')
} else {
return this.prSplitC(cmd, params, urlLength, orgCk)
}
params = this.trimParam(params, 'title', avoidPost.emtMaxTitleLength);
urlLength = baseUrl.length + params.fullLength() + 1;
if (urlLength > (lpConnLib.maxurlgetlength - splitCookieMinDelta)) {
lpConnLib.log('AP Limit ' + urlLength + ' after trim title ', 'DEBUG', 'EMT');
params = this.trimParam(params, 'referrer', avoidPost.emtMaxReferLength)
} else {
return this.prSplitC(cmd, params, urlLength, orgCk)
}
urlLength = baseUrl.length + params.fullLength() + 1;
if (urlLength > (lpConnLib.maxurlgetlength - splitCookieMinDelta)) {
lpConnLib.log('AP Limit ' + urlLength + 'trim page', 'DEBUG', 'EMT');
params = this.trimParam(params, 'page', avoidPost.emtMaxUrlLength)
} else {
return this.prSplitC(cmd, params, urlLength, orgCk)
}
urlLength = baseUrl.length + params.fullLength() + 1;
if (urlLength > (lpConnLib.maxurlgetlength - splitCookieMinDelta)) {
lpConnLib.log('AP Limit ' + urlLength, 'DEBUG', 'EMT');
params = this.trimParam(params, 'title', avoidPost.emtMinTitleLength)
} else {
return this.prSplitC(cmd, params, urlLength, orgCk)
}
urlLength = baseUrl.length + params.fullLength() + 1;
if (urlLength > (lpConnLib.maxurlgetlength - splitCookieMinDelta)) {
lpConnLib.log('AP Limit ' + urlLength, 'DEBUG', 'EMT');
params = this.trimParam(params, 'referrer', avoidPost.emtMinReferLength)
} else {
return this.prSplitC(cmd, params, urlLength, orgCk)
}
urlLength = baseUrl.length + params.fullLength() + 1;
if (urlLength > (lpConnLib.maxurlgetlength - splitCookieMinDelta)) {
lpConnLib.log('AP Limit ' + urlLength, 'DEBUG', 'EMT');
params = this.trimParam(params, 'page', avoidPost.emtMinUrlLength)
} else {
return this.prSplitC(cmd, params, urlLength, orgCk)
}
urlLength = baseUrl.length + params.fullLength() + 1;
if (urlLength > (lpConnLib.maxurlgetlength - splitCookieMinDelta)) {
lpConnLib.log('AP over limit ' + urlLength + ': DO POST', 'DEBUG', 'EMT');
var idx = params.getByName('page');
if (idx > -1) {
params.remove(idx);
params.add('page', this.lpPageLocation)
}
idx = params.getByName('referrer');
if (idx > -1) {
params.remove(idx);
params.add('referrer', this.referrer)
}
idx = params.getByName('title');
if (idx > -1) {
params.remove(idx);
params.add('title', this.title)
}
if (orgCk != '') {
this.cookieRemovedCnt--;
params.add('cookie', orgCk)
}
return params
} else {
return this.prSplitC(cmd, params, urlLength, orgCk)
}
} else {
return this.prSplitC(cmd, params, urlLength, orgCk)
}
} else {
return this.prSplitC(cmd, params, urlLength, orgCk)
}
};
lpMonitorTag.prototype.prSplitC = function(cmd, params, urlLength, orgCk) {
var d = lpMTagDebug;
if (!lpMTagConfig.sgpemtSplitCookie || (cmd != 'mTagStartPage' && cmd != 'mTagInPage' && cmd != 'mTagUDEsend')) {
lpConnLib.log('SplitCookie ' + lpMTagConfig.sgpemtSplitCookie + ' cmd ' + cmd, 'DEBUG', 'EMT');
return params
}
var chunk = '',
sizeLeft = lpConnLib.maxurlgetlength - urlLength - "&sc=".length;
if (typeof(orgCk) == 'undefined' || orgCk == '') {
if (this.splitCookieLeft.length == 0) {
lpConnLib.log('SplitCookie - nothing to send - DONE', 'DEBUG', 'EMT');
return params
}
sizeLeft = this.adjustForSpChars(this.splitCookieLeft, sizeLeft);
chunk = this.splitCookieLeft.substr(0, sizeLeft);
this.splitCookieLeft = this.splitCookieLeft.substr(sizeLeft);
var pname = 'ac';
if (this.splitCookieLeft == '') {
pname = 'ec'
}
lpConnLib.log('SC send ' + pname + ' chunk size=' + chunk.length + ' left=' + this.splitCookieLeft.length, 'DEBUG', 'EMT');
params.add(pname, this.specialUnescape(chunk))
} else {
var escCk = this.specialEscape(orgCk);
sizeLeft = this.adjustForSpChars(escCk, sizeLeft);
chunk = escCk.substr(0, sizeLeft);
params.add('sc', this.specialUnescape(chunk));
lpConnLib.log('SC send sc chunk size=' + chunk.length + ' total size=' + orgCk.length, 'DEBUG', 'EMT');
this.splitCookieLeft = escCk.substr(sizeLeft)
}
return params
};
lpMonitorTag.prototype.specialEscape = function(characters) {
var tmp = escape(characters);
tmp = tmp.replace(/\+/g, "%2B");
return tmp
};
lpMonitorTag.prototype.specialUnescape = function(characters) {
var tmp = characters.replace(/%2B/g, "+");
tmp = unescape(characters);
return tmp
};
lpMonitorTag.prototype.adjustForSpChars = function(escCk, sizeLeft) {
if (escCk.charAt(sizeLeft - 1) == '%') {
return sizeLeft - 1
}
if (escCk.charAt(sizeLeft - 2) == '%') {
return sizeLeft - 2
}
var chunkSlice = escCk.substr(0, sizeLeft).substr(-6),
unicodeIdx = chunkSlice.lastIndexOf("%u");
if (unicodeIdx > 0) {
return sizeLeft - (chunkSlice.length - unicodeIdx)
}
return sizeLeft
};
lpMonitorTag.prototype.trimParam = function(p, name, maxSize) {
var str = '',
indx = p.getByName(name);
if (indx > -1) {
str = p.getValueEsc(indx)
}
if (str.length > maxSize) {
lpConnLib.log('trimParam ' + name.toUpperCase() + ' length ' + str.length + ' to ' + maxSize, 'DEBUG', 'EMT');
str = this.trimLength(str, maxSize);
p.remove(indx);
if (str != '') {
p.add(name, str, true)
}
}
return p
};
lpMonitorTag.prototype.getAPProps = function() {
var ret = {
avoidPost: false
};
var c = lpMTagConfig;
if (c.emtAvoidPOST || (typeof(c.emtAvoidPOST) == 'undefined' && c.sgpemtAvoidPOST)) {
ret.avoidPost = true
} else {
return ret
}
if (typeof(c.emtMaxUrlLength) != 'undefined') {
ret.emtMaxUrlLength = c.emtMaxUrlLength
} else {
if (typeof(c.sgpemtMaxUrlLength) == 'undefined') {
ret.emtMaxUrlLength = 500
} else {
ret.emtMaxUrlLength = c.sgpemtMaxUrlLength
}
}
if (typeof(c.emtMinUrlLength) != 'undefined') {
ret.emtMinUrlLength = c.emtMinUrlLength
} else {
if (typeof(c.sgpemtMinUrlLength) == 'undefined') {
ret.emtMinUrlLength = 100
} else {
ret.emtMinUrlLength = c.sgpemtMinUrlLength
}
}
if (typeof(c.emtMaxReferLength) != 'undefined') {
ret.emtMaxReferLength = c.emtMaxReferLength
} else {
if (typeof(c.sgpemtMaxReferLength) == 'undefined') {
ret.emtMaxReferLength = 300
} else {
ret.emtMaxReferLength = c.sgpemtMaxReferLength
}
}
if (typeof(c.emtMinReferLength) != 'undefined') {
ret.emtMinReferLength = c.emtMinReferLength
} else {
if (typeof(c.sgpemtMinReferLength) == 'undefined') {
ret.emtMinReferLength = 100
} else {
ret.emtMinReferLength = c.sgpemtMinReferLength
}
}
if (typeof(c.emtMaxTitleLength) != 'undefined') {
ret.emtMaxTitleLength = c.emtMaxTitleLength
} else {
if (typeof(c.sgpemtMaxTitleLength) == 'undefined') {
ret.emtMaxTitleLength = 100
} else {
ret.emtMaxTitleLength = c.sgpemtMaxTitleLength
}
}
if (typeof(c.emtMinTitleLength) != 'undefined') {
ret.emtMinTitleLength = c.emtMinTitleLength
} else {
if (typeof(c.sgpemtMinTitleLength) == 'undefined') {
ret.emtMinTitleLength = 50
} else {
ret.emtMinTitleLength = c.sgpemtMinTitleLength
}
}
if (typeof(c.maxPageWinNameLength) != 'undefined') {
ret.maxPageWinNameLength = c.maxPageWinNameLength
}
return ret
};
lpMonitorTag.prototype.lpSetCallParams = function(lpCmd, extra) {
var c = lpMTagConfig,
i, tmpData, cPrm = new hcArrayStorage();
cPrm.add('site', c.lpNumber);
cPrm.add('cmd', lpCmd);
if (lpCmd != 'mTagKnockPage') {
cPrm.add('page', this.lpPageLocation)
}
cPrm.add('id', this.lpPageID);
cPrm.add('javaSupport', this.lpJavaEnabled);
cPrm.add('visitorStatus', this.lpVisitorStatus);
if (lpCmd == 'mTagInPage') {
var data = lpConnLib.getC(this.dCkName);
if (data != '' && data != null) {
this.lpDeleteCookie(this.dCkName);
cPrm.add(data)
}
}
if (lpCmd != 'mTagKnockPage') {
if (typeof(c.defaultChatInvite) != 'undefined') {
cPrm.add('defCInvite', c.defaultChatInvite)
}
if (typeof(c.defaultVoiceInvite) != 'undefined') {
cPrm.add('defVInvite', c.defaultVoiceInvite)
}
if (typeof(c.defaultMultiChannelInvite) != 'undefined') {
cPrm.add('defMCInvite', c.defaultMultiChannelInvite)
}
if (typeof(c.defaultInvite) != 'undefined') {
cPrm.add('defInvite', c.defaultInvite)
}
if (typeof(c.cobrowseEnabled) != 'undefined') {
if (typeof(c.lpActivePlugin) == 'undefined') {
c.lpActivePlugin = 'none'
}
cPrm.add('activePlugin', c.lpActivePlugin);
cPrm.add('cobrowse', 'true');
if (typeof(c.pageWindowName) != 'undefined') {
cPrm.add('pageWindowName', c.pageWindowName)
} else {
var name = '';
try {
if (top && typeof(top.document) != 'undefined') {
name = '' + top.name
}
} catch (e) {
name = ''
}
if (name != '') {
if (escape(name).length > c.maxPageWinNameLength) {
name = this.trimLength(name, c.maxPageWinNameLength)
}
cPrm.add('pageWindowName', name)
}
}
if (typeof(c.lpOperatorPageType) != "undefined") {
cPrm.add('cobrowsetitle', c.lpOperatorPageType)
}
if (typeof(c.lpOperatorPageUrl) != "undefined") {
cPrm.add('cobrowseurl', c.lpOperatorPageUrl)
}
}
}
if (lpCmd == 'mTagStartPage' || lpCmd == 'mTagInPage') {
if (typeof(c.pageVar) != 'undefined' && c.pageVar.length > 0) {
for (i = 0; i < c.pageVar.length; i++) {
cPrm.add('PV!' + c.pageVar[i], undefined, true);
this.addUDESt('page', c.pageVar[i])
}
c.pageVar = []
}
if (typeof(c.sessionVar) != 'undefined' && c.sessionVar.length > 0) {
for (i = 0; i < c.sessionVar.length; i++) {
cPrm.add('SV!' + c.sessionVar[i], undefined, true);
this.addUDESt('session', c.sessionVar[i])
}
c.sessionVar = []
}
if (typeof(c.visitorVar) != 'undefined' && c.visitorVar.length > 0) {
for (i = 0; i < c.visitorVar.length; i++) {
cPrm.add('VV!' + c.visitorVar[i], undefined, true);
this.addUDESt('visitor', c.visitorVar[i])
}
c.visitorVar = []
}
}
if (lpCmd == 'mTagKnockPage') {
if (typeof(c.dynButton) != 'undefined' && c.dynButton.length > 0) {
var dbut = '';
for (i = 0; i < c.dynButton.length; i++) {
if (i > 0) {
dbut += '#'
}
dbut += c.dynButton[i].name + '|';
if (typeof(c.dynButton[i].ovr) != 'undefined') {
dbut += c.dynButton[i].ovr + '|'
} else {
dbut += 'null|'
}
if (typeof(c.dynButton[i].pid) != 'undefined') {
dbut += c.dynButton[i].pid + '|'
} else {
dbut += 'null|'
}
}
cPrm.add('dbut', dbut)
}
}
if (typeof(c.sendSnippets) != 'undefined') {
cPrm.add('sendSnippets', c.sendSnippets);
c.sendSnippets = undefined
}
if (typeof(extra) != 'undefined') {
tmpData = extra.split('&');
for (i = 0; i < tmpData.length; i++) {
if (tmpData[i] != '') {
cPrm.add(tmpData[i])
}
}
}
if (lpCmd != 'mTagKnockPage') {
if (this.lpDataToSend != '') {
tmpData = this.lpDataToSend.split('&');
for (i = 0; i < tmpData.length; i++) {
if (tmpData[i] != '') {
cPrm.add(tmpData[i])
}
}
this.lpDataToSend = ''
}
}
if (lpCmd != 'mTagKnockPage' && lpCmd != 'mTagInPage') {
if (this.title != '') {
cPrm.add('title', this.title)
}
if (this.referrer != '') {
cPrm.add('referrer', this.referrer)
}
}
if (lpCmd != 'mTagKnockPage' && c.lpSendCookies && c.sendCookies) {
var cookies = null;
if (!c.cobrowseEnabled) {
cPrm.add('cobrowse', 'true')
}
if (lpCmd == 'mTagStartPage') {
if (typeof(c.GetPageCookies) == 'function') {
cookies = c.GetPageCookies()
} else {
cookies = document.cookie
}
if ((typeof(cookies) == 'undefined') || cookies == null) {
cookies = ''
}
if (cookies != '' && this.prevCookie != cookies) {
cPrm.add('cookie', cookies);
this.prevCookie = cookies
}
}
}
if (typeof(c.addToCallParams) == 'function') {
cPrm = c.addToCallParams(lpCmd, cPrm)
}
return cPrm
};
lpMonitorTag.prototype.lpIsJavaEnabled = function() {
var rc = false;
try {
var n = navigator;
if (typeof(n) != 'undefined') {
var agent = n.appName,
ver = parseInt(n.appVersion);
if (agent == "Microsoft Internet Explorer") {
if ((ver >= 4) && n.javaEnabled()) {
rc = true
}
} else if (typeof(n.plugins) != 'undefined' && n.plugins) {
for (var i = 0; i < n.plugins.length; i++) {
rc = rc || (n.plugins[i].name.toUpperCase().indexOf("JAVA") != -1)
}
}
}
} catch (e) {
lpConnLib.log('Ex:' + e, 'ERROR', 'lpIsJavaEnabled')
}
return rc
};
lpMonitorTag.prototype.trimLength = function(str, max) {
if (str.length > max && max > -1) {
return str.substring(0, max)
}
return str
};
lpMonitorTag.prototype.lpFixProtocol = function(str) {
if ((str != null) && (str.indexOf('http:') == 0) && (lpMTagConfig.lpProtocol == 'https')) {
return lpMTagConfig.lpProtocol + str.substring(4)
}
return str
};
lpMonitorTag.prototype.lpFormData = function(fName, useC, fL, excl, prfx) {
if (typeof(useC) == 'undefined') {
useC = false
}
if (typeof(fL) == 'undefined') {
fL = null
}
if (typeof(excl) == 'undefined') {
excl = false
}
var hcForm = document.forms[fName];
if (hcForm) {
var data = this.lpGetFormData(hcForm, fL, excl, prfx);
if (useC) {
this.lpAddToSetCookie(this.dCkName, data, lpMTagConfig.lpUseSecureCookies)
} else {
var cParam = new hcArrayStorage();
cParam = this.lpSetCallParams(this.lpCmd, data);
this.mtagAddToQueue(this.lpURL, cParam, this.MTagCallback, true, this.maxretries, false, 1, 1, lpMTagConfig.charSet)
}
return true
} else {
lpConnLib.log('Cannot get form=' + fName, 'ERROR', 'EMT');
return false
}
};
lpMonitorTag.prototype.lpFormField = function(formN, fldN, useC, prfx) {
return this.lpFormData(formN, useC, [fldN], false, prfx)
};
lpMonitorTag.prototype.lpGetFormData = function(f, fL, excl, prfx) {
var nvps = [];
for (var e = 0; f.length > e; e++) {
var el = f.elements[e];
if ((excl && !this.lpValueInArray(el.name, fL)) || ((!excl && this.lpValueInArray(el.name, fL)))) {
switch (el.type) {
case "text":
case "password":
case "hidden":
nvps[nvps.length] = (el.name ? escape(el.name) : "undefined" + e) + "=" + escape(el.value);
break;
case "select-one":
case "select-multiple":
{
if (el.length) {
for (var m = 0; el.length > m; m++) {
if (el[m].selected) {
nvps[nvps.length] = (el.name ? escape(el.name) : "undefined" + e) + "=" + escape(el[m].value)
}
}
}
}
break;
case "checkbox":
case "radio":
{
if (el.checked) {
nvps[nvps.length] = (el.name ? escape(el.name) : "undefined" + e) + "=" + escape(el.value)
}
}
break;
case "file":
case "image":
case "reset":
case "submit":
case "button":
default:
if (el.tagName == "BUTTON" || el.tagName == "TEXTAREA") {
nvps[nvps.length] = (el.name ? escape(el.name) : "undefined" + e) + "=" + escape(el.value)
}
break
}
}
}
var qs = '';
for (var i = 0; i < nvps.length; i++) {
if (typeof(prfx) != 'undefined' && prfx != "") {
qs += prfx
} else {
qs += "PV!"
}
qs += '' + nvps[i] + '&'
}
return qs
};
lpMonitorTag.prototype.lpValueInArray = function(v, l) {
if (typeof(l) == 'undefined') {
return false
}
for (var i = 0; i < l.length; i++) {
if (l[i] == v) {
return true
}
}
return false
};
lpMonitorTag.prototype.lpSendData = function(d, now) {
if (d.length <= 0) {
return false
}
if (typeof(now) == 'undefined') {
now = false
}
if (now) {
var send_data = new hcArrayStorage();
send_data = this.lpSetCallParams('mTagUDEsend', d);
this.mtagAddToQueue(this.lpURL, send_data, null, false, 0, false, 0, 1, lpMTagConfig.charSet)
} else {
this.lpDataToSend += d + '&'
}
};
lpMonitorTag.prototype.lpAddToSetCookie = function(n, v, s, ex, p, dom) {
var cV = lpConnLib.getC(n);
if (cV == null) {
cV = ''
}
this.lpSetCookie(n, v + cV, ex, p, dom, s)
};
lpMonitorTag.prototype.lpSetCookie = function(n, v, e, p, d) {
if (e) {
e = e * 1000 * 60 * 60 * 24
}
var eD = new Date((new Date()).getTime() + (e));
document.cookie = n + "=" + escape(v) + ((e) ? ";expires=" + eD.toGMTString() : "") + ((p) ? ";path=" + p : "") + ((d) ? ";domain=" + d : "") + ((lpMTagConfig.lpUseSecureCookies) ? ";secure" : "")
};
lpMonitorTag.prototype.lpGetCookie = function(n) {
return lpConnLib.getC(n)
};
lpMonitorTag.prototype.lpDeleteCookie = function(n, p, d) {
if (lpConnLib.getC(n)) {
document.cookie = n + "=" + ((p) ? ";path=" + p : "") + ((d) ? ";domain=" + d : "") + ";expires=Thu, 01-Jan-1970 00:00:01 GMT"
}
};
lpMonitorTag.prototype.ifVisitorActions = function(data) {
var c = lpMTagConfig;
if (typeof(c.ifVisitorCode) != 'undefined') {
for (var i = 0; i < c.ifVisitorCode.length; i++) {
var fn = c.ifVisitorCode[i];
try {
fn(data);
lpConnLib.log('OK Executing Visitor function', 'EXEC-OK', 'EMT')
} catch (e) {
lpConnLib.log('ERROR Executing Visitor function=' + fn + '   #' + e + '#', 'ERROR', 'EMT')
}
}
c.ifVisitorCode = []
}
c.isVisitor = true
};
lpMonitorTag.prototype.MTagCallback = function(d, r) {
var delay = 0;
if (typeof(lpMTagConfig.onResponse) == 'function') {
lpMTagConfig.onResponse(d, r)
}
if (typeof(d.ResultSet.lpCallError) != 'undefined') {
lpMTag.connErrorCnt++;
if (lpMTag.connErrorCnt <= lpMTag.maxErrorCnt) {
lpMTag.lpLoopTimer = setTimeout('lpMTag.lpMTagMain()', lpMTag.errorDelay * 1000)
}
return
}
lpMTag.connErrorCnt = 0;
if (d.ServiceInfo.resendCall) {
lpConnLib.log('Resend con ' + d.ResultSet.lpCallId, 'WARN', 'EMT');
if (r != null) {
lpMTag.mtagAddReqToQueue(r)
}
return
}
if (lpMTag.lpCmd == 'mTagKnockPage') {
lpMTag.lpCmd = 'mTagStartPage';
lpMTag.startActMon();
delay = lpMTag.lpStartPageRequestDelay
} else {
if (lpMTag.lpCmd == 'mTagStartPage') {
lpMTag.lpCmd = 'mTagInPage';
delay = lpMTag.lpFirstInPageRequestDelay
} else {
delay = lpMTag.lpInPageRequestDelay
}
lpMTag.ifVisitorActions()
}
if (!lpMTag.stopMTag) {
if (lpMTag.lpLoopTimer != -1) {
clearTimeout(lpMTag.lpLoopTimer)
}
if (lpMTag.lpLoopTimer != -1) {
lpMTag.lpLoopTimer = setTimeout('lpMTag.lpMTagMain()', delay * 1000)
}
}
};
lpMonitorTag.prototype.overrideLPServer = function(srvName, setCookie) {
var c = lpMTagConfig;
if (setCookie) {
this.lpSetCookie(this.webServerCookie, srvName)
}
c.lpServer = srvName;
this.lpURL = c.lpProtocol + '://' + c.lpServer + '/hc/' + c.lpNumber + '/'
};
lpMonitorTag.prototype.MTagOnLoad = function() {
var c = lpMTagConfig;
if (lpConnLib.getC(this.webServerCookie) != null) {
this.overrideLPServer(lpConnLib.getC(this.webServerCookie), false)
}
if (typeof(c.onLoadCode) != 'undefined') {
for (var i = 0; i < c.onLoadCode.length; i++) {
var tempfunc = c.onLoadCode[i];
try {
tempfunc();
lpConnLib.log('OK ONLoad fn', 'EXEC-OK', 'EMT')
} catch (e) {
lpConnLib.log('ERROR ONLoad fn=' + tempfunc + '   #' + e + '#', 'ERROR', 'EMT')
}
}
c.onLoadCode = []
}
if (typeof(lpGetVariables) != 'undefined' && typeof(lpGetVariables) == 'function') {
this.lpProcessUDEs(lpGetVariables())
}
if (typeof(lpUDEs) != 'undefined') {
this.lpProcessUDEs(lpUDEs)
}
};
lpMonitorTag.prototype.lpProcessUDEs = function(udes) {
var c = lpMTagConfig;
for (var indx in udes) {
for (var i = 0; i < udes[indx].length; i++) {
if (indx == 'session') {
if (typeof(c.sessionVar) == 'undefined') {
c.sessionVar = []
}
c.sessionVar[c.sessionVar.length] = udes[indx][i]
} else if (indx == 'page') {
if (typeof(c.pageVar) == 'undefined') {
c.pageVar = []
}
c.pageVar[c.pageVar.length] = udes[indx][i]
} else if (indx == 'visitor') {
if (typeof(c.visitorVar) == 'undefined') {
c.visitorVar = []
}
c.visitorVar[c.visitorVar.length] = udes[indx][i]
}
}
}
};
lpMonitorTag.prototype.lpMTagMain = function(forceGet) {
var cParam = new hcArrayStorage();
if (typeof(forceGet) == 'undefined') {
forceGet = false
}
cParam = this.lpSetCallParams(this.lpCmd);
var callType = this.mtagAddToQueue(this.lpURL, cParam, this.MTagCallback, true, this.maxretries, forceGet, undefined, 1, lpMTagConfig.charSet);
if (callType == 'POST') {
if (this.lpCmd == 'mTagKnockPage') {
this.lpCmd = 'mTagStartPage'
} else if (this.lpCmd == 'mTagStartPage') {
this.lpCmd = 'mTagInPage'
}
lpMTag.lpLoopTimer = setTimeout('lpMTag.lpMTagMain(true)', lpMTag.lpDelayAfterPost * 1000)
}
};
lpMTagConfig.UDEstore = {};
lpMTagConfig.UDEstore.SV = [];
lpMTagConfig.UDEstore.VV = [];
lpMTagConfig.UDEstore.PV = [];
lpMonitorTag.prototype.addUDESt = function(scope, ude) {
var c = lpMTagConfig;
if (scope == 'session') {
c.UDEstore.SV[c.UDEstore.SV.length] = ude
} else if (scope == 'visitor') {
c.UDEstore.VV[c.UDEstore.VV.length] = ude
} else if (scope == 'page') {
c.UDEstore.PV[c.UDEstore.PV.length] = ude
}
};
lpMonitorTag.prototype.regPlugins = function() {
var c = lpMTagConfig,
burl = '';
if (c.lpMTagSrc) {
burl = c.lpMTagSrc.substr(0, c.lpMTagSrc.lastIndexOf('/')) + "/plugins/"
} else if (c.lpTagSrv) {
burl = c.lpProtocol + "://" + c.lpTagSrv + "/hcp/html/plugins/"
} else {
burl = c.lpProtocol + "://" + c.lpServer + "/hcp/html/plugins/"
}
lpLazy.register('lpRequest.prototype.MakeCallByIframe', burl + 'emt_post_plugin.js');
lpLazy.register('lpConnectionLibrary.prototype.specialPostHandler', burl + 'emt_sp-post_plugin.js');
lpLazy.register('lpConnectionLibrary.prototype.splitRequestIntoGets', burl + 'emt_split-post_plugin.js');
lpLazy.register('lpConnectionLibrary.prototype.reportError', burl + 'emt_reportError_plugin.js');
lpLazy.register('lpMonitorTag.prototype.lpSetPage', burl + 'emt_lpSetPage_plugin.js')
};
var lpLazy = {
map: {},
d: {},
register: function(mS, f) {
try {
var that = this;
if (mS.indexOf('.prototype.') > -1) {
var str = mS + " = function () {var that = this; lpLazy.prx('" + mS + "', arguments, that);}";
eval(str)
} else if (mS.indexOf('.') > -1) {
var r = this.gR(mS);
r.rf[r.mt] = function() {
that.prx(mS, arguments)
}
} else {
window[mS] = function() {
that.prx(mS, arguments)
}
}
this.map[mS] = f;
this.log('register:' + mS + ' ' + f, 'DEBUG', 'LPLAZY')
} catch (e) {
this.log('Ex:' + e, 'ERROR', 'LPLAZY')
}
},
prx: function(mS, a, ctx) {
try {
var inP = true;
if (typeof(this.d[mS]) == 'undefined') {
this.d[mS] = [];
inP = false
}
this.d[mS][this.d[mS].length] = {
a: a,
ctx: ctx
};
if (!inP) {
this.lPl(this.map[mS])
}
this.log('prx:' + mS, 'DEBUG', 'LPLAZY')
} catch (e) {
this.log('Ex:' + e, 'ERROR', 'LPLAZY')
}
},
callback: function(mS) {
try {
var i;
if (mS.indexOf('.') == -1) {
ctx = window[mS];
for (i = 0; i < this.d[mS].length; i++) {
window[mS].apply(this, this.d[mS][i].a)
}
} else if (mS.indexOf('.prototype.') > -1) {
var fnN = mS.substr(mS.indexOf('.prototype.') + 11);
for (i = 0; i < this.d[mS].length; i++) {
this.d[mS][i].ctx[fnN].apply(this.d[mS][i].ctx, this.d[mS][i].a)
}
} else {
var r = this.gR(mS);
for (i = 0; i < this.d[mS].length; i++) {
r.rf[r.mt].apply(r.rf, this.d[mS][i].a)
}
}
this.d[mS] = [];
this.log('callback:' + mS, 'DEBUG', 'LPLAZY')
} catch (e) {
this.log('Ex:' + e, 'ERROR', 'LPLAZY')
}
},
lPl: function(src) {
var s = document.createElement("script");
s.setAttribute("type", "text/javascript");
s.setAttribute("charset", "iso-8859-1");
s.setAttribute("src", src);
document.getElementsByTagName("head").item(0).appendChild(s)
},
gR: function(mS) {
var d = mS.split('.'),
ref = window;
for (var i = 0; i < d.length - 1; i++) {
ref = ref[d[i]]
}
return {
rf: ref,
mt: d[d.length - 1]
};
},
log: function(msg, lvl, sys) {
lpConnLib.log(msg, lvl, sys)
}
};
if (typeof(lpOpenPlatformNS) == 'undefined') {
window.lpOpenPlatformNS = {}
}
if (typeof(lpMTagDebug) == 'undefined') {
window.lpMTagDebug = {}
}
var lpMTag = new lpMonitorTag();
lpMTag.ver = '9.5.0';
lpMTag.build = '6';
lpMTag.MTagOnLoad();
lpMTag.regPlugins();
lpMTag.lpLoopTimer = setTimeout('lpMTag.lpMTagMain()', lpMTag.lpKnockPageRequestDelay * 1000);
#8 JavaScript::Eval (size: 59) - SHA256: de8db9510911f9b592cb83c256e1f62273d57f1ce626e0f54406f85a911512d1
[{
area: 'ad_postion_603',
entity: 'c_image',
ad_type: 'public'
}]
#9 JavaScript::Eval (size: 59) - SHA256: 7dac34ab3cb3782c1353e82f521368cd6a032ce48628a5ed0f3c54606dc0216a
[{
area: 'ad_postion_604',
entity: 'c_image',
ad_type: 'public'
}]
#10 JavaScript::Eval (size: 59) - SHA256: 4afd8556d6bc73eed2adfd612087d0f7cb147730d5e2ba4dfd8f4ee6ac5b9762
[{
area: 'ad_postion_605',
entity: 'c_image',
ad_type: 'public'
}]
#11 JavaScript::Eval (size: 162) - SHA256: 8b52dd1041ff1c74a9c720c86fc855b6440b1e99a23c6f884141516ff4412c5b
lpConnectionLibrary.prototype.specialPostHandler = function() {
var that = this;
lpLazy.prx('lpConnectionLibrary.prototype.specialPostHandler', arguments, that);
}
#12 JavaScript::Eval (size: 130) - SHA256: 70a8d8a42ab8105547ad0f8f775aa37d83c5f51e248910194a22d554548e5536
lpMonitorTag.prototype.lpSetPage = function() {
var that = this;
lpLazy.prx('lpMonitorTag.prototype.lpSetPage', arguments, that);
}
#13 JavaScript::Eval (size: 148) - SHA256: f2b7bfd0b015caaff7fa925046e32d7aa42d3c288695edd2c1501b16716efb33
lpConnectionLibrary.prototype.reportError = function() {
var that = this;
lpLazy.prx('lpConnectionLibrary.prototype.reportError', arguments, that);
}
Executed Writes (1)
#1 JavaScript::Write (size: 258) - SHA256: 9969e3cdfe5caec2f1141be69bb1abb0284f70e7ae303d98745a6c198deb4a3d
< a href = "https://www.51.la/?comId=19162019"
title = "51.La Q�A�ߡ��"
target = "_blank" > < span style = "display:inline-block;background-color:#EF5350;color:#fff;padding:2px 5px;font-family:arial;font-size:12px;font-weight:bold;line-height:1;" > 51 La < /span></a >