/* 	purpose                : validate mailing list box
	author                 : Carroll Reid
	created                : 08/08/2004
	notes                  : 
*/

function CheckForm()
{	
	var message = "";
	
	//EMAIL ADDRESS
	//Check one is entered
	if (document.frmMailingList.txtEmail.value == "")
	{
		message = message + "Please enter an Email address.\n";
	}
	else
	//Check it contains '@' and '.'
	if ((frmMailingList.txtEmail.value.indexOf("@") == -1) || (frmMailingList.txtEmail.value.indexOf(".") == -1))
    {
        message = message + "Please enter a valid Email address.\n";
        //return false;
    }
		
		
	if ( message.length > 0 ) 
	{
   		alert( message );
		return false;
	}
	else {
	return true;
	}
}


function doSubmit()
{
	if (CheckForm())
		{
		document.forms[0].submit();
		}
}

