function validateEmail(field,alerttxt)
{
  with (field)
  {
  apos=value.indexOf("@");
  dotpos=value.lastIndexOf(".");
  if (apos < 1 || dotpos-apos < 2)
	{
	alert(alerttxt);return false;
	}	  
  else
	{
	return true;
	}
  }
}

function validateBasic(field,alerttxt)
{
  with (field)
  {
  if (value == null || value=="")
	{
	alert(alerttxt);return false;
	}  
  else
	{
	return true;
	}
  }
}

function validateForm(thisForm)
{
  with (thisForm)
  {
  if (validateBasic(name,"Please enter your name into the appropriate field!")==false)
	{
	name.focus();return false;
	}
  if (validateEmail(email,"Please enter a valid email address into the appropriate field!")==false)
	{
	email.focus();return false;
	}
  if (validateBasic(phone,"Please enter your phone number into the appropriate field!")==false)
	{
	phone.focus();return false;
	}
  if (validateBasic(comments,"Please enter your comments into the appropriate field!")==false)
	{
	comments.focus();return false;
	}
  }
}