// $Header:  $

// Requires include.js
include("is_valid_email");

function validate_newsletter_signup(form)
{	var aok = true;
	var alert_text = "Please fix the following:\n";

	if (!is_valid_email(form.email.value))
	{	aok = false;
		alert_text += "Email address does not appear to be valid\n";
		form.email.focus();
	}

	if (!form.canonicalzip.selectedIndex)
	{	alert_text += "No location was selected\n";
		form.canonicalzip.focus();
		aok = false;
	}
	
	if (!form.country.value)
	{	aok = false;
		alert_text += "No country was entered\n";
		form.country.focus();
	}

	if (!aok)
	{	alert(alert_text);
	}

	return aok;
}