var cur_topic_id, cur_msg_id, buff_subject, cur_subject_div, in_edit_mode = 0, hide_prefixes = []; function modify_topic(b, a, c) { if(window.XMLHttpRequest) { if(typeof window.opera != "undefined") { if(typeof(new XMLHttpRequest).setRequestHeader != "function") { return } } if(in_edit_mode == 1) { if(cur_topic_id == b) { return }else { modify_topic_cancel() } } mouse_on_div = in_edit_mode = 1; cur_topic_id = b; typeof window.ajax_indicator == "function" && ajax_indicator(true); getXMLDocument(smf_scripturl + "?action=quotefast;quote=" + a + ";sesc=" + c + ";modify;xml", onDocReceived_modify_topic) } } function onDocReceived_modify_topic(b) { cur_msg_id = b.getElementsByTagName("message")[0].getAttribute("id"); cur_subject_div = document.getElementById("msg_" + cur_msg_id.substr(4)); buff_subject = getInnerHTML(cur_subject_div); set_hidden_topic_areas("none"); modify_topic_show_edit(b.getElementsByTagName("subject")[0].childNodes[0].nodeValue); typeof window.ajax_indicator == "function" && ajax_indicator(false) } function modify_topic_cancel() { setInnerHTML(cur_subject_div, buff_subject); set_hidden_topic_areas(""); in_edit_mode = 0; return false } function modify_topic_save(b) { if(!in_edit_mode) { return true } var a = []; a[a.length] = "subject=" + escape(textToEntities(document.forms.quickModForm.subject.value)).replace(/\+/g, "%2B"); a[a.length] = "topic=" + parseInt(document.forms.quickModForm.elements.topic.value); a[a.length] = "msg=" + parseInt(document.forms.quickModForm.elements.msg.value); typeof window.ajax_indicator == "function" && ajax_indicator(true); sendXMLDocument(smf_scripturl + "?action=jsmodify;topic=" + parseInt(document.forms.quickModForm.elements.topic.value) + ";sesc=" + b + ";xml", a.join("&"), modify_topic_done); return false } function modify_topic_done(b) { if(!b) { modify_topic_cancel(); return true  } var a = b.getElementsByTagName("smf")[0].getElementsByTagName("message")[0]; b = a.getElementsByTagName("subject")[0]; a = a.getElementsByTagName("error")[0]; typeof window.ajax_indicator == "function" && ajax_indicator(false); if(!b || a) { return false } subjectText = b.childNodes[0].nodeValue; modify_topic_hide_edit(subjectText); set_hidden_topic_areas(""); in_edit_mode = 0; return false } function set_hidden_topic_areas(b) { for(var a = 0;a < hide_prefixes.length;a++) { if(document.getElementById(hide_prefixes[a] + cur_msg_id.substr(4)) != null) { document.getElementById(hide_prefixes[a] + cur_msg_id.substr(4)).style.display = b } } } ;
