function foiaPopHelp() {
  day = new Date();
  id = day.getTime();
  eval("page" + id + " = window.open('help.html', '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=377,height=395');");
}

function foiaCheckInput(p) {
  if (p == 'top') {
    if (document.foiaSearchformTop.q.value.length < 3) {
      alert('Please use a search term that has 3 letters or more.');
      document.foiaSearchformTop.q.focus();
      return;
    }    
    document.foiaSearchformTop.submit();
  }
  else if (p == 'bottom') {
    if (document.foiaSearchformBottom.q.value.length < 3) {
      alert('Please use a search term that has 3 letters or more.');
      document.foiaSearchformBottom.q.focus();
      return;
    }
    document.foiaSearchformBottom.submit();
  }   
}

function foiaDocSearchCheck() {
  if (document.foiaDocSearchForm.docnumber.value.length == '') {
    alert('Please enter a document number to search.');
    document.foiaDocSearchForm.docnumber.q.focus();
    return;
  }  
  document.foiaDocSearchForm.submit();
}

function foiaAdvSearchCheck() {
if ((document.foiaAdvancedForm.keywords.value.length == '') && 
  (document.foiaAdvancedForm.datetype[0].checked == true) && 
  (document.foiaAdvancedForm.agency1.checked == false) &&
  (document.foiaAdvancedForm.agency2.checked == false) &&
  (document.foiaAdvancedForm.agency3.checked == false) &&
  (document.foiaAdvancedForm.agency4.checked == false) &&
  (document.foiaAdvancedForm.agency5.checked == false) &&
  (document.foiaAdvancedForm.agency6.checked == false) &&
  (document.foiaAdvancedForm.agency7.checked == false) &&
  (document.foiaAdvancedForm.agency8.checked == false) &&
  (document.foiaAdvancedForm.agency9.checked == false) &&
  (document.foiaAdvancedForm.agency10.checked == false) &&
  (document.foiaAdvancedForm.geoRegion.value == '') &&
  (document.foiaAdvancedForm.specRegion.value == '')) {
	  alert('Please enter a valid search'); 
	  return;
  } else {
	document.foiaAdvancedForm.submit();
  }
}