function CivilSearchByCase() {
  document.inqform.action="http://www.clerk.co.sarasota.fl.us/srqapp/civilqry.asp"  
}

function CivilSearchByUTC() {
  document.inqform.action="http://www.clerk.co.sarasota.fl.us/srqapp/civilqry4.asp"  
}

function CivilSearchByName() {
  document.inqform.action="http://www.clerk.co.sarasota.fl.us/srqapp/civilqry2.asp"
}

function CivilSearchByType() {
  document.inqform.action="http://www.clerk.co.sarasota.fl.us/srqapp/civilqry3.asp"
}

function CivilSearchByDate(){
  document.inqform.action="http://www.clerk.co.sarasota.fl.us/srqapp/civilqry5.asp"
}

function setCivilSearchFocus() {
  document.inqform.cb_continue.focus()
}

function ProbateSearchByCase() {
  document.inqform.action="http://www.clerk.co.sarasota.fl.us/srqapp/probqry.asp"  
}

function ProbateSearchByUTC() {
  document.inqform.action="http://www.clerk.co.sarasota.fl.us/srqapp/probqry4.asp"  
}

function ProbateSearchByName() {
  document.inqform.action="http://www.clerk.co.sarasota.fl.us/srqapp/probqry2.asp"
}

function ProbateSearchByDate(){
  document.inqform.action="http://www.clerk.co.sarasota.fl.us/srqapp/probqry5.asp"
}

function setProbateSearchFocus() {
  document.inqform.cb_continue.focus()
}

function MarriageSearchByAppNo() {
  document.inqform.action="http://www.clerk.co.sarasota.fl.us/srqapp/marrqry.asp"  
}

function MarriageSearchByBrideName() {
  document.inqform.action="http://www.clerk.co.sarasota.fl.us/srqapp/marrqry2.asp"  
}

function MarriageSearchByGroomName() {
  document.inqform.action="http://www.clerk.co.sarasota.fl.us/srqapp/marrqry3.asp"
}

function MarriageSearchByAppDate(){
  document.inqform.action="http://www.clerk.co.sarasota.fl.us/srqapp/marrqry4.asp"
}

function MarriageSearchByCeremonyDate(){
  document.inqform.action="http://www.clerk.co.sarasota.fl.us/srqapp/marrqry5.asp"
}

function tryPlatBrowseSubmit() {
  var iErr;
  var sTitle;
  var sBook;
  var sPage;
  
  iErr = 0;
  sBook = document.form1.platbook.value
  sPage = document.form1.platpage.value
  
  if (iErr == 0) {
    if ((sPage != "") && (sBook == "")) {
      alert("Must specify the book for this page");
      iErr = 1;
    }
  }
  
  if (iErr == 0) {
    sTitle = document.form1.title.value;
    document.form1.title.value = sTitle.toUpperCase();
    document.form1.platbook.value = sBook.toUpperCase();
    return true;
  }
  else {
    return false;
  }
}

function clearPlatBrowseForm() {
  document.form1.title.value = "";
  document.form1.platbook.value = "";
  document.form1.platpage.value = "";
  setPlatBrowseFocus();
}

function setPlatBrowseFocus() {
  document.form1.title.focus()
}

function tryCrimBrowseSubmit() {
  var iErr;
  var sBeginDate;
  var sEndDate;
  var sResultDate;
  var sLastName;
  var sFirstName;
  var sCompanyName;
  var sCaseNo;
  var sUniCaseNo
  
  iErr = 0;
  sBeginDate = document.form1.dateFrom.value
  sEndDate = document.form1.dateTo.value
  sLastName = document.form1.lastname.value
  sFirstName = document.form1.firstname.value
  sCaseNo = document.form1.caseno.value
  sUniCaseNo = document.form1.unicaseno.value
  
  if (iErr == 0) {
    if (sLastName != "") {
      if (sFirstName == "") {
        alert("Name searches require something to be entered for both first and last name");
        iErr = 1;
      }
    }
  }

  if (iErr == 0) {
    if (sFirstName != "") {
      if (sLastName == "") {
        alert("Name searches require something to be entered for both first and last name");
        iErr = 1;
      }
    }
  }

  if (iErr == 0) {
    if ((sBeginDate != "") && (sEndDate == "")) {
      sEndDate = sBeginDate;
      document.form1.dateTo.value = sEndDate;
    }
  }
  
  if (iErr == 0) {
    if (sBeginDate != "") {
      sResultDate = IsDate(sBeginDate);
      if (sResultDate == "00/00/0000") {
        alert("The From Date is not valid");
        iErr = 1;
      }
      else {
        document.form1.dateFrom.value = sResultDate;
      }
    }
  }

  if (iErr == 0) {
    if (sEndDate != "") {
      sResultDate = IsDate(sEndDate);
      if (sResultDate == "00/00/0000") {
        alert("The To Date is not valid");
        iErr = 1;
      }
      else {
        document.form1.dateTo.value = sResultDate;
      }
    }
  }

  if (iErr == 0) {
    if (CmpDate(document.form1.dateFrom.value, document.form1.dateTo.value) > 0) {
      alert("From Date can not be later than To Date");
      iErr = 1;
    }
  }
  
  if (iErr == 0) {
    if (sCaseNo != "") {
      if (sCaseNo.length < 14) {
        alert("Case number is not in the correct format");
        iErr = 1;
      }
    }
  }

  if (iErr == 0) {
    if (sUniCaseNo != "") {
      if (sUniCaseNo.length != 20) {
        alert("Uniform case number is not in the correct format");
        iErr = 1;
      }
    }
  }

  if (iErr == 0) {
    sLastName = document.form1.lastname.value;
    sFirstName = document.form1.firstname.value;
    sCompanyName = document.form1.companyname.value;
    document.form1.lastname.value = sLastName.toUpperCase();
    document.form1.firstname.value = sFirstName.toUpperCase();
    document.form1.companyname.value = sCompanyName.toUpperCase();
    sCaseNo = document.form1.caseno.value;
    document.form1.caseno.value = sCaseNo.toUpperCase();
    sUniCaseNo = document.form1.unicaseno.value;
    document.form1.unicaseno.value = sUniCaseNo.toUpperCase();
    return true;
  }
  else {
    return false;
  }
}

function clearCrimBrowseForm() {
  document.form1.lastname.value = "";
  document.form1.firstname.value = "";
  document.form1.companyname.value = "";
  document.form1.caseno.value = "";
  document.form1.unicaseno.value = "";
  document.form1.dateFrom.value = "";
  document.form1.dateTo.value = "";
  setCrimBrowseFocus();
}

function setCrimBrowseFocus() {
  document.form1.lastname.focus()
}