function GetComment_($ID,$Page,$sort,$pid){
	$.ajax({
		url:"/Shop/Jaychan/Q/Comment.asp?action=ajax_getcomment&id="+$ID+"&page="+$Page+"&sort="+$sort+"&pid="+$pid+"&time"+new Date().toString(),
		type:'GET',
		success:function(){
			$('#comment_').html(arguments[0]);
		}
	});
}
function SendComment_(){	
		var $CommentParentID_	=arguments[0];
		var $CommentUser_		=$('#CommentUser_').val();
		var $CommentText_		=$('#CommentText_').val();
		var $CommentEmail_		=$('#CommentEmail_').val();
		var $CommentValidate_	=$('#CommentValidate_').val();
		var $user_P_	=$('#user_P_').val();
		var $sort_	=$('#sortId_P_').val();
		var $pid_	=$('#pid_P_').val();
		var $pid_N_	=$('#pid_N_').val();
		if ($.trim($CommentUser_)=='')
		{
			alert('请您填写用户名称！');
			$('#CommentUser_').focus();
			return false;
		}
		if ($.trim($CommentValidate_)=='')
		{
			alert('请您填写验证码！');
			$('#CommentValidate_').focus();
			return false;
		}		
		if ($.trim($CommentText_)=='')
		{
			alert('请您填写评论内容！');
			$('#CommentText_').focus();
			return false;
		}
		if ($CommentText_.length<5||$CommentText_.length>200)
		{
			alert('内容必须在5-200字之间！');		
			return false;
		}
		StopButton('CommentSubmit_',10);
	$.ajax({
		url:"/Shop/Jaychan/Q/Comment.asp?action=ajax_sendcomment&commentparentid="+$CommentParentID_+"&commentuser="+escape($CommentUser_)+"&commenttext="+escape($CommentText_)+"&commentvalidate="+escape($CommentValidate_)+"&user="+escape($user_P_)+"&pid_N="+escape($pid_N_)+"&email="+escape($CommentEmail_)+"&sort="+$sort_+"&pid="+$pid_+"&LinkU="+escape(location)+"&time="+new Date().toString(),
		type:'GET',
		success:function(){
			if (arguments[0]=='ERROR')
			{
				alert('验证码出错！');
			}else{
				GetComment_($CommentParentID_,0,$sort_,$pid_);
				alert(arguments[0]);
				$("#CommentText_").val("");
					//验证成功时，刷新验证码图片
				$("#CommentValidateImages_").attr("src","/Shop/Jaychan/P/Code.asp?s="+Math.random());
			}
			$("#CommentValidate_").val("");
		}
	});
//SetCookie("CommentUser",$CommentUser,3);
}
