function addMarkers() { mySelect = document.getElementById('selection'); Florida = [];Adams = [];Pittsfield = [];Becket = [];North_Adams = [];Cheshire = [];Clarksburg = [];Dalton = [];Otis = [];Hancock = [];Housatonic = [];Hinsdale = [];Lanesborough = [];Lee = [];Lenox = [];Sheffield = [];Great_Barrington = [];Williamstown = [];Richmond = [];Savoy = [];Stockbridge = [];West_Stockbridge = [];mySelect.options[mySelect.options.length] = new Option("Adams schools",'all=Adams'); mySelect.options[mySelect.options.length] = new Option("Becket schools",'all=Becket'); mySelect.options[mySelect.options.length] = new Option("Cheshire schools",'all=Cheshire'); mySelect.options[mySelect.options.length] = new Option("Clarksburg schools",'all=Clarksburg'); mySelect.options[mySelect.options.length] = new Option("Dalton schools",'all=Dalton'); mySelect.options[mySelect.options.length] = new Option("Florida schools",'all=Florida'); mySelect.options[mySelect.options.length] = new Option("Great Barrington schools",'all=Great_Barrington'); mySelect.options[mySelect.options.length] = new Option("Hancock schools",'all=Hancock'); mySelect.options[mySelect.options.length] = new Option("Hinsdale schools",'all=Hinsdale'); mySelect.options[mySelect.options.length] = new Option("Housatonic schools",'all=Housatonic'); mySelect.options[mySelect.options.length] = new Option("Lanesborough schools",'all=Lanesborough'); mySelect.options[mySelect.options.length] = new Option("Lee schools",'all=Lee'); mySelect.options[mySelect.options.length] = new Option("Lenox schools",'all=Lenox'); mySelect.options[mySelect.options.length] = new Option("North Adams schools",'all=North_Adams'); mySelect.options[mySelect.options.length] = new Option("Otis schools",'all=Otis'); mySelect.options[mySelect.options.length] = new Option("Pittsfield schools",'all=Pittsfield'); mySelect.options[mySelect.options.length] = new Option("Richmond schools",'all=Richmond'); mySelect.options[mySelect.options.length] = new Option("Savoy schools",'all=Savoy'); mySelect.options[mySelect.options.length] = new Option("Sheffield schools",'all=Sheffield'); mySelect.options[mySelect.options.length] = new Option("Stockbridge schools",'all=Stockbridge'); mySelect.options[mySelect.options.length] = new Option("West Stockbridge schools",'all=West_Stockbridge'); mySelect.options[mySelect.options.length] = new Option("Williamstown schools",'all=Williamstown'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Florida[Florida.length] = createMarker(new GPoint(-73.03746796,42.69341660),"
Abbott Memorial Elementary School
56 North County Rd
Florida, MA 01247

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Abbott Memorial Elementary School",'Florida=' + Florida.length); Adams[Adams.length] = createMarker(new GPoint(-73.11667633,42.62806320),"
Adams Middle School
30 Columbia Street
Adams, MA 01220

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Adams Middle School",'Adams=' + Adams.length); Pittsfield[Pittsfield.length] = createMarker(new GPoint(-73.22058105,42.45981216),"
Allendale Elementary School
180 Connecticut Avenue
Pittsfield, MA 01201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Allendale Elementary School",'Pittsfield=' + Pittsfield.length); Becket[Becket.length] = createMarker(new GPoint(-73.08329773,42.33209991),"
Becket Washington School
12 Maple Street
Becket, MA 01223

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Becket Washington School",'Becket=' + Becket.length); Adams[Adams.length] = createMarker(new GPoint(-73.12116500,42.61959300),"
Berkshire Arts And Technology Charter School
1 Commercial Place
Adams, MA 01220

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Berkshire Arts And Technology Charter School",'Adams=' + Adams.length); North_Adams[North_Adams.length] = createMarker(new GPoint(-73.15434265,42.69562149),"
Brayton Elementary School
20 Barbour Street
North Adams, MA 01247

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Brayton Elementary School",'North_Adams=' + North_Adams.length); North_Adams[North_Adams.length] = createMarker(new GPoint(-73.10505676,42.66504288),"
Charles Mccann Vocational Technical High School
70 Hodges Cross Rd
North Adams, MA 01247

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Charles Mccann Vocational Technical High School",'North_Adams=' + North_Adams.length); Cheshire[Cheshire.length] = createMarker(new GPoint(-73.15903473,42.56225967),"
Cheshire Elementary School
191 Church Street
Cheshire, MA 01225

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cheshire Elementary School",'Cheshire=' + Cheshire.length); Clarksburg[Clarksburg.length] = createMarker(new GPoint(-73.11666107,42.74152756),"
Clarksburg Elementary School
777 W Crossroad
Clarksburg, MA 01247

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Clarksburg Elementary School",'Clarksburg=' + Clarksburg.length); Dalton[Dalton.length] = createMarker(new GPoint(-73.17580414,42.47522736),"
Craneville Elementary School
71 Park Avenue
Dalton, MA 01226

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Craneville Elementary School",'Dalton=' + Dalton.length); Pittsfield[Pittsfield.length] = createMarker(new GPoint(-73.27373505,42.45129395),"
Crosby Elementary School
517 West Street
Pittsfield, MA 01201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Crosby Elementary School",'Pittsfield=' + Pittsfield.length); North_Adams[North_Adams.length] = createMarker(new GPoint(-73.09818268,42.67327881),"
Drury High School
1130 South Church Street
North Adams, MA 01247

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Drury High School",'North_Adams=' + North_Adams.length); Pittsfield[Pittsfield.length] = createMarker(new GPoint(-73.22861481,42.43693542),"
Egremont Elementary School
84 Egremont Avenue
Pittsfield, MA 01201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Egremont Elementary School",'Pittsfield=' + Pittsfield.length); Otis[Otis.length] = createMarker(new GPoint(-73.10955811,42.23075104),"
Farmington River Elementary School
555 N Main - Pob 679
Otis, MA 01253

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Farmington River Elementary School",'Otis=' + Otis.length); North_Adams[North_Adams.length] = createMarker(new GPoint(-73.15589905,42.69839859),"
Greylock Elementary School
100 Phelps Avenue
North Adams, MA 01247

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Greylock Elementary School",'North_Adams=' + North_Adams.length); Hancock[Hancock.length] = createMarker(new GPoint(-73.32437897,42.54315948),"
Hancock Elementary School
3080 Hancock Road
Hancock, MA 01237

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hancock Elementary School",'Hancock=' + Hancock.length); Pittsfield[Pittsfield.length] = createMarker(new GPoint(-73.22887421,42.44906998),"
Hibbard Alternative
280 Newell Street
Pittsfield, MA 01201

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hibbard Alternative",'Pittsfield=' + Pittsfield.length); Cheshire[Cheshire.length] = createMarker(new GPoint(-73.11719513,42.59412003),"
Hoosac Valley High School
125 Savoy Road
Cheshire, MA 01225

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hoosac Valley High School",'Cheshire=' + Cheshire.length); Housatonic[Housatonic.length] = createMarker(new GPoint(-73.36746216,42.25497818),"
Housatonic Grammar Elementary School
Pleasant,p.o.box 596
Housatonic, MA 01236

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Housatonic Grammar Elementary School",'Housatonic=' + Housatonic.length); North_Adams[North_Adams.length] = createMarker(new GPoint(-73.09681702,42.69598007),"
J S Sullivan Elementary School
151 Kemp Avenue
North Adams, MA 01247

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("J S Sullivan Elementary School",'North_Adams=' + North_Adams.length); Pittsfield[Pittsfield.length] = createMarker(new GPoint(-73.24543762,42.46691132),"
John T Reid Middle School
950 North Street
Pittsfield, MA 01201

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("John T Reid Middle School",'Pittsfield=' + Pittsfield.length); Hinsdale[Hinsdale.length] = createMarker(new GPoint(-73.11798096,42.44129944),"
Kittredge Elementary School
80 Maple Street
Hinsdale, MA 01235

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Kittredge Elementary School",'Hinsdale=' + Hinsdale.length); Lanesborough[Lanesborough.length] = createMarker(new GPoint(-73.22017670,42.51384735),"
Lanesborough Elementary School
188 Summer Street
Lanesborough, MA 01237

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lanesborough Elementary School",'Lanesborough=' + Lanesborough.length); Lee[Lee.length] = createMarker(new GPoint(-73.24855804,42.30757523),"
Lee Elementary School
310 Greylock Street
Lee, MA 01238

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lee Elementary School",'Lee=' + Lee.length); Lee[Lee.length] = createMarker(new GPoint(-73.24057770,42.30645752),"
Lee Middle/high School
300 Greylock Street
Lee, MA 01238

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lee Middle/high School",'Lee=' + Lee.length); Lenox[Lenox.length] = createMarker(new GPoint(-73.25931549,42.35550308),"
Lenox Memorial High School
197 East Street
Lenox, MA 01240

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lenox Memorial High School",'Lenox=' + Lenox.length); Sheffield[Sheffield.length] = createMarker(new GPoint(-73.35371400,42.11095000),"
Monterey
Box 326
Sheffield, MA 01257

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Monterey",'Sheffield=' + Sheffield.length); Sheffield[Sheffield.length] = createMarker(new GPoint(-73.36840057,42.10229874),"
Monterey Elementary School
Box 326
Sheffield, MA 01257

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Monterey Elementary School",'Sheffield=' + Sheffield.length); Great_Barrington[Great_Barrington.length] = createMarker(new GPoint(-73.36145020,42.19551849),"
Monument Mt Regional High School
600 Stockbridge Road
Great Barrington, MA 01230

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Monument Mt Regional High School",'Great_Barrington=' + Great_Barrington.length); Great_Barrington[Great_Barrington.length] = createMarker(new GPoint(-73.32966500,42.24572400),"
Monument Valley Regional Middle School
313 Monument Valley Rd
Great Barrington, MA 01230

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Monument Valley Regional Middle School",'Great_Barrington=' + Great_Barrington.length); Pittsfield[Pittsfield.length] = createMarker(new GPoint(-73.24492645,42.45751572),"
Morningside Community School
100 Burbank Street
Pittsfield, MA 01201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Morningside Community School",'Pittsfield=' + Pittsfield.length); Lenox[Lenox.length] = createMarker(new GPoint(-73.29638672,42.35658264),"
Morris Elementary School
129 West Street
Lenox, MA 01240

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Morris Elementary School",'Lenox=' + Lenox.length); Sheffield[Sheffield.length] = createMarker(new GPoint(-73.36840057,42.10229874),"
Mt Everett Regional High School
P O Box 219
Sheffield, MA 01257

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mt Everett Regional High School",'Sheffield=' + Sheffield.length); Williamstown[Williamstown.length] = createMarker(new GPoint(-73.23743439,42.67148972),"
Mt Greylock Regional High School
1781 Cold Spring Rd
Williamstown, MA 01267

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mt Greylock Regional High School",'Williamstown=' + Williamstown.length); Great_Barrington[Great_Barrington.length] = createMarker(new GPoint(-73.32875400,42.24393800),"
Muddy Brook Regional Elementary School
318 Monumnet Valley Rd
Great Barrington, MA 01230

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Muddy Brook Regional Elementary School",'Great_Barrington=' + Great_Barrington.length); Dalton[Dalton.length] = createMarker(new GPoint(-73.13948822,42.46718216),"
Nessacus Regional Middle School
35 Fox Road
Dalton, MA 01226

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Nessacus Regional Middle School",'Dalton=' + Dalton.length); Sheffield[Sheffield.length] = createMarker(new GPoint(-73.36840057,42.10229874),"
New Marlborough Central Elementary School
Box 326
Sheffield, MA 01257

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("New Marlborough Central Elementary School",'Sheffield=' + Sheffield.length); Pittsfield[Pittsfield.length] = createMarker(new GPoint(-73.24791718,42.44736481),"
Pittsfield High School
300 East Street
Pittsfield, MA 01201

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pittsfield High School",'Pittsfield=' + Pittsfield.length); Adams[Adams.length] = createMarker(new GPoint(-73.12106323,42.61887360),"
Plunkett Elementary School
14 Commercial Street
Adams, MA 01220

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Plunkett Elementary School",'Adams=' + Adams.length); Richmond[Richmond.length] = createMarker(new GPoint(-73.36726379,42.38989258),"
Richmond Consolidated Elementary School
1831 State Rd
Richmond, MA 01254

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Richmond Consolidated Elementary School",'Richmond=' + Richmond.length); Pittsfield[Pittsfield.length] = createMarker(new GPoint(-73.26116180,42.48103333),"
Robert T. Capeless Elementary School
86 Brooks Avenue
Pittsfield, MA 01867

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Robert T. Capeless Elementary School",'Pittsfield=' + Pittsfield.length); Savoy[Savoy.length] = createMarker(new GPoint(-72.99570465,42.56927872),"
Savoy Elementary School
26 Chapel Rd
Savoy, MA 01256

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Savoy Elementary School",'Savoy=' + Savoy.length); Great_Barrington[Great_Barrington.length] = createMarker(new GPoint(-73.35896301,42.19263840),"
Searles Middle School
79 Bridge Street
Great Barrington, MA 01230

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Searles Middle School",'Great_Barrington=' + Great_Barrington.length); Pittsfield[Pittsfield.length] = createMarker(new GPoint(-73.26574707,42.45528412),"
Silvio O Conte Community Elementary School
200 West Union Street
Pittsfield, MA 01201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Silvio O Conte Community Elementary School",'Pittsfield=' + Pittsfield.length); North_Adams[North_Adams.length] = createMarker(new GPoint(-73.10134125,42.68946075),"
Silvio O Conte Middle School
24 Church Street
North Adams, MA 01247

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Silvio O Conte Middle School",'North_Adams=' + North_Adams.length); Sheffield[Sheffield.length] = createMarker(new GPoint(-73.36840057,42.10229874),"
South Egremont Elementary School
Box 326
Sheffield, MA 01257

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("South Egremont Elementary School",'Sheffield=' + Sheffield.length); Pittsfield[Pittsfield.length] = createMarker(new GPoint(-73.29998779,42.43687820),"
Stearns Elementary School
75 Lebanon Avenue
Pittsfield, MA 01201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Stearns Elementary School",'Pittsfield=' + Pittsfield.length); Stockbridge[Stockbridge.length] = createMarker(new GPoint(-73.30255890,42.28170013),"
Stockbridge Plain Elementary School
Main Street
Stockbridge, MA 01262

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Stockbridge Plain Elementary School",'Stockbridge=' + Stockbridge.length); Pittsfield[Pittsfield.length] = createMarker(new GPoint(-73.27767181,42.45563507),"
Taconic High School
96 Valentine Road
Pittsfield, MA 01201

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Taconic High School",'Pittsfield=' + Pittsfield.length); Pittsfield[Pittsfield.length] = createMarker(new GPoint(-73.24317169,42.43327332),"
Theodore Herberg Middle School
501 Pomeroy Avenue
Pittsfield, MA 01201

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Theodore Herberg Middle School",'Pittsfield=' + Pittsfield.length); Sheffield[Sheffield.length] = createMarker(new GPoint(-73.36840057,42.10229874),"
Undermountain Elementary School
Box 326
Sheffield, MA 01257

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Undermountain Elementary School",'Sheffield=' + Sheffield.length); West_Stockbridge[West_Stockbridge.length] = createMarker(new GPoint(-73.37186432,42.33709717),"
Village Elementary School
21 State Line Rd.
West Stockbridge, MA 01266

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Village Elementary School",'West_Stockbridge=' + West_Stockbridge.length); Dalton[Dalton.length] = createMarker(new GPoint(-73.11375427,42.47332382),"
Wahconah Regional High School
150 Windsor Rd
Dalton, MA 01226

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wahconah Regional High School",'Dalton=' + Dalton.length); Great_Barrington[Great_Barrington.length] = createMarker(new GPoint(-73.36070251,42.19342422),"
William Cullen Bryant Elementary School
16 School Street
Great Barrington, MA 01230

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("William Cullen Bryant Elementary School",'Great_Barrington=' + Great_Barrington.length); Pittsfield[Pittsfield.length] = createMarker(new GPoint(-73.21044922,42.43598557),"
Williams Elementary School
50 Bushey Road
Pittsfield, MA 01201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Williams Elementary School",'Pittsfield=' + Pittsfield.length); Williamstown[Williamstown.length] = createMarker(new GPoint(-73.19915009,42.71496964),"
Williamstown Elementary School
115 Church Street
Williamstown, MA 01267

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Williamstown Elementary School",'Williamstown=' + Williamstown.length); } // End addStateMarkers JavaScript Function // Takes an array of markers and centers/zooms map based on marker range function centerByArray(myArray, recenter, newMaxMin) { if (newMaxMin == true) reMaxMin(myArray); for (var i = 0; i < myArray.length; i++) { var markLng = myArray[i].getPoint().x; var markLat = myArray[i].getPoint().y; if (markLat > maxLat) maxLat = markLat; if (markLng > maxLng) maxLng = markLng; if (markLat < minLat) minLat = markLat; if (markLng < minLng) minLng = markLng; } if (recenter) reCenterMap(); } // Reinit max/mins function reMaxMin(myArray) { maxLng = myArray[0].getPoint().x; maxLat = myArray[0].getPoint().y; minLng = myArray[0].getPoint().x; minLat = myArray[0].getPoint().y; } // Recenter map based on global max/mins function reCenterMap() { var bounds = new GLatLngBounds(); bounds.extend(new GLatLng(minLat, minLng)); bounds.extend(new GLatLng(maxLat, maxLng)); var center_lat = (bounds.getNorthEast().lat() + bounds.getSouthWest().lat()) / 2.0; var center_lng = (bounds.getNorthEast().lng() + bounds.getSouthWest().lng()) / 2.0; var center = new GLatLng(center_lat, center_lng); var zoom = map.getBoundsZoomLevel(bounds); map.setCenter(center,zoom); //map.setCenter(center,10); /* var center = new GPoint( (maxLng + minLng)/2, (maxLat+minLat)/2 ); var delta = new GSize(maxLng - minLng, maxLat - minLat); var minZoom = map.spec.getLowestZoomLevel(center, delta, map.viewSize); if (minZoom < 4) minZoom = 4; // Lowest possible zoom is 4 map.centerAndZoom(center, minZoom); */ } // Fires when drop down list of schools changes function selectChange(selection) { var myVal = selection.options[selection.selectedIndex].value; map.closeInfoWindow(); // Add entire array based on variable type if (myVal.indexOf('all') != -1 && myVal != 'all') { var temp = myVal.split('='); var showArray = temp[1]; // If Array is > X amount of markers, then open in a new page if (eval(showArray).length > 20) // New window depends on whether or not we're on the search page if (location.href.indexOf('nearby_schools.php') == -1) window.open(location.href + '/map/' + showArray); else window.open('/search////' + showArray); map.removeOverlays(Adams); map.removeOverlays(Becket); map.removeOverlays(Cheshire); map.removeOverlays(Clarksburg); map.removeOverlays(Dalton); map.removeOverlays(Florida); map.removeOverlays(Great_Barrington); map.removeOverlays(Hancock); map.removeOverlays(Hinsdale); map.removeOverlays(Housatonic); map.removeOverlays(Lanesborough); map.removeOverlays(Lee); map.removeOverlays(Lenox); map.removeOverlays(North_Adams); map.removeOverlays(Otis); map.removeOverlays(Pittsfield); map.removeOverlays(Richmond); map.removeOverlays(Savoy); map.removeOverlays(Sheffield); map.removeOverlays(Stockbridge); map.removeOverlays(West_Stockbridge); map.removeOverlays(Williamstown); map.addOverlays(eval(showArray)); centerByArray(eval(showArray), true, true); // Center and zoom on set of markers } // Add individual markers if (myVal.indexOf('all') == -1 && myVal != 'all' && myVal.length) { var temp = myVal.split('='); var myArray = temp[0]; var myIndex = parseInt(temp[1]) - 1; document.getElementById('map').width = "750"; map.removeOverlay(eval(myArray)[myIndex]); map.addOverlay(eval(myArray)[myIndex]); GEvent.trigger(eval(myArray)[myIndex],'click'); } // Show all markers if (myVal == 'all') { cntMarker = 0; reMaxMin(Florida);map.removeOverlays(Adams); map.removeOverlays(Becket); map.removeOverlays(Cheshire); map.removeOverlays(Clarksburg); map.removeOverlays(Dalton); map.removeOverlays(Florida); map.removeOverlays(Great_Barrington); map.removeOverlays(Hancock); map.removeOverlays(Hinsdale); map.removeOverlays(Housatonic); map.removeOverlays(Lanesborough); map.removeOverlays(Lee); map.removeOverlays(Lenox); map.removeOverlays(North_Adams); map.removeOverlays(Otis); map.removeOverlays(Pittsfield); map.removeOverlays(Richmond); map.removeOverlays(Savoy); map.removeOverlays(Sheffield); map.removeOverlays(Stockbridge); map.removeOverlays(West_Stockbridge); map.removeOverlays(Williamstown); map.addOverlays(Adams); centerByArray(Adams, false, false); cntMarker += Adams.length; map.addOverlays(Becket); centerByArray(Becket, false, false); cntMarker += Becket.length; map.addOverlays(Cheshire); centerByArray(Cheshire, false, false); cntMarker += Cheshire.length; map.addOverlays(Clarksburg); centerByArray(Clarksburg, false, false); cntMarker += Clarksburg.length; map.addOverlays(Dalton); centerByArray(Dalton, false, false); cntMarker += Dalton.length; map.addOverlays(Florida); centerByArray(Florida, false, false); cntMarker += Florida.length; map.addOverlays(Great_Barrington); centerByArray(Great_Barrington, false, false); cntMarker += Great_Barrington.length; map.addOverlays(Hancock); centerByArray(Hancock, false, false); cntMarker += Hancock.length; map.addOverlays(Hinsdale); centerByArray(Hinsdale, false, false); cntMarker += Hinsdale.length; map.addOverlays(Housatonic); centerByArray(Housatonic, false, false); cntMarker += Housatonic.length; map.addOverlays(Lanesborough); centerByArray(Lanesborough, false, false); cntMarker += Lanesborough.length; map.addOverlays(Lee); centerByArray(Lee, false, false); cntMarker += Lee.length; map.addOverlays(Lenox); centerByArray(Lenox, false, false); cntMarker += Lenox.length; map.addOverlays(North_Adams); centerByArray(North_Adams, false, false); cntMarker += North_Adams.length; map.addOverlays(Otis); centerByArray(Otis, false, false); cntMarker += Otis.length; map.addOverlays(Pittsfield); centerByArray(Pittsfield, false, false); cntMarker += Pittsfield.length; map.addOverlays(Richmond); centerByArray(Richmond, false, false); cntMarker += Richmond.length; map.addOverlays(Savoy); centerByArray(Savoy, false, false); cntMarker += Savoy.length; map.addOverlays(Sheffield); centerByArray(Sheffield, false, false); cntMarker += Sheffield.length; map.addOverlays(Stockbridge); centerByArray(Stockbridge, false, false); cntMarker += Stockbridge.length; map.addOverlays(West_Stockbridge); centerByArray(West_Stockbridge, false, false); cntMarker += West_Stockbridge.length; map.addOverlays(Williamstown); centerByArray(Williamstown, false, false); cntMarker += Williamstown.length; centerByArray(Florida,true, false); if (cntMarker > 20) // New window depends on whether or not we're on the search page if (location.href.indexOf('schools-by-distance') == -1) window.open(location.href + '/map/all'); else window.open('/search////all'); } }