function cvp_nonajax(getdata){ a=document.createElement('script'); a.setAttribute('type','text/javascript'); if(getdata!=null) addGet = "&"+getdata; else addGet=""; a.setAttribute('src','https://www.cvp.com/live-help/live.php?_'+Math.random() + addGet); document.getElementsByTagName('head')[0].appendChild(a); } function cvp_callback(json){ if(json != null) switch(json.type){ case "forwardToURL": //if(json.values=="location.href") location.href=location.href; // else location.href=json.values; // alert("You are being automatically forwarded to: "+json.values); location.href=json.values; // break; case "sendAlert": alert(json.values); //alert(json.values); break; case "activateChat": var st=json.values; document.getElementById("chatLayerMain").innerHTML='
'; break; case "sendMessage": var msg = prompt("[Message] \n" + unescape(json.values)); if(msg!=null) cvp_nonajax("admMessage="+ escape( msg ) ); // use this method to remove the request (to avoid it keep coming up on users screen) break; } } function popRemoteChat(st){ window.open('https://www.cvp.com/live-help/chat/chatWelcome.php?st='+st, 'CVPchat', "toolbar=no, height=363, width=445, top=200, left=200"); closeChatInvite(); } function closeChatInvite(){ document.getElementById("chatLayer").style.display='none'; } // window.onload=function(){ setInterval(function(){ }, 5000); } function loadAssistant(){ var GO=setTimeout("cvp_nonajax(null)",3000); }