function show_msg(msg) {

	alert(msg);
	
}


function valid_email(addr) {
	
	// First, we are going to check to see if the email has any bad characters in it.
	// These characters are illegal for email addresses.
	
	if (addr == 0) return false;

	badChars = " /:,;";
	
	for (i=0; i < badChars.length; i++) {
		thisChar = badChars.charAt(i);
		if (addr.indexOf(thisChar,0) != -1) {
		  show_msg("That is not a valid email address. Please try again.");
			return false;
		}
	}
	
	// Now, we check to see if the email contains an @ symbol,
	// and make sure there is only 1
	
	atPos = addr.indexOf("@",1)
	if (atPos == -1) {
	  show_msg("That is not a valid email address. Please try again.");
		return false;
	}
	
	if (addr.indexOf("@",atPos + 1) != -1) {
	  show_msg("That is not a valid email address. Please try again.");
		return false;
	}
	
	// Now we check to see if the email contains a "."
	// and make sure it is at least 4 spaces from the end
	
	periodPos = addr.indexOf(".",atPos);
	
	if (periodPos == -1) {
	  show_msg("That is not a valid email address. Please try again.");
		return false;
	}
	
	if (periodPos+2 > addr.length) {
	  show_msg("That is not a valid email address. Please try again.");
		return false
	}

	return true;	

}

