function subMsg(name, subj, cmt, ref)
{
//... (some code skipped)
mTimer = setTimeout('udtCmt(\''+ref+'\');', 1);
}
function udtMsg(ref)
{
GetXmlHttpObject();
if (xmlHttp!=null)
{
url="getMsgs.php?q="+ref+"&sid="+Math.random();
xmlHttp.onreadystatechange=state_Change;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
clearInterval(mTimer);
}
function state_Change()
{
if (xmlHttp.readyState==4)
{
toDisp=xmlHttp.responseText;
toDisp=toDisp+"\n<form name=\"messages\">\n<table><tr><td>Name:</td><td><input type=\"text\" name=\"name\" id=\"name\" autocomplete=\"off\" tabIndex=\"5\" accesskey=\"C\" maxlength=30 size=30 /></td></tr>\n<tr><td>Subject:</td><td><input type=\"text\" name=\"subj\" id=\"subj\" autocomplete=\"off\" tabIndex=\"6\" maxlength=100 size=70 /></td></tr>\n<tr><td>Messages:</td><td><textarea name=\"message\" id=\"message\" tabIndex=\"7\" rows=5 cols=50></textarea></td></tr></table>\n";
document.getElementById('form_part1').innerHTML=toDisp;
toDisp="<input type=\"button\" name=\"send_msg\" id=\"send_msg\" value=\"Submit\" tabIndex=\"8\" onClick=\"javascript:subCmt(document.getElementById(\'name\').value, document.getElementById(\'subj\').value, document.getElementById(\'message\').value, document.getElementById(\'ref\').value)\;\" />\n\n</form>";
document.getElementById('form_part2').innerHTML=toDisp;
}
}