var SCRIPT_VERSION = "1.1"; if (typeof(lpNumber) == "undefined") lpNumber = '72952164'; var lpUseFirstParty = ("true" == "false"); var lpUseSecureCookies = ("true" == "false"); var lpUseSessionCookies = ("true" == "false"); var LPLOCALVIDCOOKIE = lpNumber + '-VID'; var LPLOCALSKEYCOOKIE = lpNumber + '-SKEY'; var LPLOCALCONTAINERCOOKIE = 'HumanClickSiteContainerID_' + lpNumber; var maxImg30SequenceAllowed = 2; var maxAllowedIDFetch = 2; if (typeof(lpCustomInvitationTitle) == "undefined") lpCustomInvitationTitle = "invitation popup window for live chat with an online representative"; if (typeof(lpCustomInvitationCloseTitle) == "undefined") lpCustomInvitationCloseTitle = "Close Chat Invitation"; if (typeof(lpCustomInvitationLinkTitle) == "undefined") lpCustomInvitationLinkTitle = "invitation popup window for live chat with an online representative"; var hcUseRejectStatusCookie = ((typeof(lpSaveRejectStatus) != "undefined") && lpSaveRejectStatus); var hcUpdateState = 0; var pageLocation = document.location.toString(); var lpfcLocation = document.location.toString(); var lpfcProtocol = "http"; if ((lpfcLocation != null) && (lpfcLocation.indexOf("https:") == 0)) lpfcProtocol = "https"; var hcBase = lpfcProtocol + '://server.iad.liveperson.net/hc/'+lpNumber+'/'; var hcImageURL = lpFixProtocol("http://www.silkroad.com/SiteGen/Uploads/Public/SRT/Images/liveperson/"); if (typeof(lpCustomImageURL) != "undefined") hcImageURL = lpFixProtocol(lpCustomImageURL); var hcStaticImageURL = hcImageURL; var hcControlImage; var hcIsImage = false; var hcCounter = 0; var hcCmd = "knockPage"; var scriptType = "SERVERBASED"; var hcTimeout = 5; var hcSendCounter = 0; if (typeof(hcPageID) == "undefined") hcPageID = null; var hcLeft = -1; var hcTop = -1; var hcNS = (document.layers) ? true : false; var hcIE = (document.all) ? true : false; var hcDOM = (document.getElementById) ? true : false; var hcSafari = (navigator.userAgent) && (navigator.userAgent.toUpperCase().indexOf("SAFARI") >= 0); if (hcIE) hcDOM = false; var hcMAC = (navigator.platform) && (navigator.platform.toUpperCase().indexOf("MAC") >= 0); if (hcNS) hcMAC = false; var hcShowImage = false; var hcPos = - 30; var HumanStep = 3; var hcDir = HumanStep; var hcBorder = 100; var hcAnimate = false; var hcAnimateTimer = null; var hcOrigHcPos = null; var hcOrigHumanStep = null; var hcNeedImage; var hcCloseImage; var hcImageFetched = false; var hcimage = hcGetImage("hcIcon"); var hcicon = null; if (hcimage) { if (!(hcimage.length)) { var _lptemp = hcimage; hcimage = new Array(); hcimage[0] = _lptemp; } hcicon = new Array(); for (i = 0; i < hcimage.length; i++) { hcicon[i] = hcimage[i].src; } } var hcParam = null; var hcOpenVars = null; var hcLoadingImage = false; var hcLayerWidth = 400; var hcLayerHeight = 300; var hcClickURL; var HCinit = true; var lpForcePopup = ("{forcePopup}" == "true"); var visitorStatus = "INSITE_STATUS"; var lpActivePlugin = "none"; var lpTopFrame = null; var hcRejected = false; var hcFocusFlag = false; var lpIsVisitor = false; var lpVoiceEngageFlag = false; if ("{newChannel}" == "true") { var lpPosY = 100; var lpPosX = 100; var lpOperatorViewable= 'true'; var lpOperatorPageType= 'CoBrowse'; } if (hcDOM) { hcControlImage = document.createElement('IMG'); hcControlImage.style.visibility = "hidden"; document.body.appendChild(hcControlImage); } else if (hcMAC) { document.writeln("
"); hcControlImage = document.hcControlImage; } function lpFixProtocol(str) { if ((str != null) && (str.indexOf("http:") == 0) && (lpfcProtocol == "https")) return lpfcProtocol + str.substring(4); return str; } function hcGetObj(id) { if (document.getElementById) return document.getElementById(id); else if (document.all) return document.all(id); } function hcObjShow(obj) { if (hcNS) obj.visibility="show"; else obj.style.visibility="visible"; } function hcDate() { var d = new Date(); return d.getTime(); } function isJavaEnabled() { var rc = false; var agent = navigator.appName; ver= parseInt(navigator.appVersion); if (agent == "Microsoft Internet Explorer") { if ((ver >= 4) && navigator.javaEnabled()) rc = true; } else { for (i=0; i < navigator.plugins.length; i++) rc = rc || (navigator.plugins[i].name.toUpperCase().indexOf("JAVA") != -1); } return rc; } function lpFindCookie(key) { var s = document.cookie; var allCookies = s.split("; "); for (i = 0; i < allCookies.length; i++) { var keyval = allCookies[i].split("="); if (keyval != null && keyval.length == 2 && key == keyval[0]) return keyval[1]; } return ""; } function lpParseLocalVisitorID() { return lpFindCookie(LPLOCALVIDCOOKIE); } function lpParseLocalSessionKey() { return lpFindCookie(LPLOCALSKEYCOOKIE); } function lpParseLocalContainer() { return lpFindCookie(LPLOCALCONTAINERCOOKIE); } function lpSetOneFPCookie(name, value, expiry) { var mainDomain = lpParseDomain(); var cookieSet = name + "=" + value + ";path=/" + (lpUseSecureCookies ? ";secure" : "") + (expiry == null ? "" : (";expires=" + expiry)) + (mainDomain == null ? "" : (";domain=" + mainDomain)); document.cookie = cookieSet; } function lpParseDomain() { var mainDomain = null; try { var dom = document.location.host; var ar = dom.split("."); mainDomain = ar.length > 1? ("." + ar[ar.length-2]+ "." + ar[ar.length-1]) : null; if (mainDomain != null && mainDomain.indexOf(":") > 0) mainDomain = mainDomain.substring(0, mainDomain.indexOf(":")); } catch (e) { mainDomain = null; } return mainDomain; } var lpFPCookieSet = false; function lpSetFPCookies(id, skey, contid) { var d = new Date(); var newD = new Date(d.getTime() + (1000*60*60*24*365)); var expirydate = lpUseSessionCookies ? null : newD.toGMTString(); if (id != "-") lpSetOneFPCookie(LPLOCALVIDCOOKIE,id,expirydate); if (skey != "-") lpSetOneFPCookie(LPLOCALSKEYCOOKIE,skey,null); if(contid != "-") lpSetOneFPCookie(LPLOCALCONTAINERCOOKIE,contid,null); lpFPCookieSet = true; } function lpTestSetCookies() { var d = new Date(); var curTime = d.getTime(); var newD = new Date(curTime + (1000*10)); var expirydate = lpUseSessionCookies ? null : newD.toGMTString(); lpSetOneFPCookie("lptest", new String(curTime), expirydate); // set var ok = lpFindCookie("lptest") == new String(curTime); // check lpSetOneFPCookie("lptest", new String(curTime), "Thu, 1 Jan 1970 00:00:01 UTC"); // delete return ok; } var lpCanSetFPCookies = lpTestSetCookies(); var lpJavaSupport = isJavaEnabled(); function lpCreateScriptTag(srcURL) { if (! document.getElementsByTagName) return; var body = document.getElementsByTagName("body"); var scriptTag = document.createElement('script'); scriptTag.src= srcURL; if (document.body.firstChild != null) document.body.insertBefore(scriptTag, document.body.firstChild); else body.appendChild(scriptTag); } function lpAppendVisitorCookies(url) { var index = url.indexOf("?"); var siteContainerParam = lpParseLocalContainer(); if(siteContainerParam.length>0) { siteContainerParam = '&siteContainer=' + siteContainerParam; } if (index == -1) { var needsAmp = url.indexOf("&") != 0; url = '&visitor=' + lpParseLocalVisitorID() + '&msessionkey=' + lpParseLocalSessionKey() + siteContainerParam + ( needsAmp ? "&" : "") + url; } else { var firstChunk = url.substring(0, index + 1); var secondChunk = url.substring(index + 1); var needsAmp = secondChunk.indexOf("&") != 0; url = firstChunk + 'visitor=' + lpParseLocalVisitorID() + '&msessionkey=' + lpParseLocalSessionKey() + siteContainerParam + ( needsAmp ? "&" : "") + secondChunk; } return url; } var lpFetchReTries = 0; var lpFetchScriptCounter = 0; function lpVerifyFPCookie() { if (! lpFPCookieSet) { if (lpFetchScriptCounter-- <= 0) { if (lpFetchReTries++ > maxAllowedIDFetch) return; // we need to fetch the visitor ID before we can continue var tagSrc = hcBase + "?site=" + lpNumber + "&cmd=fetchVisitorID&callbackFunc=lpSetFPCookies('~id~', '~skey~', '~contid~');&d=" + hcDate(); tagSrc = lpAppendVisitorCookies(tagSrc); lpFetchScriptCounter = 5; lpCreateScriptTag(tagSrc); } setTimeout('lpVerifyFPCookie()', 1000); } else { if (hcCmd == "knockPage") hcCmd = "startPage"; hcloop(); } } function hcSendRequest() { hcSendCounter++; if (hcSendCounter == 5) hcIsImage = false; if (! hcIsImage) { if (hcDOM) { document.body.removeChild(hcControlImage); hcControlImage = document.createElement('IMG'); hcControlImage.style.visibility = "hidden"; hcControlImage.style.position = "absolute"; hcControlImage.style.top = "0px"; hcControlImage.style.left = "-5000px"; document.body.appendChild(hcControlImage); } else if (! hcMAC) hcControlImage= new Image; if (hcPageID==null) hcPageID=Math.round(Math.random()*9999999999); var windowname = lpTopFrame.name; if (windowname.length > 256) windowname = windowname.substring(0, 255); var u = hcBase + '?site=' + lpNumber + '&cmd=' + hcCmd + '&page=' + escape(pageLocation) + '&visitorStatus=' + escape(visitorStatus) + '&activePlugin=' + escape(lpTopFrame.lpActivePlugin) + '&pageWindowName=' + escape(windowname) + '&javaSupport=' + (lpJavaSupport ? "true" : "false") + '&id=' + hcPageID + '&scriptVersion=' + SCRIPT_VERSION + '&d=' + hcDate(); u = lpAppendVisitorCookies(u); if (hcCmd == "knockPage") hcCmd = "startPage"; else { if ((typeof(tagVars) != "undefined") && (tagVars != "")) { u = u + "&" + tagVars; } if ((typeof(customCommands) != "undefined") && (customCommands != "")) { u = u + "&" + customCommands; customCommands = ""; } if ((typeof(customStaticCommands) != "undefined") && (customStaticCommands != "")) { u = u + "&" + customStaticCommands; } var activateCobrowse = false; if ( false ) { u = u + "&cobrowse=true"; activateCobrowse = true; } if ( (typeof(lpOperatorViewable) != "undefined") && (lpOperatorViewable == "true") ) { if (! activateCobrowse) { u = u + "&cobrowse=true"; activateCobrowse = true; } if (typeof(lpOperatorPageType) != "undefined") { u = u + "&cobrowsetitle=" + escape(lpOperatorPageType); } if (typeof(lpOperatorPageUrl) != "undefined") { u = u + "&cobrowseurl=" + escape(lpOperatorPageUrl); } } if (scriptType != null) { u = u + "&scriptType=" + scriptType; scriptType = null; } hcCmd = "inPage"; if (activateCobrowse) { var cookies = document.cookie; if ((typeof(cookies) == "undefined") || (cookies == null)) cookies = ""; if (u.length <= 1990) while (escape(cookies).length + u.length > 1990) { var idx = cookies.lastIndexOf(";"); if (idx >= 0) cookies = cookies.substring(0, idx); else cookies = ""; } u = u + "&cookie=" + escape(cookies); } } if(typeof(document.title)!="undefined" && document.title.length>0){ u = u + '&title=' + escape(document.title); if(u.length>1990) u = u.substring(0,1990); } u = u + '&referrer='; var ref = escape(document.referrer); if (u.length + ref.length < 1990) u = u + ref; hcControlImage.src = u; hcIsImage = true; hcSendCounter = 0; } } function hcPlaceLayersIE() { } function hcPlaceLayersNS() { } function hcHandlePopup(w, h) { } var hcImg30Sequence = 0; var hclastW = -1; var hclastH = -1; function hcHandleWidthHeight(w,h) { if (hcMAC && (hclastH == h) && (hclastW == w) && !(w == 30 && h == 1) && !(w == 80 && h == 1)) return; hclastH = h; hclastW = w; if (h==1) { var wCode = w-w%2; var more = w%2; if (wCode > 30 && hcCmd=="inPage") { if (typeof(lpVisitorDependantCode) != "undefined") { for (i = 0; i < lpVisitorDependantCode.length; i++) { var tempfunc = lpVisitorDependantCode[i]; tempfunc(); } lpVisitorDependantCode = new Array(); } } if (wCode == 30) { hcImg30Sequence++; if (hcImg30Sequence == maxImg30SequenceAllowed) hcTimeout = -1; } else if (wCode == 40) { hcTimeout = 10; } else if (wCode == 42) { // do nothing response } else if (wCode == 50) { hcTimeout = 30; } else if (wCode == 60) { openChat(null, null, true); } else if (wCode == 70) { lpVoiceEngageFlag = false; openEngageChat("engage", null); } else if (wCode == 72) { lpVoiceEngageFlag = false; openCustomEngageChat("engage", null); } else if (wCode == 74) { openEngageVoice("engage", null); } else if (wCode == 76) { openCustomEngageVoice("engage", null); } else if (wCode == 80) { hcReloadIcon(); } else if (wCode == 90) { hcCounter=0; hcTimeout = 1; } else if (wCode == 100) { lpTopFrame.lpActivePlugin = "none"; lpTopFrame.cb_bInjecting = false; } else if (wCode == 110) { lpTopFrame.lpActivePlugin = "PCB"; setTimeout('activateCobrowsePlugin()', Math.round(Math.random()*100)); } else if (wCode == 130) { handleRedirectCommand(false); } else if (wCode == 132) { handleRedirectCommand(true); } else if (wCode == 140) { openChat(null, "Pushed=true", true); } else if (wCode == 150) { visitorStatus = "INSITE_STATUS"; hcHideTheImage(); } else if (wCode == 152) { visitorStatus = "CHAT_STATUS"; lpClearRejectState(); hcHideTheImage(); } else if (wCode == 154) { visitorStatus = "REJECT_STATUS"; saveLPReject(); hcHideTheImage(); } else if (wCode == 156) { visitorStatus = "ENGAGE_STATUS"; } else if (wCode == 160) { //change container id (FPC) to primary if(lpFPCookieSet) { lpSetOneFPCookie(LPLOCALCONTAINERCOOKIE,'primary',null); } //todo: send inPage now //hcCounter=0; hcTimeout = 0; console.log("image 160 response, set timeout to 0"); } if (wCode != 30){ hcImg30Sequence = 0; if(hcCmd=="inPage") { tagVars = ""; lpIsVisitor = true; } } if (more==1) { hcCounter=0; hcTimeout=1; } } else { var modLength=1000; var wLength=w%modLength; var hLength=h%modLength; var wCode=(w-wLength)/modLength; var hCode=(h-hLength)/modLength; if (wCode == 4) { if (visitorStatus == "ENGAGE_STATUS") setTimeout('hcInvitationTimeout()', 1000 * wLength + 10); } else if (typeof(hcHandlePopup) != "undefined") hcHandlePopup(w, h); } } function lpClearRejectState() { LPsetCookie("REJECT", ""); } function saveLPReject() { if (! hcUseRejectStatusCookie) return; if (typeof(lpRejectStateTimeout) != "undefined") LPsetCookie("REJECT", new String(new Date().getTime() + (lpRejectStateTimeout * 1000))); else LPsetCookie("REJECT", "TRUE"); } function getLPReject() { if (! hcUseRejectStatusCookie) return ""; return LPgetCookie("REJECT"); } function lpIsNumber(a) { return typeof a == 'number' && isFinite(a); } function hasValidLPRejectedCookie() { if (! hcUseRejectStatusCookie) return false; var cook = getLPReject(); if (cook == "TRUE") return true; if (cook == null || cook == "") return false; var timeout = parseInt(cook); if (lpIsNumber(timeout)) { return new Date().getTime() < timeout; } else return false; } function LPgetCookie(lpCookieSuffixName) { var search = "BEGIN" + lpCookieSuffixName + "="; if (document.cookie.length > 0) { offset = document.cookie.indexOf(search); if (offset != -1) { offset += search.length var endstr = "END" + lpCookieSuffixName; end = document.cookie.indexOf(endstr, offset); var retval = document.cookie.substring(offset, end); return retval; } } return ""; } function LPsetCookie(lpCookieSuffixName, value) { if (! hcUseRejectStatusCookie) return; var search = "BEGIN" + lpCookieSuffixName + "="; var endstr = "END" + lpCookieSuffixName; var newval = search+value+endstr; document.cookie = newval; } function handleRedirectCommand(newPage) { var s = hcBase + '?site='+lpNumber + '&cmd=visitorRedirect' + '&defaultURL=' + escape(document.location) + '&d=' + hcDate(); s = lpAppendVisitorCookies(s); if (newPage) { var attr = "screenX=0,screenY=0,left=0,top=0,scrollbars=1,alwaysLowered=0,alwaysRaised=0,channelmode=0,dependent=0,directories=0,fullscreen=0,hotkeys=1,location=1,menubar=1,toolbar=1,status=1,titlebar=1,z-lock=0,resizable=1"; attr = attr + ",height=" + (screen.availHeight - 120) + ",width=" + (screen.availWidth - (document.all ? 20 : 10)); window.open(s, "HCPushWindow", attr); } else document.location = s; } function activateCobrowsePlugin() { with (lpTopFrame) { if (typeof(cb_bInjecting)!="undefined" && cb_bInjecting) return; cb_bInjecting = true; if ((typeof(document["CBAgent"])=="undefined") || (document["CBAgent"] == null)) { var scrtag1 = ' ');
hcWriteDoc('![]() |