$(function(){
	$("#signInButton").click(function(){
		var se=new setError();
		if(se.checkForm()){
			memberloginForm.submit();
		}else{
			se.showError();
			return false;
		}
		
	})
})

function setError(){
	this.errMsg="";
	this.showError=function (){
		$("#loginerror").empty();
		$("#loginerror").css("display","none");
		$("#loginerror").append(this.errMsg);
		$("#loginerror").fadeIn(1000);
	};
	this.checkForm=function (){
		if($("#username")[0].value==""){
			this.errMsg="请输入账号";
			return false;
		}else if($("#password")[0].value==""){
			this.errMsg="请输入密码";
			return false;
		}else{
			$("#loginerror").remove();
			return true;
		}
	};
	this.init=function() {
		$("#usernamerow").append("<span id='loginerror' class='generalerror error' style='display:none'>&nbsp;</span>");
	};
	this.init();
}

