<!-- hide script from non-script enabled browsers

var email_submitted = false;

// function to check email format is correct before submitting
function CheckEmail()
{
  	if ( email_submitted )
	{
		alert ( "Your email has already been submitted. Please wait..." );
		return false;
	}

  	// initialise variables
	var errorMsg = "";

	// check for a name
	if (document.email_form.email_name.value == "")
	{
		errorMsg += "\n Your Name \t- Enter your name";
	}
	// check for an email address
	if (document.email_form.email_addr.value == "")
	{
		errorMsg += "\n Your Email \t- Enter your email address";
	}
	// check for a valid email address
	else if ((document.email_form.email_addr.value.indexOf("@",0) == -1)
			|| (document.email_form.email_addr.value.indexOf(".",0) == -1))
	{
		errorMsg += "\n Your Email \t- Enter a valid email address";
	}
	// check for a subject
	if (document.email_form.email_subject.value == "")
	{
		errorMsg += "\n Subject \t\t- Enter a subject";
	}
	// check for a message
	if (document.email_form.email_msg.value == "")
	{
		errorMsg += "\n Message \t- Enter your message";
	}

	// if there is a problem with the email then display the error(s)
	if (errorMsg != "")
	{
		msg = "____________________________________________\n\n";
		msg += " Your email could not be sent because of a problem.\n";
		msg += " Please correct the following and then re-send.\n";
		msg += "___________________________________________\n";

		// display the error
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}

	// no problems
	email_submitted = true;
	return true;
}
// end script hiding -->

