function popupMsgSubmit()
{
var subject = document.popupmsgform.subject.value.replace(/^\s+|\s+$/, "");
var content = document.popupmsgform.content.value.replace(/^\s+|\s+$/, "");
if (subject=="")
{
alert("Please type subject.");
return false;
}
else if (content=="")
{
alert("Please type content.");
return false;
}
else
{
xlocationmenu.onClose();
var obj = xGetElementById("popupmsgtable");
if (obj) obj.style.display="none";
obj = xGetElementById("popupmsgwait");
obj.style.display="block";
xlocationmenu.onOpen(xWidth(xGetElementById("tb001")), xHeight(xGetElementById("tb001")), xlocationmenu.triggerObj(), xlocationmenu.getCurrentDisp());
var query = "s=" + document.popupmsgform.sessionid.value +
"&c=" + encodeURIComponent(content) +
"&subject=" + encodeURIComponent(subject) +
"&tid=" + document.popupmsgform.tid.value;
makeRequest('/com/msg.jsp', msgHandler, query);
}
}
function showMsgForm()
{
xlocationmenu.onClose();
var obj = xGetElementById("popupmsgtable");
if (obj) obj.style.display="block";
obj = xGetElementById("popupmsgwait");
obj.style.display="none";
xlocationmenu.onOpen(xWidth(xGetElementById("tb001")), xHeight(xGetElementById("tb001")), xlocationmenu.triggerObj(), xlocationmenu.getCurrentDisp());
}
function msgHandler()
{
try
{
if (ajax_abort || http_request.readyState == 4)
{
xlocationmenu.onClose();
var obj = xGetElementById("popupmsgwait");
if(!ajax_abort && http_request.status == 200)
{
if(http_request.responseText != null)
{
obj.innerHTML = http_request.responseText;
return;
}
}
obj.innerHTML = "Cannot execute request, please try again later. <a href=\"javascript:showMsgForm(); void(0);\">Back</a>";
}
}
finally
{
xlocationmenu.onOpen(xWidth(xGetElementById("tb001")), xHeight(xGetElementById("tb001")), xlocationmenu.triggerObj(), xlocationmenu.getCurrentDisp());
http_request = null;
}
}