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

function validate_legal(field,alerttxt)
{
with (field)
  {
  if (checked==false)
    {
    alert(alerttxt);return false;
    }
  else
    {
    return true;
    }
  }
}
 
function validate_form(thisform)
{
with (thisform)
  {
  if (validate_required(name,"Please tell us your name!")==false)
  {name.focus();return false;}
  if (validate_required(coname,"Please tell us your company name!")==false)
  {coname.focus();return false;}
  if (validate_required(addr1,"Please tell us your address!")==false)
  {addr1.focus();return false;}
  if (validate_required(addr2,"Please tell us your complete address")==false)
  {addr2.focus();return false;}
  if (validate_required(telno,"Please tell us your telephone number so that we can contact you if necessary")==false)
  {telno.focus();return false;} 
    if (validate_required(email,"Please tell us your email address so that we can contact you if necessary")==false)
  {email.focus();return false;} 
    if (validate_required(password,"Please provide a password")==false)
  {password.focus();return false;} 
   if (validate_required(passwordconfirm,"Please confirm your password")==false)
  {passwordconfirm.focus();return false;}   
  
  }
}

