
function winmailLogin() {
	if (document.getElementById("f_user").value == "") {
		alert("\u8bf7\u8f93\u5165\u767b\u5f55\u540d\uff01\uff01");
		document.getElementById("f_user").focus();
		return false;
	}
	if (document.getElementById("f_pass").value == "") {
		alert("\u8bf7\u8f93\u5165\u767b\u5f55\u5bc6\u7801\uff01\uff01");
		document.getElementById("f_pass");
		return false;
	}
	document.forms["winmailLoginForm"].submit();
}
if (typeof SFT == "undefined") {
	SFT = function () {
	};
}
// 登录相关
SFT.login = function (form, returnStatus) {
	var success = false;
	SFT.Transport.fetchJsonObj({url:"/sft/ajax/PortletIndex!login.action", method:"POST", content:buildFormParams(form), async:false, onLoad:function (jsonObj) {
		if (jsonObj.success) {
			if ((typeof returnStatus) != "undefined" && returnStatus == true) {
				success = jsonObj.success;
			} else {
							//登录成功后刷新登录板块
							// fatch(form.ajaxUrl, "", form.blockId);
							//登录成功后刷新整个页面
				if (window && window.parent && window.parent.document) {
					window.parent.document.location.href = "/index/2.html";
				} else {
					if (window) {
						window.document.location.href = "/index/2.html";
					}
				}
			}
		} else {
			alert(jsonObj.customMsg);
			form.reset();
		}
	}});
	return success;
};
SFT.register = function (form) {
	//点击注册按钮后刷新改变浏览器页面
	if (window.parent && window.parent.document) {
		window.parent.document.location.href = "/sft/widget/html/System/m_process/am_c1/fp_/files/ynbyportlet/jsp/register.jsp/58/1239/26/_/_/_/1/0.html";
	} else {
		window.document.location.href = "/sft/widget/html/System/m_process/am_c1/fp_/files/ynbyportlet/jsp/register.jsp/58/1239/26/_/_/_/1/0.html";
	}
};
SFT.logout = function (form) {
	SFT.Transport.fetchJsonObj({url:"/sft/ajax/PortletIndex!logout.action", method:"POST", content:buildFormParams(form), async:false, onLoad:function (jsonObj) {
		if (jsonObj.success) {
						//注销成功后刷新登录板块
						// fatch(form.ajaxUrl, "", form.blockId);

						//注销成功后刷新整个页面
			if (window.parent && window.parent.document) {
				window.parent.document.location.href = "/index/1.html";
			} else {
				window.document.location.href = "/index/1.html";
			}
		} else {
			alert(jsonObj.customMsg);
			form.reset();
		}
	}});
};


