/********************************************************
*	科室系统后导航/分类管理
*	author: bridgler
*	mail:   bridgler@gmail.com
*	date:	2007-05-28
*	描述：	科室系统后导航/分类管理
*	version:	1.0
********************************************************/
//更改分类显示状态
function messageAdd(message,auth_code){
    $("#code_error").html("");
	if(message=="")
	{
		alert("你忘记写留言内容了吧？~呵呵");
	}else if(auth_code == ''){
		alert('请输入验证码!');
	}
	else
	{
		$("#newSuggestion input").attr("disabled","disabled");
		$("#newSuggestion textarea").attr("disabled","disabled");
		$("#newSuggestion h4").html("正在提交留言数据...");
		$.ajax({
			type: "POST",
			url: "ajax/message_add.php",
			data: "message="+message+"&auth_code="+auth_code,
			success: function(data){
				if(!isNaN(Number(data))){
					$("#newSuggestion h4").html("发表一条意见...");
					$("#newSuggestion input").removeAttr("disabled");
					$("#newSuggestion textarea").removeAttr("disabled").val("");
					$("#code_name").val("");
					$("#code_error").html("验证码错误");
				}else{
					$("#newSuggestion h4").fadeIn(1000).html("留言成功！你可以再写一条留言~");
					$("#newSuggestion input").removeAttr("disabled");
					$("#newSuggestion textarea").removeAttr("disabled").val("");
					$("#code_name").val("");
					tmp_html = $("#suggestionList ol").html();
					$("#suggestionList ol").html(data).append(tmp_html);
					rechange_auth_code();
				}
			},
			error: function(){
				$("#newSuggestion h4").html("留言失败，请重试！");
				$("#newSuggestion input").removeAttr("disabled");
				$("#newSuggestion textarea").removeAttr("disabled");
				$("#code_name").val("");
			}
		});
	}
}
//搜索验证
function checkSearch()
{
	tmp_val = $("#sugSearch input[type=text]").val();
	if(tmp_val == "" || tmp_val == "再此输入意见反馈关键字...")
	{
		alert("请输入一些你要搜索的文字");
		return false;
	}
}


