/**********************************************************************************************/
// function Contact_Validate(theform)
// - Validates Contact.asp fields
//
// Author: Ram Razavi
// Date: 4/13/2002
// Last Modified: 4/13/2002

function Contact_Validate(theform)
{
	var errormsg = '';
	
	if (theform.message.value.length > 65535)
	{
		errormsg = 'Please provide a message that is no more than than 65535 characters in length. You\ncurrently have: ' + theform.message.value.length + ' characters in this field.\n';
		theform.message.focus();
	}

	if ((theform.email.value.indexOf('@') == -1) || (theform.email.value.indexOf('.') == -1))
	{
		errormsg = 'Please specify a valid E-mail address.\n' + errormsg;
		theform.email.focus();
	}

	if (theform.lname.value == '')
	{
		errormsg = 'Please provide your last name.\n' + errormsg;
		theform.lname.focus();
	}

	if (theform.fname.value == '')
	{
		errormsg = 'Please provide your first name.\n' + errormsg;
		theform.fname.focus();
	}

	if (errormsg != '')
	{
		window.alert(errormsg);
		return false;
	}
	else
	{
		return true;
	}
}
