function casteSelection () {

  if (window.document.matrimSearchForm.Caste.options[window.document.matrimSearchForm.Caste.selectedIndex].text != "OTHER")
  {
    window.document.matrimSearchForm.CasteOther.value = '';
  }
  else {
    window.document.matrimSearchForm.CasteOther.focus();
  }
}

function matrimQuickSearchCheck (theForm)
{
  if (theForm.MinAge.value.length > 2)
  {
    alert("Please enter at most 2 characters in the \"Minimum Age\" field.");
    theForm.MinAge.focus();
    return (false);
  }

  var checkOK = "0123456789-";
  var checkStr = theForm.MinAge.value;
  var allValid = 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 \"Minimum Age\" field.");
    theForm.MinAge.focus();
    return (false);
  }

  if (theForm.MaxAge.value.length > 2)
  {
    alert("Please enter at most 2 characters in the \"Maximum Age\" field.");
    theForm.MaxAge.focus();
    return (false);
  }

  var checkOK = "0123456789-";
  var checkStr = theForm.MaxAge.value;
  var allValid = 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 \"Maximum Age\" field.");
    theForm.MaxAge.focus();
    return (false);
  }

  return (true);
}
