function fillRegions( ddRegion ) { ddRegion[ ddRegion.length ] = new Option( 'All', '', false ); for( var i = 0; i < regionList.length; i++ ) { display = unescape( regionList[ i ][ 1 ].replace( /\+/g, ' ' ) ); ddRegion[ ddRegion.length ] = new Option( display, display, false ); } } function fillCommunities( ddRegion, ddCommunity ) { clearCommunities( ddCommunity ); // if no region is selected, display prompt // otherwise, display list of communities for selected region regionid = ddRegion.selectedIndex; //Removed if condition and set the clearCommunities function to leave the first select element in place TSG /*if( regionid < 1 ) { ddCommunity[ ddCommunity.length ] = new Option( 'All', '', false ); } else {*/ ddCommunity.disabled = false; // normalize regionid to account for the 'Select a Region' prompt in the region dropdown regionid--; if( ddCommunity.type == 'select-one' ) { ddCommunity[ 0 ] = new Option( 'Select a Community', '', false ); } else if( ddCommunity.type == 'select-multiple' ) { ddCommunity[ 0 ] = new Option( 'All', '', false ); } for( var i = 0; i < comList.length; i++ ) { if( regionid == comList[ i ][ 0 ] ) { display = unescape( comList[ i ][ 1 ].replace( /\+/g, ' ' ) ); ddCommunity[ ddCommunity.length ] = new Option( display, display, false ); } } //} return( true ); /*clearCommunities( ddCommunity ); // if no region is selected, display prompt // otherwise, display list of communities for selected region regionid = ddRegion.selectedIndex; if( regionid < 1 ) { ddCommunity[ ddCommunity.length ] = new Option( 'All', '', false ); } else { ddCommunity.disabled = false; // normalize regionid to account for the 'Select a Region' prompt in the region dropdown regionid--; if( ddCommunity.type == 'select-one' ) { ddCommunity[ 0 ] = new Option( 'Select a Community', '', false ); } else if( ddCommunity.type == 'select-multiple' ) { ddCommunity[ 0 ] = new Option( 'All', '', false ); } for( var i = 0; i < comList.length; i++ ) { if( regionid == comList[ i ][ 0 ] ) { display = unescape( comList[ i ][ 1 ].replace( /\+/g, ' ' ) ); ddCommunity[ ddCommunity.length ] = new Option( display, display, false ); } } } return( true );*/ } function clearCommunities( ddCommunities ) { for( var j = ddCommunities.options.length; j > 0; j-- ) { ddCommunities.options[j] = null; } /*for( var j = ddCommunities.options.length; j >= 0; j-- ) { ddCommunities.remove( j ); }*/ } function setCommunityAllOption( ddCommunities ) { ddCommunities.options[ 0 ].selected = true; } var regionList=[ [0,"Barnstable"], [1,"Bourne"], [2,"Brewster"], [3,"Carver"], [4,"Chatham"], [5,"Dennis"], [6,"Eastham"], [7,"Falmouth"], [8,"Harwich"], [9,"Marion"], [10,"Martha%27s+Vineyard"], [11,"Mashpee"], [12,"Mattapoisett"], [13,"Nantucket"], [14,"Orleans"], [15,"Plymouth"], [16,"Provincetown"], [17,"Sandwich"], [18,"Truro"], [19,"Wareham"], [20,"Wellfleet"], [21,"Yarmouth"] ]; var comList=[ [0,"Barnstable"], [0,"Centerville"], [0,"Cotuit"], [0,"Craigville"], [0,"Cummaquid"], [0,"Hyannis"], [0,"Hyannis+Port"], [0,"Marstons+Mills"], [0,"Osterville"], [0,"Santuit"], [0,"West+Barnstable"], [0,"West+Hyannisport"], [1,"Bourne"], [1,"Bournedale"], [1,"Buzzards+Bay"], [1,"Cataumet"], [1,"Gray+Gables"], [1,"Monument+Beach"], [1,"Pocasset"], [1,"Sagamore"], [1,"Sagamore+Beach"], [1,"Sagamore+Highlands"], [2,"Brewster"], [2,"East+Brewster"], [2,"West+Brewster"], [3,"Carver"], [3,"North+Carver"], [3,"South+Carver"], [4,"Chatham"], [4,"Chatham+Port"], [4,"North+Chatham"], [4,"South+Chatham"], [4,"West+Chatham"], [5,"Dennis"], [5,"Dennis+Port"], [5,"East+Dennis"], [5,"South+Dennis"], [5,"West+Dennis"], [6,"Eastham"], [6,"North+Eastham"], [6,"South+Eastham"], [7,"Davisville"], [7,"East+Falmouth"], [7,"Falmouth"], [7,"Falmouth+Heights"], [7,"Hatchville"], [7,"Maravista"], [7,"Megansett"], [7,"North+Falmouth"], [7,"Quissett"], [7,"Silver+Beach"], [7,"Sippewissett"], [7,"Teaticket"], [7,"Waquoit"], [7,"West+Falmouth"], [7,"Woods+Hole"], [8,"East+Harwich"], [8,"Harwich"], [8,"Harwich+Port"], [8,"North+Harwich"], [8,"South+Harwich"], [8,"West+Harwich"], [9,"Marion"], [9,"Marion+Center"], [10,"Aquinnah"], [10,"Chilmark"], [10,"Edgartown"], [10,"Martha%27s+Vineyard"], [10,"Oak+Bluffs"], [10,"Tisbury"], [10,"Vineyard+Haven"], [10,"West+Tisbury"], [11,"Mashpee"], [11,"New+Seabury"], [11,"Popponesset"], [11,"South+Mashpee"], [12,"Mattapoisett"], [12,"Mattapoisett+Center"], [13,"Brant+Point"], [13,"Cisco"], [13,"Dionis"], [13,"Eel+Point"], [13,"Madaket"], [13,"Madequecham"], [13,"Miagomet"], [13,"Mid+Island"], [13,"Monomoy"], [13,"Nantucket"], [13,"Pocomo"], [13,"Polpis"], [13,"Quaise"], [13,"Quidnet"], [13,"Shawkemo"], [13,"Sheep%E2%80%99s+Pond"], [13,"Shimmo"], [13,"Siasconset"], [13,"Squam"], [13,"Surfside"], [13,"The+Cliff"], [13,"Tom+Nevers"], [13,"Wauwinet"], [14,"East+Orleans"], [14,"Orleans"], [14,"Rock+Harbor"], [14,"South+Orleans"], [15,"Cedarville"], [15,"Manomet"], [15,"North+Plymouth"], [15,"Plymouth"], [15,"South+Plymouth"], [15,"White+Horse+Beach"], [15,"White+Island+Shores"], [16,"Provincetown"], [17,"East+Sandwich"], [17,"Forestdale"], [17,"Sandwich"], [17,"South+Sandwich"], [18,"North+Truro"], [18,"South+Truro"], [18,"Truro"], [19,"East+Wareham"], [19,"Five+Corners"], [19,"Onset"], [19,"South+Wareham"], [19,"Wareham"], [19,"Wareham+Center"], [19,"West+Wareham"], [19,"Weweantic"], [20,"South+Wellfleet"], [20,"Wellfleet"], [21,"Bass+River"], [21,"Hyannis+Park"], [21,"South+Yarmouth"], [21,"West+Yarmouth"], [21,"Yarmouth"], [21,"Yarmouth+Port"] ];