function commentAdd(content,nodes,object_id,module){
	$("#code_error").html("");
	auth_code = $('#code_name').val();//验证码
	if(content == ''){
	   alert("你忘记写评论内容了吧?~呵呵");
	}
	else{
		$("#newComment input").attr("disabled","disabled");
		$("#newComment textarea").attr("disabled","disabled");
		$("#newComment h4").html("正在提交评论数据...");
	    for(var i=0;i<=nodes.length;i++){
		   if(nodes[i].checked){
			 manner_data = "is_anonymous="+nodes[i].value;
			  break;
		    }
	     }
		$.ajax({
			type: "POST",
			url: "/ajax/comment_add.php",
			data: manner_data+"&content="+content+"&object_id="+object_id+"&module="+module+"&auth_code="+auth_code,
			success: function(data){
				if (data == 1){
					$("#newComment input").removeAttr("disabled");
					$("#newComment textarea").removeAttr("disabled");
					$('#code_error').html('验证码错误！');
				}
				else{
					$("#newComment h4").fadeIn(1000).html("评论成功！你可以再写一条评论~");
					$("#newComment input").removeAttr("disabled");
					$("#newComment textarea").removeAttr("disabled").val("");
					tmp_html = $("#suggestionList ol").html();
					$("#suggestionList ol").html(data).append(tmp_html);
					rechange_auth_code();
				}
			},
			error: function(){
				$("#newComment h4").html("评论失败，请重试！");
				$("#newComment input").removeAttr("disabled");
				$("#newComment textarea").removeAttr("disabled");
			}
		});
   } 
}

function comment_vote(id,num,vote){
	if (num == '1'){
    $.ajax({
		type: "GET",
		url:  "ajax/comment_vote.php",
		data: "id="+id+"&num="+num+"&vote="+vote,
		success: function(data){
		if(!isNaN(Number(data))){
		   $('#suggestionList span[@name='+id+'supported]').html("得票数: "+data);
		}else{
		   $('#suggestionList span[@name='+id+'supported]').html(data);
		}
	},
		error: function(){
		}
	});
  }else{
	$.ajax({
		type: "GET",
		url:  "ajax/comment_vote.php",
		data: "id="+id+"&num="+num,
		success: function(data){
		if(!isNaN(Number(data))){
		   $('#suggestionList span[@name='+id+'opposed]').html("得票数: "+data);
		}else{
		   $('#suggestionList span[@name='+id+'opposed]').html(data);
		}	
	},
		error: function(){
		}
	});
	}
}

//咨询评分上的评论
function thickbox_comment(content,auth_code,object_id,module){
	if(content == ''){
	   alert("你忘记写评论内容了吧?~呵呵");
	}
	else{
		$("#thick_comm input").attr("disabled","disabled");
		$("#thick_comm textarea").attr("disabled","disabled");
		$("#thick_comm span").html("正在提交评论数据...");

		$.ajax({
			type: "POST",
			url: "ajax/comment_add.php",
			data: "content="+content+"&object_id="+object_id+"&module="+module+"&auth_code="+auth_code,
			success: function(){
				$("#thick_comm span").fadeIn(1000).html("评论成功!请去该咨询评论区查看~");
				$("#thick_comm input").removeAttr("disabled");
				$("#thick_comm textarea").removeAttr("disabled");
				setTimeout('tb_remove()',1600);
				rechange_auth_code();
			},
			error: function(){
				$("#thick_comm span").html("评论失败，请重试！");
				$("#thick_comm input").removeAttr("disabled");
				$("#thick_comm textarea").removeAttr("disabled");
			}
		});
   }
}

