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];};function lpRequest(Url,params,Callback,requireConfirm,maxretries,prunIdentify,lpjson,dataEncoding,browser){this.headLoc=document.getElementsByTagName("head").item(0);this.timeStamp=new Date();this.callId=this.timeStamp.getTime()+'-'+Math.round(1000*Math.random());this.scriptId='lpScriptId'+this.callId;this.callbackFunc=Callback;this.requireConfirm=requireConfirm;this.params=params;this.BaseUrl=Url;this.fullUrl='';if(typeof(dataEncoding)!='undefined'&&dataEncoding!=''&&dataEncoding!=null)this.dataEncoding=dataEncoding.toUpperCase();else this.dataEncoding="ISO-8859-1";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;}lpRequest.prototype.BuildCallUrl=function(type,maxLength){var tmpUrl=this.BaseUrl;if(tmpUrl.indexOf('?')==-1){tmpUrl+='?';}else{tmpUrl+='&';}tmpUrl+='lpCallId='+this.callId;if(type=='get'){tmpUrl+='&'+this.prunIdentify+this.lpjson;if(this.params.size()>0){for(var i=0;i<this.params.size();i++){tmpUrl+='&'+this.params.get(i);}}if(tmpUrl.length>maxLength){tmpUrl=tmpUrl.substring(0,maxLength);}}this.fullUrl=tmpUrl;};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(){this.headLoc.removeChild(this.scriptObj);};lpRequest.prototype.MakeCallByIframeSpecial=function(browser,iframeRef){if(lpConnLib.DebugDisplay)lpMTagDebug.Display('MakeCallByIframeSpecial IFRM Charset='+(iframeRef.contentDocument?iframeRef.contentDocument.characterSet:'No doc')+'   '+this.dataEncoding);this.usedget=false;this.usedSpecialPost=true;if(iframeRef.contentDocument&&iframeRef.contentDocument.characterSet==this.dataEncoding){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');for(var 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('input');input.setAttribute('type','text');input.setAttribute('name',name);input.setAttribute('id',name);input.setAttribute('value',value);form.appendChild(input);};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())+'&'+this.prunIdentify+this.lpjson+"'>";out_str+="<input type='hidden' name='lpCallId' value='"+this.callId+"'>";out_str+="<input type='hidden' name='lpConfirmThisCall' value='1'>";var dataObj=new Object();var valueArray=new Array();if(this.params.size()>0){for(var 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"){var doc=container.document;doc.open();doc.write(out_str);doc.close();var j=doc.forms['hcPostSubmitForm'].length;for(var i=0;i<j;i++){if(doc.forms['hcPostSubmitForm'].elements[i].name!='lpCallId'&&doc.forms['hcPostSubmitForm'].elements[i].name!='lpConfirmThisCall'){doc.forms['hcPostSubmitForm'].elements[i].value=dataObj[doc.forms['hcPostSubmitForm'].elements[i].name];}}doc.forms['hcPostSubmitForm'].submit();}else{if(browser=='FF'||browser=='SAFARI'){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(doc.forms['hcPostSubmitForm'].elements[i].name!='lpCallId'&&doc.forms['hcPostSubmitForm'].elements[i].name!='lpConfirmThisCall'){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 (doc.forms['hcPostSubmitForm'].elements[i].name!='lpCallId' && doc.forms['hcPostSubmitForm'].elements[i].name!='lpConfirmThisCall') {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;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>");var 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':var span=document.createElement('SPAN');span.id="SPAN"+containerName;document.body.appendChild(span);var 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':var span=document.createElement('SPAN');span.id="SPAN"+containerName;document.body.appendChild(span);var 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:var 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;};function lpConnectionLibrary(){this.ver='8.2';this.build='6';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.queueSize=0;this.browser=this.BrowserSniff();if(this.browser=='IE')this.maxurlgetlength=this.maxurllengthIE;else this.maxurlgetlength=this.maxurllengthMZ;this.js_exec_ok='';this.js_exec_error='';this.callCounter=0;this.garbageCollectCounter=0;this.forcedGet=0;this.reconfirmedCalls=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);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(this.browser,iframeObj['iframeRef'])){iframeObj['callMade']=true;}else{setTimeout("lpConnLib.specialPostHandler('"+callId+"')",1000);}}}};lpConnectionLibrary.prototype.findCreateIframe=function(callId,encoding,spImmediateCleanup){for(var i=0;i<this.spPostIframesBusy.length;i++){if(this.spPostIframesBusy[i]['callID']==callId){if(this.DebugDisplay)lpMTagDebug.Display('FOUND IN BUSY IFRAME:'+callId);return this.spPostIframesBusy[i];}}for(var i=0;i<this.spPostIframesFree.length;i++){if(this.spPostIframesFree[i]['encoding']==encoding){if(this.DebugDisplay)lpMTagDebug.Display('FOUND A FREE IFRAME:'+callId);var iframeRef=this.spPostIframesFree[i]['iframeRef'];this.spPostIframesFree.splice(i,1);return this.addIframeToBusy(callId,encoding,iframeRef,spImmediateCleanup);}}var 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);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);return;}if(this.spPostIframesBusy[i]['encoding']!=iframeRef.contentDocument.characterSet.toUpperCase()){if(this.DebugDisplay)lpMTagDebug.Display('deleting since encodings DO not match '+callId);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);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);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;var u=url+"?cmd=visitorDebugPrint&site="+site+"&logger="+logger+"&d="+(new Date()).getTime()+"&log="+msg;errorImage.src=u;}};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.addToQueue=function(Url,params,Callback,requireConfirm,maxretries,forceget,onPostAutoConfirm,lpjson,dataEncoding,forcePost,specialPost,spImmediateCleanup,encodingBlankUrl){var qSize=this.queueSize;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(specialPostImmediateCleanup)=='undefined')spImmediateCleanup=true;this.queue[qSize]=new lpRequest(Url,params,Callback,requireConfirm,maxretries,this.prunIdentify,this.lpjson,dataEncoding,this.browser);if(typeof(lpMTagDebug)!='undefined')this.DebugDisplay=true;this.callCounter++;if(forceget)this.forcedGet++;if(this.js_exec_ok!=''){params.add("code_id_ok",this.js_exec_ok);this.js_exec_ok='';}if(this.js_exec_error!=''){params.add("code_id_error",this.js_exec_error);this.js_exec_error='';}this.queue[qSize].BuildCallUrl('get',(this.browser=='IE'?this.maxurllengthIE:this.maxurllengthMZ));if(!forcePost&&(this.queue[qSize].fullUrl.length<this.maxurlgetlength||forceget)){this.queue[qSize].MakeCallByScript();callType='GET';if(!requireConfirm)this.queue[qSize].confirmed=true;}else{if(specialPost){this.queue[qSize].spImmediateCleanup=spImmediateCleanup;this.specialPostHandler(this.queue[qSize].callId);}else{this.queue[qSize].MakeCallByIframe(this.browser);}callType='POST';if(postAutoConfirm)this.queue[qSize].confirmed=true;}this.queueSize++;if(this.DebugDisplay){lpMTagDebug.Display('Making Call id='+this.queue[qSize].callId+'  Using-'+callType+((specialPost&&callType=='POST')?'-SPECIAL':''),null);}return callType;};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.AddToExecJSList=function(code_id,status){if(status){if(this.js_exec_ok=='')this.js_exec_ok=code_id;else this.js_exec_ok+=','+code_id;}else{if(this.js_exec_error=='')this.js_exec_error=code_id;else this.js_exec_error+=','+code_id;}};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');this.queue.sort(this.SortQueue);var tmpSize=this.queue.length;var confirmedCnt=0;for(var i=0;i<(tmpSize-1);i++){if(this.queue[i].confirmed){if(this.queue[i].usedget)this.queue[i].removeScriptTag();confirmedCnt++;}}this.queue.splice(0,confirmedCnt);this.queueSize=this.queue.length;this.garbageCollectCounter++;this.CleanUpBusySpecialPost();var timeNow=new Date().getTime();for(var 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,null);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,null);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');return;}this.lpCallbackCnt++;if(lpDataObj.ResultSet.lpCallId==0||lpDataObj.ResultSet.lpCallId==null||lpDataObj.ResultSet.lpCallId==''){if(this.DebugDisplay)lpMTagDebug.Display('Callback No Call ID recieved','ERROR');return;}if(this.DebugDisplay)lpMTagDebug.Display('Callback callId='+lpDataObj.ResultSet.lpCallId,null);if(typeof(lpDataObj.ResultSet.lpCallConfirm)=='undefined'||lpDataObj.ResultSet.lpCallConfirm=='')lpDataObj.ResultSet.lpCallConfirm=lpDataObj.ResultSet.lpCallId;this.confirmConnection(lpDataObj.ResultSet.lpCallConfirm);if(typeof(mtagDebugConfirmLists)=='function'){mtagDebugConfirmLists(lpDataObj.ResultSet.lpCallId,lpDataObj.ResultSet.lpCallConfirm);}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;}this.AddToExecJSList(code_id,no_err_flag);if(this.DebugDisplay){if(no_err_flag)debug_msg[debug_msg.length]='OK Executed snippet='+lpDataObj.ResultSet.lpJS_Execute[MTagI].code_id+'<!!>'+'EXEC-OK';else debug_msg[debug_msg.length]='ERROR Executing snippet='+lpDataObj.ResultSet.lpJS_Execute[MTagI].code_id+' &nbsp #'+err_msg+'#'+'<!!>'+'ERROR';}}if(this.DebugDisplay)lpMTagDebug.DisplayArray(debug_msg);}if(typeof(lpDataObj.ResultSet.lpCallError)!='undefined'&&this.DebugDisplay)lpMTagDebug.Display('ERROR Reply Recieved='+lpDataObj.ResultSet.lpCallError+' &nbsp # CallID = '+lpDataObj.ResultSet.lpCallId+'#','ERROR');this.CallUsrCallbackFunc(lpDataObj);};lpConnectionLibrary.prototype.CallUsrCallbackFunc=function(lpDataObj){var userCallbackFunc=this.GetCallbackFunc(lpDataObj.ResultSet.lpCallId);if(userCallbackFunc!=''&&userCallbackFunc!=null){var no_err_flag=true;var err_msg='';try{userCallbackFunc(lpDataObj);}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');else lpMTagDebug.Display('ERROR Executing User CallBackFunction='+userCallbackFunc+' &nbsp #'+err_msg+'#','ERROR');}}};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.ver='8.2';this.build='6';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.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=new Array();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);}};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;if((currentTime-lastActiveTime)>(lpMTag.inactivityPeriod*1000)){actStatus=false;}else{actStatus=true;}if(actStatus!=lpMTagConfig.visitorActive){if(lpConnLib.DebugDisplay)lpMTagDebug.Display('Visitor Active STATUS= '+(actStatus?'1':'0'));lpMTagConfig.pageVar[lpMTagConfig.pageVar.length]='visitorActive='+(actStatus?'1':'0');lpMTagConfig.visitorActive=actStatus;}};lpMonitorTag.prototype.lpSetCallParams=function(lpCmd,extra){var CallParams=new hcArrayStorage();if(typeof(lpMTagConfig.useFirstParty)!='undefined'&&lpMTagConfig.useFirstParty||lpCmd=='mTagKnockPage'){var vid=this.lpGetCookie(lpMTagConfig.lpNumber+'-VID');if(vid!=null){CallParams.add('visitor',vid);var skey=this.lpGetCookie(lpMTagConfig.lpNumber+'-SKEY');if(skey!=null){CallParams.add('msessionkey',skey);}}}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);CallParams.add('scriptVersion',this.lpScriptVersion);if(lpCmd=='mTagInPage'){var data=this.lpGetCookie(this.dataCookieName);if(data!=''&&data!=null){this.lpDeleteCookie(this.dataCookieName);CallParams.add(data);}}if(typeof(lpMTagConfig.defaultChatInvite)!='undefined'){CallParams.add('defCInvite',lpMTagConfig.defaultChatInvite);}if(typeof(lpMTagConfig.defaultVoiceInvite)!='undefined'){CallParams.add('defVInvite',lpMTagConfig.defaultVoiceInvite);}if(typeof(lpMTagConfig.defaultInvite)!='undefined'){CallParams.add('defCInvite',lpMTagConfig.defaultInvite);CallParams.add('defVInvite',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='';}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'){if(typeof(lpMTagConfig.pageVar)!='undefined'&&lpMTagConfig.pageVar.length>0){for(var i=0;i<lpMTagConfig.pageVar.length;i++){CallParams.add('PAGEVAR!'+lpMTagConfig.pageVar[i],undefined,true);}lpMTagConfig.pageVar=new Array();}if(typeof(lpMTagConfig.sessionVar)!='undefined'&&lpMTagConfig.sessionVar.length>0){for(var i=0;i<lpMTagConfig.sessionVar.length;i++){CallParams.add('SESSIONVAR!'+lpMTagConfig.sessionVar[i],undefined,true);}lpMTagConfig.sessionVar=new Array();}if(typeof(lpMTagConfig.visitorVar)!='undefined'&&lpMTagConfig.visitorVar.length>0){for(var i=0;i<lpMTagConfig.visitorVar.length;i++){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(var 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'){var tmpData=extra.split('&');for(var i=0;i<tmpData.length;i++){if(tmpData[i]!='')CallParams.add(tmpData[i]);}}if(this.lpDataToSend!=''){var tmpData=this.lpDataToSend.split('&');for(var i=0;i<tmpData.length;i++){if(tmpData[i]!='')CallParams.add(tmpData[i]);}this.lpDataToSend='';}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);}CallParams.add('title',this.title);CallParams.add('referrer',document.referrer);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.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);lpConnLib.addToQueue(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');return false;}return true;};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==true){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+="PAGEVAR!";}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);lpConnLib.addToQueue(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,secure){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+"=");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));};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');}catch(hcError){if(lpConnLib.DebugDisplay)lpMTagDebug.Display('ERROR Executing Visitor dependent function='+tempfunc+' &nbsp #'+hcError+'#','ERROR');}}lpMTagConfig.ifVisitorCode=new Array();}lpMTagConfig.isVisitor=true;};lpMonitorTag.prototype.MTagCallback=function(lpDataObj){var delay=0;if(typeof(lpDataObj.ResultSet.lpCallError)!='undefined'){lpMTag.connErrorCnt++;if(lpMTag.connErrorCnt<=lpMTag.maxErrorCnt){lpMTag.lpLoopTimer=setTimeout('lpMTag.lpMTagMain()',this.errorDelay*1000);}return;}lpMTag.connErrorCnt=0;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');}catch(hcError){if(lpConnLib.DebugDisplay)lpMTagDebug.Display('ERROR Executing MTag ONLoad dependent function='+tempfunc+' &nbsp #'+hcError+'#','ERROR');}}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=new Array();lpMTagConfig.sessionVar[lpMTagConfig.sessionVar.length]=udes[indx][i];}else if(indx=='page'){if(typeof(lpMTagConfig.pageVar)=='undefined')lpMTagConfig.pageVar=new Array();lpMTagConfig.pageVar[lpMTagConfig.pageVar.length]=udes[indx][i];}else if(indx=='visitor'){if(typeof(lpMTagConfig.visitorVar)=='undefined')lpMTagConfig.visitorVar=new Array();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=lpConnLib.addToQueue(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.MTagOnLoad();lpMTag.lpLoopTimer=setTimeout('lpMTag.lpMTagMain()',lpMTag.lpKnockPageRequestDelay*1000);