function sp_AttachEvents() { if(!spEventsAttached) { sp_Load(); if(document.getElementById('sitepath_debug')) { document.getElementById('sitepath_debug').style.display = '';} document.body.onbeforeunload = sp_BeforeUnload; document.body.onload = sp_BodyLoad; document.body.onmousemove = sp_MouseMove; document.body.onresize = sp_Resize; document.body.onscroll = sp_Scroll; window.setTimeout('sp_CheckMouse()', 5000); spEventsAttached = true; } } function sp_BeforeUnload() { if(spCheckMouseTimer!=null) { window.clearTimeout(spCheckMouseTimer); } sp_CheckMouse(); if(spCheckMouseTimer!=null) { window.clearTimeout(spCheckMouseTimer); } } function sp_BodyLoad() { sp_Command('page;' + sp_Now() + ';' + escape(document.location.href) + ';' + escape(document.body.outerHTML)) } function sp_CheckMouse() { if(spMouseBuffer!='') { //sp_Debug(spMouseBuffer); sp_Command('mouse;' + spMouseTime + spMouseBuffer) spMouseTime = sp_Now(); spMouseBuffer = ''; } spCheckMouseTimer = window.setTimeout('sp_CheckMouse()', 5000); } function sp_Command(spCommand) { var nMaxLength = 1800 if(spSitePageOn) { for(a=0;a<=(Math.floor((spCommand.length-1)/nMaxLength));a++) { spCommands[spCommands.length] = (spCommandIndex) + (a==0?';':';;;') + spCommand.substring(a * nMaxLength, (a + 1) * nMaxLength); } spCommandIndex++; sp_ShowCommandBuffer(); if(!spProcessingCommand) { sp_ProcessNextCommand(); } } } function sp_CommandImageLoad() { spProcessingCommand = false; var spCommandsTemp = new Array(); for(a=0;a0) { sp_ProcessNextCommand(); } } function sp_Debug(spMessage) { if(document.getElementById('sitepath_debug')) { document.getElementById('sitepath_debug').innerHTML = spMessage; } } function sp_FlashVersion() { if (navigator.plugins && navigator.plugins.length) { x = navigator.plugins["Shockwave Flash"]; if (x) { if (x.description) { y = x.description; return y.charAt(y.indexOf('.')-1); } } if (navigator.plugins["Shockwave Flash 2.0"]) { return 2; } } else { if (navigator.mimeTypes && navigator.mimeTypes.length) { x = navigator.mimeTypes['application/x-shockwave-flash']; if (x && x.enabledPlugin) { return ''; } } else { return ''; } } } function sp_GetCookie(sName) { var spCookie = '; ' + document.cookie + '; '; var spIndex1 = spCookie.indexOf('; ' + sName + '=') if(spIndex1<0) { return ''; } else { return spCookie.substr(spIndex1 + sName.length + 3).split('; ')[0]; } } function sp_Load() { sp_Command('load;' + sp_Now() + ';' + escape(document.location.href) + ';' + document.body.clientWidth + ';' + document.body.clientHeight + ';' + screen.width + ';' + screen.height + ';' + screen.colorDepth + ';' + sp_FlashVersion()) } function sp_MouseDown(e) { if(!(e)) { e=event; } if(e.button==4) { if(spSitePageOn) { document.cookie = 'sitepath=off; path=/' spSitePageOn = false; } else { document.cookie = 'sitepath=on; path=/' spSitePageOn = true; if(!spEventsAttached) { sp_AttachEvents(); sp_BodyLoad(); } } } } function sp_MouseMove(e) { if(!(e)) { e=event; } spMouseBuffer += ';' + (sp_Now() - spMouseTime) + ',' + e.x + ',' + e.y } function sp_Now() { return Number(new Date()); } function sp_ProcessNextCommand() { spProcessingCommand = true; spCommandImage.src = 'http://www.teravault.com/sitepath/com.asp?' + spUserGuid + ';' + spSessionGuid + ';' + spPageGuid + ';' + spCommands[0]; } function sp_Resize() { if(spResizeTimer!=null) { window.clearTimeout(spResizeTimer); } spResizeTimer = window.setTimeout('sp_Command(\'resize;' + sp_Now() + ';' + document.body.clientWidth + ';' + document.body.clientHeight + '\')', 500); } function sp_Scroll() { if(spScrollTimer!=null) { window.clearTimeout(spScrollTimer); } spScrollTimer = window.setTimeout('sp_Command(\'scroll;' + sp_Now() + ';' + document.body.scrollLeft + ';' + document.body.scrollTop + '\')', 500); } function sp_ShowCommandBuffer() { //return false; var sDisplay = ''; for(a=0;a'; } sp_Debug(sDisplay); } // allocate variables var spGuid = 'B7629848232E4728A98EB3786FA7689A'; var spMouseBuffer = '' var spMouseTime = Number(new Date()); var spCommands = new Array(); var spCommandImage = new Image(); var spResizeTimer = null; var spScrollTimer = null; var spEventsAttached = false; var spSitePageOn = !(document.cookie.indexOf('sitepath=off')>-1); var spUserGuid = sp_GetCookie('spUserGuid'); var spSessionGuid = sp_GetCookie('spSessionGuid'); var spPageGuid = spGuid; var spCommandIndex = 0; var spProcessingCommand = false; var spCheckMouseTimer = null; if(spUserGuid=='') { spUserGuid = spGuid; document.cookie = 'spUserGuid=' + spUserGuid + ';path=/;expires='+(new Date((new Date()).getTime()+(30*86400000))).toGMTString(); } if(spSessionGuid=='') { spSessionGuid = spGuid; document.cookie = 'spSessionGuid=' + spSessionGuid + '; path=/;'; } //document.write(''); //document.write('[' + spUserGuid + ']
'); //document.write('[' + spSessionGuid + ']
'); //document.write('[' + spPageGuid + ']
'); // do we start? if(spSitePageOn) { sp_AttachEvents(); } document.body.onmousedown = sp_MouseDown; spCommandImage.onload = sp_CommandImageLoad spCommandImage.onerror = function() { sp_Debug('IMAGE ERROR: ' + spCommandImage.src); }