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

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


function validate_form(thisform)
	{
with (thisform)
	{
	if (validate_required(firstname,"The First Name field is blank!")==false)
	{firstname.focus();return false;}
	}
with (thisform)
	{
	if (validate_required(surname,"The Surname field is blank!")==false)
	{surname.focus();return false;}
	}
with (thisform)
	{
	if (validate_required(address1,"The Address 1 field is blank!")==false)
	{address1.focus();return false;}
	}
with (thisform)
	{
	if (validate_required(address2,"The Address 2 field is blank!")==false)
	{address2.focus();return false;}
	}
with (thisform)
	{
	if (validate_required(address3,"The Address 3 field is blank!")==false)
	{address3.focus();return false;}
	}
with (thisform)
	{
	if (validate_required(county,"The County field is blank!")==false)
	{county.focus();return false;}
	}
with (thisform)
	{
	if (validate_required(countycovered,"The County Covered field is blank!")==false)
	{countycovered.focus();return false;}
	}
with (thisform)
	{
	if (validate_required(adi,"The ADI Number field is blank!")==false)
	{adi.focus();return false;}
	}
with (thisform)
	{
	if (validate_required(phone,"The Phone Number field is blank!")==false)
	{phone.focus();return false;}
	}
/*with (thisform)
	{
	if (validate_required(email,"The Email Address field is blank!")==false)
	{email.focus();return false;}
	}
with (thisform)
	{
	if (validate_email(email,"Please enter a valid Email Address!")==false)
	{email.focus();return false;}
	}
with (thisform)
	{
	if (validate_required(attachment,"The Attachment field is blank!")==false)
	{attachment.focus();return false;}
	}*/
}

