function check_uid ( uid ){
if( uid.length <= 0 )
return( "Please enter your \"ID\".\n" );
if( uid.length <3 || uid.length> 12 )
return( "Sorry, your ID must be more than 3 characters.\n" );
for( idx = 0 ; idx <uid.length ; idx++ )
{
if( !(( uid.charAt(idx)>= 'a' && uid.charAt(idx) <= 'z' ) || 
      ( uid.charAt(idx)>= 'A' && uid.charAt(idx) <= 'Z' ) || 
      ( uid.charAt(idx)>= '0' && uid.charAt(idx) <= '9' ) || 
      ( uid.charAt(idx) == '_' ) || ( uid.charAt(idx) == '.' ) ))
return( "Your ID have to be digits, English characters and only \"_\" \".\".\nNo other symbols can be contained !\n" );
if( uid.charAt(idx) == '_' && uid.charAt(idx-1) == '_' )
return( "\"_\" cannot put together !\n" );
}
if( uid.charAt( uid.length - 1 ) == '_' ) return( "\"_\" cannot be the last character !\n" );
return "";
}

function check_passwd ( pw1, pw2 )
{
if( pw1 == '' ) {
return ("Please enter your \"Password\".\n");
}
for( var idx = 0 ; idx <pw1.length ; idx++ )
if( pw1.charAt(idx) == ' ' || pw1.charAt(idx) == '\"' )
return ("Sorry, password cannot have space and quotation mark !\n");
if( pw1.length <6 || pw1.length> 8 )
return( "Sorry, your password much be more than 6 characters.\n" );
if( pw1 != pw2 )
return("Your two passwords didn't match, please input again.\n");
return "";
}

function check_uid_passwd ( uid, pw1 )
{
if( uid == pw1 )
return("The ID and the Password can not be the same, please input again.\n");
return "";
}
