﻿
function SetTextNull(obj, initValue)
{
    if (obj.value.Trim() == initValue)
    {
        obj.value = "";
    }
}

function SubmitSimpleAsk(objID)
{
    var strTitle;
    var strContent;
    var strHfAnony;
    var MyTitle;
    var MyContent;
    var MyHfAnony;
    var MyhfDID;
    var MyhfCID;
    strTitle = document.getElementById("txtTitle" + objID);
    strContent = document.getElementById("txtContent" + objID);
    strHfAnony = document.getElementById("hfAnony" + objID);
    MyhfDID = document.getElementById("hfDID" + objID);
    MyhfCID = document.getElementById("hfCID" + objID);
    
    if (strTitle.value=="" || strTitle.value=="请输入你的问题")
    {
        alert("请输入您要提问的标题！");
        strTitle.focus();
        return false;
    }
    else if (strContent.value=="" || strContent.value=="请在此输入你咨询的内容，如：我怀孕了，应该做哪些检查呢。我28岁。")
    {
        alert("请输入您要提问的内容！");
        strContent.focus();
        return false;
    }
    else if (CheckAskLogin("CheckDoctor") == "1")
    {
        alert("对不起，您是医生会员，不能进行提问！");
        strContent.focus();
        return false;        
    }
    else
    {
        MyTitle = strTitle.value;
        MyContent = strContent.value;
        
        //标题
        document.getElementById("txtTitle").value = MyTitle;
        //内容
        document.getElementById("txtContent").value = MyContent;
        //是否匿名
        MyHfAnony = "0";
        if (strHfAnony != null)
        {
            if(strHfAnony.checked)
            {
                MyHfAnony = "1";
            }
        }
        document.getElementById("hfAnony").value = MyHfAnony;
        //科室
        //document.getElementById("hfDID").value = MyhfDID;
        //诊室
        //document.getElementById("hfCID").value = MyhfCID;
        
        FormSimpleAsk.submit();
    }
}