$(document).ready(function(){
	
	$("#subject div.list ul li").mouseover(function(){
		$(this).addClass("over").mouseout(function(){
			$(this).removeClass("over")
		});
	});
	
	$("#skill div.list ul li").mouseover(function(){
		$(this).addClass("over").mouseout(function(){
			$(this).removeClass("over")
		});
	});
	
	$("#sites div.list dl").mouseover(function(){
		$(this).addClass("over").mouseout(function(){
			$(this).removeClass("over")
		});
	});
	
	$("#word ul li").mouseover(function(){
		$(this).addClass("over").mouseout(function(){
			$(this).removeClass("over")
		});
	});
	
	
	

	$("#comment").load("/ajax/comment.asp?nid="+$("#comment").attr("lang"));
	
	$("#submit").click(function(){
		var arrow = 0;
		if($("input#truename").val()==""){
			arrow = arrow + 1;
			alert("姓名不能为空！");
			$("#input#truename").focus();
			return false;
		}
		if($("textarea#content").val()==""){
			arrow = arrow + 1;
			alert("内容不能为空！");
			$("textarea#content").focus();
			return false;
		}
		if(arrow == 0){
			$.ajax({
				type: "post",
				url: "/ajax/save.asp",
				data: "truename="+$("#truename").val()+"&content="+$("#content").val()+"&aid="+$("#comment").attr("lang"),
				success: function(xml){
					//alert($("#truename").val());
					$("#truename").val("");
					$("#content").val("");
					$("#comment").load("/ajax/comment.asp?nid="+$("#comment").attr("lang"));
				}
			});	
		}					 
	});
});