var askedForCall = new Image(); var check4opimg = new Image(); var chkMsg = true; var rnd; var c, g, p, a, v, pl, dm, rf, tl; var exit=true; var isNS = (document.layers) ? true : false; var isIE = (document.all) ? true : false; var isIE55 = (navigator.userAgent.indexOf("MSIE 5.5") >= 1); a=navigator.appName; v=navigator.appVersion; pl=navigator.platform; dm=document.domain; rf=document.referrer; tl=document.title; var gotImage=false; var lhTop = -1; var lhLeft = -1; var pos = - 30; var lhHelpImage; var lhCloseImage; var Border = 100; var step = 3; var dir = step; var stopRunningAround = false; var showImage = false; function startCall() { closeThis(); // open chat screen } function closeThis() { if (isIE) document.all.lhLayer.style.visibility = "hidden"; else if (isNS) document.layers.lhLayer.visibility = "hidden"; showImage = false; } function setImage1(name, image, type) { if (type) { stopRunningAround=true; } else stopRunningAround=false; document[name].src = image; return; } function setImage(name, image) { document[name].src = image; } function animate() { showImage = true; if (isIE) { Border = document.body.clientWidth; } else if (isNS) { Border = window.innerWidth; } animateImage(); } function animateImage() { if (stopRunningAround) { setTimeout("animateImage()", 20); return; } if (gotImage) pos = pos + dir; if (pos > Border - 160) dir = - step; placeImage(); if (((pos > 30) || (dir > 0))) setTimeout("animateImage()", 20); } function placeImage() { var y = 40; if (isIE) { document.all.lhLayer.style.left = document.body.scrollLeft + pos; document.all.lhLayer.style.top = document.body.scrollTop + y; } else if (isNS) { document.layers.lhLayer.left = pageXOffset + pos; document.layers.lhLayer.top = pageYOffset + y; } } function imageTimer() { if (gotImage && showImage) { var top; var left; if (isIE) { top = document.body.scrollTop; left = document.body.scrollLeft; if ((lhTop < 0) || ((lhTop == top) && (lhLeft == left))) { document.all.lhLayer.style.visibility = "visible"; } else { document.all.lhLayer.style.visibility = "hidden"; } } else if (isNS) { top = pageYOffset; left = pageXOffset; if ((lhTop < 0) || ((lhTop == top) && (lhLeft == left))) { document.layers.lhLayer.visibility = "visible"; } else { document.layers.lhLayer.visibility = "hidden"; } } placeImage(); lhTop = top; lhLeft = left; } setTimeout('imageTimer()', 250); } function getImg() { var r = Math.random()+1; var sc = "http://216.64.196.143/servlet/hpLiveHelperBrowse?ACTION=ISTHERENEWMSG&RND=" + rnd + "&p=" + p + "&c=" + c + "&g=" + escape (g) + "&r=" + r + "&a=" + escape(a) + "&v=" + escape(v) + "&pl=" + escape(pl) + "&dm=" + escape(dm) + "&rf=" + escape (rf) + "&tl=" + escape (tl); askedForCall.src = sc; chkMsg = false; setTimeout('getImg()', 5000); } function loadChat(companyId, groupName, pageId) { var name = removeDot (Math.random().toString()); var url = "http://216.64.196.139/servlet/hpLiveHelperChat?ACTION=SENDNAMEENTRYSCREEN&COMPANYID=" + companyId + "&GROUPNAME=" + groupName; window.open(url, name, 'height=300,width=295,toolbar=no,menubar=no,directories=no,resizable=no'); return; } function setIcon(companyId, groupName, pageId) { document.write('
'); document.write(''); document.write('
'); var lnk = ""; document.write (lnk); document.write('free from livehelper !
'); //if (isIE) //{ //document.write(""); //} //else //if (isNS) //{ //document.write(""); //document.write(""); //document.write(""); //document.write(""); //document.write("
"); //} //setTimeout('imageTimer()', 250); //lhHelpImage = new Image(); //lhHelpImage.src = "images/bottomON.gif"; //lhCloseImage = new Image(); //lhCloseImage.src = "images/topBarON.gif"; var ch = "check4messages('" + companyId + "', '" + groupName + "', '" + pageId + "')"; setTimeout(ch, 0); } function check4messages(companyId, groupName, pageId) { // Src to show the present icon. if (chkMsg) { // set a cookie c = companyId; g = groupName; p = pageId; rnd = Math.random(); getImg(); } // change the width if (askedForCall.width == 8) { //animate(); var name = removeDot (Math.random().toString()); var url = "http://216.64.196.139/servlet/hpLiveHelperChat?ACTION=SENDCHATSCREEN&COMPANYID=" + companyId + "&GROUPNAME=" + groupName + "&CHATTYPE=Text&CLIENTNAME=Visitor&RND=" + rnd ; window.open(url, name, 'height=300,width=295,toolbar=no,menubar=no,directories=no,resizable=no'); return; } var ch = "check4messages('" + companyId + "', '" + groupName + "', '" + pageId + "')"; setTimeout(ch, 5000); } function removeDot(str) { var ret = new String(""); var ch; for (var i = 0; i < str.length; i++) { ch = str.charAt(i); if (ch == ".") ret += "X"; else ret += ch; } return ret; } function check4opwidth(companyId, groupName, clientId, chatMode) { if (check4opimg.width == 8) { var url1 = "http://216.64.196.139/servlet/hpLiveHelperChat?ACTION=WAITINGSENDCHATSCREEN&COMPANYID=" + companyId + "&GROUPNAME=" + escape (groupName) + "&CLIENTID=" + clientId + "&CHATMODE=" + chatMode + "&RND=" + removeDot (Math.random().toString()); setTimeout(url1, 0); check4opimg=new Image(); } else if (check4opimg.width == 116) { check4opimg=new Image(); alert ("disconnected"); } var url = "check4opwidth (\"" + companyId + "\", \"" + groupName + "\", \"" + clientId + "\", \"" + chatMode + "\")"; setTimeout(url, 500); } function check4ops(companyId, groupName, clientId, chatMode) { var url = "http://216.64.196.139/servlet/hpLiveHelperChat?ACTION=IMGWAITINGSENDCHATSCREEN&COMPANYID=" + companyId + "&GROUPNAME=" + escape (groupName) + "&CLIENTID=" + clientId + "&CHATMODE=" + chatMode + "&RND=" + removeDot (Math.random().toString()); check4opimg.src = url; url = "check4ops (\"" + companyId + "\", \"" + groupName + "\", \"" + clientId + "\", \"" + chatMode + "\")"; setTimeout(url, 5*1000); url = "check4opwidth (\"" + companyId + "\", \"" + groupName + "\", \"" + clientId + "\", \"" + chatMode + "\")"; setTimeout(url, 0); } function buhbye(clientId) { var url="http://216.64.196.139/servlet/hpLiveHelperChat?ACTION=CLIENTCLOSEDCHAT&CLIENTID=" + clientId; if (exit) window.open(url, 'nameEntryScreen', 'width=295,height=300'); } function setIconWithImage(companyId, groupName, pageId, imgPath) { document.write('
'); document.write('"; document.write(imgLink); document.write('
'); var lnk = ""; document.write (lnk); var imgLink="free from livehelper !
'); var ch = "check4messages('" + companyId + "', '" + groupName + "', '" + pageId + "')"; setTimeout(ch, 0); }