/**
 * 登陆
 */
function login() {
	try {
		
		var number = $("#number").val();
		var password = $("#password").val();
		var code = $("#code").val();
		if(number == "" || number == undefined){
			alert("请输入学号");
			return false;
		}
		if(password == "" || password == undefined){
			alert("请输入登陆密码");
			return false;
		}
		if(code == "" || code == undefined){
			alert("请输入验证码");
			return false;
		}
		$.ajax({
			type: "POST",
			url: "/studentView.shtml?method=login&number="+myjs.encodeByValue(number)+"&password="+myjs.encodeByValue(password)+"&time="+new Date().getTime(),
			dataType:"text",
			success: function(data){ 
				if("suc" == data) {
					alert('登陆成功!');
					document.location.href='/studentView.shtml?method=center';
				}else if("你的资料信息不全,请填写相关信息" == data){ 
					alert(data);
					document.location.href='/studentView.shtml?method=update';
				}else {
					alert(data);
					$("#password").val("");
					$("#code").val("");
				}
			} 
		});
	} catch(e) {
		alert(e);
		return false;
	}
}		

