jQuery(function($){
	$('#slogin').click(function() {
		var flag = true;
		var param = "submit=submit";
		var arrParam = new Array;
		$("#tlogin").find("input").each(function(i){
			if(this.value == "")
			{
				alert("用户名或者密码不能为空!")
				flag = false;
				return false;
			}
			if(this.type == 'text' || this.type == 'password')
			{
				param += "&" + this.name + "=" +this.value;
			}
			return true;
		});
		if(flag)
		{
			$.ajax({
				   type: "POST",
				   url: "index.php",
				   data: param,
				   dataType:'json',
				   async:'true',
				   success: function(objt)
				   {
				   		if(objt.flag == false) 
				   		{	
				   			$("#tlogin").find("input")[0].value = "";
				   			$("#tlogin").find("input")[1].value = "";
				   			alert(objt.msg);
				   			return;
				   		}	
				   		/*
				   		var strDt = $("#tlogin").find("dt")[0].innerHTML;		
							strDt = strDt.replace("用户登录","用户信息");
							$("#tlogin dt").html(strDt);
							$('#tlogin dt a.up, #tlogin dt a.down').bind('click', moveUpDown);
							*/
							var strHTML = "<ul class=\"last\" style=\"list-style:none;border:1px dotted #ccc;margin-left:5px;padding:5px\"><li><b>用户名:</b>&nbsp;&nbsp;&nbsp;&nbsp;" + objt.user + "</li>";
          		if(objt.type == 1)
          		{
          			strHTML += "<li><a href=\"index.php?m=index&a=frame\">控制面板</a></a></li>";
          		}
          		strHTML += "<li><a href=\"index.php?m=index&a=logout\">退出登录</a></li></ul>";
          		$("#tlogin dd").html(strHTML);
				   }
			});		
		}
		return;
	})
});
