function is_numeric ( string )
{
   var valid_chars = "0123456789.";
   var is_number = true;
   var char;

 
	for ( i = 0; i < string.length && is_number == true; i++ ) 
	{ 

		char = string.charAt ( i );
		 
		if ( valid_chars.indexOf ( char ) == -1 ) 
		{
			is_number = false;
		}
		
	}
   
	return is_number;
   
}

function is_empty ( text_field )
{

	if ( ( text_field.value.length == 0 ) || ( text_field.value == null ) )
	{
		return true;
	}
	else
	{
		return false;
	}

  	return true;
   
}	

function validate_email ( form )
{

	// In order for this script to work make sure that the
	// name of the e-mail address text-box is "email_address".
	var email_address = form.email_address.value;
	
	var at = "@";
	var dot = ".";
	
	var at_location = email_address.indexOf ( at );
	var email_address_length = email_address.length;
	var dot_location = email_address.indexOf ( dot );
	
	if ( email_address.indexOf ( at ) == -1 )
	{
		return false;
	}
	
	if ( email_address.indexOf ( at ) == -1 || email_address.indexOf ( at ) == 0 || email_address.indexOf ( at ) == email_address_length )
	{
		return false;
	}
	
	if ( email_address.indexOf ( dot ) == -1 || email_address.indexOf ( dot ) == 0 || email_address.indexOf ( dot ) == email_address_length )
	{
		return false;
	}
	
	if ( email_address.indexOf ( at, ( at_location + 1 ) ) != -1 )
	{
		return false;
	}
	 
	if ( email_address.substring ( at_location - 1, at_location ) == dot || email_address.substring ( at_location + 1, at_location + 2 ) == dot )
	{
		return false;
	}
	
	if ( email_address.indexOf ( dot, ( at_location + 2 ) ) == -1 )
	{
	   return false;
	}
	
	if ( email_address.indexOf (" ") != -1 )
	{
	   return false;
	}
	 
	return true;

}