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.index=0;this.nameArray=new Array();this.valueArray=new Array();}hcArrayStorage.prototype.add=function(name,value,unescapeData){if(typeof(unescapeData)=='undefined'){unescapeData=false;}if(typeof(value)=='undefined'){var temp=name.split('=');name=temp[0];value=temp[1];}if(unescapeData){this.nameArray[this.index]=unescape(name);this.valueArray[this.index]=unescape(value);}else{this.nameArray[this.index]=name;this.valueArray[this.index]=value;}this.index++;};hcArrayStorage.prototype.size=function(){return this.index;};hcArrayStorage.prototype.get=function(i){if(typeof(this.nameArray[i])=='undefined'){return'';}var tmp=escape(this.nameArray[i])+'='+escape(this.valueArray[i]);tmp=tmp.replace(/\+/g,"%2B");return tmp;};hcArrayStorage.prototype.getName=function(i){return this.nameArray[i];};hcArrayStorage.prototype.getValue=function(i){return this.valueArray[i];};hcArrayStorage.prototype.getValueEsc=function(i){return escape(this.valueArray[i]);};hcArrayStorage.prototype.getByName=function(name){for(var i=0;i<this.index;i++){if(this.getName(i)==name){return i;}}return-1;};hcArrayStorage.prototype.remove=function(i){if(typeof(i)=='undefined'||i==null||typeof(this.nameArray[i])=='undefined'){return;}this.nameArray.splice(i,1);this.valueArray.splice(i,1);this.index--;};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.index;i++){length+=this.paramLength(i);}return length;};hcArrayStorage.prototype.getMaxLengthItem=function(){var max=0;var maxItemId=-1;for(var i=0;i<this.index;i++){if(this.paramLength(i)>max){max=this.paramLength(i);maxItemId=i;}}return maxItemId;};hcArrayStorage.prototype.clone=function(){var cloneObj=new hcArrayStorage();cloneObj.index=this.index;for(var i=0;i<this.index;i++){cloneObj.nameArray[i]=this.nameArray[i];cloneObj.valueArray[i]=this.valueArray[i];}return cloneObj;};function lpRequest(protocolVer,Url,params,Callback,requireConfirm,maxretries,prunIdentify,lpjson,dataEncoding,browser,postAutoConfirm,spImmediateCleanup,partial,part,outOf,forceget,forcePost,encodingBlankUrl,minimizePost,minimizePostMaxGets,allowTruncate){this.headLoc=document.getElementsByTagName("head").item(0);this.timeStamp=new Date();this.callId=this.BuildCallID();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(dataEncoding)!='undefined'&&dataEncoding!=''&&dataEncoding!=null){this.dataEncoding=dataEncoding.toUpperCase();}else{this.dataEncoding="UTF-8";}this.retries=0;this.confirmed=false;this.usedget=true;this.usedSpecialPost=false;this.maxretries=maxretries;this.prunIdentify=prunIdentify;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=minimizePost;this.minimizePostMaxGets=minimizePostMaxGets;this.allowTruncate=allowTruncate;}lpRequest.prototype.BuildCallID=function(){var sessionKey=this.getCookie('HumanClickKEY');if(sessionKey==null){sessionKey=Math.round(Math.random()*999999999999);}return sessionKey+'-'+Math.round(Math.random()*9999999999);};lpRequest.prototype.getCookie=function(name){var start=document.cookie.indexOf(name+"=");var len=start+name.length+1;if((!start)&&(name!=document.cookie.substring(0,name.length))){return null;}if(start==-1){return null;}var end=document.cookie.indexOf(";",len);if(end==-1){end=document.cookie.length;}return unescape(document.cookie.substring(len,end));};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.prunIdentify+this.lpjson;return url;};lpRequest.prototype.BuildCallUrl=function(type,maxLength,nolog){var callUrl=this.BuildBaseCallUrl();var urlLength=callUrl.length;if(type=='get'){if(this.params.size()>0){for(var i=0;i<this.params.size();i++){callUrl+='&'+this.params.get(i);}}urlLength=callUrl.length;if(urlLength>maxLength){if(lpConnLib.DebugDisplay&&!nolog){lpMTagDebug.Display('lpRequest.BuildCallUrl Cutting length:'+urlLength+' max='+maxLength,'WARN','EMT');}callUrl=callUrl.substring(0,maxLength);}}this.fullUrl=callUrl;return urlLength;};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){if(lpConnLib.DebugDisplay){lpMTagDebug.Display('lpRequest.removeScriptTag FAILED with error:'+e,'ERROR','EMT');}}};lpRequest.prototype.MakeCallByIframeSpecial=function(iframeRef){if(lpConnLib.DebugDisplay){lpMTagDebug.Display('MakeCallByIframeSpecial IFRM Charset='+(iframeRef.contentDocument?iframeRef.contentDocument.characterSet:'No doc')+'   '+this.dataEncoding,'DEBUG','EMT');}this.usedget=false;this.usedSpecialPost=true;if(iframeRef.contentDocument&&iframeRef.contentDocument.characterSet.toUpperCase()==this.dataEncoding.toUpperCase()){this.specialPostMakeCall(iframeRef.contentDocument);return true;}return false;};lpRequest.prototype.specialPostMakeCall=function(doc){this.BuildCallUrl('post');var form=doc.createElement('form');form.setAttribute('id','hcPostSubmitForm-'+this.callId);form.setAttribute('target','_self');form.setAttribute('action',this.fullUrl+"&A_ID="+Math.round(10000*Math.random())+'&'+this.prunIdentify+this.lpjson);form.setAttribute('method','post');var i;var urlParams=this.urlToParams(this.fullUrl);for(i=0;i<urlParams.size();i++){this.createInput(doc,form,urlParams.getName(i),urlParams.getValue(i));form[urlParams.getName(i)].value=urlParams.getValue(i);}for(i=0;i<this.params.size();i++){this.createInput(doc,form,this.params.getName(i),this.params.getValue(i));form[this.params.getName(i)].value=this.params.getValue(i);}doc.body.appendChild(form);form.submit();};lpRequest.prototype.createInput=function(doc,form,name,value){var input=doc.createElement('textarea');input.setAttribute('type','text');input.setAttribute('name',name);input.setAttribute('id',name);input.setAttribute('value',value);form.appendChild(input);};lpRequest.prototype.urlToParams=function(url){var urlParams=new hcArrayStorage();var tempD=url.split('?');var par=tempD[1];if(typeof(par)!='undefined'&&par!=''){var data=par.split('&');for(var i=0;i<data.length;i++){if(data[i]!=''){var splitParam=data[i].split('=');urlParams.add(splitParam[0],splitParam[1]);}}}return urlParams;};lpRequest.prototype.MakeCallByIframe=function(browser){this.usedget=false;this.BuildCallUrl('post');var container='';if(!document.getElementById(lpConnLib.iframeName)){container=this.CreateIframeContainer(browser);}else{if(browser=='IE'){document.body.removeChild(document.getElementById('SPAN'+lpConnLib.iframeName));}else{document.body.removeChild(document.getElementById(lpConnLib.iframeName));}container=this.CreateIframeContainer(browser);}var out_str='<html><head>';out_str+="<meta http-equiv='Content-Type' content='text/html; charset="+this.dataEncoding+"'>";out_str+='</head><body>';out_str+="<form name='hcPostSubmitForm' id='hcPostSubmitForm' method='post' target='_self' action='"+this.fullUrl+"&A_ID="+Math.round(10000*Math.random())+"'>";var urlParams=this.urlToParams(this.fullUrl);var i;for(i=0;i<urlParams.size();i++){out_str+="<input type='hidden' name='"+urlParams.getName(i)+"' value='"+urlParams.getValue(i)+"'>";}var dataObj={};if(this.params.size()>0){for(i=0;i<this.params.size();i++){out_str+="<input type='hidden' name='"+this.params.getName(i)+"' value=''>";dataObj[this.params.getName(i)]=this.params.getValue(i);}}out_str+="</form></body></html>";if(browser=='IE'||browser=='FF'||browser=='SAFARI'){var doc=null;if(browser=='IE'){doc=container.document;}else{doc=container.contentDocument;}doc.open();doc.write(out_str);doc.close();var j=doc.forms['hcPostSubmitForm'].length;for(i=0;i<j;i++){if(typeof(dataObj[doc.forms['hcPostSubmitForm'].elements[i].name])!='undefined'){doc.forms['hcPostSubmitForm'].elements[i].value=dataObj[doc.forms['hcPostSubmitForm'].elements[i].name];}}doc.forms['hcPostSubmitForm'].submit();}else{lpConnLib.postParams[this.callId]=dataObj;setTimeout("var container = document.getElementById('hcIframeContainer1'); var doc =  container.contentDocument; doc.open(); doc.write(\""+out_str+"\"); doc.close(); var j = doc.forms['hcPostSubmitForm'].length; for(var i=0;i<j;i++){if(typeof(lpConnLib.postParams['"+this.callId+"'][doc.forms['hcPostSubmitForm'].elements[i].name])!='undefined'){doc.forms['hcPostSubmitForm'].elements[i].value=lpConnLib.postParams['"+this.callId+"'][doc.forms['hcPostSubmitForm'].elements[i].name];}} doc.forms['hcPostSubmitForm'].submit(); delete lpConnLib.postParams['"+this.callId+"'];",250);}if(browser=="IE"){setTimeout("try {document.body.removeChild(document.getElementById('SPAN'+lpConnLib.iframeName));} catch (e) {}",lpConnLib.postDeleteIfrDelay*1000);}else{setTimeout("try {document.body.removeChild(document.getElementById(lpConnLib.iframeName));} catch (e) {}",lpConnLib.postDeleteIfrDelay*1000);}};lpRequest.prototype.CreateIframeContainer=function(browser){var containerName=lpConnLib.iframeName;var container,span,iframe;switch(browser){case'NS':container=new Layer(100);container.name=containerName;container.visibility='hidden';container.clip.width=100;container.clip.height=100;container.visibility='hidden';break;case'IE':document.body.insertAdjacentHTML('afterBegin',"<span id='SPAN"+containerName+"'></span>");span=document.all("SPAN"+containerName);var html="<iframe name='"+containerName+"' src=\"javascript:''\"></iframe>";span.innerHTML=html;span.style.display='none';span.style.visibility='hidden';span.style.position='absolute';span.style.width='0px';span.style.height='0px';container=window.frames[containerName];document.all("SPAN"+containerName).style.display='none';break;case'OPR':span=document.createElement('SPAN');span.id="SPAN"+containerName;document.body.appendChild(span);iframe=document.createElement('IFRAME');iframe.name=containerName;iframe.id=containerName;iframe.frameBorder=0;iframe.width=0;iframe.height=0;span.appendChild(iframe);container=iframe;document.getElementById("SPAN"+containerName).style.visibility='hidden';break;case'KONQ':span=document.createElement('SPAN');span.id="SPAN"+containerName;document.body.appendChild(span);iframe=document.createElement('IFRAME');iframe.name=containerName;iframe.id=containerName;span.appendChild(iframe);container=iframe;span.style.display=none;iframe.style.display=none;iframe.style.visibility='hidden';iframe.height=0;iframe.width=0;break;default:iframe=document.createElement('IFRAME');iframe.setAttribute("id",containerName);iframe.setAttribute("name",containerName);iframe.setAttribute("src","");iframe.frameBorder=0;iframe.scrolling='no';iframe.style.top="0px";iframe.style.left="0px";iframe.style.position='absolute';iframe.style.width='0px';iframe.style.height='0px';iframe.style.visibility='hidden';document.body.appendChild(iframe);container=iframe;break;}return container;};lpRequest.prototype.clone=function(){var cloneReq=new lpRequest();for(var p in this){if(typeof(this[p])!='undefined'){if(typeof(this[p])!='object'){cloneReq[p]=this[p];}else if(typeof(this[p])!='undefined'&&this[p]!=null&&this[p].constructor==hcArrayStorage){cloneReq[p]=this[p].clone();}else{cloneReq[p]=this[p];}}}return cloneReq;};function lpConnectionLibrary(){this.protocolVer=20;this.garbagePeriod=10;this.garbageTimer=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=new Array();this.partialQueue=new Array();this.fullForPartialQueue=new Object();this.browser=this.BrowserSniff();if(this.browser=='IE'){this.maxurlgetlength=this.maxurllengthIE;}else{this.maxurlgetlength=this.maxurllengthMZ;}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.prunIdentify='lpjson=';this.DebugSend=true;this.DebugDisplay=false;this.postParams=new Array();this.spPostIframesFree=new Array();this.spPostIframesBusy=new Array();}lpConnectionLibrary.prototype.specialPostHandler=function(callId){if(this.DebugDisplay){lpMTagDebug.Display('specialPostHandler:'+callId,'DEBUG','EMT');}for(var i=0;i<this.queue.length;i++){if(this.queue[i].callId==callId){var iframeObj=this.findCreateIframe(this.queue[i].callId,this.queue[i].dataEncoding,this.queue[i].spImmediateCleanup);if(this.queue[i].MakeCallByIframeSpecial(iframeObj['iframeRef'])){iframeObj['callMade']=true;}else{setTimeout("lpConnLib.specialPostHandler('"+callId+"')",1000);}}}};lpConnectionLibrary.prototype.findCreateIframe=function(callId,encoding,spImmediateCleanup){var iframeRef,i;for(i=0;i<this.spPostIframesBusy.length;i++){if(this.spPostIframesBusy[i]['callID']==callId){if(this.DebugDisplay){lpMTagDebug.Display('FOUND IN BUSY IFRAME:'+callId,'DEBUG','EMT');}return this.spPostIframesBusy[i];}}for(i=0;i<this.spPostIframesFree.length;i++){if(this.spPostIframesFree[i]['encoding']==encoding){if(this.DebugDisplay){lpMTagDebug.Display('FOUND A FREE IFRAME:'+callId,'DEBUG','EMT');}iframeRef=this.spPostIframesFree[i]['iframeRef'];this.spPostIframesFree.splice(i,1);return this.addIframeToBusy(callId,encoding,iframeRef,spImmediateCleanup);}}iframeRef=this.createIframe(callId,encoding);return this.addIframeToBusy(callId,encoding,iframeRef,spImmediateCleanup);};lpConnectionLibrary.prototype.releaseIframe=function(callId){if(this.DebugDisplay){lpMTagDebug.Display('trying to release '+callId,'DEBUG','EMT');}for(var i=0;i<this.spPostIframesBusy.length;i++){if(this.spPostIframesBusy[i]['callID']==callId){var iframeRef=this.spPostIframesBusy[i]['iframeRef'];var doc=iframeRef.contentDocument;var frm=doc.getElementById('hcPostSubmitForm-'+callId);if(frm!=null){if(this.DebugDisplay){lpMTagDebug.Display('form still exists '+callId,'DEBUG','EMT');}return;}if(this.spPostIframesBusy[i]['encoding']!=iframeRef.contentDocument.characterSet.toUpperCase()){if(this.DebugDisplay){lpMTagDebug.Display('deleting since encodings DO not match '+callId,'DEBUG','EMT');}iframeRef.parentNode.removeChild(iframeRef);}else{var cnt=this.spPostIframesFree.length;this.spPostIframesFree[cnt]=new Array();this.spPostIframesFree[cnt]=this.spPostIframesBusy[i];}this.spPostIframesBusy.splice(i,1);if(this.DebugDisplay){lpMTagDebug.Display('released ok '+callId,'DEBUG','EMT');}return;}}};lpConnectionLibrary.prototype.addIframeToBusy=function(callId,encoding,iframeRef,spImmediateCleanup){var cnt=this.spPostIframesBusy.length;this.spPostIframesBusy[cnt]=new Array();this.spPostIframesBusy[cnt]['callID']=callId;this.spPostIframesBusy[cnt]['encoding']=encoding.toUpperCase();this.spPostIframesBusy[cnt]['spImmediateCleanup']=spImmediateCleanup;this.spPostIframesBusy[cnt]['callMade']=false;this.spPostIframesBusy[cnt]['iframeRef']=iframeRef;return this.spPostIframesBusy[cnt];};lpConnectionLibrary.prototype.createIframe=function(callId,encoding){if(this.DebugDisplay){lpMTagDebug.Display('Created iframe for: '+callId,'DEBUG','EMT');}var containerName='hcIframeContainer1';var iframe=document.createElement('IFRAME');iframe.setAttribute("id",containerName+'-'+callId);iframe.setAttribute("name",containerName+'-'+callId);iframe.setAttribute("src",this.encodingBlankUrl+'?encoding='+encoding);iframe.frameBorder=0;iframe.scrolling='no';iframe.style.top="1px";iframe.style.left="1px";iframe.style.position='absolute';iframe.style.width='1px';iframe.style.height='1px';iframe.style.visibility='hidden';document.body.appendChild(iframe);return iframe;};lpConnectionLibrary.prototype.reportError=function(url,msg,logger,site){if(!this.DebugSend){return;}try{var vaParams=new hcArrayStorage();vaParams.add("cmd","visitorDebugPrint");vaParams.add("site",site);vaParams.add("log",msg);vaParams.add("logger",logger);this.addToQueue(url,vaParams,null,false);}catch(e){var errorImage=new Image;errorImage.src=url+"?cmd=visitorDebugPrint&site="+site+"&logger="+logger+"&d="+(new Date()).getTime()+"&log="+msg;}};lpConnectionLibrary.prototype.SortQueue=function(first,second){if(first.confirmed==second.confirmed){return first.timeStamp.getTime()-second.timeStamp.getTime();}if(first.confirmed&&!second.confirmed){return-1;}if(!first.confirmed&&second.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='';var 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.prunIdentify,this.lpjson,dataEncoding,this.browser,postAutoConfirm,spImmediateCleanup,undefined,0,0,forceget,forcePost,encodingBlankUrl,minimizePost,minimizePostMaxGets,allowTruncate);if(typeof(lpMTagDebug)!='undefined'){this.DebugDisplay=true;}if(forceget){this.forcedGet++;}var partial='';var 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();var req=this.splitRequestIntoGets(request,minimizePostMaxGets,allowTruncate);if(req){this.partialCounter++;origRequest.callId=this.splitPartialFromStr(req.callId);this.fullForPartialQueue[origRequest.callId]=origRequest;minPostStatus=true;callType=this.makeTheCall(req,'get',requireConfirm);partial='PARTIAL';}}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(request,protocol){protocol=protocol.toUpperCase();var ret,qsize;if(protocol=='GET'){request.BuildCallUrl('get',this.maxurlgetlength);qsize=this.queue.length;this.queue[qsize]=request;this.queue[qsize].MakeCallByScript();if(!request.requireConfirm){this.queue[qsize].confirmed=true;}ret='GET';}else if(protocol=='POST'){request.BuildCallUrl('post',this.maxurlgetlength);qsize=this.queue.length;this.queue[qsize]=request;this.queue[qsize].MakeCallByIframe(this.browser);if(request.postAutoConfirm){this.queue[qsize].confirmed=true;}ret='POST';}else if(protocol=='SP-POST'){request.BuildCallUrl('post',this.maxurlgetlength);qsize=this.queue.length;this.queue[qsize].spImmediateCleanup=request.spImmediateCleanup;this.specialPostHandler(request.callId);if(request.postAutoConfirm){this.queue[qsize].confirmed=true;}ret='POST';}if(this.DebugDisplay){var cmd='';try{cmd=request.params.getValue(request.params.getByName('cmd'));if(typeof(cmd)=='undefined'){cmd=request.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){}lpMTagDebug.Display('Making '+protocol+' Call id='+request.callId+' '+cmd,'DEBUG','EMT');}this.callCounter++;return ret;};lpConnectionLibrary.prototype.splitRequestIntoGets=function(request,maxNum,allowTruncate){var getrequestLength=request.BuildCallUrl('get');var i;request.BuildCallUrl('post');var maxDataLength=this.maxurlgetlength-request.fullUrl.length-20;var numRequests=getrequestLength/maxDataLength;if(numRequests>(numRequests|0)){numRequests=parseInt(numRequests+1);}else{numRequests=parseInt(numRequests);}if(numRequests>maxNum){if(this.DebugDisplay){lpMTagDebug.Display('Minimize POST for call id='+request.callId+' - failed - too Many GETs needed ('+numRequests+')','DEBUG','EMT');}return false;}var numBuckets=1;var dataContain=new Array();dataContain[numBuckets-1]=new hcArrayStorage();var maxId=request.params.getMaxLengthItem();if(request.params.paramLength(maxId)>maxDataLength){if(allowTruncate){var tmpData=request.params.get(maxId);tmpData=tmpData.substring(0,maxDataLength-1);tmpData=unescape(tmpData);request.params.remove(maxId);request.params.add(tmpData);if(this.DebugDisplay){lpMTagDebug.Display('Minimize POST for call id='+request.callId+' - TRUNCATING too long pair','DEBUG','EMT');}}else{if(this.DebugDisplay){lpMTagDebug.Display('Minimize POST for call id='+request.callId+' - failed - too long pair','DEBUG','EMT');}return false;}}while(request.params.size()>0){var foundBucket=false;for(i=0;i<numBuckets;i++){if((dataContain[i].fullLength()+request.params.paramLength(maxId))<maxDataLength){dataContain[i].add(request.params.getName(maxId),request.params.getValue(maxId));foundBucket=true;}}if(!foundBucket){numBuckets++;if(numBuckets>maxNum){if(this.DebugDisplay){lpMTagDebug.Display('Minimize POST for call id='+request.callId+' - failed - too Many GETs required ('+numBuckets+') max='+maxNum,'DEBUG','EMT');}return false;}dataContain[numBuckets-1]=new hcArrayStorage();dataContain[numBuckets-1].add(request.params.getName(maxId),request.params.getValue(maxId));}request.params.remove(maxId);maxId=request.params.getMaxLengthItem();}var numGets=dataContain.length;var req=null;var callId;for(i=0;i<numGets;i++){var part=i+1;var outOf=numGets;dataContain[i].add('part',part);dataContain[i].add('outof',outOf);var partial=true;if(i==0){req=new lpRequest(this.protocolVer,request.BaseUrl,dataContain[i],request.callbackFunc,request.requireConfirm,request.maxretries,this.prunIdentify,this.lpjson,request.dataEncoding,this.browser,request.postAutoConfirm,request.spImmediateCleanup,partial,part,outOf,request.forceget,request.forcePost,request.encodingBlankUrl,request.minimizePost,request.minimizePostMaxGets,request.allowTruncate);callId=req.callId;req.callId=callId+'!'+(i+1);}else{var tmpReq=new lpRequest(this.protocolVer,request.BaseUrl,dataContain[i],request.callbackFunc,request.requireConfirm,request.maxretries,this.prunIdentify,this.lpjson,request.dataEncoding,this.browser,request.postAutoConfirm,request.spImmediateCleanup,partial,part,outOf,request.forceget,request.forcePost,request.encodingBlankUrl,request.minimizePost,request.minimizePostMaxGets,request.allowTruncate);tmpReq.callId=callId+'!'+(i+1);this.partialQueue[tmpReq.callId]=tmpReq;}}return req;};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.layers){return"NS";}if(document.all){var is_opera=(agt.indexOf("opera")!=-1);var is_konq=(agt.indexOf("konqueror")!=-1);if(is_opera){return"OPR";}else{if(is_konq){return"KONQ";}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.garbageCollection=function(){if(this.DebugDisplay){lpMTagDebug.Display('Garbage Collection','OK','EMT');}this.queue.sort(this.SortQueue);var confirmedCnt=0;var 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 timeNow=new Date().getTime();for(i=0;i<this.queue.length;i++){if(!this.queue[i].confirmed&&(timeNow-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++;if(this.DebugDisplay){lpMTagDebug.Display('Retrying '+this.queue[i].retries+'/'+this.queue[i].maxretries+' callId='+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;if(this.DebugDisplay){lpMTagDebug.Display('Timeout for callId='+this.queue[i].callId,'DEBUG','EMT');}var lpDataObj={"ResultSet":{"lpCallId":this.queue[i].callId,"lpCallError":"TIMEOUT"}};this.CallUsrCallbackFunc(lpDataObj);}}}};lpConnectionLibrary.prototype.Process=function(lpDataObj){if(lpDataObj==null){if(this.DebugDisplay){lpMTagDebug.Display('Callback No data recieved','ERROR','EMT');}return;}this.lpCallbackCnt++;lpDataObj.ServiceInfo={};if(lpDataObj.ResultSet.lpCallId==0||lpDataObj.ResultSet.lpCallId==null||lpDataObj.ResultSet.lpCallId==''){if(this.DebugDisplay){lpMTagDebug.Display('Callback No Call ID recieved','ERROR','EMT');}return;}lpDataObj.ServiceInfo.requestType='REGULAR';lpDataObj.ServiceInfo.resendCall=false;lpDataObj.ServiceInfo.origCallId=lpDataObj.ResultSet.lpCallId;if(typeof(lpDataObj.ResultSet.lpData)!='undefined'&&typeof(lpDataObj.ResultSet.lpData)=='object'&&typeof(lpDataObj.ResultSet.lpData[0])!='undefined'){if(typeof(lpDataObj.ResultSet.lpData[0].TYPE)!='undefined'){lpDataObj.ServiceInfo.requestType=lpDataObj.ResultSet.lpData[0].TYPE;}if(typeof(lpDataObj.ResultSet.lpData[0].RESEND)!='undefined'){lpDataObj.ServiceInfo.resendCall=lpDataObj.ResultSet.lpData[0].RESEND;}}if(lpDataObj.ServiceInfo.resendCall){this.resendCounter++;}if(lpDataObj.ServiceInfo.requestType=='PARTIAL REQUEST'){lpDataObj.ResultSet.lpCallId=lpDataObj.ResultSet.lpCallId+'!'+lpDataObj.ResultSet.lpData[0].PART;}if(this.DebugDisplay){lpMTagDebug.Display('Callback callId='+lpDataObj.ResultSet.lpCallId,'DEBUG','EMT');}if(typeof(lpDataObj.ResultSet.lpCallConfirm)=='undefined'||lpDataObj.ResultSet.lpCallConfirm==''){lpDataObj.ResultSet.lpCallConfirm=lpDataObj.ResultSet.lpCallId;}else{lpDataObj.ResultSet.lpCallConfirm+=','+lpDataObj.ResultSet.lpCallId;}var req;if(lpDataObj.ServiceInfo.requestType=='PARTIAL REQUEST'&&lpDataObj.ServiceInfo.resendCall){req=this.fullForPartialQueue[lpDataObj.ServiceInfo.origCallId];delete this.fullForPartialQueue[lpDataObj.ServiceInfo.origCallId];if(this.DebugDisplay){lpMTagDebug.Display('CallId='+lpDataObj.ResultSet.lpCallId+' Deleted - fullForPartialQueue['+lpDataObj.ServiceInfo.origCallId+']','DEBUG','EMT');}}else{req=this.getRequestForCallId(lpDataObj.ResultSet.lpCallId);if(req!=null&&req.partial){req=this.fullForPartialQueue[lpDataObj.ServiceInfo.origCallId];}}if(lpDataObj.ServiceInfo.requestType!='PARTIAL REQUEST'){if(this.fullForPartialQueue[lpDataObj.ServiceInfo.origCallId]){delete this.fullForPartialQueue[lpDataObj.ServiceInfo.origCallId];if(this.DebugDisplay){lpMTagDebug.Display('CallId='+lpDataObj.ResultSet.lpCallId+' Deleted fullForPartialQueue['+lpDataObj.ServiceInfo.origCallId+']','DEBUG','EMT');}}}if(req==null){if(this.DebugDisplay){lpMTagDebug.Display('REQUEST is NULL callId='+lpDataObj.ServiceInfo.origCallId,'ERROR','EMT');}}this.confirmConnection(lpDataObj.ResultSet.lpCallConfirm);if(lpDataObj.ServiceInfo.requestType=='PARTIAL REQUEST'){var callNum;var outOfcalls;if(typeof(lpDataObj.ResultSet.lpData)!='undefined'&&typeof(lpDataObj.ResultSet.lpData)=='object'){if(typeof(lpDataObj.ResultSet.lpData[0].PART)!='undefined'){callNum=lpDataObj.ResultSet.lpData[0].PART;}if(typeof(lpDataObj.ResultSet.lpData[0].OUTOF)!='undefined'){outOfcalls=lpDataObj.ResultSet.lpData[0].OUTOF;}}if(lpDataObj.ServiceInfo.resendCall){for(var i=(callNum+1);i<=outOfcalls;i++){var cid=lpDataObj.ServiceInfo.origCallId+'!'+i;delete this.partialQueue[cid];}}else{try{var nextCallId=lpDataObj.ServiceInfo.origCallId+'!'+(callNum+1);if(this.DebugDisplay){lpMTagDebug.Display('Partial Call Response recieved  - '+lpDataObj.ResultSet.lpCallId+' part='+callNum+' outof='+outOfcalls,'DEBUG','EMT');}var request=this.partialQueue[nextCallId];if(request!=null){delete this.partialQueue[nextCallId];if(request.part==request.outOf){request.callId=this.splitPartialFromStr(request.callId);}this.makeTheCall(request,'get');}else{if(lpMTagDebug){lpMTagDebug.Display('Partial Call NOT found for id='+nextCallId,'ERROR','EMT');}}}catch(e){if(lpMTagDebug){lpMTagDebug.Display('Partial Call Processing error for id='+lpDataObj.ResultSet.lpCallId+' exception='+e,'ERROR','EMT');}}return;}}if(typeof(lpDataObj.ResultSet.lpJS_Execute)!='undefined'){var debug_msg=new Array();for(var MTagI=0;MTagI<lpDataObj.ResultSet.lpJS_Execute.length;MTagI++){var no_err_flag=true;var err_msg='';var code_id=lpDataObj.ResultSet.lpJS_Execute[MTagI].code_id;try{eval(lpDataObj.ResultSet.lpJS_Execute[MTagI].js_code);}catch(hcExecError){this.lpExecuteErrors++;no_err_flag=false;err_msg=hcExecError;}if(this.DebugDisplay){if(no_err_flag){debug_msg[debug_msg.length]='OK Executed snippet=<strong>'+code_id+'</strong><!!>'+'EXEC-OK';}else{debug_msg[debug_msg.length]='ERROR Executing snippet=<strong>'+code_id+'</strong> &nbsp #'+err_msg+'#'+'<!!>'+'ERROR';}}}if(this.DebugDisplay){lpMTagDebug.DisplayArray(debug_msg,'EMT');}}if(typeof(lpDataObj.ResultSet.lpCallError)!='undefined'&&this.DebugDisplay){lpMTagDebug.Display('ERROR Reply Recieved='+lpDataObj.ResultSet.lpCallError+' &nbsp # CallID = '+lpDataObj.ResultSet.lpCallId+'#','ERROR','EMT');}this.CallUsrCallbackFunc(lpDataObj,req);};lpConnectionLibrary.prototype.splitPartialFromStr=function(str){var temp=str.split('!');return temp[0];};lpConnectionLibrary.prototype.CallUsrCallbackFunc=function(lpDataObj,request){var userCallbackFunc=this.GetCallbackFunc(lpDataObj.ResultSet.lpCallId);if(userCallbackFunc!=''&&userCallbackFunc!=null){var no_err_flag=true;var err_msg='';try{userCallbackFunc(lpDataObj,request);}catch(hcExecError){no_err_flag=false;err_msg=hcExecError;}if(this.DebugDisplay){if(no_err_flag){lpMTagDebug.Display('OK Executed User CallBackFunction - '+lpDataObj.ResultSet.lpCallId,'EXEC-OK','EMT');}else{lpMTagDebug.Display('ERROR Executing User CallBackFunction='+userCallbackFunc+' &nbsp #'+err_msg+'#','ERROR','EMT');}}}};if(typeof(lpConnLib)=='undefined'){function lpJSLibrary(){}var lpJSLib=new lpJSLibrary();var lpConnLib=new lpConnectionLibrary();lpConnLib.garbageTimer=setInterval('lpConnLib.garbageCollection()',lpConnLib.garbagePeriod*1000);}function lpMonitorTag(){this.maxretries=3;this.maxErrorCnt=2;this.connErrorCnt=0;this.errorDelay=10;if(typeof(lpMTagConfig.lpProtocol)=='undefined'){lpMTagConfig.lpProtocol=(document.location.toString().indexOf("https:")==0)?"https":"http";}this.lpURL=lpMTagConfig.lpProtocol+'://'+lpMTagConfig.lpServer+'/hc/'+lpMTagConfig.lpNumber+'/';this.lpPageLocation=document.location.toString();if(typeof(lpMTagConfig.lpUseSecureCookies)=='undefined'){lpMTagConfig.lpUseSecureCookies=false;}if(typeof(lpMTagConfig.sendCookies)=='undefined'){lpMTagConfig.sendCookies=true;}if(typeof(lpMTagConfig.lpSendCookies)=='undefined'){lpMTagConfig.lpSendCookies=false;}this.dataCookieName='LP_DATA_COOKIE';this.lpScriptType='SERVERBASED';this.lpVisitorStatus='INSITE_STATUS';this.lpCmd='mTagKnockPage';this.webServerCookie='LPNMT_DOMAIN-'+lpMTagConfig.lpNumber;this.lpPageID=Math.round(Math.random()*9999999999);this.title='';if(typeof(document.title)!="undefined"&&document.title.length>0){this.title=document.title;}this.referrer='';if(typeof(document.referrer)!="undefined"&&document.referrer.length>0){this.referrer=document.referrer;}this.lpJavaEnabled=(this.lpIsJavaEnabled()?'true':'false');this.lpScriptVersion='1.1';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(lpMTagConfig.activePlugin)=='undefined'){lpMTagConfig.activePlugin='none';}if(typeof(lpMTagConfig.enableActivityMon)!='undefined'){this.activityMonitor=lpMTagConfig.enableActivityMon;}else{this.activityMonitor=true;}if(typeof(lpMTagConfig.inactivityPeriod)!='undefined'){this.inactivityPeriod=lpMTagConfig.inactivityPeriod;}else{this.inactivityPeriod=120;}if(typeof(lpMTagConfig.actPollingInterval)!='undefined'){this.actPollingInterval=lpMTagConfig.actPollingInterval;}else{this.actPollingInterval=3;}this.lastActiveDate=new Date();if(this.activityMonitor){lpMTagConfig.visitorActive=true;if(typeof(lpMTagConfig.pageVar)=='undefined'){lpMTagConfig.pageVar=[];}lpMTagConfig.pageVar[lpMTagConfig.pageVar.length]='visitorActive=1';if(window.attachEvent){document.attachEvent('onmousedown',this.MonitorActivity);document.attachEvent('onmousemove',this.MonitorActivity);document.attachEvent('onmouseover',this.MonitorActivity);window.attachEvent('onresize',this.MonitorActivity);window.attachEvent('onblur',this.MonitorActivity);window.attachEvent('onfocus',this.MonitorActivity);document.attachEvent('onkeydown',this.MonitorActivity);document.attachEvent('onscroll',this.MonitorActivity);}else{window.addEventListener("mousedown",this.MonitorActivity,false);window.addEventListener("mousemove",this.MonitorActivity,false);window.addEventListener("mouseover",this.MonitorActivity,false);window.addEventListener("scroll",this.MonitorActivity,false);window.addEventListener("resize",this.MonitorActivity,false);window.addEventListener("blur",this.MonitorActivity,false);window.addEventListener("focus",this.MonitorActivity,false);window.addEventListener("keydown",this.MonitorActivity,false);}this.activityTimer=setInterval(this.checkActivity,this.actPollingInterval*1000);}this.cookieRemovedCnt=0;};lpMonitorTag.prototype.MonitorActivity=function(){lpMTag.lastActiveDate=new Date();};lpMonitorTag.prototype.checkActivity=function(){var currentTime=new Date().getTime();var lastActiveTime=lpMTag.lastActiveDate.getTime();var actStatus=lpMTagConfig.visitorActive;actStatus=(currentTime-lastActiveTime)<=(lpMTag.inactivityPeriod*1000);if(actStatus!=lpMTagConfig.visitorActive){if(lpConnLib.DebugDisplay){lpMTagDebug.Display('Visitor Active STATUS= '+(actStatus?'1':'0'),'DEBUG','EMT');}lpMTagConfig.pageVar[lpMTagConfig.pageVar.length]='visitorActive='+(actStatus?'1':'0');lpMTagConfig.visitorActive=actStatus;}};lpMonitorTag.prototype.removeUrlParameter=function(url,parameter){var pnt=url.indexOf('&'+parameter+'=');if(pnt>-1){var tmp=url.substring(pnt+('&'+parameter+'=').length);var 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){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(lpMTagConfig.useFirstParty)!='undefined'&&lpMTagConfig.useFirstParty||cmd=='mTagKnockPage'){var vid=this.lpGetCookie(lpMTagConfig.FPC_VID_NAME?lpMTagConfig.FPC_VID_NAME:lpMTagConfig.lpNumber+'-VID');var skey=this.lpGetCookie(lpMTagConfig.FPC_SKEY_NAME?lpMTagConfig.FPC_SKEY_NAME:lpMTagConfig.lpNumber+'-SKEY');var contId=this.lpGetCookie(lpMTagConfig.FPC_CONT_NAME?lpMTagConfig.FPC_CONT_NAME:'HumanClickSiteContainerID_'+lpMTagConfig.lpNumber);if(url.indexOf('?')==-1){url+='?';}if(url.indexOf('&visitor=')>-1){if(lpConnLib.DebugDisplay){lpMTagDebug.Display('MTAG FPC Found &visitor in the url - removing','DEBUG','EMT');}url=this.removeUrlParameter(url,'visitor');}if(url.indexOf('&msessionkey=')>-1){if(lpConnLib.DebugDisplay){lpMTagDebug.Display('MTAG FPC Found &msessionkey in the url - removing','DEBUG','EMT');}url=this.removeUrlParameter(url,'msessionkey');}if(url.indexOf('&siteContainer=')>-1){if(lpConnLib.DebugDisplay){lpMTagDebug.Display('MTAG FPC Found &siteContainer in the url - removing','DEBUG','EMT');}url=this.removeUrlParameter(url,'siteContainer');}if(typeof(params)!='undefined'){var idx;idx=params.getByName('visitor');if(idx>-1){if(lpConnLib.DebugDisplay){lpMTagDebug.Display('MTAG FPC Found visitor in params - removing','DEBUG','EMT');}params.remove(idx);}idx=params.getByName('msessionkey');if(idx>-1){if(lpConnLib.DebugDisplay){lpMTagDebug.Display('MTAG FPC Found msessionkey in params - removing','DEBUG','EMT');}params.remove(idx);}idx=params.getByName('siteContainer');if(idx>-1){if(lpConnLib.DebugDisplay){lpMTagDebug.Display('MTAG FPC Found siteContainer in params - removing','DEBUG','EMT');}params.remove(idx);}}if(vid!=null){url+='&visitor='+vid;}if(skey!=null){url+='&msessionkey='+skey;}if(contId!=null){if(typeof(lpMTagConfig.allowThirdPartyByServer)!='undefined'&&!lpMTagConfig.allowThirdPartyByServer){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.addStaticCommandstoUrl(Url,params);params=this.avoidPost(Url,params);return lpConnLib.addToQueue(Url,params,Callback,requireConfirm,maxretries,forceget,onPostAutoConfirm,lpjson,dataEncoding,forcePost,specialPost,spImmediateCleanup,encodingBlankUrl,minimizePost,minimizePostMaxGets,allowTruncate);};lpMonitorTag.prototype.addStaticCommandstoUrl=function(url,params){var indx;var 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 avoidPost=this.getAvoiPostSettings();if(!avoidPost.avoidPost){return params;}var r=new lpRequest(lpConnLib.protocolVer,Url,params,null,false,0,lpConnLib.prunIdentify,lpConnLib.lpjson,'UTF-8',lpConnLib.browser,false,true,undefined,0,0,false,false);var baseUrl=r.BuildBaseCallUrl();var urlLength=baseUrl.length+params.fullLength()+1;var originalCookie='';if(urlLength>lpConnLib.maxurlgetlength){var indx=params.getByName('cookie');if(indx>-1){if(lpConnLib.DebugDisplay){lpMTagDebug.Display('emtAvoidPost true over Limit '+urlLength+': dropping cookies','DEBUG','EMT');}originalCookie=params.getValue(indx);params.remove(indx);this.cookieRemovedCnt++;if(this.cookieRemovedCnt>1){if(lpConnLib.DebugDisplay){lpMTagDebug.Display('emtAvoidPost setting sendCookies to FALSE','DEBUG','EMT');}lpMTagConfig.sendCookies=false;}}else{if(lpConnLib.DebugDisplay){lpMTagDebug.Display('emtAvoidPost true over Limit '+urlLength+': cookies not FOUND','DEBUG','EMT');}}urlLength=baseUrl.length+params.fullLength()+1;if(urlLength>lpConnLib.maxurlgetlength){if(lpConnLib.DebugDisplay){lpMTagDebug.Display('emtAvoidPost true over Limit '+urlLength+': after dropping cookies - trimming','DEBUG','EMT');}params=this.trimParam(params,'title',avoidPost.emtMaxTitleLength);urlLength=baseUrl.length+params.fullLength()+1;if(urlLength>lpConnLib.maxurlgetlength){if(lpConnLib.DebugDisplay){lpMTagDebug.Display('emtAvoidPost over Limit '+urlLength,'DEBUG','EMT');}params=this.trimParam(params,'referrer',avoidPost.emtMaxReferLength);}urlLength=baseUrl.length+params.fullLength()+1;if(urlLength>lpConnLib.maxurlgetlength){if(lpConnLib.DebugDisplay){lpMTagDebug.Display('emtAvoidPost over Limit '+urlLength,'DEBUG','EMT');}params=this.trimParam(params,'page',avoidPost.emtMaxUrlLength);}urlLength=baseUrl.length+params.fullLength()+1;if(urlLength>lpConnLib.maxurlgetlength){if(lpConnLib.DebugDisplay){lpMTagDebug.Display('emtAvoidPost over Limit '+urlLength,'DEBUG','EMT');}params=this.trimParam(params,'title',avoidPost.emtMinTitleLength);}urlLength=baseUrl.length+params.fullLength()+1;if(urlLength>lpConnLib.maxurlgetlength){if(lpConnLib.DebugDisplay){lpMTagDebug.Display('emtAvoidPost over Limit '+urlLength,'DEBUG','EMT');}params=this.trimParam(params,'referrer',avoidPost.emtMinReferLength);}urlLength=baseUrl.length+params.fullLength()+1;if(urlLength>lpConnLib.maxurlgetlength){if(lpConnLib.DebugDisplay){lpMTagDebug.Display('emtAvoidPost over Limit '+urlLength,'DEBUG','EMT');}params=this.trimParam(params,'page',avoidPost.emtMinUrlLength);}urlLength=baseUrl.length+params.fullLength()+1;if(urlLength>lpConnLib.maxurlgetlength){if(lpConnLib.DebugDisplay){lpMTagDebug.Display('emtAvoidPost true nothing helps over limit  '+urlLength+': DOING 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(originalCookie!=''){this.cookieRemovedCnt--;params.add('cookie',originalCookie);}}}}return params;};lpMonitorTag.prototype.trimParam=function(p,name,maxSize){var str='';var indx=p.getByName(name);if(indx>-1){str=p.getValueEsc(indx);}if(str.length>maxSize){if(lpConnLib.DebugDisplay){lpMTagDebug.Display('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.getAvoiPostSettings=function(){var ret={avoidPost:false};if(lpMTagConfig.emtAvoidPOST||(typeof(lpMTagConfig.emtAvoidPOST)=='undefined'&&lpMTagConfig.sgpemtAvoidPOST)){ret.avoidPost=true;}else{return ret;}if(typeof(lpMTagConfig.emtMaxUrlLength)!='undefined'){ret.emtMaxUrlLength=lpMTagConfig.emtMaxUrlLength;}else{if(typeof(lpMTagConfig.sgpemtMaxUrlLength)=='undefined'){ret.emtMaxUrlLength=500;}else{ret.emtMaxUrlLength=lpMTagConfig.sgpemtMaxUrlLength;}}if(typeof(lpMTagConfig.emtMinUrlLength)!='undefined'){ret.emtMinUrlLength=lpMTagConfig.emtMinUrlLength;}else{if(typeof(lpMTagConfig.sgpemtMinUrlLength)=='undefined'){ret.emtMinUrlLength=100;}else{ret.emtMinUrlLength=lpMTagConfig.sgpemtMinUrlLength;}}if(typeof(lpMTagConfig.emtMaxReferLength)!='undefined'){ret.emtMaxReferLength=lpMTagConfig.emtMaxReferLength;}else{if(typeof(lpMTagConfig.sgpemtMaxReferLength)=='undefined'){ret.emtMaxReferLength=300;}else{ret.emtMaxReferLength=lpMTagConfig.sgpemtMaxReferLength;}}if(typeof(lpMTagConfig.emtMinReferLength)!='undefined'){ret.emtMinReferLength=lpMTagConfig.emtMinReferLength;}else{if(typeof(lpMTagConfig.sgpemtMinReferLength)=='undefined'){ret.emtMinReferLength=100;}else{ret.emtMinReferLength=lpMTagConfig.sgpemtMinReferLength;}}if(typeof(lpMTagConfig.emtMaxTitleLength)!='undefined'){ret.emtMaxTitleLength=lpMTagConfig.emtMaxTitleLength;}else{if(typeof(lpMTagConfig.sgpemtMaxTitleLength)=='undefined'){ret.emtMaxTitleLength=100;}else{ret.emtMaxTitleLength=lpMTagConfig.sgpemtMaxTitleLength;}}if(typeof(lpMTagConfig.emtMinTitleLength)!='undefined'){ret.emtMinTitleLength=lpMTagConfig.emtMinTitleLength;}else{if(typeof(lpMTagConfig.sgpemtMinTitleLength)=='undefined'){ret.emtMinTitleLength=50;}else{ret.emtMinTitleLength=lpMTagConfig.sgpemtMinTitleLength;}}return ret;};lpMonitorTag.prototype.lpSetCallParams=function(lpCmd,extra){var i;var tmpData;var CallParams=new hcArrayStorage();CallParams.add('site',lpMTagConfig.lpNumber);CallParams.add('cmd',lpCmd);if(lpCmd!='mTagKnockPage'){CallParams.add('page',this.lpPageLocation);}CallParams.add('id',this.lpPageID);CallParams.add('javaSupport',this.lpJavaEnabled);CallParams.add('visitorStatus',this.lpVisitorStatus);if(lpCmd=='mTagInPage'){var data=this.lpGetCookie(this.dataCookieName);if(data!=''&&data!=null){this.lpDeleteCookie(this.dataCookieName);CallParams.add(data);}}if(lpCmd!='mTagKnockPage'){if(typeof(lpMTagConfig.defaultChatInvite)!='undefined'){CallParams.add('defCInvite',lpMTagConfig.defaultChatInvite);}if(typeof(lpMTagConfig.defaultVoiceInvite)!='undefined'){CallParams.add('defVInvite',lpMTagConfig.defaultVoiceInvite);}if(typeof(lpMTagConfig.defaultMultiChannelInvite)!='undefined'){CallParams.add('defMCInvite',lpMTagConfig.defaultMultiChannelInvite);}if(typeof(lpMTagConfig.defaultInvite)!='undefined'){CallParams.add('defInvite',lpMTagConfig.defaultInvite);}if(typeof(lpMTagConfig.cobrowseEnabled)!='undefined'){if(typeof(lpMTagConfig.lpActivePlugin)=='undefined'){lpMTagConfig.lpActivePlugin='none';}CallParams.add('activePlugin',lpMTagConfig.lpActivePlugin);CallParams.add('cobrowse','true');if(typeof(lpMTagConfig.pageWindowName)!='undefined'){CallParams.add('pageWindowName',lpMTagConfig.pageWindowName);}else{var name='';try{if(top&&typeof(top.document)!='undefined'){name=''+top.name;}}catch(e){name='';}if(name!=''){CallParams.add('pageWindowName',name);}}if(typeof(lpMTagConfig.lpOperatorPageType)!="undefined"){CallParams.add('cobrowsetitle',lpMTagConfig.lpOperatorPageType);}if(typeof(lpMTagConfig.lpOperatorPageUrl)!="undefined"){CallParams.add('cobrowseurl',lpMTagConfig.lpOperatorPageUrl);}}}if(lpCmd=='mTagStartPage'||lpCmd=='mTagInPage'){var shortUdeNotation=false;if(typeof(lpMTagConfig.useShortUDEnotation)!='undefined'&&lpMTagConfig.useShortUDEnotation){shortUdeNotation=true;}if(typeof(lpMTagConfig.pageVar)!='undefined'&&lpMTagConfig.pageVar.length>0){for(i=0;i<lpMTagConfig.pageVar.length;i++){if(shortUdeNotation){CallParams.add('PV!'+lpMTagConfig.pageVar[i],undefined,true);}else{CallParams.add('PAGEVAR!'+lpMTagConfig.pageVar[i],undefined,true);}}lpMTagConfig.pageVar=new Array();}if(typeof(lpMTagConfig.sessionVar)!='undefined'&&lpMTagConfig.sessionVar.length>0){for(i=0;i<lpMTagConfig.sessionVar.length;i++){if(shortUdeNotation){CallParams.add('SV!'+lpMTagConfig.sessionVar[i],undefined,true);}else{CallParams.add('SESSIONVAR!'+lpMTagConfig.sessionVar[i],undefined,true);}}lpMTagConfig.sessionVar=new Array();}if(typeof(lpMTagConfig.visitorVar)!='undefined'&&lpMTagConfig.visitorVar.length>0){for(i=0;i<lpMTagConfig.visitorVar.length;i++){if(shortUdeNotation){CallParams.add('VV!'+lpMTagConfig.visitorVar[i],undefined,true);}else{CallParams.add('VISITORVAR!'+lpMTagConfig.visitorVar[i],undefined,true);}}lpMTagConfig.visitorVar=new Array();}}if(lpCmd=='mTagKnockPage'){if(typeof(lpMTagConfig.dynButton)!='undefined'&&lpMTagConfig.dynButton.length>0){var dbut='';for(i=0;i<lpMTagConfig.dynButton.length;i++){if(i>0){dbut+='#';}dbut+=lpMTagConfig.dynButton[i].name+'|';if(typeof(lpMTagConfig.dynButton[i].ovr)!='undefined'){dbut+=lpMTagConfig.dynButton[i].ovr+'|';}else{dbut+='null|';}if(typeof(lpMTagConfig.dynButton[i].pid)!='undefined'){dbut+=lpMTagConfig.dynButton[i].pid+'|';}else{dbut+='null|';}}CallParams.add('dbut',dbut);}}if(typeof(lpMTagConfig.sendSnippets)!='undefined'){CallParams.add('sendSnippets',lpMTagConfig.sendSnippets);lpMTagConfig.sendSnippets=undefined;}if(typeof(extra)!='undefined'){tmpData=extra.split('&');for(i=0;i<tmpData.length;i++){if(tmpData[i]!=''){CallParams.add(tmpData[i]);}}}if(this.lpDataToSend!=''){tmpData=this.lpDataToSend.split('&');for(i=0;i<tmpData.length;i++){if(tmpData[i]!=''){CallParams.add(tmpData[i]);}}this.lpDataToSend='';}if(lpCmd!='mTagKnockPage'&&lpCmd!='mTagInPage'){if(this.title!=''){CallParams.add('title',this.title);}if(this.referrer!=''){CallParams.add('referrer',this.referrer);}}if(lpCmd!='mTagKnockPage'&&lpMTagConfig.lpSendCookies&&lpMTagConfig.sendCookies){var cookies=null;if(typeof(lpMTagConfig.GetPageCookies)=='function'){cookies=lpMTagConfig.GetPageCookies();}else{cookies=document.cookie;}if((typeof(cookies)=='undefined')||cookies==null){cookies='';}if(!lpMTagConfig.cobrowseEnabled){CallParams.add('cobrowse','true');}CallParams.add('cookie',cookies);}return CallParams;};lpMonitorTag.prototype.lpIsJavaEnabled=function(){var rc=false;var agent=navigator.appName;var ver=parseInt(navigator.appVersion);if(agent=="Microsoft Internet Explorer"){if((ver>=4)&&navigator.javaEnabled()){rc=true;}}else{for(var i=0;i<navigator.plugins.length;i++){rc=rc||(navigator.plugins[i].name.toUpperCase().indexOf("JAVA")!=-1);}}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(formName,useCookie,fieldList,exclude,useSendPrefix){if(typeof(useCookie)=='undefined'){useCookie=false;}if(typeof(fieldList)=='undefined'){fieldList=null;}if(typeof(exclude)=='undefined'){exclude=false;}var hcForm=document.forms[formName];if(hcForm){var data=this.lpGetFormData(hcForm,fieldList,exclude,useSendPrefix);if(useCookie){this.lpAddToSetCookie(this.dataCookieName,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{if(lpConnLib.DebugDisplay){lpMTagDebug.Display('Cannot get the form='+formName,'ERROR','EMT');}return false;}};lpMonitorTag.prototype.lpFormField=function(formName,fieldName,useCookie,useSendPrefix){return this.lpFormData(formName,useCookie,[fieldName],false,useSendPrefix);};lpMonitorTag.prototype.lpGetFormData=function(form,fieldList,exclude,useSendPrefix){var nvps=new Array();for(var e=0;form.length>e;e++){var el=form.elements[e];if((exclude&&!this.lpValueInArray(el.name,fieldList))||((!exclude&&this.lpValueInArray(el.name,fieldList)))){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(useSendPrefix)!='undefined'&&useSendPrefix!=""){qs+=useSendPrefix;}else{qs+="PV!";}qs+=''+nvps[i]+'&';}return qs;};lpMonitorTag.prototype.lpValueInArray=function(value,list){if(typeof(list)=='undefined'){return false;}for(var i=0;i<list.length;i++){if(list[i]==value){return true;}}return false;};lpMonitorTag.prototype.lpSendData=function(data,immediate){if(data.length<=0){return false;}if(typeof(immediate)=='undefined'){immediate=false;}if(immediate){var send_data=new hcArrayStorage();send_data=this.lpSetCallParams('mTagUDEsend',data);this.mtagAddToQueue(this.lpURL,send_data,null,false,0,false,0,1,lpMTagConfig.charSet);}else{this.lpDataToSend+=data+'&';}};lpMonitorTag.prototype.lpAddToSetCookie=function(name,value,secure,expires,path,domain){var cookieValue=this.lpGetCookie(name);if(cookieValue==null){cookieValue='';}this.lpSetCookie(name,value+cookieValue,expires,path,domain,secure);};lpMonitorTag.prototype.lpSetCookie=function(name,value,expires,path,domain){var today=new Date();today.setTime(today.getTime());if(expires){expires=expires*1000*60*60*24;}var expires_date=new Date(today.getTime()+(expires));document.cookie=name+"="+escape(value)+((expires)?";expires="+expires_date.toGMTString():"")+((path)?";path="+path:"")+((domain)?";domain="+domain:"")+((lpMTagConfig.lpUseSecureCookies)?";secure":"");};lpMonitorTag.prototype.lpGetCookie=function(name){var start=document.cookie.indexOf(name+"=");if(typeof(name)=='undefined'||start==-1){return null;}var len=start+name.length+1;if((!start)&&(name!=document.cookie.substring(0,name.length))){return null;}var end=document.cookie.indexOf(";",len);if(end==-1){end=document.cookie.length;}return unescape(document.cookie.substring(len,end));};lpMonitorTag.prototype.lpDeleteCookie=function(name,path,domain){if(this.lpGetCookie(name)){document.cookie=name+"="+((path)?";path="+path:"")+((domain)?";domain="+domain:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT";}};lpMonitorTag.prototype.ifVisitorActions=function(data){if(typeof(lpMTagConfig.ifVisitorCode)!='undefined'){for(var i=0;i<lpMTagConfig.ifVisitorCode.length;i++){var tempfunc=lpMTagConfig.ifVisitorCode[i];try{tempfunc(data);if(lpConnLib.DebugDisplay){lpMTagDebug.Display('OK Executing Visitor dependent function','EXEC-OK','EMT');}}catch(hcError){if(lpConnLib.DebugDisplay){lpMTagDebug.Display('ERROR Executing Visitor dependent function='+tempfunc+' &nbsp #'+hcError+'#','ERROR','EMT');}}}lpMTagConfig.ifVisitorCode=new Array();}lpMTagConfig.isVisitor=true;};lpMonitorTag.prototype.MTagCallback=function(lpDataObj,request){var delay=0;if(typeof(lpDataObj.ResultSet.lpCallError)!='undefined'){lpMTag.connErrorCnt++;if(lpMTag.connErrorCnt<=lpMTag.maxErrorCnt){lpMTag.lpLoopTimer=setTimeout('lpMTag.lpMTagMain()',lpMTag.errorDelay*1000);}return;}lpMTag.connErrorCnt=0;if(lpDataObj.ServiceInfo.resendCall){if(lpConnLib.DebugDisplay){lpMTagDebug.Display('Resending connection '+lpDataObj.ResultSet.lpCallId,'WARN','EMT');}if(request!=null){lpMTag.mtagAddReqToQueue(request);}return;}if(lpMTag.lpCmd=='mTagKnockPage'){lpMTag.lpCmd='mTagStartPage';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);}lpMTag.lpLoopTimer=setTimeout('lpMTag.lpMTagMain()',delay*1000);}};lpMonitorTag.prototype.overrideLPServer=function(serverName,setCookie){if(setCookie){this.lpSetCookie(this.webServerCookie,serverName);}lpMTagConfig.lpServer=serverName;this.lpURL=lpMTagConfig.lpProtocol+'://'+lpMTagConfig.lpServer+'/hc/'+lpMTagConfig.lpNumber+'/';};lpMonitorTag.prototype.MTagOnLoad=function(){if(this.lpGetCookie(this.webServerCookie)!=null){this.overrideLPServer(this.lpGetCookie(this.webServerCookie),false);}if(typeof(lpMTagConfig.onLoadCode)!='undefined'){for(var i=0;i<lpMTagConfig.onLoadCode.length;i++){var tempfunc=lpMTagConfig.onLoadCode[i];try{tempfunc();if(lpConnLib.DebugDisplay){lpMTagDebug.Display('OK Executing MTag ONLoad dependent function','EXEC-OK','EMT');}}catch(hcError){if(lpConnLib.DebugDisplay){lpMTagDebug.Display('ERROR Executing MTag ONLoad dependent function='+tempfunc+' &nbsp #'+hcError+'#','ERROR','EMT');}}}lpMTagConfig.onLoadCode=new Array();}if(typeof(lpGetVariables)!='undefined'&&typeof(lpGetVariables)=='function'){this.lpProcessUDEs(lpGetVariables());}if(typeof(lpUDEs)!='undefined'){this.lpProcessUDEs(lpUDEs);}};lpMonitorTag.prototype.lpProcessUDEs=function(udes){for(var indx in udes){for(var i=0;i<udes[indx].length;i++){if(indx=='session'){if(typeof(lpMTagConfig.sessionVar)=='undefined'){lpMTagConfig.sessionVar=[];}lpMTagConfig.sessionVar[lpMTagConfig.sessionVar.length]=udes[indx][i];}else if(indx=='page'){if(typeof(lpMTagConfig.pageVar)=='undefined'){lpMTagConfig.pageVar=[];}lpMTagConfig.pageVar[lpMTagConfig.pageVar.length]=udes[indx][i];}else if(indx=='visitor'){if(typeof(lpMTagConfig.visitorVar)=='undefined'){lpMTagConfig.visitorVar=[];}lpMTagConfig.visitorVar[lpMTagConfig.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);}};var lpMTag=new lpMonitorTag();lpMTag.ver='8.6';lpMTag.build='5';lpMTag.MTagOnLoad();lpMTag.lpLoopTimer=setTimeout('lpMTag.lpMTagMain()',lpMTag.lpKnockPageRequestDelay*1000);