function StopButton(){
	document.getElementById(arguments[0]).disabled=true;
	document.getElementById(arguments[0]).value="提交("+arguments[1]+")";
	if(--arguments[1]>0){
		window.setTimeout("StopButton('"+arguments[0]+"',"+arguments[1]+")",1000);
	}
	if(arguments[1]<=0){
		document.getElementById(arguments[0]).value='提交';
		document.getElementById(arguments[0]).disabled=false;
	}
}
function ppcode(){
			$("#CommentValidateImages").attr("src","/member/Code.asp?s="+Math.random());
}
function GetComment($ID,$Page){

	$.ajax({
		url:"/blog1/Comment.asp?action=ajax_getcomment&id="+$ID+"&page="+$Page+"&time"+new Date().toString(),
		type:'GET',
		success:function(){
			$('#comment').html(arguments[0]);
			//$("#CommentValidateImages").attr("src","/member/Code.asp?s="+Math.random());
		}
	});
}
function SendComment(){	
		var $CommentParentID	=arguments[0];
		var $CommentUser		=$('#CommentUser').val();
		var $nm		=$('#nm').val();
		var $CommentText		=$('#CommentText').val();
		var $viewflag	=$('#viewflag1').val();
		var $password	=$('#password').val();
		var $CommentValidate	=$('#CommentValidate').val();
		var $ArticleId	=$('#ArticleId').val();
		//if ($.trim($CommentUser)=='')
		//{
		//	alert('请您填写昵称！');
		//	$('#CommentUser').focus();
		//	return false;
		//}
				
		if ($.trim($CommentText)=='')
		{
			alert('请您填写回复内容！');
			$('#CommentText').focus();
			return false;
		}
		if ($.trim($CommentValidate)=='')
		{
			alert('请您填写验证码！');
			$('#CommentValidate').focus();
			return false;
		}			
	//alert("/blog1/Comment.asp?action=ajax_sendcomment&commentparentid="+$CommentParentID+"&nm="+escape($nm)+"&viewflag="+escape($viewflag)+"&password="+escape($password)+"&commentuser="+escape($CommentUser)+"&commenttext="+escape($CommentText));
		//alert($CommentParentID);
		//alert($CommentUser);
		//alert($CommentText);
		//alert($viewflag);
		//return false;
		//if ($CommentText.length<5||$CommentText.length>200)
		//{
		//	alert('内容必须在5-200字之间！');		
		//	return false;
		//}
		//StopButton('CommentSubmit',10);
	$.ajax({
		url:"/blog1/Comment.asp?action=ajax_sendcomment&commentparentid="+$CommentParentID+"&CommentValidate="+$CommentValidate+"&nm="+escape($nm)+"&viewflag="+escape($viewflag)+"&password="+escape($password)+"&ArticleId="+$ArticleId+"&commentuser="+escape($CommentUser)+"&commenttext="+escape($CommentText)+"&time="+new Date().toString(),
		type:'GET',
		success:function(){
			//alert($CommentUser);
			if (arguments[0]=='ERROR')
			{
				alert('验证码出错！');
				$("#CommentValidateImages").attr("src","/member/Code.asp?s="+Math.random());
			}else{
				GetComment($CommentParentID,99);
				alert(arguments[0]);
				$("#Content").val("");
					//验证成功时，刷新验证码图片
				//$("#CommentValidateImages").attr("src","/member/Code.asp?s="+Math.random());
				$('#CommentText').val("");
			}
			$("#CommentValidate").val("");
			
		}
	});
//SetCookie("CommentUser",$CommentUser,3);
}
function getCheckboxValue(){ 
if (document.getElementById('nm').checked==true)
{
document.getElementById('nm').value=1
}else
	{document.getElementById('nm').value=0}
} 
function getCheckboxValue1(){ 
var objs = window.document.getElementsByName('viewflag'); 
var i; 
var idArray = new Array(); 
var j = 0; 
for(i=0;i<objs.length;i++) 
{  
if(objs[i].checked == true) 
{ 
document.getElementById('viewflag1').value = objs[i].value; 
 } 
}}