<!--
//check  form
var disableButton=false;

function chkEntry() {

   var f = document.newGameAccount;
      
   var selIndex 
   var selText


      
   var okchar = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
   var okchar2 = "abcdefghijklmnopqrstuvwxyz0123456789";
   var okchar3 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

   if ( f.mid.value == '' ) {
		f.mid.focus();
		alert("請輸入曙光2遊戲帳號!");
		return false;
	}
	if ( f.password.value == '' ) {
		f.pwd.focus();
		alert("請輸入曙光2遊戲密碼!");
		return false
	}	 
	
   if(f.account.value == "")  {
   	alert("請輸入元氣卡帳號");
   	f.account.focus();
	f.account.select(); 
   	return false;	  	
	}

    if(f.account.value.length < 6 || f.account.value.length >20)  {
   	alert("帳號必須為6-20個字元");
   	f.account.focus();
	f.account.select();   
	return false;	
	}
	var allValid = true;
  	for (i = 0;  i < f.account.value.length;  i++)
  	{
    		ch = f.account.value.charAt(i);
    		for (j = 0;  j < okchar2.length;  j++)

	      		if (ch == okchar2.charAt(j))
        			break;

    			if (j == okchar2.length)
    			{
      				allValid = false;
      				break;
    			}
  	}
  	

  	if (!allValid)
  	{
    		alert("帳號只能輸入小寫字母或數字字元！");
    		f.account.focus();
    		f.account.select();
    		return false;
  	}	
  	

   if(f.pwd.value == "" || f.pwd1.value == "")  {
   	alert("請輸入密碼");
   	f.pwd.focus();
	f.pwd.select(); 
   	return false;
   	}
   	
   if(f.account.value == f.pwd.value)  {
   	alert("帳號密碼不可相同，請重新輸入");
   	f.pwd.focus();
	f.pwd.select(); 
   	return false;
   	}
   	   	
   if(f.pwd.value != f.pwd1.value)  {
   	alert("兩次密碼不相同,請重新輸入");
     	
	return false;
	}  	

    if(f.pwd.value.length < 6 || f.pwd.value.length > 12)  {
   	alert("密碼必須為6-12個字元");
   	f.pwd.focus();
	f.pwd.select();   
	return false;	
	}
	
  	for (i = 0;  i < f.pwd.value.length;  i++)
  	{
    		ch = f.pwd.value.charAt(i);
    		for (j = 0;  j < okchar.length;  j++)

	      		if (ch == okchar.charAt(j))
        			break;

    			if (j == okchar.length)
    			{
      				allValid = false;
      				break;
    			}
  	}

  	if (!allValid)
  	{
    		alert("密碼只能輸入字母或數字字元！");
    		f.pwd.focus();
    		f.pwd.select();
    		return false;
  	}
  	
	if(f.name.value.length > 20 ) {  	
   	alert("您的姓名太長了");
	f.name.focus();
	f.name.select(); 
	return false;  	
   	}
	 if(f.name.value.length == 0 ) {  	
   	alert("請輸入姓名");
	f.name.focus();
	f.name.select(); 
	return false;  	
   	}
    if(f.tid.value.length == 0 ) {  	
   	alert("請輸入身份正字號");
	f.name.focus();
	f.name.select(); 
	return false;  	
   	}
	 if(f.tel.value == "" || f.tel.value.length != 10  )  {
   	alert("請輸入手機號碼");
   	f.tel.focus();
	f.tel.select(); 
   	return false ;	  	
	}
	  if(isInt(f.Byear)==false)
	{
	
	    alert ("出生年份請用數字");
	    f.Byear.focus();
	    f.Byear.select();
	    return false ;
	}
	var str1=f.Email.value;
		if ((str1.indexOf("@")<0) ||(str1.indexOf(".")< 1) )
 		{
			alert("EMAIL不正確");
			f.Email.focus();
			f.Email.select();
    		return false ;
    		} 
   if(f.address.value.length == 0 ) {  	
   	alert("請輸入住址");
	f.address.focus();
	f.address.select(); 
	return false;  	
   	}
    if(f.mid.value.length < 6 || f.mid.value.length >20)  {
   	alert("帳號必須為6-20個字元");
   	f.mid.focus();
	f.mid.select();   
	return false;	
	}
		
  
 
	if ( f.checkbox.checked != true ) {
		alert("請確認閱讀過會員使用合約!");
		return false;
	}
	

  f.submit();	  
   return true;

}	


function isInt(elm)
{
	var elmstr=elm.value + "";
	var l=elmstr.length;
	if (elmstr== "" ) return false;
	for (var i=0; i < l ; i++ )
	{
		if ((elmstr.charAt(i) < "0") || (elmstr.charAt(i)>"9"))
		{
			return false;
		}
	}
	return true;
}
//-->
