function toggleHTML(grouponline){ var obj if ((document.getElementById("AliveChatImage")) && (document.getElementById("AliveChatForm"))){ if (grouponline == 'Y'){ obj = document.getElementById("AliveChatForm"); }else{ obj = document.getElementById("AliveChatImage"); } if (obj){ obj.style.display = "block"; obj.style.visibility = "visible"; } } } toggleHTML('Y'); function URLEncode(plaintext) { // The Javascript escape and unescape functions do not correspond // with what browsers actually do... var SAFECHARS = "0123456789" + // Numeric "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + // Alphabetic "abcdefghijklmnopqrstuvwxyz" + "-_.!~*'()"; // RFC2396 Mark characters var HEX = "0123456789ABCDEF"; //var plaintext = document.URLForm.F1.value; var encoded = ""; for (var i = 0; i < plaintext.length; i++ ) { var ch = plaintext.charAt(i); if (ch == " ") { encoded += "%20"; // x-www-urlencoded, rather than %20 } else if (SAFECHARS.indexOf(ch) != -1) { encoded += ch; } else { var charCode = ch.charCodeAt(0); if (charCode > 255) { encoded += "%20"; } else { encoded += "%"; encoded += HEX.charAt((charCode >> 4) & 0xF); encoded += HEX.charAt(charCode & 0xF); } } } // for //document.URLForm.F2.value = encoded; plaintext = encoded; return plaintext; }; var rf = document.referrer.toString(); var dl = document.location.toString(); var dt = document.title.toString(); rf = URLEncode(rf); dl = URLEncode(dl); dt = URLEncode(dt); var urlstr = "&dt=" + dt + "&dl=" + dl + "&rf=" + rf + "&wsa_custom_str=" + "^^^^"; //---------------------------------------------------------------- function callServer(url) { var sRn=Math.random(); var head = document.getElementsByTagName('head').item(0); var old = document.getElementById('vtracker'); if (old){ if (old.readyState=="loading"){ //let the old script complete return; } head.removeChild(old); } try{ var s = document.createElement('script'); url = url + '&random=' + sRn; s.src = url; s.type = 'text/javascript'; s.defer = true; s.id = 'vtracker'; void(head.appendChild(s)); }catch(e){ return; } } function processWH() { var url = "http://www.websitealive7.com/1325/visitor/vTrackerSrc_v2.asp?action=poll&groupid=1325&websiteid=0&departmentid=0&sessionid_=99999990" + urlstr; callServer(url); } //This function gets the sessiontimeout set by admin. If visitor has left page open longer then sessiontimeout, then they will stop pinging the server. function checkProcess(landingTime) { var sessiontimeout = 1800; var newTime = new Date(); var tDiff = (newTime - landingTime) / 1000; // diff in seconds //alert(tDiff); if ((sessiontimeout == 0) || (sessiontimeout > tDiff)) //if no timeout or still active { processWH(); //keep processing; }else{ //do nothing } } //initial call to vTrackerSrc. processWH(); //continuous call to vTrackerSrc, if conditions are met. var landingTime = new Date(); setInterval("checkProcess(landingTime);",6000); /* This script is copyright (c) Henrik Petersen, NetKontoret Feel free to use this script on your own pages as long as you do not change it. It is illegal to distribute the script as part of a tutorial / script archive. Updated version available at: http://www.echoecho.com/toolfloatinglayer.htm This comment and the 4 lines above may not be removed from the code. */ /* -------------------------- // START variables to edit -------------------------- */ // "ee_menu" holds the HTML for your floating layer. // Type it all on one line, no carriage returns, no line breaks, // and no single quotes (unless you escpae them like this: \' ee_floatX = 0; // this number is the distance in pixels from the right and left edges of the browser's window ee_floatY = 0; // this number is the distance in pixels from the top and bottom edges of the browser's window ee_layerwidth = 120; // this number is the width in pixels for the layer ee_layerheight = 120; // this number is the height in pixels for the layer ee_halign = 'left'; // this value is the horizontal position of the layer (left, center, or right) ee_valign = 'top'; // this value is the vertical position of the layer (top, middle, or bottom) ee_delayspeed = 1; // this value is the speed at which the layer must float (0, 1, or 3) /* -------------------------- // END variables to edit -------------------------- */ function ee_adjust() { /* //////////// // assign // //////////// */ var ee_xs = 0, ee_ys = 0; if (typeof(window.pageYOffset) == 'number') { ee_ys = window.pageYOffset; ee_xs = window.pageXOffset; } else if (document.body && (document.body.scrollLeft || document.body.scrollTop)) { ee_ys = document.body.scrollTop; ee_xs = document.body.scrollLeft; } else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) { ee_ys = document.documentElement.scrollTop; ee_xs = document.documentElement.scrollLeft; } /* /////////////// // calculate // /////////////// */ if ((ee_lastX == -1) || (ee_delayspeed == 0)) { ee_lastX = ee_xs + ee_floatX; ee_lastY = ee_ys + ee_floatY; } else { var ee_dx = Math.abs(ee_xs + ee_floatX - ee_lastX); var ee_dy = Math.abs(ee_ys + ee_floatY - ee_lastY); var ee_d = Math.sqrt((ee_dx * ee_dx) + (ee_dy * ee_dy)); var ee_c = Math.round(ee_d / 10); if (ee_xs + ee_floatX > ee_lastX) { ee_lastX = ee_lastX + ee_delayspeed + ee_c; } if (ee_xs + ee_floatX < ee_lastX) { ee_lastX = ee_lastX - ee_delayspeed - ee_c; } if (ee_ys + ee_floatY > ee_lastY) { ee_lastY = ee_lastY + ee_delayspeed + ee_c; } if (ee_ys + ee_floatY < ee_lastY) { ee_lastY = ee_lastY - ee_delayspeed - ee_c; } } /* /////////////// // move // /////////////// */ document.getElementById('ee_floatlayer').style.left = ee_lastX + 'px'; document.getElementById('ee_floatlayer').style.top = ee_lastY + 'px'; // do it again //window.setTimeout('ee_adjust()',50); timerIDWSA = setTimeout('ee_adjust()',50); } function ee_define() { if (ee_old_resize) { ee_old_resize(); } var ee_wo, ee_ho; ee_lastX = -1; if (typeof(window.innerWidth) == 'number') { ee_wo = window.innerWidth; ee_ho = window.innerHeight; } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) { ee_wo = document.documentElement.clientWidth; ee_ho = document.documentElement.clientHeight; } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) { ee_wo = document.body.clientWidth; ee_ho = document.body.clientHeight; } if (ee_halign == 'left') { ee_floatX = ee_ifloatX; } if (ee_halign == 'right') { ee_floatX = ee_wo - ee_ifloatX - ee_layerwidth - ee_r_edge; } if (ee_halign == 'center') { ee_floatX = Math.round(ee_wo / 2) - Math.round(ee_layerwidth / 2); } if (ee_valign == 'top') { ee_floatY = ee_ifloatY; } if (ee_valign == 'bottom') { ee_floatY = ee_ho - ee_ifloatY - ee_layerheight - ee_b_edge; } if (ee_valign == 'middle') { ee_floatY = Math.round(ee_ho / 2) - Math.round(ee_layerheight / 2); } } var W3CDOM = (document.createElement && document.getElementsByTagName); if (W3CDOM) { ee_container = document.createElement("DIV"); ee_container.id = 'ee_floatlayer'; ee_container.style.position = 'absolute'; ee_container.style.left = ee_floatX + 'px'; ee_container.style.top = ee_floatY + 'px'; ee_container.style.width = ee_layerwidth + 'px'; ee_container.style.height = ee_layerheight + 'px'; ee_container.style.marginTop = '0px'; ee_container.style.marginRight = '0px'; ee_container.style.marginBottom = '0px'; ee_container.style.marginLeft = '0px'; ee_container.style.paddingTop = '0px'; ee_container.style.paddingRight = '0px'; ee_container.style.paddingBottom = '0px'; ee_container.style.paddingLeft = '0px'; ee_container.style.borderTop = '0'; ee_container.style.borderRight = '0'; ee_container.style.borderBottom = '0'; ee_container.style.borderLeft = '0'; ee_container.style.zIndex = 10000; ee_container.style.display = 'none'; if (window.ActiveXObject) { ee_container.style.overflowX = 'hidden'; ee_container.style.overflowY = 'hidden'; } else { ee_container.style.overflow = 'hidden'; } window.ActiveXObject ? ee_r_edge = 0 : ee_r_edge = 20; window.ActiveXObject ? ee_b_edge = 0 : ee_b_edge = 20; ee_ifloatX = ee_floatX; ee_ifloatY = ee_floatY; ee_lastX = -1; ee_lastY = -1; ee_body = document.getElementsByTagName("BODY")[0]; ee_body.insertBefore(ee_container,null); ee_old_resize = window.onresize; window.onresize = ee_define; ee_define(); } function writeHTML(ee_menu,p_left,p_top,p_width,p_height,p_backgroundimage,p_backgroundimage_ssl,p_align){ ee_container.style.left = p_left + 'px'; ee_container.style.top = p_top + 'px'; ee_floatX = p_left; // this number is the distance in pixels from the right and left edges of the browser's window ee_floatY = p_top; // this number is the distance in pixels from the top and bottom edges of the browser's window ee_container.style.width = p_width +'px'; ee_container.style.height = p_height + 'px'; ee_container.style.backgroundImage = "url("+ p_backgroundimage +")"; ee_container.style.textAlign = p_align; ee_container.style.display = "inline"; ee_container.style.visibility = "visible"; ee_container.innerHTML = ee_menu; } function startScroll(){ ee_adjust(); } function stopCheckWSA(){ //alert('stopping timerIDWSA:' + timerIDWSA); if (timerIDWSA){ //alert('stopCheckWSA() running on:'+timerIDWSA); clearTimeout(timerIDWSA); timerIDWSA = 0; } writeHTMLBool = false; ee_container.style.display = 'none'; ee_container.style.visibility = 'hidden'; } function declineChat(){ var decline_url = 'http://www.websitealive7.com/1325/Visitor/vTrackerSrc_v2.asp?action=decline&groupid=1325&websiteid=0&departmentid=0&sessionid_=99999990'; callServer(decline_url); setTimeout('stopCheckWSA()',1000); } var writeHTMLBool = false; var timerIDWSA; function chatInvite(proactiveid,departmentid_invite,p_left,p_top,p_width,p_height,p_backgroundimage,p_backgroundimage_ssl,p_linebreaks,p_align,p_scrolling,p_version){ if (writeHTMLBool == false){ var HTML, appdir, groupid, websiteid, departmentid_invite, sessionid_; HTML = ''; appdir = 'http://www.websitealive7.com'; groupid = '1325'; websiteid = '0'; sessionid_ = '99999990'; //this is sessionid of the visitor, not chat var windowOpenURL = appdir + '/' + groupid + '/visitor/vInvite.asp?action=accept&groupid=' + groupid + '&websiteid=' + websiteid + '&departmentid=' + departmentid_invite + '&sessionid_=' + sessionid_; if (p_version == '2'){ HTML = HTML + "
"; }else{ for(i = 0; i < p_linebreaks; i++) { HTML = HTML + "
 " } HTML = HTML + " "; } //alert(HTML); writeHTML(HTML,p_left,p_top,p_width,p_height,p_backgroundimage,p_backgroundimage_ssl,p_align); if (p_scrolling == 'Y'){ startScroll(); } writeHTMLBool = true; } }