function UpdatePick()
{
  var countySelect = document.forms.pick.county;
  var jurisSelect = document.forms.pick.juris;
 
  jurisSelect.options.length = 0; // Clear the popup
 
  if (countySelect.options[countySelect.selectedIndex].value == "Alameda")
  {
    jurisSelect.options[0] = new Option("Alameda County TOTAL"); jurisSelect.options[1] = new Option("Alameda County Uninc."); jurisSelect.options[2] = new Option("Alameda"); jurisSelect.options[3] = new Option("Albany");
	jurisSelect.options[4] = new Option("Berkeley"); jurisSelect.options[5] = new Option("Dublin"); jurisSelect.options[6] = new Option("Emeryville"); jurisSelect.options[7] = new Option("Fremont");
	jurisSelect.options[8] = new Option("Hayward"); jurisSelect.options[9] = new Option("Livermore"); jurisSelect.options[10] = new Option("Newark");
	jurisSelect.options[11] = new Option("Oakland"); jurisSelect.options[12] = new Option("Piedmont"); jurisSelect.options[13] = new Option("Pleasanton");
	jurisSelect.options[14] = new Option("San Leandro"); jurisSelect.options[15] = new Option("Union City");
  }
  else if (countySelect.options[countySelect.selectedIndex].value == "Contra Costa")
  {
    jurisSelect.options[0] = new Option("Contra Costa County TOTAL"); jurisSelect.options[1] = new Option("Contra Costa County Uninc."); jurisSelect.options[2] = new Option("Antioch");
    jurisSelect.options[3] = new Option("Brentwood"); jurisSelect.options[4] = new Option("Clayton"); jurisSelect.options[5] = new Option("Concord");
	jurisSelect.options[6] = new Option("Danville"); jurisSelect.options[7] = new Option("El Cerrito"); jurisSelect.options[8] = new Option("Hercules");
	jurisSelect.options[9] = new Option("Lafayette"); jurisSelect.options[10] = new Option("Martinez"); jurisSelect.options[11] = new Option("Moraga");
	jurisSelect.options[12] = new Option("Oakley");
	jurisSelect.options[13] = new Option("Orinda"); jurisSelect.options[14] = new Option("Pinole"); jurisSelect.options[15] = new Option("Pittsburg");
	jurisSelect.options[16] = new Option("Pleasant Hill"); jurisSelect.options[17] = new Option("Richmond"); jurisSelect.options[18] = new Option("San Pablo");
	jurisSelect.options[19] = new Option("San Ramon"); jurisSelect.options[20] = new Option("Walnut Creek");
  }
else if (countySelect.options[countySelect.selectedIndex].value == "Marin")
  {
    jurisSelect.options[0] = new Option("Marin County TOTAL"); jurisSelect.options[1] = new Option("Marin County Uninc."); jurisSelect.options[2] = new Option("Belvedere");
    jurisSelect.options[3] = new Option("Corte Madera"); jurisSelect.options[4] = new Option("Fairfax"); jurisSelect.options[5] = new Option("Larkspur");
	jurisSelect.options[6] = new Option("Mill Valley"); jurisSelect.options[7] = new Option("Novato"); jurisSelect.options[8] = new Option("Ross");
	jurisSelect.options[9] = new Option("San Anselmo"); jurisSelect.options[10] = new Option("San Rafael"); jurisSelect.options[11] = new Option("Sausalito");
        jurisSelect.options[12] = new Option("Tiburon");
  }
else if (countySelect.options[countySelect.selectedIndex].value == "Napa")
  {
    jurisSelect.options[0] = new Option("Napa County TOTAL"); jurisSelect.options[1] = new Option("Napa County Uninc."); jurisSelect.options[2] = new Option("American Canyon");
    jurisSelect.options[3] = new Option("Calistoga"); jurisSelect.options[4] = new Option("Napa"); jurisSelect.options[5] = new Option("St. Helena");
	jurisSelect.options[6] = new Option("Yountville");
  }
else if (countySelect.options[countySelect.selectedIndex].value == "San Francisco")
  {
    jurisSelect.options[0] = new Option("San Francisco County TOTAL");
  }
else if (countySelect.options[countySelect.selectedIndex].value == "San Mateo")
  {
    jurisSelect.options[0] = new Option("San Mateo County TOTAL"); jurisSelect.options[1] = new Option("San Mateo County Uninc."); jurisSelect.options[2] = new Option("Atherton");
    jurisSelect.options[3] = new Option("Belmont"); jurisSelect.options[4] = new Option("Brisbane"); jurisSelect.options[5] = new Option("Burlingame");
	jurisSelect.options[6] = new Option("Colma"); jurisSelect.options[7] = new Option("Daly City"); jurisSelect.options[8] = new Option("East Palo Alto");
	jurisSelect.options[9] = new Option("Foster City"); jurisSelect.options[10] = new Option("Half Moon Bay"); jurisSelect.options[11] = new Option("Hillsborough");
	jurisSelect.options[12] = new Option("Menlo Park"); jurisSelect.options[13] = new Option("Millbrae"); jurisSelect.options[14] = new Option("Pacifica");
	jurisSelect.options[15] = new Option("Portola Valley"); jurisSelect.options[16] = new Option("Redwood City"); jurisSelect.options[17] = new Option("San Bruno");
	jurisSelect.options[18] = new Option("San Carlos"); jurisSelect.options[19] = new Option("San Mateo"); jurisSelect.options[20] = new Option("South San Francisco");
    jurisSelect.options[21] = new Option("Woodside");
  }
else if (countySelect.options[countySelect.selectedIndex].value == "Santa Clara")
  {
    jurisSelect.options[0] = new Option("Santa Clara County TOTAL"); jurisSelect.options[1] = new Option("Santa Clara County Uninc."); jurisSelect.options[2] = new Option("Campbell");
    jurisSelect.options[3] = new Option("Cupertino"); jurisSelect.options[4] = new Option("Gilroy"); jurisSelect.options[5] = new Option("Los Altos");
	jurisSelect.options[6] = new Option("Los Altos Hills"); jurisSelect.options[7] = new Option("Los Gatos");
	jurisSelect.options[8] = new Option("Milpitas"); jurisSelect.options[9] = new Option("Monte Sereno"); jurisSelect.options[10] = new Option("Morgan Hill");
	jurisSelect.options[11] = new Option("Mountain View"); jurisSelect.options[12] = new Option("Palo Alto"); jurisSelect.options[13] = new Option("San Jose");
	jurisSelect.options[14] = new Option("Santa Clara"); jurisSelect.options[15] = new Option("Saratoga"); jurisSelect.options[16] = new Option("Sunnyvale");
  }
else if (countySelect.options[countySelect.selectedIndex].value == "Solano")
  {
    jurisSelect.options[0] = new Option("Solano County TOTAL"); jurisSelect.options[1] = new Option("Solano County Uninc."); jurisSelect.options[2] = new Option("Benicia");
    jurisSelect.options[3] = new Option("Dixon"); jurisSelect.options[4] = new Option("Fairfield"); jurisSelect.options[5] = new Option("Rio Vista");
	jurisSelect.options[6] = new Option("Suisun City"); jurisSelect.options[7] = new Option("Vacaville"); jurisSelect.options[8] = new Option("Vallejo");
  }
else if (countySelect.options[countySelect.selectedIndex].value == "Sonoma")
  {
    jurisSelect.options[0] = new Option("Sonoma County TOTAL"); jurisSelect.options[1] = new Option("Sonoma County Uninc."); jurisSelect.options[2] = new Option("Cloverdale");
    jurisSelect.options[3] = new Option("Cotati"); jurisSelect.options[4] = new Option("Healdsburg"); jurisSelect.options[5] = new Option("Petaluma");
	jurisSelect.options[6] = new Option("Rohnert Park"); jurisSelect.options[7] = new Option("Santa Rosa"); jurisSelect.options[8] = new Option("Sebastopol");
	jurisSelect.options[9] = new Option("Sonoma"); jurisSelect.options[10] = new Option("Windsor");
  }
else if (countySelect.options[countySelect.selectedIndex].value == "9-County Bay Area TOTAL")
  {
    jurisSelect.options[0] = new Option("9-County Bay Area TOTAL");
  }
}
 
function errorCheck(){
var CounMessage = "";
var JurMessage = "";
//check if the user has selected from the pull-down menu
var selectCoun = document.forms['pick'].elements['county'].selectedIndex;
if(document.forms['pick'].elements['county'].options[selectCoun].value == 'Select a County'){
CounMessage ="Please Select a County.  "
}
var selectJur = document.forms['pick'].elements['juris'].selectedIndex;
if(document.forms['pick'].elements['juris'].options[selectJur].value == 'Select a Jursidiction'){
JurMessage ="Please Select a Jurisdiction.  "
}
if ((CounMessage) || (JurMessage)){
alertMessage = "";
//build remainder of the alert message
alertMessage= alertMessage + CounMessage;
alertMessage= alertMessage + JurMessage;
alert (alertMessage);
} else {
document.forms['pick'].submit();
  }
}


