function check_null ( column, name )
{
	if( column.length == 0 )
	{
		return name + " Please fill the bank !\n";
		return "";
	}
return "";
}


function check_email ( EMA )
{
	var len = EMA.length;
	if(len==0)
	{
		return "Email cannot be blank !!\n";
	}
	
	for(var i=0;i<len;i++)
	{
		var c= EMA.charAt(i);
		if(!((c>="A"&&c<="Z")||(c>="a"&&c<="z")||(c>="0"&&c<="9")||(c=="-")||(c=="_")||(c==".")||(c=="@")))
		{
			return "Your electronic mail address can only be the digit, English letter and ' - ' , ' _' And so on marks, other marks cannot use !!\n";
		}
	}
	
	if((EMA.indexOf("@")==-1)||(EMA.indexOf("@")==0)||(EMA.indexOf("@")==(len-1)))
	{
		return "Your electronic mail address are illegal !!\n";
	}
	
	if((EMA.indexOf("@")!=-1)&&(EMA.substring(EMA.indexOf("@")+1,len).indexOf("@")!=-1))
	{
		return "Your electronic mail address are illegal !!\n";
	}
	
	if((EMA.indexOf(".")==-1)||(EMA.indexOf(".")==0)||(EMA.lastIndexOf(".")==(len-1)))
	{
		return "Your electronic mail address are incomplete !!\n";
	}
	
return "";
}

function check_radio( radio, name )
{
	var error = true;
	for( i=0; i <radio.length; i++ )
	{
		if( radio[i].checked == true ) 
		{
			error = false;
			break;
		}
	}	

	if( error == true )
	{
		return name + " Please answer !\n";
	}
	
return "";
}


function check_telephonenumber ( number )
{
	var error = false;
	if( number.length <= 0 )
	{
		return "Your telephone is not filled in !!\n";
	}
	
	for( idx = 0 ; idx <number.length ; idx++ ) 
	{
		if( !( ( number.charAt(idx)>= '0' && number.charAt(idx) <= '9' ) || ( number.charAt(idx) == '-' ) ) )
		{
			error = true;
			break;
		}
	}
	
	if( error == true )
	{
		return "Your telephone can only be the digit and ' - ' And so on marks, other marks cannot use !\n";
	}
return "";
}

function check_Faxnumber ( number )
{
	var error = false;
	if( number.length <= 0 )
	{
		return "Your Fax is not filled in !!\n";
	}
	
	for( idx = 0 ; idx <number.length ; idx++ ) 
	{
		if( !( ( number.charAt(idx)>= '0' && number.charAt(idx) <= '9' ) || ( number.charAt(idx) == '-' ) ) )
		{
			error = true;
			break;
		}
	}
	
	if( error == true )
	{
		return "Your Fax can only be the digit and ' - ' And so on marks, other marks cannot use !\n";
	}
return "";
}


function check_UserName( EMA )
{
	var len = EMA.length;
	if(len==0)
	{
		return "UserName cannot be blank !!\n";
	}
	
	for(var i=0;i<len;i++)
	{
		var c= EMA.charAt(i);
		if(!((c>="A"&&c<="Z")||(c>="a"&&c<="z")||(c>="0"&&c<="9")||(c=="-")||(c=="_")||(c==".")||(c=="@")))
		{
			return "Your UserName error !!\n";
		}
	}
	
	if((EMA.indexOf("@")==-1)||(EMA.indexOf("@")==0)||(EMA.indexOf("@")==(len-1)))
	{
		return "Your UserName error !!\n";
	}
	
	if((EMA.indexOf("@")!=-1)&&(EMA.substring(EMA.indexOf("@")+1,len).indexOf("@")!=-1))
	{
		return "Your UserName error !!\n";
	}
	
	if((EMA.indexOf(".")==-1)||(EMA.indexOf(".")==0)||(EMA.lastIndexOf(".")==(len-1)))
	{
		return "Your UserName error !!\n";
	}
	
return "";
}


function check_passwd ( PWD1 )
{
	 for( idx = 0 ; idx <PWD1.length ; idx++ )
	{
		if(!( ( PWD1.charAt(idx)>= 'a' && PWD1.charAt(idx) <= 'z' ) || ( PWD1.charAt(idx)>= 'A' && PWD1.charAt(idx) <= 'Z' ) || ( PWD1.charAt(idx)>= '0' && PWD1.charAt(idx) <= '9' ) ) )
		{
			return "Your password can only be the digit, English alphabetic character, other marks cannot use !!\n";
		}
	}
	
    if( PWD1 == '' ) 
    {
		return "PassWord cannot be blank !!\n";
	}
	
return "";
}


function check_ZipCode ( number )
{
	var error = false;
	if( number.length <= 0 )
	{
		return "Your Zip / Postal Code is not filled in !!\n";
	}
	
	for( idx = 0 ; idx <number.length ; idx++ ) 
	{
		if( !( ( number.charAt(idx)>= '0' && number.charAt(idx) <= '9' )  ) )
		{
			error = true;
			break;
		}
	}
	
	if( error == true )
	{
		return "Your Zip/Postal Code can only be a digit, other marks cannot use !\n";
	}
return "";
}











