// Live Help Server Version: 1.1 Rev. 1 // Geo Tracking Load var region = ''; var country = ''; var city = ''; var countrycode = ''; var latitude = ''; var longitude = ''; function initgeo(geoDict) { countrycode = geoDict['CountryCode']; country = geoDict['CountryName']; city = geoDict['City']; latitude = geoDict['Latitude']; longitude = geoDict['Longitude']; region = geoDict['RegionName']; } // JavaScript Check Status Functions var topMargin = 10; var leftMargin = 10; var itopMargin = topMargin; var ileftMargin = leftMargin; var ns6 = (!document.all && document.getElementById); var ie4 = (document.all); var ns4 = (document.layers); var initiateOpen = 0; var initiateLoaded = 0; var infoOpen = 0; var infoImageLoaded = 0; var countTracker = 0; var timeElapsed; var timerTracker; var trackingInitalized = 0; var trackerLoaded = 0; var windowWidth = 470 var windowHeight = 369 var hAlign = ""; var vAlign = ""; var layerHeight = 238; var layerWidth = 377; var slideTime = 1200; var windowLeft = (screen.width - windowWidth) / 2; var windowTop = (screen.height - windowHeight) / 2; var size = 'height=' + windowHeight + ',width=' + windowWidth + ',top=' + windowTop + ',left=' + windowLeft; //Images trackerStatus = new Image; openingTrackerStatus = new Image; acceptTrackerStatus = new Image; declineTrackerStatus = new Image; var title = document.title; var referrer; //Script tracking and status indicator var _vlDomain = 0; var _vlAgent = 0; var _vldirection =0; var _vlLanguage = 'en'; var _vlService = 1; var _vlTracking = new Boolean(true); var _vlStatus_indicator = new Boolean(true); var _request_initiated = new Boolean(false); var _custom_offline_form =""; var _vlofftracking ="0"; var _vloffline =1; var _vlinitiated = 0; var _vldisableinvitation = 0; function none() { } function toggle(object) { if (document.getElementById) { if (document.getElementById(object).style.visibility == 'visible') document.getElementById(object).style.visibility = 'hidden'; else document.getElementById(object).style.visibility = 'visible'; } else if (document.layers && document.layers[object] != null) { if (document.layers[object].visibility == 'visible' || document.layers[object].visibility == 'show' ) document.layers[object].visibility = 'hidden'; else document.layers[object].visibility = 'visible'; } else if (document.all) { if (document.all[object].style.visibility == 'visible') document.all[object].style.visibility = 'hidden'; else document.all[object].style.visibility = 'visible'; } return false; } function statusClass (s_id, _vlDomain) { this.s_id = s_id; this.checkInitiate_json = checkInitiate_json; this.currentTime = currentTime; this.toggle = toggle; this.initiateFloatLayer = initiateFloatLayer; // this.floatRefresh = floatRefresh; this.resetTimer = resetTimer; this.floatObject = floatObject; // this.mainPositions = mainPositions; this.mainTrigger = mainTrigger; // this.floatStart = floatStart; this.animate = animate; this.resetLayerLocation = resetLayerLocation; this.stopLayer = stopLayer; this.acceptInitiateChat = acceptInitiateChat; this.declineInitiateChat = declineInitiateChat; this.onloadEvent = onloadEvent; this.checkInitiate = checkInitiate; this.openInfo = openInfo; this.infoImageLoad = infoImageLoad; this.displayInfo = displayInfo; this.closeInfo = closeInfo; this.cancelClosingInfo = cancelClosingInfo; this.openLiveHelp = openLiveHelp; this.onlineTracker = onlineTracker; var server = 'https://cpgarmor.com'; var request = ''; var domain = 'cpgarmor.com'; var timerClosingLiveHelpInfo; var timerLiveHelpInfo; var timerInitiateLayer; var idleTimeout = 90 * 60 * 1000; var timeStart = currentTime(); function currentTime() { var date = new Date(); return date.getTime(); } if (document.referrer.indexOf('https://cpgarmor.com') >= 0) { referrer = ''; } else { referrer = escape(document.referrer); } // JavaScript Initiate Chat Layer Functions var invitationIsOpen = false; var invitationCloseTimer = false; function initiateFloatLayer( has_message ) { if ( invitationCloseTimer !== false ) { window.clearTimeout( invitationCloseTimer ); } if ( has_message == true ) { invitationCloseTimer = window.setTimeout( 's1.declineInitiateChat( true );', 60 * 1000 ); } else { invitationCloseTimer = window.setTimeout( 's1.declineInitiateChat( false );', 60 * 1000 ); } invitationIsOpen = true; var trkUrl = ""; //var openingTrackerStatus = new Image; var time = currentTime(); // new parameters (screen.width,screen.height) in order to support safari third-party cookies restriction. trkUrl = 'https://cpgarmor.com/wp-content/plugins/activehelper-livehelp/server/import/tracker.php?status_id=' + s_id + '&TIME=' + time + '&INITIATE=Opened&WIDTH=' + screen.width + '&HEIGHT=' + screen.height + ''; openingTrackerStatus.src = trkUrl; if ( ie4 ) document.all['initiateChatResponse_' + s_id].location = 'https://cpgarmor.com/wp-content/plugins/activehelper-livehelp/server/import/tracker.php?status_id=s_id&TIME=' + time + '&INITIATE=Opened&WIDTH=' + screen.width + '&HEIGHT=' + screen.height + ''; if ( ns4 ) eval("document.initiateChatResponse_" + s_id + ".location = 'https://cpgarmor.com/wp-content/plugins/activehelper-livehelp/server/import/tracker.php?status_id=s_id&TIME=' + time + '&INITIATE=Opened&WIDTH=' + screen.width + '&HEIGHT=' + screen.height + ''"); if ( ns6 ) document.getElementById('initiateChatResponse_' + s_id).location = 'https://cpgarmor.com/wp-content/plugins/activehelper-livehelp/server/import/tracker.php?status_id=s_id&TIME=' + time + '&INITIATE=Opened&WIDTH=' + screen.width + '&HEIGHT=' + screen.height + ''; floatRefresh(); } function get_vertical_scroll( ) { if( window.pageYOffset ) return window.pageYOffset; else if ( ( document.documentElement ) && ( document.documentElement.scrollTop ) ) return document.documentElement.scrollTop; else if ( ( document.body ) && ( document.body.scrollTop ) ) return document.body.scrollTop; else return 0; } window.floatRefresh = function() { var trkUrl = ""; window.clearTimeout(timerInitiateLayer); // window.clearTimeout(timerTracker); if (countTracker == 10000) { var time = currentTime(); trkUrl = 'https://cpgarmor.com/wp-content/plugins/activehelper-livehelp/server/import/tracker.php?status_id=s_id&WIDTH=' + screen.width + '&HEIGHT=' + screen.height + '&TIME=' + time; trackerStatus.onload = resetTimer; trackerStatus.src = trkUrl; countTracker = 0; } else { countTracker = countTracker + 10; //timerInitiateLayer = window.setTimeout('mainPositions();floatRefresh();', 10); //timerInitiateLayer = window.setTimeout('floatRefresh();', 10); // document.getElementById( 'floatLayer_1' ).style.top = ( get_vertical_scroll( ) + 10 ) + "px"; // setTimeout( function(){ glue( document.getElementById( 'floatLayer_1' )); }, 10 ); } } function glue( object ) { object.style.top = ( get_vertical_scroll( ) + 10 ) + "px"; setTimeout( function(){ glue( object ); }, 1 ); } window.mainPositions=function() { if(_vlTracking == false){ return false; } /* if (ns4) { eval("this.currentY = document.floatLayer_" + s_id + ".top"); eval("this.currentX = document.floatLayer_" + s_id + ".left"); this.scrollTop = window.pageYOffset; this.scrollLeft = window.pageXOffset; mainTrigger(); } else if(ns6) { this.currentY = parseInt(document.getElementById('floatLayer_' + s_id).style.top); this.currentX = parseInt(document.getElementById('floatLayer_' + s_id).style.left); this.scrollTop = scrollY; this.scrollLeft = scrollX; mainTrigger(); } else if(ie4) { this.currentY = document.all['floatLayer_' + s_id].style.pixelTop; this.currentX = document.all['floatLayer_' + s_id].style.pixelLeft; this.scrollTop = document.body.scrollTop; this.scrollLeft = document.body.scrollLeft; mainTrigger(); } */ //glue( document.getElementById( 'floatLayer_1' ) ); } function resetTimer() { mainPositions(); floatRefresh(); } function floatObject() { if (ns4 || ns6) { findHeight = window.innerHeight; findWidth = window.innerWidth; } else if(ie4) { findHeight = document.body.clientHeight; findWidth = document.body.clientWidth; } } function mainTrigger() { var newTargetY = this.scrollTop + this.topMargin; if((this.scrollLeft + this.leftMargin) > 400) { var newTargetX = this.scrollLeft + this.leftMargin -300; }else { var newTargetX = this.scrollLeft + this.leftMargin; } if ( this.currentY != newTargetY || this.currentX != newTargetX) { if ( newTargetY != this.targetY || newTargetX != this.targetX ) { this.targetY = newTargetY; this.targetX = newTargetX; floatStart(); } animate(); } } function floatStart() { var now = new Date(); this.Y = this.targetY - this.currentY; this.X = this.targetX - this.currentX; this.C = Math.PI / ( 2 * this.slideTime ) this.D = now.getTime() if (Math.abs(this.Y) > this.findHeight) { this.E = this.Y > 0 ? this.targetY - this.findHeight : this.targetY + this.findHeight; this.Y = this.Y > 0 ? this.findHeight : -this.findHeight; } else { this.E = this.currentY; } if (Math.abs(this.X) > this.findWidth) { this.F = this.X > 0 ? this.targetX - this.findWidth : this.targetX + this.findWidth; this.X = this.X > 0 ? this.findWidth : -this.findWidth; } else { this.F = this.currentX; } } function animate() { var now = new Date() ; var newY = this.Y * Math.sin( this.C * ( now.getTime() - this.D ) ) + this.E; var newX = this.X * Math.sin( this.C * ( now.getTime() - this.D ) ) + this.F; newY = Math.round(newY); newX = Math.round(newX); if (( this.Y > 0 && newY > this.currentY ) || ( this.Y < 0 && newY < this.currentY )) { if ( ie4 ) { document.all['floatLayer_' + s_id].style.pixelTop = newY } else if ( ns4 ) { eval("document.floatLayer_" + s_id + ".top = newY"); } else if ( ns6 ) { document.getElementById('floatLayer_' + s_id).style.top = newY; } } if (( this.X > 0 && newX > this.currentX ) || ( this.X < 0 && newX < this.currentX )) { if ( ie4 ) { document.all['floatLayer_' + s_id].style.pixelLeft = newX; } else if ( ns4 ) { eval("document.floatLayer_" + s_id + ".left = newX"); } else if ( ns6 ) { document.getElementById('floatLayer_' + s_id).style.left = newX; } } } function resetLayerLocation() { var browserWidth = 0, browserHeight = 0; if( typeof( window.innerWidth ) == 'number' ) { browserWidth = window.innerWidth; browserHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { browserWidth = document.documentElement.clientWidth; browserHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { browserWidth = document.body.clientWidth; browserHeight = document.body.clientHeight; } if ((ns4) || (ns6)) { if (hAlign == "left") { leftMargin = ileftMargin; } if (hAlign == "right") { leftMargin = window.innerWidth-ileftMargin-layerWidth-20; } if (hAlign == "center") { leftMargin = Math.round((window.innerWidth-20)/2)-Math.round(layerWidth/2); } if (vAlign == "top") { topMargin = itopMargin; } if (vAlign == "bottom") { topMargin = window.innerHeight-itopMargin-layerHeight; } if (vAlign == "center") { topMargin = Math.round((window.innerHeight-20)/2)-Math.round(layerHeight/2); } } if (ie4) { if (hAlign == "left") { leftMargin = ileftMargin; } if (hAlign == "right") { leftMargin = document.body.offsetWidth-ileftMargin-layerWidth-20; } if (hAlign == "center") { leftMargin = Math.round((document.body.offsetWidth-20)/2)-Math.round(layerWidth/2); } if (vAlign == "top") { topMargin = itopMargin; } if (vAlign == "bottom") { topMargin = browserHeight-itopMargin-layerHeight; } if (vAlign == "center") { topMargin = Math.round((browserHeight-20)/2)-Math.round(layerHeight/2); } } } function stopLayer() { window.clearTimeout(timerInitiateLayer); if ( ns4 ) { eval("document.floatLayer_" + s_id + ".top = '10'"); eval("document.floatLayer_" + s_id + ".left = '10'"); } else if ( ns6 ) { document.getElementById('floatLayer_' + s_id).style.top = "10"; document.getElementById('floatLayer_' + s_id).style.left = "10"; } else if ( ie4 ) { document.all['floatLayer_' + s_id].style.pixelTop = "10px"; document.all['floatLayer_' + s_id].style.pixelLeft = "10px"; } } function acceptInitiateChat( has_message ) { if ( invitationCloseTimer !== false ) { window.clearTimeout( invitationCloseTimer ); } var trkUrl = ""; //var acceptTrackerStatus = new Image; var time = currentTime(); trkUrl = 'https://cpgarmor.com/wp-content/plugins/activehelper-livehelp/server/import/tracker.php?status_id=s_id&TIME=' + time + '&INITIATE=Accepted&WIDTH=' + screen.width + '&HEIGHT=' + screen.height + ''; acceptTrackerStatus.src = trkUrl; if ( ie4 )document.all['initiateChatResponse_' + s_id].location = 'https://cpgarmor.com/wp-content/plugins/activehelper-livehelp/server/import/tracker.php?status_id=s_id&TIME=' + time + '&INITIATE=Accepted&WIDTH=' + screen.width + '&HEIGHT=' + screen.height + ''; if ( ns4 )eval("document.initiateChatResponse_" + s_id + ".location = 'https://cpgarmor.com/wp-content/plugins/activehelper-livehelp/server/import/tracker.php?status_id=s_id&TIME=' + time + '&INITIATE=Accepted&WIDTH=' + screen.width + '&HEIGHT=' + screen.height + ''"); if ( ns6 )document.getElementById('initiateChatResponse_' + s_id).location = 'https://cpgarmor.com/wp-content/plugins/activehelper-livehelp/server/import/tracker.php?status_id=s_id&TIME=' + time + '&INITIATE=Accepted&WIDTH=' + screen.width + '&HEIGHT=' + screen.height + ''; if (initiateOpen == 1) { if ( has_message == true ) { toggle('floatLayer_message_' + s_id); } else { toggle('floatLayer_' + s_id); } } initiateLoaded = 0; stopLayer(); onlineTracker(); } function declineInitiateChat( has_message ) { if ( invitationCloseTimer !== false ) { window.clearTimeout( invitationCloseTimer ); } var trkUrl = ""; //var declineTrackerStatus = new Image; var time = currentTime(); trkUrl = 'https://cpgarmor.com/wp-content/plugins/activehelper-livehelp/server/import/tracker.php?status_id=s_id&TIME=' + time + '&INITIATE=Declined&WIDTH=' + screen.width + '&HEIGHT=' + screen.height + ''; declineTrackerStatus.src = trkUrl; if ( ie4 )document.all['initiateChatResponse_' + s_id].location = 'https://cpgarmor.com/wp-content/plugins/activehelper-livehelp/server/import/tracker.php?status_id=s_id&TIME=' + time + '&INITIATE=Declined&WIDTH=' + screen.width + '&HEIGHT=' + screen.height + ''; if ( ns4 )eval("document.initiateChatResponse_" + s_id + ".location = 'https://cpgarmor.com/wp-content/plugins/activehelper-livehelp/server/import/tracker.php?status_id=s_id&TIME=' + time + '&INITIATE=Declined&WIDTH=' + screen.width + '&HEIGHT=' + screen.height + ''"); if ( ns6 )document.getElementById('initiateChatResponse_' + s_id).location = 'https://cpgarmor.com/wp-content/plugins/activehelper-livehelp/server/import/tracker.php?status_id=s_id&TIME=' + time + '&INITIATE=Declined&WIDTH=' + screen.width + '&HEIGHT=' + screen.height + ''; if (initiateOpen == 1) { if ( has_message == true ) toggle('floatLayer_message_' + s_id); else toggle('floatLayer_' + s_id); initiateOpen = 0; } initiateLoaded = 0; stopLayer(); // onlineTracker(); invitationIsOpen = false; } window.onload = onloadEvent; window.onresize = resetLayerLocation; function onloadEvent() { resetLayerLocation(); mainPositions(); } function checkInitiate_json(data) { var text = data.text; if ( typeof( text ) == "undefined" ) { text = ''; } document.getElementById('floatLayer_message_text_' + s_id).innerHTML = text; initiateFloatLayer( true ); toggle('floatLayer_message_' + s_id); initiateOpen = 1; } function checkInitiate() { // Check if site visitor has an Initiate Chat Request Pending for display... var imageWidth = this.width; var imageHeight = this.height; // Proactive message. if ( ( ( ( imageWidth == 2 && imageHeight == 2 ) || ( imageWidth == 3 && imageHeight == 3 ) ) && initiateOpen == 0) || initiateLoaded == 1 ) { if ( ! invitationIsOpen ) { if ( imageWidth == 3 && imageHeight == 3 ) { if ( typeof( jQuery ) == "undefined" ) { var time = currentTime(); var ajax_request_url = 'https://cpgarmor.com/wp-content/plugins/activehelper-livehelp/server/import/tracker.php?json&status_id=' + s_id + '&TIME=' + time + '&WIDTH=' + screen.width + '&HEIGHT=' + screen.height + '&USERID=&services='+ '&DOMAINID=' + _vlDomain + '&LANGUAGE=' + _vlLanguage + '&DIRECTION=' + _vldirection + '&SERVICE=' + _vlService + '&GET_INVITATION_MESSAGE=1&callback=?'; var head= document.getElementsByTagName('head')[0]; var script= document.createElement('script'); script.type= 'text/javascript'; script.src= ajax_request_url; head.appendChild(script); /* var ajax_request = new XMLHttpRequest(); ajax_request.onreadystatechange = function() { if ( ajax_request.readyState == 4 && ajax_request.status == 200 ) { var text = ajax_request.responseText; if ( typeof( text ) == "undefined" ) { text = ''; } document.getElementById('floatLayer_message_text_' + s_id).innerHTML = text; initiateFloatLayer( true ); toggle('floatLayer_message_' + s_id); initiateOpen = 1; } }; var time = currentTime(); var ajax_request_url = 'https://cpgarmor.com/wp-content/plugins/activehelper-livehelp/server/import/tracker.php?json&status_id=' + s_id + '&WIDTH=' + screen.width + '&HEIGHT=' + screen.height + '&TIME=' + time + '&USERID=&services='+ '&DOMAINID=' + _vlDomain + '&LANGUAGE=' + _vlLanguage + '&DIRECTION=' + _vldirection + '&SERVICE=' + _vlService + '&GET_INVITATION_MESSAGE=1&callback=?'; ajax_request.open( "GET", ajax_request_url, true ); ajax_request.send( null ); */ } else { var time = currentTime(); var ajax_request_url = 'https://cpgarmor.com/wp-content/plugins/activehelper-livehelp/server/import/tracker.php?json&status_id=' + s_id + '&WIDTH=' + screen.width + '&HEIGHT=' + screen.height + '&TIME=' + time + '&USERID=&services='+ '&DOMAINID=' + _vlDomain + '&LANGUAGE=' + _vlLanguage + '&DIRECTION=' + _vldirection + '&SERVICE=' + _vlService + '&GET_INVITATION_MESSAGE=1&callback=?'; jQuery.getJSON(ajax_request_url); // the result is going to call checkInitiate_json(data) } } else { initiateFloatLayer( false ); toggle('floatLayer_' + s_id); initiateOpen = 1; } // We play the sound in proactive message and invitation. if ("1" != 0 && typeof( Audio ) != "undefined" ) { var snd = new Audio(); if(!!(snd.canPlayType && snd.canPlayType('audio/ogg; codecs="vorbis"').replace(/no/, ''))) snd.src = "https://cpgarmor.com/wp-content/plugins/activehelper-livehelp/server/sounds/alert.ogg"; else if(!!(snd.canPlayType && snd.canPlayType('audio/mpeg;').replace(/no/, ''))) snd.src = "https://cpgarmor.com/wp-content/plugins/activehelper-livehelp/server/sounds/alert.mp3"; else if(!!(snd.canPlayType && snd.canPlayType('audio/mp4; codecs="mp4a.40.2"').replace(/no/, ''))) snd.src = "https://cpgarmor.com/wp-content/plugins/activehelper-livehelp/server/sounds/alert.m4a"; else snd.src = "https://cpgarmor.com/wp-content/plugins/activehelper-livehelp/server/sounds/alert.wav"; snd.play(); } } } } function openInfo(statusImage, e) { return false; if(_vlTracking == false){ return false; } window.clearTimeout(timerLiveHelpInfo); cancelClosingInfo(); var iLayerX = document['LiveHelpInfoContent_' + s_id].width; var iLayerY = document['LiveHelpInfoContent_' + s_id].height; var iPosX = statusImage.offsetLeft; var iPosY = statusImage.offsetTop; var iWidth = statusImage.clientWidth; var iHeight = statusImage.clientHeight; if (!iWidth) { iWidth = statusImage.offsetWidth; } obj = statusImage.offsetParent; while(obj != null){ iPosX += obj.offsetLeft; iPosY += obj.offsetTop; obj = obj.offsetParent; } var iCurrentY; var iCurrentX; var iScrollTop; var iScrollLeft; var iFindHeight; var iFindWidth; if (ns4) { iScrollTop = window.pageYOffset; iScrollLeft = window.pageXOffset; } else if(ns6) { iScrollTop = scrollY; iScrollLeft = scrollX; } else if(ie4) { iScrollTop = document.body.scrollTop; iScrollLeft = document.body.scrollLeft; iFindHeight = document.body.clientHeight; iFindWidth = document.body.clientWidth; } if (ns4 || ns6) { iFindHeight = window.innerHeight; iFindWidth = window.innerWidth; } infoImage = new Image(); infoImage.onload = infoImageLoad; var iMarginHeight = iFindHeight - (iHeight + iPosY - iScrollTop); var iMarginWidth = iFindWidth - (iWidth + iPosX - iScrollLeft); if (iMarginHeight < iLayerY && iPosY > iLayerY) { if (ie4) { document.all['LiveHelpInfo_' + s_id].style.background = 'url(' + infoImage.src + ')'; } else if (ns4) { eval("document.LiveHelpInfo_" + s_id + ".background = 'url(' + infoImage.src + ')'"); } else if(ns6) { document.getElementById('LiveHelpInfo_' + s_id).style.background = 'url(' + infoImage.src + ')'; } iNewX = iPosX - 15; iNewY = iPosY + 20 - iLayerY - 20; } else { if (ie4) { document.all['LiveHelpInfo_' + s_id].style.background = 'url(' + infoImage.src + ')'; } else if (ns4) { eval("document.LiveHelpInfo_" + s_id + ".background = 'url(' + infoImage.src + ')'"); } else if(ns6) { document.getElementById('LiveHelpInfo_' + s_id).style.background = 'url(' + infoImage.src + ')'; } iNewX = iPosX + 15; iNewY = iPosY + 20 + statusImage.height - 20; } if (iMarginWidth < iLayerX && iPosX > iLayerX) { iNewX = iPosX - iLayerX + 175; } else if (iMarginWidth > iLayerX && iPosX < iLayerX) { iNewX = iPosX + 25; } if (ie4) { document.all['LiveHelpInfo_' + s_id].style.pixelTop = iNewY; document.all['LiveHelpInfo_' + s_id].style.pixelLeft = iNewX; } else if (ns4) { eval("document.LiveHelpInfo_" + s_id + ".top = iNewY"); eval("document.LiveHelpInfo_" + s_id + ".left = iNewX"); } else if(ns6) { document.getElementById('LiveHelpInfo_' + s_id).style.top = iNewY + "px"; document.getElementById('LiveHelpInfo_' + s_id).style.left = iNewX + "px"; } if (infoImageLoaded == 1) { displayInfo(); } } function infoImageLoad() { infoImageLoaded = 1; } //TODO - Improve the method for displayInfo and closeInfo because this method is not using s_id directly function displayInfo() { if (infoOpen == 0) { timerLiveHelpInfo = window.setTimeout("toggle('LiveHelpInfo_1'); infoOpen = 1;", 2000); } } function closeInfo() { return false; window.clearTimeout(timerLiveHelpInfo); if (infoOpen == 1) { timerClosingLiveHelpInfo = window.setTimeout("toggle('LiveHelpInfo_1'); infoOpen = 0;", 500); } } function cancelClosingInfo() { window.clearTimeout(timerClosingLiveHelpInfo); } function openLiveHelp() { var timestamp_get = Math.round(+new Date()/1000); switch(s_id) { case 1 : { var winLiveHelp = window.open('https://cpgarmor.com/wp-content/plugins/activehelper-livehelp/server/index.php?' + timestamp_get + '&DOMAINID=' + _vlDomain + '&WIDTH=' + screen.width + '&HEIGHT=' + screen.height + '&AGENTID=' + _vlAgent + '&URL=' + document.location + '&TITLE=' + title + '&SERVER=https://cpgarmor.com&COOKIE=cpgarmor.com&LANGUAGE=' + _vlLanguage + '&DIRECTION=' + _vldirection + '&CHARSET=', 'SUPPORTER' + s_id + '_0', size) break } case 4 : { var winLiveHelp = window.open('https://cpgarmor.com/wp-content/plugins/activehelper-livehelp/server/webc_form.php?URL=' + document.location + '&TITLE=' + title + '&SERVER=https://cpgarmor.com&COOKIE=cpgarmor.com&LANGUAGE=&CHARSET=', 'SUPPORTER' + s_id + '_0', size) break } } if (winLiveHelp) { winLiveHelp.opener = self; } } function onlineTracker() { var trkUrl = ""; var time = currentTime(); if ( ie4 ) { if (document.all['initiateChatResponse_' + s_id]) { trackerLoaded = 1; } } else if ( ns4 ) { if(eval("document.initiateChatResponse_" + s_id)) { trackerLoaded = 1; } } else if ( ns6 ) { if(document.getElementById('initiateChatResponse_' + s_id)) { trackerLoaded = 1; } } if (trackingInitalized == 0) { //-- Geo Location data trkUrl = 'https://cpgarmor.com/wp-content/plugins/activehelper-livehelp/server/import/tracker.php?status_id=' + s_id + '&TIME='+ time + '&WIDTH=' + screen.width + '&HEIGHT=' + screen.height + '&TITLE=' + title + '&URL=' + document.location + '&REFERRER=' + referrer + '&COOKIE=cpgarmor.com&USERID=&services=' + '&LANGUAGE=' + _vlLanguage + '&DIRECTION=' + _vldirection + '&DOMAINID=' + _vlDomain + '&AGENTID=' + _vlAgent + '&SERVICE=' + _vlService + '®ion=' + region + '&country=' + country + '&city=' + city + '&countrycode=' + countrycode + '&latitude=' + latitude + '&longitude=' + longitude; trackerStatus.src = trkUrl; trackingInitalized = 1; } else { if (trackerLoaded == 1) { trkUrl = 'https://cpgarmor.com/wp-content/plugins/activehelper-livehelp/server/import/tracker.php?status_id=' + s_id + '&TIME=' + time + '&WIDTH=' + screen.width + '&HEIGHT=' + screen.height + '&USERID=&services='+ '&DOMAINID=' + _vlDomain + '&AGENTID=' + _vlAgent + '&LANGUAGE=' + _vlLanguage + '&DIRECTION=' + _vldirection + '&SERVICE=' + _vlService; trackerStatus.onload = checkInitiate; trackerStatus.src = trkUrl; } } // If the Site Visitor has been Idle for under the given idleTimeout then run the tracker timeElapsed = time - timeStart; if ((timeElapsed < idleTimeout) && (_vlTracking == true)) { window.clearTimeout(timerTracker); timerTracker = window.setTimeout('s' + s_id + '.onlineTracker();', 10000); } } onlineTracker(); } // Disable invitation // Invitation Refresh function startLivehelp() { var timestamp_get = Math.round(+new Date()/1000); //--- BEGIN GEO LOCATION --- var _vlGeolocationoff =0; if(_vlGeolocationoff !=1){ document.writeln(''); } //--- END GEO LOCATION --- // loadGeoLocation(); document.writeln(''); _vlnot_allowed_country="0"; // Insert invitation script _vldisableinvitation =0; html = ''; html += 'Accept'; html += 'Decline'; html += ''; html += ''; html += ''; var div = document.createElement( 'div' ); div.innerHTML = html; document.body.insertBefore( div, document.body.firstChild ); document.writeln(''); // Custom offline form var _vlExternalLink = 0; // not allowed conuntries restriction if (_vlnot_allowed_country ==0) { // Offline for custm form if ( _vlStatus_indicator && _vloffline ==1 &&_custom_offline_form !='') { document.writeln(''); document.writeln(''); _vlExternalLink =1; } // Regular chat option for domain if(_vlStatus_indicator && _vlExternalLink ==0 && _vlofftracking ==0 && _vlAgent ==0){ document.writeln(''); document.writeln(''); } else if(_vlStatus_indicator && _vlExternalLink ==0 && _vlofftracking ==0 && _vlAgent !=0){ document.writeln(''); document.writeln(''); } } }