function validate_required(field,alerttxt)
{
with (field)
  {
  if (value==null||value=="")
    {
    alert(alerttxt);return false;
    }
  else
    {
    return true;
    }
  }
}
function validate_email(field,alerttxt)
{
with (field)
  {
  apos=value.indexOf("@");
  dotpos=value.lastIndexOf(".");
  if (apos<1||dotpos-apos<2)
    {
	  alert(alerttxt);return false;
    }
  else {return true;}
  }
}
function IsNumeric(field,alerttxt)
//  check for valid numeric strings	
{
with (field)
{
var strValidChars = "0123456789.-";
var strChar;
//  test strString consists of valid characters listed above
for (i = 0; i < value.length; i++)
   {
   strChar = value.charAt(i);
   if (strValidChars.indexOf(strChar) == -1)
      {
	   alert(alerttxt);return false;
      }
   }
}
}

function validate_form(thisform)
{
	with (thisform)
	{
		if (validate_required(onc5khko,"First Name must be filled out!")==false)
		{onc5khko.focus();return false;}
	}
	with (thisform)
	{
		if (validate_required(sk5tyelo,"Last Name must be filled out!")==false)
		{sk5tyelo.focus();return false;}
	}	
	with (thisform)
	{
		if (validate_required(mi0moecs,"Email must be filled out!")==false)
		{mi0moecs.focus();return false;}
	}
	with (thisform)
	{
		if (validate_email(mi0moecs,"Not a valid e-mail address!")==false)
		{mi0moecs.focus();return false;}
	}
	with (thisform)
	{
		if (validate_required(phone_number,"Phone Number must be filled out!")==false)
		{phone_number.focus();return false;}
	}	
	with (thisform)
	{
		if (IsNumeric(phone_number,"Phone Number must be numeric!")==false)
		{phone_number.focus();return false;}
	}
}

