/**********************************************************************************************/
// function Email_Validate(theform)
// - Validates Email.asp fields
//
// Author: Ram Razavi
// Date: 2/03/2002
// Last Modified: 2/03/2002

function Email_Validate(theform)
{
	var errormsg = '';
	
	if ((theform.toemail.value.indexOf('@') == -1) || (theform.toemail.value.indexOf('.') == -1))
	{
		errormsg = errormsg + 'Please specify a valid  \'To\'  E-mail address.\n';
		theform.toemail.focus();
	}

	if (theform.fromname.value == '')
	{
		if (errormsg == '')
		{
			theform.fromname.focus();
		}

		errormsg = errormsg + 'Please specify a  \'From\'  name.\n';
	}

	if ((theform.fromemail.value.indexOf('@') == -1) || (theform.fromemail.value.indexOf('.') == -1))
	{
		if (errormsg == '')
		{
			theform.fromemail.focus();
		}

		errormsg = errormsg + 'Please specify a  \'From\'  E-mail address.\n';
	}
	
	if (errormsg != '')
	{
		window.alert(errormsg);
		return false;
	}
	else
	{
		return true;
	}
}

