function validate(theForm)
{

 if (theForm.FirstName.value == '')
  {
    alert('Please enter a value for the \'Firstname\' field.');
    theForm.FirstName.focus();
    return (false);
  }
   
 if (theForm.LastName.value == '')
  {
    alert('Please enter a value for the \'Lastname\' field.');
    theForm.FirstName.focus();
    return (false);
  }


if (theForm.ZipCode.value == '')
  {
    alert('Please enter a value for the \'ZipCode\' field.');
    theForm.ZipCode.focus();
    return (false);
  }
  if (theForm.ZipCode.value.length < 5)
  {
    alert('Please enter at least 5 characters in the \'ZipCode\' field.');
    theForm.ZipCode.focus();
    return (false);
  }
  if (theForm.ZipCode.value.length > 5)
  {
    alert('Please enter at most 5 characters in the \'ZipCode\' field.');
    theForm.ZipCode.focus();
    return (false);
  }

  var checkOK = '0123456789-';
  var checkStr = theForm.ZipCode.value;
  var allValid = true;
  var validGroups = true;
  var decPoints = 0;
  var allNum = '';
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert('Please enter only digit characters in the \'ZipCode\' field.');
    theForm.ZipCode.focus();
    return (false);
  }

  if (theForm.phone.value == '')
  {
    alert('Please enter a value for the \'HomeLastFourPhone\' field.');
    theForm.HomeLastFourPhone.focus();
    return (false);
  }


  var checkOK = '0123456789-';
  var checkStr = theForm.phone.value;
  var allValid = true;
  var validGroups = true;
  var decPoints = 0;
  var allNum = '';
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert('Please enter only digit characters in the \'HomeLastFourPhone\' field.');
    theForm.phone.focus();
    return (false);
  }

  return (true);
}

function stat(site,status)
{ 
switch(status)
{ 
case 'decline': 
document.location='linkx.php?func=update&site='+site+'&status='+status;
break;

case 'accept': 

document.location='linkx.php?func=update&site='+site+'&status='+status;
break;
}
}
