function check(url) {
	if ($.trim($("#loginName").val()).length != 0
			&& $.trim($("#password").val()).length != 0) {
		$("#role").empty();
		var obj = {
			"loginName" : $("#loginName").val(),
			"password" : $("#password").val()
		};
		var User = JSON.stringify(obj);
		$.ajax({
			type : "POST",
			url :url+"/user/loadRole",
			data : User,
			contentType : "application/json; charset=utf-8",
			dataType : "json",
			success : function(callback) {
				var html = $("#role").html();
				callback = eval(callback);
				for (var i = 0; i < callback.length; i++) {
					html += "<option value\"" + callback[i].id + "\">"
							+ callback[i].name + "</option>";
				}
				$("#role").html(html);
			}
		});
	}
}

function checkRole(formName){
	if ($.trim($("#loginName").val()).length == 0){
		alert("请输入账号");
		return false;
	}else if($.trim($("#password").val()).length == 0){
		alert("请输入密码");
		return false;
	}
	if(formName.role.value==""){
		alert("需要选择角色登陆!");
		return false;
	}
}
