function favspotSubmit(doc, src_fid, sid, pfid, fn)
{
var query;
if (doc==null)
{
if (document.popupfavspotform.folder_id.value==-1)
if (!confirm("Private note will be removed as well, proceed?")) return;
query = "sid=" + document.popupfavspotform.sid.value +
"&act=" + document.popupfavspotform.act.value +
"&src_folder_id=" + document.popupfavspotform.src_folder_id.value +
"&folder_id=" + document.popupfavspotform.folder_id.value;
}
else if (doc=="ADDTONEWFOLDER")
{
fn = fn.replace(/(^\s*)|(\s*$)/g, "");
if (fn=="")
{
alert("Please enter new folder name.");
return;
}
query = "sid=" + sid +
"&act=" + doc +
"&src_folder_id=" + src_fid +
"&pfid=" + pfid +
"&fn=" + encodeURI(fn)
;
}
else
{
return;
}
xlocationmenu.onClose();
var obj = xGetElementById("popupfavspottable");
if (obj) obj.style.display="none";
obj = xGetElementById("popupfavspotwait");
obj.style.display="block";
xlocationmenu.onOpen(xWidth(xGetElementById("tb001")), xHeight(xGetElementById("tb001")), xlocationmenu.triggerObj(), xlocationmenu.getCurrentDisp());
makeRequest('/com/favspot.jsp', favspotSubmitHandler, query);
}
function favspotSubmitHandler()
{
try
{
if (ajax_abort || http_request.readyState == 4)
{
xlocationmenu.onClose();
var obj = xGetElementById("popupfavspotwait");
if(!ajax_abort && http_request.status == 200)
{
if(http_request.responseText != null)
{
favspot_fid = document.popupfavspotform.folder_id.value;
obj.innerHTML = http_request.responseText.replace(/(^\s*)|(\s*$)/g, "");
return;
}
}
obj.innerHTML = "Cannot execute request, please try again later. <a href=\"javascript:restoreFavSpotForm(); void(0);\">Back</a>";
}
}
finally
{
xlocationmenu.onOpen(xWidth(xGetElementById("tb001")), xHeight(xGetElementById("tb001")), xlocationmenu.triggerObj(), xlocationmenu.getCurrentDisp());
http_request = null;
}
}
function restoreFavSpotForm()
{
xlocationmenu.onClose();
var obj = xGetElementById("popupfavspottable");
if (obj) obj.style.display="block";
obj = xGetElementById("popupfavspotwait");
obj.style.display="none";
xlocationmenu.onOpen(xWidth(xGetElementById("tb001")), xHeight(xGetElementById("tb001")), xlocationmenu.triggerObj(), xlocationmenu.getCurrentDisp());
}