﻿
        function CheckData()
        {
            if(document.getElementById('txtPublishContent').value=="")
            {
                alert('请填写内容');
                return false;
            }
            return true;
        }

		function updateBBSTopicVote(bbsTopicId,voteType)
		{
		    if($("#lnkBBSTopic" + voteType).html().indexOf("已") == -1)
		    {
		        var url = '/AjaxPage/UpdateBBSTopicAgreeOrAgainstNumAjax.aspx';
				$.get(url,{"type":voteType,"id":bbsTopicId,"rand":new Date()}, showBBSTopicVoteResult);
		    }
		}    
		
		function showBBSTopicVoteResult(originalRequest)
		{						    
			eval("var ret = " + originalRequest);
			if(ret.VoteResult > 0)
			{
				if(ret.VoteType =='Agree')
				{
					$("#lnkBBSTopic" + ret.VoteType).html("已支持(" + ret.VoteResult + ")");
				}
				else
				{
					$("#lnkBBSTopic" + ret.VoteType).html("已反对(" + ret.VoteResult + ")");
				}
			}
			else
			{
				alert("您的操作失败，请稍后再试！");
			}
		}
	
		function updateBBSTopicReplyVote(replyId, voteType)
		{
			if($("#lnkBBSTopicReply" + replyId + voteType).html().indexOf("已") == -1)
		    {
		        var url = '/AjaxPage/UpdateBBSTopicReplyAgreeOrAgainstOrBestNumAjax.aspx';
				$.get(url,{"type":voteType,"id":replyId,"rand":new Date()}, showBBSTopicReplyVoteResult);
		    }
		} 
		   
		function showBBSTopicReplyVoteResult(originalRequest)
		{						    
			eval("var ret = " + originalRequest);
			if(ret.VoteResult > 0)
			{
				if(ret.VoteType =='Agree')
				{
					$("#lnkBBSTopicReply" + ret.ReplyId + ret.VoteType).html("已支持(" + ret.VoteResult + ")");
				}
				else
				{
					$("#lnkBBSTopicReply" + ret.ReplyId + ret.VoteType).html("已反对(" + ret.VoteResult + ")");
				}
			}
			else
			{
				alert("您的操作失败，请稍后再试！");
			}
		}
		
		function addBBSReplyId(str)
		{
		    document.getElementById('HideBBSReplyId').value=str;
		}
		
		function BBSTopic_SetOrCancelTop(Id,Type)
		{
			$.get("/AjaxPage/BBSTopicSetOrCancelTopAjax.aspx",{type:Type,id:Id},showBBSTopic_SetOrCancelTop);
		}
		function showBBSTopic_SetOrCancelTop(result)
		{					
			if(typeof result != 'undefined')
			{		
 			    if(result==1)  
			    {
				    alert("操作成功");
				}
				else
				{
				    alert("操作失败");
				}
			}
		}
		
		function BBSTopic_SetOrCancelGood(Id,Type)
		{
			$.get("/AjaxPage/BBSTopicSetOrCancelGoodAjax.aspx",{type:Type,id:Id},showBBSTopic_SetOrCancelGood);
		}
		function showBBSTopic_SetOrCancelGood(result)
		{					
			if(typeof result != 'undefined')
			{		
 			    if(result==1)  
			    {
				    alert("操作成功");
				}
				else
				{
				    alert("操作失败");
				}
			}
		}
		
		function BBSTopic_DeleteOrRefuse(Id,Type)
		{
			$.get("/AjaxPage/BBSTopicDeleteOrRefuseAjax.aspx",{type:Type,id:Id},showBBSTopic_DeleteOrRefuse);
		}
		function showBBSTopic_DeleteOrRefuse(result)
		{					
			if(typeof result != 'undefined')
			{		
			    if(result==1)  
			    {
				    alert("操作成功");
				}
				else
				{
				    alert("操作失败");
				}
			}
		}
		
		function BBSReplyTopic_DeleteOrRefuse(Id,Type)
		{
			$.get("/AjaxPage/BBSReplyTopicDeleteOrRefuseAjax.aspx",{type:Type,id:Id},showBBSReplyTopic_DeleteOrRefuse);
		}
		
		function showBBSReplyTopic_DeleteOrRefuse(result)
		{					
			if(typeof result != 'undefined')
			{		
			    if(result==1)  
			    {
				    alert("操作成功");
				}
				else
				{
				    alert("操作失败");
				}
			}
		}
