function GetNewsDiscus(isappend, newsid, name, content, code,page) {
    if (isappend) {
        if (content == "") {
            alert("请输入内容");
            return;
        }
    }

    $.ajax({
    url: "/inc/aspx/NewsDiscusList.aspx",
        data: { id: newsid, name: name, content: content, code: code, isappend: isappend,page:page },
        cache: false,
        success: function(html) {
            if (html == "0")
                alert("验证码不正确");
            else {
                $("#discuz_panel").html(html);

                if (isappend) {
                    $("#txtContent").attr("value", "");
                    $("#txtValidateCode").attr("value", "");
                    $("#validateimg img").attr("src", $("#validateimg img").attr("src") + "p=0");

                    if (name != "")
                        alert("发表成功");
                }
            }
        }
    });
}

function SubmitAsk(topcid, uid, asker, content, code, isnick) {
    if (content == "") {
        alert("请输入内容");
        return;
    }

    if (content.length > 1000) {
        alert("字数太长，请重新输入，仅限1000个字符。");
        return;
    }

    $.ajax({
    url: "/ask/AskPostItemPage.aspx",
        data: { topcid: topcid, uid: uid, asker: asker, content: content, code: code, isnick: isnick },
        cache: false,
        success: function(html) {
            if (html == "0")
                alert("验证码不正确");
            else {
                $("#asklist").append(html);
                $("#txtContent").attr("value", "");
                $("#txtValidateCode").attr("value", "");
                $("#validateimg img").attr("src", $("#validateimg img").attr("src") + "p=0");
                alert("回答成功");
            }
        }
    });
}

function AppendQuestion(topcid, content,uid) {
    if (content == "") {
        alert("请输入内容");
        return;
    }

    $.ajax({
        url: "/ask/AppendQuestion.ashx",
        data: { topcid: topcid, content: content, uid: uid },
        cache: false,
        success: function(html) {
            $(".appendcontent").html(html);
            $(".appendcontent").show();
            $("#appendquespnl").hide();
            alert("补充成功");
        }
    });
}
