efform_onload = function() {  
  
  //ef.get("p_username").focus();
  //ef.get("p_username").select();
  if (self != parent){
    self.parent.location=document.location;
  } 
}

passwordOnFocus = function() {
  ef.get("userLoginPsd").select();
}

usernameOnFocus = function() {
  ef.get("userLoginNo").select();
}

resetClick = function() {
  ef.get("userLoginNo").value="";
  ef.get("userLoginPsd").value=""; 		
  document.forms[0].reset();
}

loginClick = function() {
	var check = document.getElementById("check");
	if(check.checked==false){
		alert("请阅读服务条款");
		return;
	}
	var pwd = document.getElementById("userLoginPsd").value;
	var rand = document.getElementById("ccode").value;
	var username = document.getElementById("userLoginNo").value;
	if(username == ""){
		alert("请输入帐号");
		return;
	}
	if(pwd == ""){
		alert("请输入密码");
		return;
	}
	if(rand == ""){
		alert("请输入验证码");
		return;
	}
	if(username != "baostar"){
		
	if(username.substring(0,6) == "U00108" || (username.indexOf("T") == -1 && username.indexOf("U") == -1)){
		alert("对不起，该帐号不能登录！");
		return;
	}
	}
	if(!checkpwd(pwd)){
		alert("您的密码过于简单，为了保护您的帐户安全，请及时更改！");
	}
	$('.s_login').attr('disabled','disabled');
	$('.s_login').val('登录中');
	$('.s_login').attr('style','color:#cccccc');
	document.forms[0].submit();
}
text_onkeypress = function(){   
  		if(event.keyCode==13){ 
	  		this.loginClick(); 
    	}
	}

function registerClick(){
	window.location.href = "DispatchAction.do?efFormEname=GOCM0202";
}
function reloadImage(obj){
	obj.src = "http://www.bsteel.net/baosteel_cas2/ccode.jsp?t="+new Date().getTime();
}


keyPressLogin = function() {
  if(event.keyCode==13) {
    document.forms[0].submit();
  }
}


function checkpwd(password){
	var isNum = /^[0-9]+.?[0-9]*$/;
	var isChar = /^[a-zA-Z]+$/;
	if(password.length < 6){
		//alert('新密码的长度至少要6位');
		return false;
	}
	if(isNum.test(password)){
		//alert('新密码不能全为数字.');
		return false;
	}
	if(isChar.test(password)){
		//alert('新密码不能全为字母.');
		return false;
	}
	return true;
}

