function popupFlagSubmit()
{
if (document.popupflagform.flag_reason.selectedIndex==0)
{
alert("Please select a reason.");
return false;
}
else
{
xlocationmenu.onClose();
var obj = xGetElementById("popupflagtable");
if (obj) obj.style.display="none";
obj = xGetElementById("popupflagwait");
obj.style.display="block";
xlocationmenu.onOpen(xWidth(xGetElementById("tb001")), xHeight(xGetElementById("tb001")), xlocationmenu.triggerObj(), xlocationmenu.getCurrentDisp());
var query = "s=" + document.popupflagform.sessionid.value +
(document.popupflagform.sid!=null ? "&i=" + document.popupflagform.sid.value : "&ti=" + document.popupflagform.ti.value) +
"&c=" + encodeURIComponent(document.popupflagform.flag_message.value) +
"&r=" + encodeURIComponent(document.popupflagform.flag_reason.options[document.popupflagform.flag_reason.selectedIndex].text) +
"&ri=" + document.popupflagform.flag_reason.options[document.popupflagform.flag_reason.selectedIndex].value +
"&t=" + document.popupflagform.t.value +
"&cc=" + (document.popupflagform.email_copy.checked ? "Y" : "N");
makeRequest('/com/flag.jsp', flagHandler, query);
}
}
function showFlagForm()
{
xlocationmenu.onClose();
var obj = xGetElementById("popupflagtable");
if (obj) obj.style.display="block";
obj = xGetElementById("popupflagwait");
obj.style.display="none";
xlocationmenu.onOpen(xWidth(xGetElementById("tb001")), xHeight(xGetElementById("tb001")), xlocationmenu.triggerObj(), xlocationmenu.getCurrentDisp());
}
function flagHandler()
{
try
{
if (ajax_abort || http_request.readyState == 4)
{
xlocationmenu.onClose();
var obj = xGetElementById("popupflagwait");
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:showFlagForm(); void(0);\">Back</a>";
}
}
finally
{
xlocationmenu.onOpen(xWidth(xGetElementById("tb001")), xHeight(xGetElementById("tb001")), xlocationmenu.triggerObj(), xlocationmenu.getCurrentDisp());
http_request = null;
}
}