/* * heatmap.js v2.0.5 | JavaScript Heatmap Library * * Copyright 2008-2016 Patrick Wied - All rights reserved. * Dual licensed under MIT and Beerware license * * :: 2016-09-05 01:16 */ (function(a,b,c){if(typeof module!=="undefined"&&module.exports){module.exports=c()}else if(typeof define==="function"&&define.amd){define(c)}else{b[a]=c()}})("h337",this,function(){var a={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}};var b=function h(){var b=function d(a){this._coordinator={};this._data=[];this._radi=[];this._min=10;this._max=1;this._xField=a["xField"]||a.defaultXField;this._yField=a["yField"]||a.defaultYField;this._valueField=a["valueField"]||a.defaultValueField;if(a["radius"]){this._cfgRadius=a["radius"]}};var c=a.defaultRadius;b.prototype={_organiseData:function(a,b){var d=a[this._xField];var e=a[this._yField];var f=this._radi;var g=this._data;var h=this._max;var i=this._min;var j=a[this._valueField]||1;var k=a.radius||this._cfgRadius||c;if(!g[d]){g[d]=[];f[d]=[]}if(!g[d][e]){g[d][e]=j;f[d][e]=k}else{g[d][e]+=j}var l=g[d][e];if(l>h){if(!b){this._max=l}else{this.setDataMax(l)}return false}else if(l0){var a=arguments[0];var b=a.length;while(b--){this.addData.call(this,a[b])}}else{var c=this._organiseData(arguments[0],true);if(c){if(this._data.length===0){this._min=this._max=c.value}this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[c]})}}return this},setData:function(a){var b=a.data;var c=b.length;this._data=[];this._radi=[];for(var d=0;d0){this._drawAlpha(a);this._colorize()}},renderAll:function(a){this._clear();if(a.data.length>0){this._drawAlpha(c(a));this._colorize()}},_updateGradient:function(b){this._palette=a(b)},updateConfig:function(a){if(a["gradient"]){this._updateGradient(a)}this._setStyles(a)},setDimensions:function(a,b){this._width=a;this._height=b;this.canvas.width=this.shadowCanvas.width=a;this.canvas.height=this.shadowCanvas.height=b},_clear:function(){this.shadowCtx.clearRect(0,0,this._width,this._height);this.ctx.clearRect(0,0,this._width,this._height)},_setStyles:function(a){this._blur=a.blur==0?0:a.blur||a.defaultBlur;if(a.backgroundColor){this.canvas.style.backgroundColor=a.backgroundColor}this._width=this.canvas.width=this.shadowCanvas.width=a.width||this._width;this._height=this.canvas.height=this.shadowCanvas.height=a.height||this._height;this._opacity=(a.opacity||0)*255;this._maxOpacity=(a.maxOpacity||a.defaultMaxOpacity)*255;this._minOpacity=(a.minOpacity||a.defaultMinOpacity)*255;this._useGradientOpacity=!!a.useGradientOpacity},_drawAlpha:function(a){var c=this._min=a.min;var d=this._max=a.max;var a=a.data||[];var e=a.length;var f=1-this._blur;while(e--){var g=a[e];var h=g.x;var i=g.y;var j=g.radius;var k=Math.min(g.value,d);var l=h-j;var m=i-j;var n=this.shadowCtx;var o;if(!this._templates[j]){this._templates[j]=o=b(j,f)}else{o=this._templates[j]}var p=(k-c)/(d-c);n.globalAlpha=p<.01?.01:p;n.drawImage(o,l,m);if(lthis._renderBoundaries[2]){this._renderBoundaries[2]=l+2*j}if(m+2*j>this._renderBoundaries[3]){this._renderBoundaries[3]=m+2*j}}},_colorize:function(){var a=this._renderBoundaries[0];var b=this._renderBoundaries[1];var c=this._renderBoundaries[2]-a;var d=this._renderBoundaries[3]-b;var e=this._width;var f=this._height;var g=this._opacity;var h=this._maxOpacity;var i=this._minOpacity;var j=this._useGradientOpacity;if(a<0){a=0}if(b<0){b=0}if(a+c>e){c=e-a}if(b+d>f){d=f-b}var k=this.shadowCtx.getImageData(a,b,c,d);var l=k.data;var m=l.length;var n=this._palette;for(var o=3;o0){r=g}else{if(p>0;return b},getDataURL:function(){return this.canvas.toDataURL()}};return d}();var d=function j(){var b=false;if(a["defaultRenderer"]==="canvas2d"){b=c}return b}();var e={merge:function(){var a={};var b=arguments.length;for(var c=0;c 3) { parts.shift(); } if (parts.length === 3 && ((parts[1].length > 2 && parts[2].length > 2) || (secondTLDs.indexOf(parts[1]) === -1) && firstTLDs.indexOf(parts[2]) === -1)) { parts.shift(); } return parts.join('.'); }; var thisdomainname=getSubdomain(window.location.host); function ROC_sitebam_persist_setCookie(cname, cvalue, exdays) { if (exdays==0) { document.cookie = cname + "=" + cvalue + ";path=/;samesite=none;Secure;"; } else { var d = new Date(); d.setTime(d.getTime() + (exdays*24*60*60*1000)); var expires = "expires="+ d.toUTCString(); document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/;SameSite=None;Secure;"; } } function ROC_sitebam_persist_getCookie(cname) { var name = cname + "="; var decodedCookie = decodeURIComponent(document.cookie); var ca = decodedCookie.split(';'); for(var i = 0; i 0) return parseInt(sAgent.substring(Idx+ 5, sAgent.indexOf(".", Idx))); // If IE 11 then look for Updated user agent string. else if (!!navigator.userAgent.match(/Trident\/7\./)) return 11; else return 0; //It is not IE } function ROC_sitebam_SR_setupnewpage() { //We now have a traceid //Add a new page entry as the page must have been refreshed to run this //http://remote.sitebam.com/pers/pers.asp?action=page&usr=1&trc=1&url=https://www.test.com //Get a new pageseqid var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { ROC_sitebam_thispageseqid=this.responseText; //start recording ROC_sitebam_record(); } }; thisurl=encodeURI(window.location.href); xhttp.open("GET", "https://remote.sitebam.com/pers/pers.asp?action=page&usr="+ROC_sitebam_thissitebamid+'&trc='+ROC_sitebam_thistraceid+'&tcurl='+thisurl+'&dm='+encodeURI(window.location.hostname), true); xhttp.timeout = 2000; xhttp.send(); } ROC_sitebam_RecStParam=ROC_sitebam_SR_getqueryparam('SRpb'); if (ROC_sitebam_RecStParam) { if (ROC_sitebam_RecStParam=='OK') { ROC_sitebam_iu=true; //begin playback ROC_sitebam_isPlayback=true; ROC_sitebam_thistraceid=ROC_sitebam_SR_getqueryparam('SRtrcid'); if (!ROC_sitebam_SR_getqueryparam('SRpsid')) { ROC_sitebam_thispageseqid=1; } else { if (ROC_sitebam_SR_getqueryparam('SRpsid')=='') { ROC_sitebam_thispageseqid=1; } else { ROC_sitebam_thispageseqid=ROC_sitebam_SR_getqueryparam('SRpsid'); } } } } //ROC_sitebam_eraseCookie('SEOTBtrace'); var ROC_sitebam_thisfulldata; function ROC_sitebam_getplayback(fromPos) { ROC_sitebam_thisfulldata=[]; //Playback the recording for this page. //load the ROC_sitebam_mousePos array with all the data for this page var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { ROC_sitebam_thisfulldata=this.responseText; if (ROC_sitebam_thisfulldata=='0|0|5!0|0|4') { ROC_sitebam_isPlayback=false; alert('Playback has finished'); } else { //console.log(ROC_sitebam_thisfulldata); //now to reload the array from this data //data is in triplets x,y,action separated by ! var SRtriplets = ROC_sitebam_thisfulldata.split("!"); var icount; var SRtripletData; var SRtripletRow; for (icount = 0; icount < SRtriplets.length; icount++) { SRtripletRow=SRtriplets[icount]; SRtripletData=SRtripletRow.split("|"); ROC_sitebam_mousePos.push([SRtripletData[0],SRtripletData[1],SRtripletData[2]]); ROC_sitebam_mouseEventsCount++; } ROC_sitebam_playback(); } } }; //console.log("https://remote.sitebam.com/pers/pers.asp?action=play&trc="+ROC_sitebam_thistraceid+"&usr="+ROC_sitebam_thissitebamid+'&psi='+ROC_sitebam_thispageseqid+'&sr_rk='+ROC_sitebam_thisrandomkey); xhttp.open("GET", "https://remote.sitebam.com/pers/pers.asp?action=play&trc="+ROC_sitebam_thistraceid+"&usr="+ROC_sitebam_thissitebamid+'&psi='+ROC_sitebam_thispageseqid+'&sr_rk='+ROC_sitebam_thisrandomkey+'&fp='+fromPos+'&dm='+encodeURI(window.location.hostname), true); xhttp.timeout = 2000; xhttp.send(); } if (navigator.cookieEnabled) { ROC_sitebam_oktorecord=true; } else { ROC_sitebam_oktorecord=false; }; if (ROC_sitebam_isPlayback) { ROC_sitebam_getplayback(0); } else { if (ROC_sitebam_oktorecord) { //begin recording var ROC_sitebam_gettraceid = ROC_sitebam_getCookie('SEOTBtrace'); //Get the new traceid or check the cookie one is still valid. var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { ROC_sitebam_thistraceid=this.responseText; if (ROC_sitebam_thistraceid=='NODOM') { console.log("SiteBam - No Domain"); } else { if (ROC_sitebam_thistraceid=='MAXEXC') { console.log("SiteBam - need to upgrade"); } else { if (ROC_sitebam_thistraceid=='NOUSR') { console.log("SiteBam - no user"); } else { if (ROC_sitebam_thistraceid=='NOIP') { console.log("SiteBam - no ip"); } else { ROC_sitebam_setCookie('SEOTBtrace',ROC_sitebam_thistraceid,60); ROC_sitebam_SR_setupnewpage(); ROC_sitebam_thisgoogleadstraceid=ROC_sitebam_thistraceid; } } } } //Process adwords check ROC_sitebam_googleadscheck(ROC_sitebam_thisgoogleadstraceid); } }; xhttp.open("GET", "https://remote.sitebam.com/pers/pers.asp?action=trace&trc="+ROC_sitebam_gettraceid+"&usr="+ROC_sitebam_thissitebamid+'&dm='+encodeURI(window.location.hostname)+'&ip=3.147.65.111&dv=1&srw='+SR_screenwidth+'&srh='+ SR_screenheight+'&dmns='+thisdomainname, true); xhttp.timeout = 2000; xhttp.send(); } } if (ROC_sitebam_oktorecord) { //now for mouse recording document.onmousemove = function(e){ if (ROC_sitebam_recordingon) { //ROC_sitebam_mousePos.push([e.pageX, e.pageY,0]); ROC_sitebam_mousePos.push([parseInt(e.pageX,10), parseInt(e.pageY,10),0]); ROC_sitebam_mouseEventsCount++; ROC_sitebam_checkmouseEvents(); } }; document.body.onclick = function(e) { if (ROC_sitebam_recordingon) { //ROC_sitebam_mousePos.push([e.clientX, e.clientY,1]); //ROC_sitebam_mousePos.push([parseInt(e.clientX,10), parseInt(e.clientY,10),1]); ROC_sitebam_mousePos.push([parseInt(e.pageX,10), parseInt(e.pageY,10),1]); ROC_sitebam_mouseEventsCount++; //ROC_sitebam_savealldata(false); ROC_sitebam_checkmouseEvents(); } }; } window.onscroll = function() { if (ROC_sitebam_recordingon) { var bodyScrollTop = document.documentElement.scrollTop || document.body.scrollTop; ROC_sitebam_mousePos.push([bodyScrollTop, bodyScrollTop,2]); ROC_sitebam_mouseEventsCount++; ROC_sitebam_checkmouseEvents(); } }; var ROC_sitebam_icount =0; var ROC_sitebam_thisplay; function ROC_sitebam_checkmouseEvents() { if (ROC_sitebam_mouseEventsCount>=190) { ROC_sitebam_savealldata(true); } } function ROC_sitebam_reset() { ROC_sitebam_icount=0; } function ROC_sitebam_record() { if (ROC_sitebam_recordingon) { ROC_sitebam_recordingon=false; } else { ROC_sitebam_mousePos=[]; ROC_sitebam_mouseEventsCount=0; ROC_sitebam_recordingon=true; //Record initial scroll position var bodyScrollTop = document.documentElement.scrollTop || document.body.scrollTop; ROC_sitebam_mousePos.push([bodyScrollTop, bodyScrollTop,2]); ROC_sitebam_mouseEventsCount++; ROC_sitebam_mousePos.push([bodyScrollTop, bodyScrollTop,2]); ROC_sitebam_mouseEventsCount++; } } function ROC_sitebam_stoprec() { clearInterval(ROC_sitebam_thisplay) ROC_sitebam_recordingon=false; document.getElementById('btnrecord').innerHTML = 'Record'; } function ROC_sitebam_showclick(thisToppos,thisLeftpos) { document.getElementById('SEOToolBox_clk').innerHTML=""; document.getElementById('SEOToolBox_clk').style.top=thisToppos-40+'px'; document.getElementById('SEOToolBox_clk').style.left=thisLeftpos-40+'px'; document.getElementById('SEOToolBox_clk').style.display='block'; thisClick=setTimeout(function () { document.getElementById('SEOToolBox_clk').style.display='none'; clearInterval(thisClick); }, 1000); } function ROC_sitebam_playback() { var SEOToolBox_ptr = document.createElement("div"); SEOToolBox_ptr.setAttribute("id", "SEOToolBox_ptr"); SEOToolBox_ptr.style.position = "absolute"; SEOToolBox_ptr.style.width = "32px"; SEOToolBox_ptr.style.top = "-100%"; SEOToolBox_ptr.style.zIndex = "999999"; SEOToolBox_ptr.innerHTML=""; document.body.appendChild(SEOToolBox_ptr); var SEOToolBox_clk = document.createElement("div"); SEOToolBox_clk.setAttribute("id", "SEOToolBox_clk"); SEOToolBox_clk.style.position = "absolute"; SEOToolBox_clk.style.width = "32px"; SEOToolBox_clk.style.height = "32px"; SEOToolBox_clk.style.top = "-100%"; SEOToolBox_clk.style.zIndex = "999998"; SEOToolBox_clk.innerHTML=""; document.body.appendChild(SEOToolBox_clk); var ROC_sitebam_pCon = document.createElement("div"); ROC_sitebam_pCon.id = "ROC_sitebam_pCon"; ROC_sitebam_pCon.style.position = "fixed"; ROC_sitebam_pCon.style.left = "0px"; ROC_sitebam_pCon.style.top = "0px"; ROC_sitebam_pCon.style.height = "17px"; ROC_sitebam_pCon.style.width = "100px"; ROC_sitebam_pCon.style.backgroundColor = "#ddd"; ROC_sitebam_pCon.style.zIndex = "999998"; var ROC_sitebam_pBar = document.createElement("div"); ROC_sitebam_pBar.id = "ROC_sitebam_pBar"; ROC_sitebam_pBar.style.position = "absolute"; ROC_sitebam_pBar.style.left = "0px"; ROC_sitebam_pBar.style.bottom = "0px"; ROC_sitebam_pBar.style.lineHeight = "17px"; ROC_sitebam_pBar.style.width = "0px"; ROC_sitebam_pBar.style.fontSize = "small"; ROC_sitebam_pBar.style.backgroundColor = "#4CAF50"; ROC_sitebam_pBar.style.color = "#000000"; ROC_sitebam_pBar.innerHTML = "0%"; ROC_sitebam_pBar.style.textAlign = "center"; ROC_sitebam_pBar.style.verticalAlign='middle'; ROC_sitebam_pCon.appendChild(ROC_sitebam_pBar); document.body.appendChild(ROC_sitebam_pCon); ROC_sitebam_icount=0; ROC_sitebam_recordingon=false; clearInterval(ROC_sitebam_thisplay); document.body.scrollTop=0; document.documentElement.scrollTop=0; //document.getElementById('btnrecord').innerHTML = 'Record'; ROC_sitebam_thisplay=setInterval(function(){ROC_sitebam_animcursor();} , 30); } function ROC_sitebam_animcursor() { if (ROC_sitebam_icount<=ROC_sitebam_mousePos.length) { ROC_sitebam_playbackProgress((100/ROC_sitebam_mousePos.length)*ROC_sitebam_icount) document.getElementById('SEOToolBox_ptr').style.display='block'; ROC_sitebam_icount=ROC_sitebam_icount+1; move= ROC_sitebam_mousePos[ROC_sitebam_icount]; if (move!=undefined) { if( move[2]==1) { var SR_checknext=ROC_sitebam_mousePos[ROC_sitebam_icount+2]; var SR_oktoclick=true; if (SR_checknext!=undefined) { if (SR_checknext[2]==5) { SR_oktoclick=false; } } document.getElementById('SEOToolBox_ptr').style.display='none'; if (document.elementFromPoint(move[0], move[1])&&SR_oktoclick) { if (document.elementFromPoint(move[0], move[1]).tagName=="A") { if (document.elementFromPoint(move[0], move[1]).href) { var SR_href=document.elementFromPoint(move[0], move[1]).href; if (SR_href.substring(0, 4)=='http') { SR_oktoclick=false; } } } if (SR_oktoclick) { document.elementFromPoint(move[0], move[1]).click(); } } ROC_sitebam_showclick(move[1],move[0]); document.getElementById('SEOToolBox_ptr').style.display='block'; //this is a click } else { if( move[2]==2) { document.body.scrollTop=move[1]; document.documentElement.scrollTop=move[1]; } else { if( move[2]==3) { window.location.href=move[0]; } else { if( move[2]==4) { ROC_sitebam_getplayback(ROC_sitebam_icount); return; //alert('Playback has finished'); } else { if(move[2]==5) { //do nothing } else { document.getElementById('SEOToolBox_ptr').style.display='block'; document.getElementById('SEOToolBox_ptr').innerHTML=""; document.getElementById('SEOToolBox_ptr').style.top=move[1]-10+'px'; document.getElementById('SEOToolBox_ptr').style.left=move[0]-10+'px'; } } } } } } } else { document.getElementById('SEOToolBox_ptr').style.display='none'; clearInterval(ROC_sitebam_thisplay); } } function ROC_sitebam_playbackProgress(ROC_sitebam_playbackperc) { var ROC_sitebam_playback_elem = document.getElementById("ROC_sitebam_pBar"); ROC_sitebam_playback_elem.style.width = ROC_sitebam_playbackperc + '%'; document.getElementById('ROC_sitebam_pBar').innerHTML=ROC_sitebam_playbackperc.toFixed(0) + '%'; } function ROC_sitebam_savealldata(useasync) { //reset array and dump out array. var thisMEstring=''; var thisisample=0; for (var i = 0; i < ROC_sitebam_mousePos.length&&i<200; i++) { //change thisissample to use sampled data thisisample++; if (thisisample>1) { thisisample=0; move= ROC_sitebam_mousePos[i]; //thisMEstring=thisMEstring+move[0]+'|'+move[1]+'|'+move[2]+'!' thisMEstring=thisMEstring+move[0].toFixed(0)+'|'+move[1].toFixed(0)+'|'+move[2].toFixed(0)+'!' } } if (thisMEstring!='') { ROC_sitebam_sendalldata(thisMEstring,useasync); } ROC_sitebam_mousePos=[]; ROC_sitebam_mouseEventsCount=0; } function ROC_sitebam_sendalldata(thisvalstosave,useasync) { ROC_sitebam_ilimiter=ROC_sitebam_ilimiter+100 if (ROC_sitebam_ilimiter<20000) { if (useasync) { //send all data to server async //Get a new pageseqid var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { //do nothing } }; thisdatachunk=encodeURI(thisvalstosave); thisurl=encodeURI(window.location.href); //console.log("https://remote.sitebam.com/pers/pers.asp?action=data&usr="+ROC_sitebam_thissitebamid+'&trc='+ROC_sitebam_thistraceid+'&psi='+ROC_sitebam_thispageseqid+'&dc='+thisdatachunk+'&tcurl='+thisurl+'&dm='+encodeURI(window.location.hostname)); xhttp.open("POST", "https://remote.sitebam.com/pers/pers.asp?action=data&usr="+ROC_sitebam_thissitebamid+'&trc='+ROC_sitebam_thistraceid+'&psi='+ROC_sitebam_thispageseqid+'&dc='+thisdatachunk+'&tcurl='+thisurl+'&dv=1&srw='+SR_screenwidth+'&srh='+ SR_screenheight+'&dm='+encodeURI(window.location.hostname), true); xhttp.timeout = 2000; xhttp.send(); } else { //Use sync - used on nav away from page var xhttp = new XMLHttpRequest(); thisdatachunk=encodeURI(thisvalstosave); thisurl=encodeURI(window.location.href); xhttp.open("POST", "https://remote.sitebam.com/pers/pers.asp?action=data&usr="+ROC_sitebam_thissitebamid+'&trc='+ROC_sitebam_thistraceid+'&psi='+ROC_sitebam_thispageseqid+'&dc='+thisdatachunk+'&tcurl='+thisurl+'&dv=1&srw='+SR_screenwidth+'&srh='+ SR_screenheight+'&dm='+encodeURI(window.location.hostname), false); xhttp.send(); if (xhttp.status === 200) { //console.log('Saved onunload'); } } } } if (ROC_sitebam_SR_getqueryparam("SRhmm")=='OK'||ROC_sitebam_SR_getqueryparam("SRhmc")=='OK') { ROC_sitebam_iu=true; var SEOToolBox_heatmap = document.createElement("div"); SEOToolBox_heatmap.setAttribute("id", "SEOToolBox_heatmap"); SEOToolBox_heatmap.style.position = "absolute"; SEOToolBox_heatmap.style.width = "100%"; SEOToolBox_heatmap.style.height = "100%"; SEOToolBox_heatmap.style.top = "0px"; SEOToolBox_heatmap.style.left = "0px"; SEOToolBox_heatmap.style.zIndex = "9999999"; //SEOToolBox_heatmap.innerHTML = "9999999"; //document.body.appendChild(SEOToolBox_heatmap); if (typeof h337 === 'undefined') { console.log('Heatmap script is not included on this page - see instructions to add'); } else { //hmm is mouse hmc is clicks //Get the data from server var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { //Display the heatmap ROC_sitebam_thisfulldata=this.responseText; //console.log(ROC_sitebam_thisfulldata); //now to reload the array from this data //data is in pairs x,y,count separated by ! var SRtriplets = ROC_sitebam_thisfulldata.split("!"); var icount; var SRtripletData; var SRtripletRow; var HMpoints = []; var HMmax = 0; var HMwidth = SR_screenwidth; var HMheight = SR_screenheight; for (icount = 0; icount < SRtriplets.length; icount++) { SRtripletRow=SRtriplets[icount]; SRtripletData=SRtripletRow.split("|"); ROC_sitebam_mousePos.push([SRtripletData[0],SRtripletData[1],SRtripletData[2]]); var HMpoint = { x: Math.floor(SRtripletData[0]), y: Math.floor(SRtripletData[1]), value: SRtripletData[2] }; HMpoints.push(HMpoint); HMmax = Math.max(HMmax, SRtripletData[2]); } var HMdata = { max: HMmax, data: HMpoints }; //var heatmapInstance = h337.create({container: document.getElementById('SEOToolBox_heatmap')}); var heatmapInstance = h337.create({container: document.body}); heatmapInstance.setData(HMdata); document.getElementsByClassName('heatmap-canvas')[0].style.zIndex = 1000000; } }; //thisurl=encodeURI(ROC_sitebam_SR_getqueryparam("urltc")); //thisscw=encodeURI(ROC_sitebam_SR_getqueryparam("scw")); //thissch=encodeURI(ROC_sitebam_SR_getqueryparam("sch")); thisurl=ROC_sitebam_SR_getqueryparam("urltc"); thisscw=ROC_sitebam_SR_getqueryparam("scw"); thissch=ROC_sitebam_SR_getqueryparam("sch"); if (ROC_sitebam_SR_getqueryparam("SRhmm")=='OK') { thisaction='SRhmm'; } else { thisaction='SRhmc'; } xhttp.open("GET", "https://remote.sitebam.com/pers/pers.asp?action="+thisaction+"&usr="+ROC_sitebam_thissitebamid+"&tcurl="+thisurl+"&srw="+thisscw+"&srh="+thissch+"&sr_rk="+ROC_sitebam_thisrandomkey+'&dm='+encodeURI(window.location.hostname), true); xhttp.timeout = 2000; xhttp.send(); } } if (ROC_sitebam_SR_getqueryparam("SRsm")=='OK') { ROC_sitebam_iu=true; //create 10 divs each 100px high for (thissection = 0; thissection < 50; thissection++) { var SEOToolBox_scrollmap = document.createElement("div"); SEOToolBox_scrollmap.setAttribute("id", "SEOToolBox_scrollmap"+thissection); SEOToolBox_scrollmap.style.position = "absolute"; SEOToolBox_scrollmap.style.width = "100%"; SEOToolBox_scrollmap.style.height = "100px"; SEOToolBox_scrollmap.style.opacity="0.5"; SEOToolBox_scrollmap.style.top = thissection*100+"px"; SEOToolBox_scrollmap.style.left = "0px"; SEOToolBox_scrollmap.style.zIndex = "9999999"; document.body.appendChild(SEOToolBox_scrollmap); } //Get the data from server var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { //Display the scrollmap ROC_sitebam_thisfulldata=this.responseText; //console.log(ROC_sitebam_thisfulldata); //now to reload the array from this data //data is a list of colurs separated by | var SRcolours = ROC_sitebam_thisfulldata.split("|"); var thissection; var prevcolour='000000'; var nextcolour='000000'; var thiscolour='000000'; for (thissection = 0; thissection < 50; thissection++) { //loop through the sections //thissection is the div //icount is where we are in the data if (thissection=0 ) { if (thissection-1=targetheight) { //do nothing } else { function frame() { thisheight=thisheight+10; elem.style.height = thisheight + 'px' if (thisheight >= targetheight) clearInterval(id) } var id = setInterval(frame, 10) } } function ROC_sitebam_AnimDown(elem,targetheight) { var thisheight = elem.offsetHeight; if (thisheight<=targetheight) { //do nothing } else { function frame() { thisheight=thisheight-10; elem.style.height = thisheight + 'px' if (thisheight <= targetheight) clearInterval(id) } var id = setInterval(frame, 10) } } function ROC_sitebam_openChat() { ROC_sitebam_AnimUp(document.getElementById('ROC_sitebam_chatFeature'),310) document.getElementById('ROC_sitebam_openChat').style.display='none'; document.getElementById('ROC_sitebam_chatSpTtl1').innerHTML="Online Chat"; document.getElementById('ROC_sitebam_chatMain').style.display='block'; ROC_sitebam_chat_doPoll(); if (document.getElementById('ROC_sitebam_chat_name').value!='') { ROC_sitebam_initChat(); } }; function ROC_sitebam_closeChat() { ROC_sitebam_AnimDown(document.getElementById('ROC_sitebam_chatFeature'),50) document.getElementById('ROC_sitebam_openChat').style.display='block'; document.getElementById('ROC_sitebam_chatSpTtl1').innerHTML="Online - Start Chat?"; document.getElementById('ROC_sitebam_chatMain').style.display='none'; ROC_sitebam_chat_PageTitleNotification.Off(); ROC_sitebam_endChat(); }; function ROC_sitebam_isCanvasSupported(){ var elem = document.createElement('canvas'); return !!(elem.getContext && elem.getContext('2d')); } function ROC_sitebam_proChat() { ROC_sitebam_AnimUp(document.getElementById('ROC_sitebam_chatFeature'),310) document.getElementById('ROC_sitebam_openChat').style.display='none'; document.getElementById('ROC_sitebam_SpTtl1').innerHTML="Online Chat"; document.getElementById('ROC_sitebam_chatMain').style.display='block'; } function ROC_sitebam_maxChat() { ROC_sitebam_AnimUp(document.getElementById('ROC_sitebam_chatFeature'),310) document.getElementById('ROC_sitebam_openChat').style.display='none'; document.getElementById('ROC_sitebam_chatSpTtl1').innerHTML="Online Chat"; document.getElementById('ROC_sitebam_chatMain').style.display='block'; } function ROC_sitebam_initChat() { //If no name has been entered then exit if (document.getElementById('ROC_sitebam_chat_name').value=='') { alert('Please enter your name.'); } else { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (xhttp.readyState == 4 && xhttp.status == 200) { if (xhttp.responseText=='X') { document.getElementById('ROC_sitebam_cp1').style.display='block'; document.getElementById('ROC_sitebam_cp2').style.display='none'; //document.getElementById('ROC_sitebam_chat_name').value=''; } else { //it must have returned a chatid //store it in a cookie ROC_sitebam_persist_setCookie(ROC_sitebam_chat_sitebamid+'|'+'cid',xhttp.responseText , 365) ROC_sitebam_chatid=xhttp.responseText; //Now hide the name field document.getElementById('ROC_sitebam_cp1').style.display='none'; document.getElementById('ROC_sitebam_cp2').style.display='block'; //document.getElementById('ROC_sitebam_chat_name').value=''; document.getElementById('ROC_sitebam_chatwin').innerHTML="

Waiting for Agent...

" } } } xhttp.timeout = 2000; xhttp.open('GET', 'https://remote.sitebam.com/chat/pollchat.asp?udid='+ROC_sitebam_chat_userdomainid+'&sitebamid='+ROC_sitebam_chat_sitebamid+'&chid=0&ip='+ROC_sitebam_chat_ipaddress+'&vid='+ROC_sitebam_chat_vid+'&act=i&name='+encodeURIComponent(document.getElementById('ROC_sitebam_chat_name').value), true); xhttp.send(); } } function ROC_sitebam_endChat() { if (!ROC_sitebam_chatid) { ROC_sitebam_chatid='0'; } if (ROC_sitebam_chatid=='0') { //Do nothing } else { //Close down this chat var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (xhttp.readyState == 4 && xhttp.status == 200) { if (xhttp.responseText=='X') { document.getElementById('ROC_sitebam_cp1').style.display='block'; document.getElementById('ROC_sitebam_cp2').style.display='none'; //document.getElementById('ROC_sitebam_chat_name').value=''; ROC_sitebam_persist_setCookie(ROC_sitebam_chat_sitebamid+'|'+'cid','0', 365); ROC_sitebam_chatid=0; } } } xhttp.timeout = 2000; xhttp.open('GET', 'https://remote.sitebam.com/chat/pollchat.asp?udid='+ROC_sitebam_chat_userdomainid+'&sitebamid='+ROC_sitebam_chat_sitebamid+'&chid='+ROC_sitebam_chatid+'&ip='+ROC_sitebam_chat_ipaddress+'&vid='+ROC_sitebam_chat_vid+'&act=c&name='+encodeURIComponent(document.getElementById('ROC_sitebam_chat_name').value), true); xhttp.send(); } ROC_sitebam_chat_PageTitleNotification.Off(); } function ROC_sitebam_sendChat() { if (!ROC_sitebam_chatid) { ROC_sitebam_chatid='0'; } if (ROC_sitebam_chatid=='0') { //Do nothing } else { //Add message to chat var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (xhttp.readyState == 4 && xhttp.status == 200) { if (xhttp.responseText=='OK') { document.getElementById('ROC_sitebam_chatMsg').value=''; ROC_sitebam_chat_doPoll(); } } } xhttp.timeout = 2000; //console.log('called sendchat https://remote.sitebam.com/chat/pollchat.asp?udid='+ROC_sitebam_chat_userdomainid+'&sitebamid='+ROC_sitebam_chat_sitebamid+'&chid='+ROC_sitebam_chatid+'&ip='+ROC_sitebam_chat_ipaddress+'&vid='+ROC_sitebam_chat_vid+'&act=m&msg='+encodeURIComponent(document.getElementById('ROC_sitebam_chatMsg').value)); xhttp.open('GET', 'https://remote.sitebam.com/chat/pollchat.asp?udid='+ROC_sitebam_chat_userdomainid+'&sitebamid='+ROC_sitebam_chat_sitebamid+'&chid='+ROC_sitebam_chatid+'&ip='+ROC_sitebam_chat_ipaddress+'&vid='+ROC_sitebam_chat_vid+'&act=m&msg='+encodeURIComponent(document.getElementById('ROC_sitebam_chatMsg').value), true); xhttp.send(); } } var ROC_sitebam_chat_PageTitleNotification = { Vars:{ OriginalTitle: document.title, Interval: null }, On: function(notification, intervalSpeed){ var _this = this; _this.Vars.Interval = setInterval(function(){ document.title = (_this.Vars.OriginalTitle == document.title) ? notification : _this.Vars.OriginalTitle; }, (intervalSpeed) ? intervalSpeed : 1000); }, Off: function(){ clearInterval(this.Vars.Interval); document.title = this.Vars.OriginalTitle; } } function ROC_sitebam_chat_notifyBeep() { if (ROC_sitebam_isCanvasSupported()) { var audio = new Audio('https://remote.sitebam.com/chat/SellrAlert1.mp3'); audio.play(); } ROC_sitebam_chat_PageTitleNotification.On("New Chat"); } function ROC_sitebam_chat_msgBeep() { if (ROC_sitebam_isCanvasSupported()) { var audio = new Audio('https://remote.sitebam.com/chat/msg.mp3'); audio.play(); } } function ROC_sitebam_chat_endedBeep() { if (ROC_sitebam_isCanvasSupported()) { var audio = new Audio('https://remote.sitebam.com/chat/exit.mp3'); audio.play(); } } function ROC_sitebam_chat_doPoll() { var ROC_sitebam_chat_msgcount=0; var ROC_sitebam_chat_newmsgcount=0; var ROC_sitebam_chat_hasended=0; var ROC_sitebam_chat_newhasended=0; if (!ROC_sitebam_chatid) { ROC_sitebam_chatid='0'; } if (ROC_sitebam_persist_getCookie(ROC_sitebam_chat_sitebamid+'|ROC_sitebam_chat_msgcount')) { ROC_sitebam_chat_msgcount=ROC_sitebam_persist_getCookie(ROC_sitebam_chat_sitebamid+'|ROC_sitebam_chat_msgcount'); } ROC_sitebam_persist_setCookie(ROC_sitebam_chat_sitebamid+'|ROC_sitebam_chat_msgcount', ROC_sitebam_chat_msgcount, 1) if (ROC_sitebam_persist_getCookie(ROC_sitebam_chat_sitebamid+'|ROC_sitebam_chat_hasended')) { ROC_sitebam_chat_hasended=ROC_sitebam_persist_getCookie(ROC_sitebam_chat_sitebamid+'|ROC_sitebam_chat_hasended'); } ROC_sitebam_persist_setCookie(ROC_sitebam_chat_sitebamid+'|ROC_sitebam_chat_hasended', ROC_sitebam_chat_hasended, 1) var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (xhttp.readyState == 4 && xhttp.status == 200) { if (xhttp.responseText=='X') { //Cancel the chat but dont close the chat panel ROC_sitebam_persist_setCookie(ROC_sitebam_chat_sitebamid+'|'+'cid','0', 365); document.getElementById('ROC_sitebam_cp1').style.display='block'; document.getElementById('ROC_sitebam_cp2').style.display='none'; } else { if (xhttp.responseText=='F') { //Close the actual chat panel and reset ROC_sitebam_persist_setCookie(ROC_sitebam_chat_sitebamid+'|'+'cid','0', 365); document.getElementById('ROC_sitebam_cp1').style.display='block'; document.getElementById('ROC_sitebam_cp2').style.display='none'; ROC_ROC_sitebam_closeChat(); } else { if (xhttp.responseText=='P') { //Proactive Chat launch window ROC_sitebam_getROC_sitebam_proChatid(); ROC_sitebam_chat_notifyBeep(); } else { if (xhttp.responseText=='H') { ROC_sitebam_chat_cio=0; ROC_sitebam_persist_setCookie(ROC_sitebam_chat_sitebamid+'|'+'cid','0', 365); document.getElementById('ROC_sitebam_chatFeature').style.display='none'; } else { if (xhttp.responseText=='S') { ROC_sitebam_AnimDown(document.getElementById('chat'),50) document.getElementById('ROC_sitebam_openChat').style.display='block'; document.getElementById('ROC_sitebam_SpTtl1').innerHTML="Online - Start Chat?"; document.getElementById('ROC_sitebam_chatMain').style.display='none'; document.getElementById('ROC_sitebam_chatFeature').style.display='block'; } else { //Display the chat contents //parse the results var ROC_sitebam_returnstr = xhttp.responseText; if (ROC_sitebam_returnstr.indexOf("|^&|+")>-1) { var ROC_sitebam_returnspl = ROC_sitebam_returnstr.split("|^&|+"); if (ROC_sitebam_returnspl[0]!='') { window.location=ROC_sitebam_returnspl[0]; } var ROC_sitebam_paneltext=ROC_sitebam_returnspl[1]; document.getElementById('ROC_sitebam_cp1').style.display='none'; document.getElementById('ROC_sitebam_cp2').style.display='block'; //document.getElementById('ROC_sitebam_chat_name').value=''; document.getElementById('ROC_sitebam_chatwin').innerHTML=ROC_sitebam_paneltext; ROC_sitebam_maxChat(); var elem = document.getElementById('ROC_sitebam_chatwin'); elem.scrollTop = elem.scrollHeight; if (document.getElementById('ROC_sitebam_chat_msgcount')) { ROC_sitebam_chat_newmsgcount=document.getElementById('ROC_sitebam_chat_msgcount').value; } if (document.getElementById('ROC_sitebam_chat_hasended')) { ROC_sitebam_chat_newhasended=document.getElementById('ROC_sitebam_chat_hasended').value; } if ((ROC_sitebam_chat_newmsgcount!=ROC_sitebam_chat_msgcount)&&(ROC_sitebam_chat_newmsgcount!='0')) { ROC_sitebam_chat_msgBeep(); ROC_sitebam_chat_PageTitleNotification.Off(); } if ((ROC_sitebam_chat_newhasended!=ROC_sitebam_chat_hasended)&&ROC_sitebam_chat_newhasended=='1') { ROC_sitebam_chat_endedBeep(); } ROC_sitebam_persist_setCookie(ROC_sitebam_chat_sitebamid+'|ROC_sitebam_chat_msgcount', ROC_sitebam_chat_newmsgcount, 1) ROC_sitebam_persist_setCookie(ROC_sitebam_chat_sitebamid+'|ROC_sitebam_chat_hasended', ROC_sitebam_chat_newhasended, 1) } } } } } } } } if (document.getElementById('ROC_sitebam_chatFeature')) { if (document.getElementById('ROC_sitebam_chatFeature').style.display!='none') { //console.log('https://remote.sitebam.com/chat/pollchat.asp?udid='+ROC_sitebam_chat_userdomainid+'&sitebamid='+ROC_sitebam_chat_sitebamid+'&chid='+ROC_sitebam_chatid+'&ip='+ROC_sitebam_chat_ipaddress+'&vid='+ROC_sitebam_chat_vid+'&act=p'); xhttp.open('GET', 'https://remote.sitebam.com/chat/pollchat.asp?udid='+ROC_sitebam_chat_userdomainid+'&sitebamid='+ROC_sitebam_chat_sitebamid+'&chid='+ROC_sitebam_chatid+'&ip='+ROC_sitebam_chat_ipaddress+'&vid='+ROC_sitebam_chat_vid+'&act=p', true); xhttp.timeout = 2000; xhttp.send(); } } } function ROC_sitebam_getROC_sitebam_proChatid() { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (xhttp.readyState == 4 && xhttp.status == 200) { if (xhttp.responseText!='X') { ROC_sitebam_persist_setCookie(ROC_sitebam_chat_sitebamid+'|'+'cid',xhttp.responseText , 365) ROC_sitebam_chatid=xhttp.responseText; document.getElementById('ROC_sitebam_cp1').style.display='none'; document.getElementById('ROC_sitebam_cp2').style.display='block'; //document.getElementById('ROC_sitebam_chat_name').value=''; var elem = document.getElementById('ROC_sitebam_chatwin'); elem.scrollTop = elem.scrollHeight; ROC_sitebam_chat_doPoll(); ROC_sitebam_proChat(); } } } //console.log('https://remote.sitebam.com/chat/pollchat.asp?udid='+ROC_sitebam_chat_userdomainid+'&sitebamid='+ROC_sitebam_chat_sitebamid+'&chid=0&ip='+ROC_sitebam_chat_ipaddress+'&vid='+ROC_sitebam_chat_vid+'&act=x'); xhttp.open('GET', 'https://remote.sitebam.com/chat/pollchat.asp?udid='+ROC_sitebam_chat_userdomainid+'&sitebamid='+ROC_sitebam_chat_sitebamid+'&chid=0&ip='+ROC_sitebam_chat_ipaddress+'&vid='+ROC_sitebam_chat_vid+'&act=x', true); xhttp.timeout = 2000; xhttp.send(); } function ROC_sitebam_chat_istyping() { if (ROC_sitebam_chat_cio==1) { if (!ROC_sitebam_chatid) { ROC_sitebam_chatid='0'; } if (ROC_sitebam_chatid=='0') { //Do nothing } else { //Add message to chat var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (xhttp.readyState == 4 && xhttp.status == 200) { if (xhttp.responseText=='OK') { document.getElementById('ROC_sitebam_chatMsg').value=''; ROC_sitebam_chat_doPoll(); } } } //console.log('called pollchat '+'https://remote.sitebam.com/chat/pollchat.asp?udid='+ROC_sitebam_chat_userdomainid+'&sitebamid='+ROC_sitebam_chat_sitebamid+'&chid='+ROC_sitebam_chatid+'&ip='+ROC_sitebam_chat_ipaddress+'&vid='+ROC_sitebam_chat_vid+'&act=t'); xhttp.open('GET', 'https://remote.sitebam.com/chat/pollchat.asp?udid='+ROC_sitebam_chat_userdomainid+'&sitebamid='+ROC_sitebam_chat_sitebamid+'&chid='+ROC_sitebam_chatid+'&ip='+ROC_sitebam_chat_ipaddress+'&vid='+ROC_sitebam_chat_vid+'&act=t', true); xhttp.timeout = 2000; xhttp.send(); } } } window.setInterval(function(){ if (ROC_sitebam_chat_cio==1){ROC_sitebam_chat_doPoll();} }, 5000); function ROC_sitebam_addchatwindow() { //console.log('Chat is On:'+ROC_sitebam_chat_cio); //Add chat window var thischatpanel; thischatpanel="
"; thischatpanel=thischatpanel+"
"; thischatpanel=thischatpanel+"
Online - Start Chat?
"; thischatpanel=thischatpanel+"
"; thischatpanel=thischatpanel+"
"; thischatpanel=thischatpanel+"
"; thischatpanel=thischatpanel+"
"; thischatpanel=thischatpanel+"
"; thischatpanel=thischatpanel+"
"; thischatpanel=thischatpanel+"
"; thischatpanel=thischatpanel+"

Your name *

"; thischatpanel=thischatpanel+""; thischatpanel=thischatpanel+"

 

"; thischatpanel=thischatpanel+"
"; thischatpanel=thischatpanel+""; thischatpanel=thischatpanel+"Cancel"; thischatpanel=thischatpanel+"
"; thischatpanel=thischatpanel+"
"; thischatpanel=thischatpanel+"
"; thischatpanel=thischatpanel+"
"; thischatpanel=thischatpanel+"
"; thischatpanel=thischatpanel+" "; thischatpanel=thischatpanel+" "; thischatpanel=thischatpanel+"
"; thischatpanel=thischatpanel+"
"; thischatpanel=thischatpanel+"
"; thischatpanel=thischatpanel+"
"; var div = document.createElement('div'); div.className = 'sitebam_ChatHolder'; div.innerHTML=thischatpanel; document.body.appendChild(div); document.getElementById('ROC_sitebam_chatFeature').style.display='block'; document.getElementById('ROC_sitebam_chatMsg').onkeypress = function (e) { if (ROC_sitebam_isCanvasSupported()){ if(e.keyCode === 13) { ROC_sitebam_sendChat(); } else { ROC_sitebam_chat_istyping(); } } else { ROC_sitebam_chat_istyping(); } } document.getElementById('ROC_sitebam_chat_name').onkeypress = function (e) { if (ROC_sitebam_isCanvasSupported()) { if(e.keyCode === 13){ ROC_sitebam_initChat(); } } } thisURLstr = encodeURIComponent(document.URL); } ROC_sitebam_chat_cio==0; var ROC_sitebam_pingchatcount=0; function ROC_sitebam_do_ws_poll(ROC_sitebam_is_chat_init) { if (ROC_sitebam_iu==0&&ROC_sitebam_pingchatcount<20) { ROC_sitebam_pingchatcount++; var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (xhttp.readyState == 4 && xhttp.status == 200) { thisuserdetail=this.responseText; thisuserdetail=thisuserdetail.split('|'); ROC_sitebam_chat_userdomainid=thisuserdetail[0]; ROC_sitebam_chat_vid=thisuserdetail[1]; ROC_sitebam_chat_cio=thisuserdetail[2]; if (ROC_sitebam_iu) { ROC_sitebam_chat_cio=0; } ROC_sitebam_persist_setCookie(ROC_sitebam_chat_sitebamid+'|vid', ROC_sitebam_chat_vid, 90) ROC_sitebam_persist_setCookie(ROC_sitebam_chat_sitebamid+'|udm', ROC_sitebam_chat_userdomainid, 90) //show chat window if not already loaded if (!document.getElementById('ROC_sitebam_chatFeature')) { if (ROC_sitebam_chat_cio==1) { ROC_sitebam_addchatwindow(); } } else { if (ROC_sitebam_chat_cio==0) { document.getElementById('ROC_sitebam_chatFeature').style.display='none'; } if (ROC_sitebam_chat_cio==1) { document.getElementById('ROC_sitebam_chatFeature').style.display='block'; } } } } thisURLstr = encodeURIComponent(document.URL); //console.log('called pingchat https://remote.sitebam.com/chat/pingchat.asp?udid='+ROC_sitebam_chat_userdomainid+'&vid='+ROC_sitebam_chat_vid+'&sitebamid='+ROC_sitebam_chat_sitebamid+'&ip=3.147.65.111&ping=ok&URL='+thisURLstr+'&UA=udebot%40anthropic%2Ecom%29&RF=&act=n&dm='+encodeURI(window.location.hostname)); xhttp.open('GET', 'https://remote.sitebam.com/chat/pingchat.asp?udid='+ROC_sitebam_chat_userdomainid+'&vid='+ROC_sitebam_chat_vid+'&sitebamid='+ROC_sitebam_chat_sitebamid+'&ip=3.147.65.111&ping=ok&URL='+thisURLstr+'&UA=udebot%40anthropic%2Ecom%29&RF=&act=n&dm='+encodeURI(window.location.hostname), true); xhttp.timeout = 2000; xhttp.send(); } } //Check for googlebot if (/Google/.test(navigator.userAgent)) { //sync call to set google spider date //Use sync - used on nav away from page var xhttp = new XMLHttpRequest(); thisurl=encodeURI(window.location.href); //console.log("https://remote.sitebam.com/pers/pers.asp?action=ggl&usr="+ROC_sitebam_thissitebamid+'&tcurl='+thisurl+'&dv=1&dm='+encodeURI(window.location.hostname)); xhttp.open("GET", "https://remote.sitebam.com/pers/pers.asp?action=ggl&usr="+ROC_sitebam_thissitebamid+'&tcurl='+thisurl+'&dv=1&dm='+encodeURI(window.location.hostname), true); xhttp.timeout = 2000; xhttp.send(); if (xhttp.status === 200) { //console.log('Saved spider detect'); } } function ROC_sitebam_googleadscheck(ROC_sitebam_thisgoogleadstraceid) { if (ROC_sitebam_chat_ipaddress.substring(0,6)!='66.249'){ if (ROC_sitebam_SR_getqueryparam("sbgaact")=='ok') { //This is a Google Click ROC_sitebam_iu=true; var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { //console.log(this.responseText); ROC_sitebam_persist_setCookie("SiteBAM|C", this.responseText, 30); } }; thisurl=ROC_sitebam_SR_getqueryparam("urltc"); thisscw=ROC_sitebam_SR_getqueryparam("scw"); thissch=ROC_sitebam_SR_getqueryparam("sch"); thissbgacid=ROC_sitebam_SR_getqueryparam("sbgacid"); thissbgaadgid=ROC_sitebam_SR_getqueryparam("sbgaadgid"); thissbgafim=ROC_sitebam_SR_getqueryparam("sbgafim"); thissbgakwd=decodeURI(ROC_sitebam_SR_getqueryparam("sbgakwd")); thissbgaplc=ROC_sitebam_SR_getqueryparam("sbgaplc"); thissbgaadp=ROC_sitebam_SR_getqueryparam("sbgaadp"); thissbgamt=ROC_sitebam_SR_getqueryparam("sbgamt"); thissbganwk=ROC_sitebam_SR_getqueryparam("sbganwk"); thissbgadv=ROC_sitebam_SR_getqueryparam("sbgadv"); thissbgadvm=ROC_sitebam_SR_getqueryparam("sbgadvm"); thissbgaua="Mozilla%2F5%2E0+AppleWebKit%2F537%2E36+%28KHTML%2C+like+Gecko%3B+compatible%3B+ClaudeBot%2F1%2E0%3B+%2Bclaudebot%40anthropic%2Ecom%29"; xhttp.open("GET", "https://remote.sitebam.com/pers/pers.asp?action=gad&trcid="+ROC_sitebam_thisgoogleadstraceid+"&usr="+ROC_sitebam_thissitebamid+"&tcurl="+encodeURI(location.host + location.pathname)+"&ip="+ROC_sitebam_chat_ipaddress+"&srw="+thisscw+"&srh="+thissch+"&sr_rk="+ROC_sitebam_thisrandomkey+'&dm='+encodeURI(window.location.hostname)+'&sbgacid='+encodeURI(thissbgacid)+'&sbgaadgid='+encodeURI(thissbgaadgid)+'&sbgafim='+encodeURI(thissbgafim)+'&sbgakwd='+encodeURI(thissbgakwd)+'&sbgaplc='+encodeURI(thissbgaplc)+'&sbgaadp='+encodeURI(thissbgaadp)+'&sbgamt='+encodeURI(thissbgamt)+'&sbganwk='+encodeURI(thissbganwk)+'&sbgadv='+encodeURI(thissbgadv)+'&sbgadvm='+encodeURI(thissbgadvm)+'&sbgadisc='+ROC_sitebam_isconversion+'&sbgaua='+thissbgaua+'&sbsid=85UGW882RG3EO0K0NQB1VWK2FKHQT6GHPXTAN3CSNF58C4X4LW|9|59|13|27|11|2024|10', true); xhttp.timeout = 2000; xhttp.send(); } } //Facebook tracking if (ROC_sitebam_SR_getqueryparam("utm_source")=='facebook') { //This is a Facebook Click ROC_sitebam_iu=true; var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { //console.log(this.responseText); ROC_sitebam_persist_setCookie("SiteBAM|C", this.responseText, 30); } }; thisurl=ROC_sitebam_SR_getqueryparam("urltc"); thisscw=ROC_sitebam_SR_getqueryparam("scw"); thissch=ROC_sitebam_SR_getqueryparam("sch"); thissbfbterm=decodeURI(ROC_sitebam_SR_getqueryparam("utm_term")); thissbfadid=decodeURI(ROC_sitebam_SR_getqueryparam("ad_id")); thissbfbcn=decodeURI(ROC_sitebam_SR_getqueryparam("utm_campaign")); thissbfbad=decodeURI(ROC_sitebam_SR_getqueryparam("utm_content")); thissbgaua="Mozilla%2F5%2E0+AppleWebKit%2F537%2E36+%28KHTML%2C+like+Gecko%3B+compatible%3B+ClaudeBot%2F1%2E0%3B+%2Bclaudebot%40anthropic%2Ecom%29"; xhttp.open("GET", "https://remote.sitebam.com/pers/pers.asp?action=fbad&trcid="+ROC_sitebam_thisgoogleadstraceid+"&usr="+ROC_sitebam_thissitebamid+"&tcurl="+encodeURI(location.host + location.pathname)+"&ip="+ROC_sitebam_chat_ipaddress+"&srw="+thisscw+"&srh="+thissch+"&sr_rk="+ROC_sitebam_thisrandomkey+'&dm='+encodeURI(window.location.hostname)+'&sbfbad='+encodeURI(thissbfbad)+'&sbfadid='+encodeURI(thissbfadid)+'&sbfbterm='+encodeURI(thissbfbterm)+'&sbfbcn='+encodeURI(thissbfbcn)+'&sbgadisc='+ROC_sitebam_isconversion+'&sbgaua='+thissbgaua+'&sbsid=85UGW882RG3EO0K0NQB1VWK2FKHQT6GHPXTAN3CSNF58C4X4LW|9|59|13|27|11|2024|10', true); xhttp.timeout = 2000; xhttp.send(); } } //This will check if chat is on ROC_sitebam_do_ws_poll(true); window.setInterval(function(){ ROC_sitebam_do_ws_poll(false); return false; }, 30000); if (ROC_sitebam_oktorecord) { window.onunload = function() {ROC_sitebam_savealldata(true)}; }