//Enable or Disable cities and school listbox based on radio selection
function setSearch(a){
if(a == 'town'){
document.theform.school.disabled = true;
document.theform.cities.disabled = false;
document.theform.rschool.checked = false;
} 
else if(a == 'school'){
document.theform.school.disabled = false;
document.theform.cities.disabled = true;
document.theform.rtown.checked = false;
}
else{
document.theform.school.disabled = true;
document.theform.cities.disabled = false;
document.theform.rtown.checked = true;
document.theform.rschool.checked = false;
}
}

//This function removes all options from a listbox
function removeAll(listbox)
{
var i;
for(i=listbox.options.length-1;i>=0;i--)
{
listbox.remove(i);
}
}

//This function adds an option to a listbox
function addOption(listbox,text,value)
{
var optn = document.createElement("OPTION");
optn.text = text;
optn.value = value;
listbox.options.add(optn);
}

//This function removes all options from the cities and school listboxes and then populates each one based on the county selection
function seeselected(){
switch (document.theform.county.selectedIndex)
{
case 1:
		removeAll(document.theform.cities);
		removeAll(document.theform.school);
addOption(document.theform.cities, "Airmont","Airmont");
addOption(document.theform.school, "CLARKSTOWN","CLARKSTOWN");
addOption(document.theform.cities, "Bardonia","Bardonia");
addOption(document.theform.school, "EAST RAMAPO","EAST RAMAPO");
addOption(document.theform.cities, "Blauvelt","Blauvelt");
addOption(document.theform.school, "NANUET","NANUET");
addOption(document.theform.cities, "Central Nyack","Central Nyack");
addOption(document.theform.school, "NORTH ROCKLAND","NORTH ROCKLAND");
addOption(document.theform.cities, "Chestnut Ridge","Chestnut Ridge");
addOption(document.theform.school, "NYACK","NYACK");
addOption(document.theform.cities, "Congers","Congers");
addOption(document.theform.school, "PEARL RIVER","PEARL RIVER");
addOption(document.theform.cities, "Garnerville","Garnerville");
addOption(document.theform.school, "RAMAPO","RAMAPO");
addOption(document.theform.cities, "Grand View","Grand View");
addOption(document.theform.school, "SOUTH ORANGETOWN","SOUTH ORANGETOWN");
addOption(document.theform.cities, "Grassy Point","Grassy Point");
addOption(document.theform.cities, "Haverstraw","Haverstraw");
addOption(document.theform.cities, "Hillburn","Hillburn");
addOption(document.theform.cities, "Hillcrest","Hillcrest");
addOption(document.theform.cities, "Jones Point","Jones Point");
addOption(document.theform.cities, "Kaser","Kaser");
addOption(document.theform.cities, "Monsey","Monsey");
addOption(document.theform.cities, "Montebello","Montebello");
addOption(document.theform.cities, "Nanuet","Nanuet");
addOption(document.theform.cities, "New City","New City");
addOption(document.theform.cities, "New Hempstead","New Hempstead");
addOption(document.theform.cities, "New Square","New Square");
addOption(document.theform.cities, "Nyack","Nyack");
addOption(document.theform.cities, "Orangeburg","Orangeburg");
addOption(document.theform.cities, "Other","Other");
addOption(document.theform.cities, "Palisades","Palisades");
addOption(document.theform.cities, "Pearl River","Pearl River");
addOption(document.theform.cities, "Piermont","Piermont");
addOption(document.theform.cities, "Pierson Lakes","Pierson Lakes");
addOption(document.theform.cities, "Pomona","Pomona");
addOption(document.theform.cities, "Sloatsburg","Sloatsburg");
addOption(document.theform.cities, "South Monsey","South Monsey");
addOption(document.theform.cities, "South Nyack","South Nyack");
addOption(document.theform.cities, "South Spring Valley","South Spring Valley");
addOption(document.theform.cities, "Sparkill","Sparkill");
addOption(document.theform.cities, "Spring Valley","Spring Valley");
addOption(document.theform.cities, "Stony Point","Stony Point");
addOption(document.theform.cities, "Suffern","Suffern");
addOption(document.theform.cities, "Tallman","Tallman");
addOption(document.theform.cities, "Tappan","Tappan");
addOption(document.theform.cities, "Thiells","Thiells");
addOption(document.theform.cities, "Tomkins Cove","Tomkins Cove");
addOption(document.theform.cities, "Upper Grand View","Upper Grand View");
addOption(document.theform.cities, "Upper Nyack","Upper Nyack");
addOption(document.theform.cities, "Valley Cottage","Valley Cottage");
addOption(document.theform.cities, "Wesley Hills","Wesley Hills");
addOption(document.theform.cities, "West Haverstraw","West Haverstraw");
addOption(document.theform.cities, "West Nyack","West Nyack");
		break
case 2:
		removeAll(document.theform.cities);
		removeAll(document.theform.school);
addOption(document.theform.cities, "Amity", "Amity");
addOption(document.theform.cities, "Balmville", "Balmville");
addOption(document.theform.cities, "Bellvale", "Bellvale");
addOption(document.theform.cities, "Blooming Grove", "Blooming Grove");
addOption(document.theform.cities, "Bloomingburg", "Bloomingburg");
addOption(document.theform.cities, "Bullville", "Bullville");
addOption(document.theform.cities, "Campbell Hall", "Campbell Hall");
addOption(document.theform.cities, "Central Valley", "Central Valley");
addOption(document.theform.cities, "Chester", "Chester");
addOption(document.theform.cities, "Circleville", "Circleville");
addOption(document.theform.cities, "Cornwall", "Cornwall");
addOption(document.theform.cities, "Cornwallonhudson", "Cornwallonhudson");
addOption(document.theform.cities, "Cornwlonhud", "Cornwlonhud");
addOption(document.theform.cities, "Crawford", "Crawford");
addOption(document.theform.cities, "Cronomer Valley", "Cronomer Valley");
addOption(document.theform.cities, "Cuddebackville", "Cuddebackville");
addOption(document.theform.cities, "Deer Park", "Deer Park");
addOption(document.theform.cities, "Fair Oaks", "Fair Oaks");
addOption(document.theform.cities, "Florida", "Florida");
addOption(document.theform.cities, "Fort Montgomery", "Fort Montgomery");
addOption(document.theform.cities, "Fortmontgomery", "Fortmontgomery");
addOption(document.theform.cities, "Godeffroy", "Godeffroy");
addOption(document.theform.cities, "Goshen", "Goshen");
addOption(document.theform.cities, "Greenville", "Greenville");
addOption(document.theform.cities, "Greenwood Lake", "Greenwood Lake");
addOption(document.theform.cities, "Hamptonburgh", "Hamptonburgh");
addOption(document.theform.cities, "Harriman", "Harriman");
addOption(document.theform.cities, "Highland Falls", "Highland Falls");
addOption(document.theform.cities, "Highland Mills", "Highland Mills");
addOption(document.theform.cities, "Howells", "Howells");
addOption(document.theform.cities, "Huguenot", "Huguenot");
addOption(document.theform.cities, "Johnson", "Johnson");
addOption(document.theform.cities, "Lake Osiris", "Lake Osiris");
addOption(document.theform.cities, "Leptondale", "Leptondale");
addOption(document.theform.cities, "Marlboro", "Marlboro");
addOption(document.theform.cities, "Maybrook", "Maybrook");
addOption(document.theform.cities, "Mechanicstown", "Mechanicstown");
addOption(document.theform.cities, "Middlehope", "Middlehope");
addOption(document.theform.cities, "Middletown", "Middletown");
addOption(document.theform.cities, "Minisink", "Minisink");
addOption(document.theform.cities, "Mnt Lodge Park", "Mnt Lodge Park");
addOption(document.theform.cities, "Monroe", "Monroe");
addOption(document.theform.cities, "Montgomery", "Montgomery");
addOption(document.theform.cities, "Mount Hope", "Mount Hope");
addOption(document.theform.cities, "Mountainville", "Mountainville");
addOption(document.theform.cities, "New Hampton", "New Hampton");
addOption(document.theform.cities, "New Milford", "New Milford");
addOption(document.theform.cities, "New Windsor", "New Windsor");
addOption(document.theform.cities, "Newburgh", "Newburgh");
addOption(document.theform.cities, "Newburgh City", "Newburgh City");
addOption(document.theform.cities, "Orange Lake", "Orange Lake");
addOption(document.theform.cities, "Osseo Park", "Osseo Park");
addOption(document.theform.cities, "Otisville", "Otisville");
addOption(document.theform.cities, "Otisville Village", "Otisville Village");
addOption(document.theform.cities, "Pine Bush", "Pine Bush");
addOption(document.theform.cities, "Pine Island", "Pine Island");
addOption(document.theform.cities, "Port Jervis", "Port Jervis");
addOption(document.theform.cities, "Rock Tavern", "Rock Tavern");
addOption(document.theform.cities, "Salisbury Mills", "Salisbury Mills");
addOption(document.theform.cities, "Scotchtown", "Scotchtown");
addOption(document.theform.cities, "Scotts Corner", "Scotts Corner");
addOption(document.theform.cities, "Searsville", "Searsville");
addOption(document.theform.cities, "Slate Hill", "Slate Hill");
addOption(document.theform.cities, "Southfields", "Southfields");
addOption(document.theform.cities, "Sparrowbush", "Sparrowbush");
addOption(document.theform.cities, "Sterling Forest", "Sterling Forest");
addOption(document.theform.cities, "Sterlingforest", "Sterlingforest");
addOption(document.theform.cities, "Sugar Loaf", "Sugar Loaf");
addOption(document.theform.cities, "Thompson Ridge", "Thompson Ridge");
addOption(document.theform.cities, "Tuxedo", "Tuxedo");
addOption(document.theform.cities, "Tuxedo Park", "Tuxedo Park");
addOption(document.theform.cities, "Unionville", "Unionville");
addOption(document.theform.cities, "Vails Gate", "Vails Gate");
addOption(document.theform.cities, "Walden", "Walden");
addOption(document.theform.cities, "Wallkill", "Wallkill");
addOption(document.theform.cities, "Warwick", "Warwick");
addOption(document.theform.cities, "Washington Hgts", "Washington Hgts");
addOption(document.theform.cities, "Washingtonville", "Washingtonville");
addOption(document.theform.cities, "Wawayanda", "Wawayanda");
addOption(document.theform.cities, "Westbrookville", "Westbrookville");
addOption(document.theform.cities, "Westtown", "Westtown");
addOption(document.theform.cities, "Woodbury", "Woodbury");
addOption(document.theform.school, "CHESTER", "CHESTER");
addOption(document.theform.school, "CORNWALL", "CORNWALL");
addOption(document.theform.school, "ELDRED", "ELDRED");
addOption(document.theform.school, "FLORIDA", "FLORIDA");
addOption(document.theform.school, "GOSHEN", "GOSHEN");
addOption(document.theform.school, "GREENWOOD LAKE", "GREENWOOD LAKE");
addOption(document.theform.school, "HIGHLAND FALLS", "HIGHLAND FALLS");
addOption(document.theform.school, "MARLBORO", "MARLBORO");
addOption(document.theform.school, "MIDDLETOWN", "MIDDLETOWN");
addOption(document.theform.school, "MINISINK VALLEY", "MINISINK VALLEY");
addOption(document.theform.school, "MONROE-WOODBURY", "MONROE-WOODBURY");
addOption(document.theform.school, "NEWBURGH", "NEWBURGH");
addOption(document.theform.school, "PINE BUSH", "PINE BUSH");
addOption(document.theform.school, "PORT JERVIS", "PORT JERVIS");
addOption(document.theform.school, "TUXEDO", "TUXEDO");
addOption(document.theform.school, "VALLEY CENTRAL", "VALLEY CENTRAL");
addOption(document.theform.school, "WALLKILL", "WALLKILL");
addOption(document.theform.school, "WARWICK VALLEY", "WARWICK VALLEY");
addOption(document.theform.school, "WASHINGTONVILLE", "WASHINGTONVILLE");
		break
		
case 3:
		removeAll(document.theform.cities);
		removeAll(document.theform.school);
addOption(document.theform.cities, "Beacon", "Beacon");
addOption(document.theform.cities, "Clinton Corner", "Clinton Corner");
addOption(document.theform.cities, "Dover Plains", "Dover Plains");
addOption(document.theform.cities, "Fishkill", "Fishkill");
addOption(document.theform.cities, "Hopewell Junction", "Hopewell Junction");
addOption(document.theform.cities, "Hyde Park", "Hyde Park");
addOption(document.theform.cities, "Millbrook", "Millbrook");
addOption(document.theform.cities, "Other", "Other");
addOption(document.theform.cities, "Pleasant Valley", "Pleasant Valley");
addOption(document.theform.cities, "Poughkeepsie", "Poughkeepsie");
addOption(document.theform.cities, "Red Hook", "Red Hook");
addOption(document.theform.cities, "Rhinebeck", "Rhinebeck");
addOption(document.theform.cities, "Verbank", "Verbank");
addOption(document.theform.cities, "Wappinger Falls", "Wappinger Falls");
addOption(document.theform.school, "ARLINGTON", "ARLINGTON");
addOption(document.theform.school, "BEACON", "BEACON");
addOption(document.theform.school, "DOVER", "DOVER");
addOption(document.theform.school, "HYDE PARK", "HYDE PARK");
addOption(document.theform.school, "MILLBROOK", "MILLBROOK");
addOption(document.theform.school, "PINE PLAINS", "PINE PLAINS");
addOption(document.theform.school, "POUGHKEEPSIE CITY", "POUGHKEEPSIE CITY");
addOption(document.theform.school, "RED HOOK", "RED HOOK");
addOption(document.theform.school, "RHINEBECK", "RHINEBECK");
addOption(document.theform.school, "WAPPINGERS", "WAPPINGERS");
		break
		
case 4:
		removeAll(document.theform.cities);
		removeAll(document.theform.school);
addOption(document.theform.cities, "Barryville", "Barryville");
addOption(document.theform.cities, "Bethel", "Bethel");
addOption(document.theform.cities, "Bloomingburg", "Bloomingburg");
addOption(document.theform.cities, "Burlingham", "Burlingham");
addOption(document.theform.cities, "Callicoon", "Callicoon");
addOption(document.theform.cities, "Callicoon Center", "Callicoon Center");
addOption(document.theform.cities, "Callicoon Cntr", "Callicoon Cntr");
addOption(document.theform.cities, "Cochecton", "Cochecton");
addOption(document.theform.cities, "Cochecton Center", "Cochecton Center");
addOption(document.theform.cities, "Eldred", "Eldred");
addOption(document.theform.cities, "Ellenville", "Ellenville");
addOption(document.theform.cities, "Fallsburg", "Fallsburg");
addOption(document.theform.cities, "Ferndale", "Ferndale");
addOption(document.theform.cities, "Forestburg", "Forestburg");
addOption(document.theform.cities, "Forestburgh", "Forestburgh");
addOption(document.theform.cities, "Fosterdale", "Fosterdale");
addOption(document.theform.cities, "Fremont Center", "Fremont Center");
addOption(document.theform.cities, "Glen Spey", "Glen Spey");
addOption(document.theform.cities, "Glen Wild", "Glen Wild");
addOption(document.theform.cities, "Grahamsville", "Grahamsville");
addOption(document.theform.cities, "Hankins", "Hankins");
addOption(document.theform.cities, "Harris", "Harris");
addOption(document.theform.cities, "Highland Lake", "Highland Lake");
addOption(document.theform.cities, "Hortonville", "Hortonville");
addOption(document.theform.cities, "Hurleyville", "Hurleyville");
addOption(document.theform.cities, "Jeffersonville", "Jeffersonville");
addOption(document.theform.cities, "Kauneonga", "Kauneonga");
addOption(document.theform.cities, "Kauneonga Lake", "Kauneonga Lake");
addOption(document.theform.cities, "Kenoza Lake", "Kenoza Lake");
addOption(document.theform.cities, "Kiamesha Lake", "Kiamesha Lake");
addOption(document.theform.cities, "Lake Huntington", "Lake Huntington");
addOption(document.theform.cities, "Lew Beach", "Lew Beach");
addOption(document.theform.cities, "Liberty", "Liberty");
addOption(document.theform.cities, "Liberty Village", "Liberty Village");
addOption(document.theform.cities, "Livingston Manor", "Livingston Manor");
addOption(document.theform.cities, "Livingston Mnr", "Livingston Mnr");
addOption(document.theform.cities, "Lk Louise Marie", "Lk Louise Marie");
addOption(document.theform.cities, "Loch Sheldrake", "Loch Sheldrake");
addOption(document.theform.cities, "Lumberland", "Lumberland");
addOption(document.theform.cities, "Masten Lake", "Masten Lake");
addOption(document.theform.cities, "Middletown", "Middletown");
addOption(document.theform.cities, "Mongaup", "Mongaup");
addOption(document.theform.cities, "Mongaup Valley", "Mongaup Valley");
addOption(document.theform.cities, "Monticello", "Monticello");
addOption(document.theform.cities, "Monticello Village", "Monticello Village");
addOption(document.theform.cities, "Mountaindale", "Mountaindale");
addOption(document.theform.cities, "Narrowburg", "Narrowburg");
addOption(document.theform.cities, "Narrowsburg", "Narrowsburg");
addOption(document.theform.cities, "Neversink", "Neversink");
addOption(document.theform.cities, "North Branch", "North Branch");
addOption(document.theform.cities, "Other", "Other");
addOption(document.theform.cities, "Parksville", "Parksville");
addOption(document.theform.cities, "Phillipsport", "Phillipsport");
addOption(document.theform.cities, "Pine Bush", "Pine Bush");
addOption(document.theform.cities, "Pond Eddy", "Pond Eddy");
addOption(document.theform.cities, "Rock Hill", "Rock Hill");
addOption(document.theform.cities, "Rockland", "Rockland");
addOption(document.theform.cities, "Roscoe", "Roscoe");
addOption(document.theform.cities, "Smallwood", "Smallwood");
addOption(document.theform.cities, "South Fallsburg", "South Fallsburg");
addOption(document.theform.cities, "Spring Glen", "Spring Glen");
addOption(document.theform.cities, "Summitville", "Summitville");
addOption(document.theform.cities, "Swan Lake", "Swan Lake");
addOption(document.theform.cities, "Thompsonville", "Thompsonville");
addOption(document.theform.cities, "Tusten", "Tusten");
addOption(document.theform.cities, "Westbrookville", "Westbrookville");
addOption(document.theform.cities, "White Lake", "White Lake");
addOption(document.theform.cities, "White Sulfur", "White Sulfur");
addOption(document.theform.cities, "White Sulphur Springs", "White Sulphur Springs");
addOption(document.theform.cities, "Winterton", "Winterton");
addOption(document.theform.cities, "Woodbourne", "Woodbourne");
addOption(document.theform.cities, "Woodridge", "Woodridge");
addOption(document.theform.cities, "Wurtsboro", "Wurtsboro");
addOption(document.theform.cities, "Yankee Lake", "Yankee Lake");
addOption(document.theform.cities, "Youngsville", "Youngsville");
addOption(document.theform.cities, "Yulan", "Yulan");
addOption(document.theform.school, "ELDRED", "ELDRED");
addOption(document.theform.school, "ELLENVILLE", "ELLENVILLE");
addOption(document.theform.school, "FALLSBURG", "FALLSBURG");
addOption(document.theform.school, "LIBERTY", "LIBERTY");
addOption(document.theform.school, "LIVINGSTON MANOR", "LIVINGSTON MANOR");
addOption(document.theform.school, "MINISINK VALLEY", "MINISINK VALLEY");
addOption(document.theform.school, "MONTICELLO", "MONTICELLO");
addOption(document.theform.school, "OTHER", "OTHER");
addOption(document.theform.school, "PINE BUSH", "PINE BUSH");
addOption(document.theform.school, "PORT JERVIS", "PORT JERVIS");
addOption(document.theform.school, "ROSCOE", "ROSCOE");
addOption(document.theform.school, "SULLIVAN WEST", "SULLIVAN WEST");
addOption(document.theform.school, "TRI VALLEY", "TRI VALLEY");
		break
		
case 5:
		removeAll(document.theform.cities);
		removeAll(document.theform.school);
addOption(document.theform.cities, "Accord", "Accord");
addOption(document.theform.cities, "Bearsville", "Bearsville");
addOption(document.theform.cities, "Bloomington", "Bloomington");
addOption(document.theform.cities, "Claryville", "Claryville");
addOption(document.theform.cities, "Clintondale", "Clintondale");
addOption(document.theform.cities, "Cottekill", "Cottekill");
addOption(document.theform.cities, "Cotteskill", "Cotteskill");
addOption(document.theform.cities, "Cragsmoor", "Cragsmoor");
addOption(document.theform.cities, "Dening", "Dening");
addOption(document.theform.cities, "Dwaarkill", "Dwaarkill");
addOption(document.theform.cities, "Ellenville", "Ellenville");
addOption(document.theform.cities, "Ellenville Village", "Ellenville Village");
addOption(document.theform.cities, "Esopus", "Esopus");
addOption(document.theform.cities, "Gardiner", "Gardiner");
addOption(document.theform.cities, "Glasco", "Glasco");
addOption(document.theform.cities, "Grahamsville", "Grahamsville");
addOption(document.theform.cities, "Greenfield Park", "Greenfield Park");
addOption(document.theform.cities, "Hardenburgh", "Hardenburgh");
addOption(document.theform.cities, "Highland", "Highland");
addOption(document.theform.cities, "Hurley", "Hurley");
addOption(document.theform.cities, "Kerhonkson", "Kerhonkson");
addOption(document.theform.cities, "Kingston", "Kingston");
addOption(document.theform.cities, "Kingston Point", "Kingston Point");
addOption(document.theform.cities, "Lake Katrine", "Lake Katrine");
addOption(document.theform.cities, "Lloyd", "Lloyd");
addOption(document.theform.cities, "Marbletown", "Marbletown");
addOption(document.theform.cities, "Marlboro", "Marlboro");
addOption(document.theform.cities, "Milton", "Milton");
addOption(document.theform.cities, "Modena", "Modena");
addOption(document.theform.cities, "Mount Tremper", "Mount Tremper");
addOption(document.theform.cities, "Napanoch", "Napanoch");
addOption(document.theform.cities, "New Paltz", "New Paltz");
addOption(document.theform.cities, "New Paltz Village", "New Paltz Village");
addOption(document.theform.cities, "Olivebridge", "Olivebridge");
addOption(document.theform.cities, "Olverbridge", "Olverbridge");
addOption(document.theform.cities, "Other", "Other");
addOption(document.theform.cities, "Palentown", "Palentown");
addOption(document.theform.cities, "Phoenicia", "Phoenicia");
addOption(document.theform.cities, "Pine Bush", "Pine Bush");
addOption(document.theform.cities, "Plattekill", "Plattekill");
addOption(document.theform.cities, "Port Ewen", "Port Ewen");
addOption(document.theform.cities, "Rosendale", "Rosendale");
addOption(document.theform.cities, "Saugerties", "Saugerties");
addOption(document.theform.cities, "Saugerties Village", "Saugerties Village");
addOption(document.theform.cities, "Shandaken", "Shandaken");
addOption(document.theform.cities, "Spring Glen", "Spring Glen");
addOption(document.theform.cities, "Stone Ridge", "Stone Ridge");
addOption(document.theform.cities, "Tillson", "Tillson");
addOption(document.theform.cities, "Tilson", "Tilson");
addOption(document.theform.cities, "Tuthilltown", "Tuthilltown");
addOption(document.theform.cities, "Ulster Hgts", "Ulster Hgts");
addOption(document.theform.cities, "Ulster Park", "Ulster Park");
addOption(document.theform.cities, "Walker Valley", "Walker Valley");
addOption(document.theform.cities, "Wallkill", "Wallkill");
addOption(document.theform.cities, "Wallkill Hmlt", "Wallkill Hmlt");
addOption(document.theform.cities, "Wawarsing", "Wawarsing");
addOption(document.theform.cities, "West Park", "West Park");
addOption(document.theform.cities, "West Saugerties", "West Saugerties");
addOption(document.theform.cities, "Woodstock", "Woodstock");
addOption(document.theform.school, "ELLENVILLE", "ELLENVILLE");
addOption(document.theform.school, "FALLSBURG", "FALLSBURG");
addOption(document.theform.school, "HIGHLAND", "HIGHLAND");
addOption(document.theform.school, "KINGSTON", "KINGSTON");
addOption(document.theform.school, "LIVINGSTON MANOR", "LIVINGSTON MANOR");
addOption(document.theform.school, "MARLBORO", "MARLBORO");
addOption(document.theform.school, "NEW PALTZ", "NEW PALTZ");
addOption(document.theform.school, "ONTEORA", "ONTEORA");
addOption(document.theform.school, "OTHER", "OTHER");
addOption(document.theform.school, "PINE BUSH", "PINE BUSH");
addOption(document.theform.school, "RONDOUT VALLEY", "RONDOUT VALLEY");
addOption(document.theform.school, "SAUGERTIES", "SAUGERTIES");
addOption(document.theform.school, "TRI VALLEY", "TRI VALLEY");
addOption(document.theform.school, "VALLEY CENTRAL", "VALLEY CENTRAL");
addOption(document.theform.school, "WALLKILL", "WALLKILL");
		break
		
default:
		removeAll(document.theform.cities);
		removeAll(document.theform.school);
addOption(document.theform.cities, "Select County First","");
addOption(document.theform.school, "Select County First","");
		break
}
}

//This function converts multiple values into one string value
function citySelect()
{
   var i, myString="", comma="";
   var L = document.theform.cities.length;
   for (i=0; i<L; i++)
   {
      if (document.theform.cities[i].selected)
      {
         // build string of values separated by comma
         myString += comma + (document.theform.cities[i].value);
		 comma=",";
      }
   }
   // write value to city
   document.theform.city.value = myString;
}

//This function converts multiple values into one string value  
function schoolSelect(){
   var k, myS="", c="";
   var T = document.theform.school.length;
   for (k=0; k<T; k++)
   {
      if (document.theform.school[k].selected)
      {
         // build string of values separated by comma
         myS += c + (document.theform.school[k].value);
		 c=",";
      }
   }
   // write value to city
   document.theform.school_district.value = myS;
}

function doBoth(){
citySelect();
schoolSelect();
}