var HishopQuestionAjaxUrlBase;
var HishopQuestionAjaxShowRe="False";//是否允许回复
var HishopQuestionAjaxShowAuditingAndEmbody="False";//是否允许修改审核状态

//var QuestionServiceUrl="<% =Trihero.Hishop.Common.Path.FromServerPath("~/HishopAjax/Def.aspx") %>";
function QuestionRe(_id)
{
    var _reText=document.getElementById("MessageReTextArea_"+_id);    
    var theUrl=HishopQuestionAjaxUrlBase+"?ShowAuditingAndShowEmbody="+HishopQuestionAjaxShowAuditingAndEmbody+"&ShowRe="+HishopQuestionAjaxShowRe+"&MessageId="+_id+"&ReText="+escape(_reText.value);
	GetValue2(theUrl,QuestionReShowDiv,_id);
}
function QuestionAuditingAndEmBodyButton(_id)
{
    var AuditingChecked=document.getElementById("MessageAuditing_"+_id).checked;
    var EmbodyChecked=document.getElementById("MessageEmbody_"+_id).checked;
    var theUrl=HishopQuestionAjaxUrlBase+"?ShowAuditingAndShowEmbody="+HishopQuestionAjaxShowAuditingAndEmbody+"&ShowRe="+HishopQuestionAjaxShowRe+"&MessageId="+_id+"&Auditing="+AuditingChecked+"&Embody="+EmbodyChecked;
    
    GetValue2(theUrl,QuestionReShowDiv,_id);
 }
function QuestionReShowDiv(_showText,_id)
{
    var _theDiv=document.getElementById("MessageId_"+_id);
    if (_theDiv!=null){
        setInnerHTML(_theDiv,_showText);
        //_theDiv.innerHTML=_showText;
        }
}

//加个新的消息
function QuestionAdd(_messageId,_clientId)
{
    var theUrl=HishopQuestionAjaxUrlBase+"?ShowAuditingAndShowEmbody="+HishopQuestionAjaxShowAuditingAndEmbody+"&ShowRe="+HishopQuestionAjaxShowRe+"&MessageId="+_messageId;    
     GetValue2(theUrl,QuestionAddShowDiv,_clientId);
}

function QuestionAddShowDiv(_showText,_clientId)
{
    var _table=document.getElementById("MessageTable_"+_clientId);
    if (_table!=null)
    {
      var col = InsTableCell(_table,0)     
      col.className = "MessageItem";
      col.innerHTML = _showText;
    }
}

function QuestionDel(_parentControl,_rowIndex,_messageId)
{
     if (confirm('确定吗?'))
     {
     var theUrl=HishopQuestionAjaxUrlBase+"?Delete=1&MessageId="+_messageId;    
     GetValue2(theUrl,QuestionDelShowDiv,_parentControl,_rowIndex);
     }
}
function QuestionDelShowDiv(_showText,_parentControl,_rowIndex)
{
    if (_showText=="1" && _parentControl !=null)
    {       
        if (_parentControl.nodeName=="TABLE")
            DelTableRow(_parentControl,_rowIndex);
        else
            _parentControl.style.display = "none";
        
    }
}

function QuestionChangeTextBox_Onblur(_theValue,_messageId,_literText)
{
    var theUrl=HishopQuestionAjaxUrlBase+"?Change=1&MessageId="+_messageId+"&ChangeText="+escape(_theValue);

    GetValue2(theUrl,QuestionChangeShowDiv,_literText);
}
function QuestionChangeShowDiv(_showText,_literText)
{
    _literText.innerHTML=_showText.replace("<script type=\"text/javascript\"></script>","");
}


