function verifyUser() {
  var p = document.getElementById('verify').value;
  var e = Number(p)+4;
  var sid = document.getElementById('sid').value;
  sid=sid.substring(p,e);
  var guess=prompt("To verify that you are a real person,\n please enter the following code...\n"+sid.toUpperCase());
  return guess;
  };

function validateAndSend () {
  var url=document.getElementById('url').value;
  var action=document.getElementById('action').value;
  var params='?action='+action;
  // validate fields...
  if (!fieldIs('name','text')) { return; };
  if (!fieldIs('phone','phone')) { return; };
  if (!fieldIs('email','email')) { return; };
  if (!fieldIs('comment','fullText',1)) { return; };
  params+='&sid='+verifyUser();
  params+='&verify='+document.getElementById('verify').value;
  params+='&name='+document.getElementById('name').value;
  params+='&phone='+document.getElementById('phone').value;
  params+='&email='+document.getElementById('email').value;
  params+='&comment='+encodeURIComponent(document.getElementById('comment').value);
  //alert("URL: "+url+params);
  window.location=url+params;
  };
