//弹出注销登录框
function signout() { if(confirm("您确定要退出吗?")) { return true; } return false; }
//登录
function topLogin() {
	var basePath = $($("body")[0]).attr("base");
	var O_Account = $("#O_AccountTop");//获取用户帐号控件
    var O_Psd = $("#O_PsdTop");//获取密码控件
	var v_account = $.trim(O_Account.val());
	var v_psd = $.trim(O_Psd.val());
	if(v_account == "") {
		alert("帐号不能为空！");
		O_Account.val("");
		O_Account.focus();
	} else if(v_psd == "") {
		alert("密码不能为空！");
		O_Psd.val("");
		O_Psd.focus();
	} else {
		$.post(basePath + "?m=login.check", { account:v_account, password:v_psd }, function(data) {//alert(data);
			if(data[0] == "success") {
				window.location.reload();
			} else {
				alert(data[1]);
				if(data[2] == "account is null") {
					O_Account.val("");
					O_Account.focus();
				} else if(data[2] == "password is null") {
					O_Psd.val("");
					O_Psd.focus();
				} else if(data[2] == "member is not exists") {
					O_Account.focus();
				} else if(data[2] == "member is stopped") {
					O_Account.focus();
				} else if(data[2] == "password error") {
					O_Psd.val("");
					O_Psd.focus();
				}
			}
		}, "json");
    }
}
//注册
function topRegister() {
	//启动浏览模式
	var range = getRange();
	var obj_doing = document.getElementById("doing");
	if(range != null && obj_doing != null) {
		obj_doing.style.width = range.width + "px";
		obj_doing.style.height = (range.height + 100)+ "px";
		obj_doing.style.display = "block";
	}
	var divReg = document.getElementById("divReg");
	if(divReg != null) { divReg.style.display = ""; }
	var divRegF = document.getElementById("divRegF");
	if(divRegF != null) { divRegF.style.display = ""; }
}
//忘记密码
function topForget() {
	//alert("forget");
}