﻿function ReMessage(obj, gid)
{
    if(document.getElementById("rediv") != null)
    {
        document.getElementById("rediv").parentNode.removeChild(document.getElementById("rediv"));
    }
    var ta = document.createElement("div");
    ta.id = "rediv";
    ta.innerHTML = "<form id=\"remessageform\" method=\"post\" action=\"?a=save&gid=" + gid + "\" style=\"padding:0px; margin:0px;\">\r\n<textarea id=\"Fq_content\" name=\"Fq_content\" rows=\"5\" style=\"width:400px;\"></textarea>\r\n<button onclick=\"ReFormSubmit()\">提交</button><button onclick=\"this.parentNode.parentNode.parentNode.removeChild(document.getElementById('rediv'))\">取消</button>\r\n</form>";
    
    obj.parentNode.appendChild(ta);
    
} 
function ReFormSubmit()
{
    if(document.getElementById("Fq_content").value.replace(/^\s+|\s+$/g,"") == "")
    {
        alert("填写回复内容再提交");
        document.getElementById("Fq_content").focus();
        return false;
    }
    
    document.forms["remessageform"].submit();
}
function DelMessage(urls)
{
    if(confirm("确定要删除吗？不可恢复"))
    {
        window.location.href = urls;
    }
}
