var login_show=function() {
	$("#GB_overlay").show();
	GB_position();
	$("#GB_window").slideDown("slow");
}

var loginformvalid=function(){
	var ifsubmit=true;
	
	$("#emailerror").html("");
	$("#pwderror").html("");
	
	var email=$("#email").val();
	var pwd=$("#pwd").val();
	
	if (email=='' || email==null){
		$("#emailerror").html("邮件不能为空");
		ifsubmit=false;
	}
	else {
		var reg=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;				
		if(!reg.test(email)){
			$("#emailerror").html("邮件格式不正确");
			ifsubmit=false;
		}
	}
	
	if (pwd=='' || pwd==null){
		$("#pwderror").html("密码不能为空");
		ifsubmit=false;
	}
	
	return ifsubmit;
	
}

function GB_position() {
	var de = document.documentElement;
	var GB_HEIGHT = 200;
	var GB_WIDTH = 460;
	var w = self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
	$("#GB_window").css({width:GB_WIDTH+"px",height:GB_HEIGHT+"px",
	left: ((w - GB_WIDTH)/2)+"px", top: "50px" });		 
}

function GB_hide() {
		$("#GB_window,#GB_overlay").hide();
}