var xmlHttp = false; var ichatstate ; try { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e2) { xmlHttp = false; } } if (!xmlHttp && typeof XMLHttpRequest != 'undefined') { xmlHttp = new XMLHttpRequest(); }
function sendmsg(){ var msgbody = escape(document.getElementById("msgbody").value); var sendto = escape(document.getElementById("sendto").value); var SendData = "msgbody=" + msgbody +"&sendto=" + sendto; xmlHttp.open("POST","../ichat/sendmsg.asp",false); xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xmlHttp.onreadystatechange = function sendok(){ if (xmlHttp.readyState == 4) { } } xmlHttp.send(SendData); document.getElementById("msgbody").value = ""; showmsg(); }
function hot_key() {
if (window.event.keyCode==13 && window.event.ctrlKey && document.getElementById("msgbody").value != ""){sendmsg();}
}
function exitchat(){ var url = "../ichat/online.asp?action=exit&pid=" +Math.random(); xmlHttp.open("GET", url, true); xmlHttp.send(null); }
function intochat(){ window.ionline.location.href="../ichat/online.asp?action=intochat"; showmsg(); }
function showonline(){ var url = "../ichat/online.asp?action=showonline&pid=" +Math.random(); xmlHttp.open("GET", url, true); xmlHttp.send(null); }
function showmsg(){ var url = "../ichat/getmsg.asp?pid=" +Math.random(); xmlHttp.open("GET", url, true); xmlHttp.onreadystatechange = reloadX; xmlHttp.send(null); }
function reloadX() { if (xmlHttp.readyState == 4) { var response = xmlHttp.responseText; document.getElementById("mymsg").innerHTML = response; document.getElementById("mymsg").scrollTop=document.getElementById("mymsg").scrollHeight; setTimeout("showmsg();",10000); } }
function saveset(){ var mycolor = document.getElementById("mycolor").value; var msgtotal = document.getElementById("msgtotal").value; var mystate = document.getElementById("mystate").value; var allowmsg = document.getElementById("allowmsg").value; var closemsg;