function login_check()  {
	if(document.login.username.value=="")  {
		alert("请输入你的用户名.");
		return false;
	} else if(document.login.username.value.length<1) {
		alert("用户名无效，请重新输入.");
		return false;
	} else if(document.login.username.value.length>30) {
		alert("用户名无效，请重新输入.");
		return false;
	} else if(document.login.password.value=="") {
		alert("请输入你的密码.");
		return false;
	} else if(document.login.password.value.length<2) {
		alert("密码无效，请重新输入.");
		return false;
	} else if(document.login.password.value.length>18){
		alert("密码长度不能超过18位.");
		return false;
	} else  {
		return true;
	}
}
function getpass() {
  window.open('http://mail.gszl.gov.cn/cgi-bin/getpass.cgi?lang=gb','','top=100,left=150,width=350,height=200');
}

var username='';
var the_cookie=document.cookie;
var each_cookie=the_cookie.split('; ');  
for(var i=0;i<each_cookie.length;i++) {
    var  each_value=each_cookie[i].split('=');
    if(each_value[0]=='username')
        username=each_value[1];
}
function read_cookie() {
    if(username.indexOf('%40') != -1)    {
        var username_value=username.split('%40')
        document.login.username.value=username_value[0];
        document.login.mail_domain.value=username_value[1];
	}
}

