function addMarkers() { mySelect = document.getElementById('selection'); Frederick = [];Brunswick = [];Adamstown = [];Thurmont = [];New_Market = [];Emmitsburg = [];Walkersville = [];Monrovia = [];Hillcrest = [];Libertytown = [];Middletown = [];Myersville = [];Keymar = [];Ijamsville = [];Sabillasville = [];Mt_Airy = [];Jefferson = [];mySelect.options[mySelect.options.length] = new Option("Adamstown schools",'all=Adamstown'); mySelect.options[mySelect.options.length] = new Option("Brunswick schools",'all=Brunswick'); mySelect.options[mySelect.options.length] = new Option("Emmitsburg schools",'all=Emmitsburg'); mySelect.options[mySelect.options.length] = new Option("Frederick schools",'all=Frederick'); mySelect.options[mySelect.options.length] = new Option("Hillcrest schools",'all=Hillcrest'); mySelect.options[mySelect.options.length] = new Option("Ijamsville schools",'all=Ijamsville'); mySelect.options[mySelect.options.length] = new Option("Jefferson schools",'all=Jefferson'); mySelect.options[mySelect.options.length] = new Option("Keymar schools",'all=Keymar'); mySelect.options[mySelect.options.length] = new Option("Libertytown schools",'all=Libertytown'); mySelect.options[mySelect.options.length] = new Option("Middletown schools",'all=Middletown'); mySelect.options[mySelect.options.length] = new Option("Monrovia schools",'all=Monrovia'); mySelect.options[mySelect.options.length] = new Option("Mt Airy schools",'all=Mt_Airy'); mySelect.options[mySelect.options.length] = new Option("Myersville schools",'all=Myersville'); mySelect.options[mySelect.options.length] = new Option("New Market schools",'all=New_Market'); mySelect.options[mySelect.options.length] = new Option("Sabillasville schools",'all=Sabillasville'); mySelect.options[mySelect.options.length] = new Option("Thurmont schools",'all=Thurmont'); mySelect.options[mySelect.options.length] = new Option("Walkersville schools",'all=Walkersville'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Frederick[Frederick.length] = createMarker(new GPoint(-77.42973328,39.37783813),"
Ballenger Creek Elementary School
5250 Kingsbrook Dr
Frederick, MD 21703

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ballenger Creek Elementary School",'Frederick=' + Frederick.length); Frederick[Frederick.length] = createMarker(new GPoint(-77.44321442,39.38301086),"
Ballenger Creek Middle School
5525 Ballenger Creek Pike
Frederick, MD 21703

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Ballenger Creek Middle School",'Frederick=' + Frederick.length); Brunswick[Brunswick.length] = createMarker(new GPoint(-77.63430023,39.31801224),"
Brunswick Elementary School
400 Central Ave
Brunswick, MD 21716

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Brunswick Elementary School",'Brunswick=' + Brunswick.length); Brunswick[Brunswick.length] = createMarker(new GPoint(-77.61074829,39.31625748),"
Brunswick High School
101 Cummings Dr
Brunswick, MD 21716

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Brunswick High School",'Brunswick=' + Brunswick.length); Brunswick[Brunswick.length] = createMarker(new GPoint(-77.61074829,39.31625748),"
Brunswick Middle School
301 Cummings Dr
Brunswick, MD 21716

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Brunswick Middle School",'Brunswick=' + Brunswick.length); Adamstown[Adamstown.length] = createMarker(new GPoint(-77.47062683,39.31265640),"
Carroll Manor Elementary School
5624 Adamstown Rd
Adamstown, MD 21710

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Carroll Manor Elementary School",'Adamstown=' + Adamstown.length); Thurmont[Thurmont.length] = createMarker(new GPoint(-77.41068268,39.63788223),"
Catoctin High School
14745 Sabillasville Rd
Thurmont, MD 21788

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Catoctin High School",'Thurmont=' + Thurmont.length); Frederick[Frederick.length] = createMarker(new GPoint(-77.33410700,39.33358500),"
Centerville Elementary School
3601 Carriage Hill Dr
Frederick, MD 21704

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Centerville Elementary School",'Frederick=' + Frederick.length); Frederick[Frederick.length] = createMarker(new GPoint(-77.42512600,39.39304200),"
Crestwood Middle School
7100 Foxcroft Dr
Frederick, MD 21703

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Crestwood Middle School",'Frederick=' + Frederick.length); New_Market[New_Market.length] = createMarker(new GPoint(-77.29999542,39.40055084),"
Deer Crossing Elementary School
10601 Finn Dr
New Market, MD 21774

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Deer Crossing Elementary School",'New_Market=' + New_Market.length); Emmitsburg[Emmitsburg.length] = createMarker(new GPoint(-77.32825470,39.70128632),"
Emmitsburg Elementary School
300 S Seton Ave
Emmitsburg, MD 21727

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Emmitsburg Elementary School",'Emmitsburg=' + Emmitsburg.length); Frederick[Frederick.length] = createMarker(new GPoint(-77.41319275,39.45068741),"
Frederick County Career & Technology Center
7922 Opossumtown Pike
Frederick, MD 21702

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Frederick County Career & Technology Center",'Frederick=' + Frederick.length); Walkersville[Walkersville.length] = createMarker(new GPoint(-77.34755707,39.48323059),"
Frederick County Evening High School
44 Frederick St B Bldg
Walkersville, MD 21793

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Frederick County Evening High School",'Walkersville=' + Walkersville.length); Frederick[Frederick.length] = createMarker(new GPoint(-77.42572784,39.41726685),"
Frederick High School
650 Carroll Pky
Frederick, MD 21701

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Frederick High School",'Frederick=' + Frederick.length); Walkersville[Walkersville.length] = createMarker(new GPoint(-77.35199738,39.49954987),"
Glade Elementary School
9525 Glade Rd
Walkersville, MD 21793

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Glade Elementary School",'Walkersville=' + Walkersville.length); Frederick[Frederick.length] = createMarker(new GPoint(-77.40487671,39.43273926),"
Gov. Thomas Johnson High School
1501 N Market St
Frederick, MD 21701

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Gov. Thomas Johnson High School",'Frederick=' + Frederick.length); Frederick[Frederick.length] = createMarker(new GPoint(-77.39967346,39.43870544),"
Gov. Thomas Johnson Middle School
1799 Schifferstadt Blvd
Frederick, MD 21701

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Gov. Thomas Johnson Middle School",'Frederick=' + Frederick.length); Monrovia[Monrovia.length] = createMarker(new GPoint(-77.26227570,39.34454727),"
Green Valley Elementary School
11501 Fingerboard Rd
Monrovia, MD 21770

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Green Valley Elementary School",'Monrovia=' + Monrovia.length); Frederick[Frederick.length] = createMarker(new GPoint(-77.41301727,39.43625641),"
Heather Ridge High School
1445 Taney Ave
Frederick, MD 21702

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Heather Ridge High School",'Frederick=' + Frederick.length); Frederick[Frederick.length] = createMarker(new GPoint(-77.41301727,39.43625641),"
Heather Ridge Middle School
1445 Taney Ave
Frederick, MD 21702

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Heather Ridge Middle School",'Frederick=' + Frederick.length); Hillcrest[Hillcrest.length] = createMarker(new GPoint(-77.45285034,39.41078186),"
Hillcrest Elementary School
1285 Hillcrest Drive
Hillcrest, MD 21703

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hillcrest Elementary School",'Hillcrest=' + Hillcrest.length); Monrovia[Monrovia.length] = createMarker(new GPoint(-77.23516846,39.32716370),"
Kemptown Elementary School
3456 Kemptown Church Rd
Monrovia, MD 21770

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Kemptown Elementary School",'Monrovia=' + Monrovia.length); Thurmont[Thurmont.length] = createMarker(new GPoint(-77.41559601,39.53761673),"
Lewistown Elementary School
11119 Hessong Bridge Rd
Thurmont, MD 21788

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lewistown Elementary School",'Thurmont=' + Thurmont.length); Libertytown[Libertytown.length] = createMarker(new GPoint(-77.25475311,39.48220062),"
Liberty Elementary School
11820 Liberty Rd
Libertytown, MD 21762

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Liberty Elementary School",'Libertytown=' + Libertytown.length); Frederick[Frederick.length] = createMarker(new GPoint(-77.24376678,39.43250275),"
Linganore High School
12013 Old Annapolis Rd
Frederick, MD 21701

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Linganore High School",'Frederick=' + Frederick.length); Middletown[Middletown.length] = createMarker(new GPoint(-77.53799438,39.44302750),"
Middletown Elementary School
201 E Green St
Middletown, MD 21769

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Middletown Elementary School",'Middletown=' + Middletown.length); Middletown[Middletown.length] = createMarker(new GPoint(-77.53638458,39.44179916),"
Middletown High School
200 Schoolhouse Dr
Middletown, MD 21769

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Middletown High School",'Middletown=' + Middletown.length); Middletown[Middletown.length] = createMarker(new GPoint(-77.53656769,39.44147110),"
Middletown Middle School
100 High St
Middletown, MD 21769

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Middletown Middle School",'Middletown=' + Middletown.length); Frederick[Frederick.length] = createMarker(new GPoint(-77.41042328,39.45694351),"
Monocacy Elementary School
7421 Hayward Rd
Frederick, MD 21702

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Monocacy Elementary School",'Frederick=' + Frederick.length); Frederick[Frederick.length] = createMarker(new GPoint(-77.41454315,39.45526886),"
Monocacy Middle School
8009 Opossumtown Pike
Frederick, MD 21702

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Monocacy Middle School",'Frederick=' + Frederick.length); Frederick[Frederick.length] = createMarker(new GPoint(-77.38664246,39.44884872),"
Monocacy Valley Montessori School
217 Dill Ave
Frederick, MD 21701

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Monocacy Valley Montessori School",'Frederick=' + Frederick.length); Myersville[Myersville.length] = createMarker(new GPoint(-77.56620026,39.50970078),"
Myersville Elementary School
Lushbaugh Way
Myersville, MD 21773

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Myersville Elementary School",'Myersville=' + Myersville.length); New_Market[New_Market.length] = createMarker(new GPoint(-77.28549957,39.40530014),"
New Market Elementary School
93 W Main St
New Market, MD 21774

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("New Market Elementary School",'New_Market=' + New_Market.length); New_Market[New_Market.length] = createMarker(new GPoint(-77.28549957,39.40530014),"
New Market Middle School
125 W Main St
New Market, MD 21774

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("New Market Middle School",'New_Market=' + New_Market.length); Keymar[Keymar.length] = createMarker(new GPoint(-77.71311188,39.64149475),"
New Midway/woodsboro Elementary School
12226 Woodsboro Pike
Keymar, MD 21757

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("New Midway/woodsboro Elementary School",'Keymar=' + Keymar.length); Frederick[Frederick.length] = createMarker(new GPoint(-77.41008759,39.42676544),"
North Frederick Elementary School
1001 Motter Ave
Frederick, MD 21701

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("North Frederick Elementary School",'Frederick=' + Frederick.length); Ijamsville[Ijamsville.length] = createMarker(new GPoint(-77.32577515,39.39353561),"
Oakdale Elementary School
9850 Old National Pike
Ijamsville, MD 21754

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Oakdale Elementary School",'Ijamsville=' + Ijamsville.length); Ijamsville[Ijamsville.length] = createMarker(new GPoint(-77.28549957,39.40530014),"
Oakdale Middle School
9840 Old National Pike
Ijamsville, MD 21754

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Oakdale Middle School",'Ijamsville=' + Ijamsville.length); Frederick[Frederick.length] = createMarker(new GPoint(-77.44117737,39.39249802),"
Orchard Grove Elementary School
5898 Hannover Dr
Frederick, MD 21703

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Orchard Grove Elementary School",'Frederick=' + Frederick.length); Frederick[Frederick.length] = createMarker(new GPoint(-77.41842651,39.41496658),"
Parkway Elementary School
300 Carroll Pky
Frederick, MD 21701

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Parkway Elementary School",'Frederick=' + Frederick.length); Frederick[Frederick.length] = createMarker(new GPoint(-77.45979309,39.42501068),"
Rock Creek School
191 Waverley Dr
Frederick, MD 21702

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rock Creek School",'Frederick=' + Frederick.length); Sabillasville[Sabillasville.length] = createMarker(new GPoint(-77.45477295,39.67759705),"
Sabillasville Elementary School
16210b Sabillasville Rd
Sabillasville, MD 21780

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sabillasville Elementary School",'Sabillasville=' + Sabillasville.length); Frederick[Frederick.length] = createMarker(new GPoint(-77.41616821,39.40877533),"
South Frederick Elementary School
250 Madison St
Frederick, MD 21701

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("South Frederick Elementary School",'Frederick=' + Frederick.length); Frederick[Frederick.length] = createMarker(new GPoint(-77.35218048,39.40039063),"
Spring Ridge Elementary School
9051 Ridgefield Dr
Frederick, MD 21701

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Spring Ridge Elementary School",'Frederick=' + Frederick.length); Thurmont[Thurmont.length] = createMarker(new GPoint(-77.39813232,39.61745453),"
Thurmont Elementary School
805 E Main St
Thurmont, MD 21788

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Thurmont Elementary School",'Thurmont=' + Thurmont.length); Thurmont[Thurmont.length] = createMarker(new GPoint(-77.40448761,39.62139130),"
Thurmont Middle School
408 E Main St
Thurmont, MD 21788

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Thurmont Middle School",'Thurmont=' + Thurmont.length); Thurmont[Thurmont.length] = createMarker(new GPoint(-77.38831329,39.61463547),"
Thurmont Primary
7989 Rocky Ridge Rd
Thurmont, MD 21788

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Thurmont Primary",'Thurmont=' + Thurmont.length); Frederick[Frederick.length] = createMarker(new GPoint(-77.44329400,39.37089900),"
Tuscarora Elementary School
6321 Lambert Dr
Frederick, MD 21703

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Tuscarora Elementary School",'Frederick=' + Frederick.length); Frederick[Frederick.length] = createMarker(new GPoint(-76.83809662,38.97650146),"
Tuscarora High School
5312 Ballenger Creek Pk
Frederick, MD 21703

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Tuscarora High School",'Frederick=' + Frederick.length); Mt_Airy[Mt_Airy.length] = createMarker(new GPoint(-77.17405701,39.37118912),"
Twin Ridge Elementary School
1106 Leafy Hollow Circle
Mt Airy, MD 21771

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Twin Ridge Elementary School",'Mt_Airy=' + Mt_Airy.length); Frederick[Frederick.length] = createMarker(new GPoint(-77.35765839,39.32861328),"
Urbana Elementary School
3554 Urbana Pike
Frederick, MD 21704

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Urbana Elementary School",'Frederick=' + Frederick.length); Ijamsville[Ijamsville.length] = createMarker(new GPoint(-77.32436600,39.36162100),"
Urbana High School
3471 Campus Dr
Ijamsville, MD 21754

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Urbana High School",'Ijamsville=' + Ijamsville.length); Jefferson[Jefferson.length] = createMarker(new GPoint(-77.54837799,39.36021042),"
Valley Elementary School
3519 Jefferson Pike
Jefferson, MD 21755

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Valley Elementary School",'Jefferson=' + Jefferson.length); Walkersville[Walkersville.length] = createMarker(new GPoint(-77.34645081,39.48373795),"
Walkersville Elementary School
83 Frederick Street
Walkersville, MD 21793

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Walkersville Elementary School",'Walkersville=' + Walkersville.length); Walkersville[Walkersville.length] = createMarker(new GPoint(-77.35768127,39.47620773),"
Walkersville High School
81 Frederick Street
Walkersville, MD 21793

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Walkersville High School",'Walkersville=' + Walkersville.length); Walkersville[Walkersville.length] = createMarker(new GPoint(-77.35536194,39.47837067),"
Walkersville Middle School
55 Frederick Street
Walkersville, MD 21793

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Walkersville Middle School",'Walkersville=' + Walkersville.length); Frederick[Frederick.length] = createMarker(new GPoint(-77.45981598,39.42507935),"
Waverley Elementary School
201 Waverley Dr
Frederick, MD 21702

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Waverley Elementary School",'Frederick=' + Frederick.length); Frederick[Frederick.length] = createMarker(new GPoint(-77.43735504,39.41598892),"
West Frederick Middle School
515 W Patrick St
Frederick, MD 21701

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("West Frederick Middle School",'Frederick=' + Frederick.length); Frederick[Frederick.length] = createMarker(new GPoint(-77.44624329,39.45489120),"
Whittier Elementary School
2400 Whittier Dr
Frederick, MD 21702

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Whittier Elementary School",'Frederick=' + Frederick.length); Ijamsville[Ijamsville.length] = createMarker(new GPoint(-77.27815247,39.32204056),"
Windsor Knolls Middle School
11150 Windsor Rd
Ijamsville, MD 21754

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Windsor Knolls Middle School",'Ijamsville=' + Ijamsville.length); Myersville[Myersville.length] = createMarker(new GPoint(-77.55112457,39.57336807),"
Wolfsville Elementary School
12520 Wolfsville Rd
Myersville, MD 21773

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wolfsville Elementary School",'Myersville=' + Myersville.length); Frederick[Frederick.length] = createMarker(new GPoint(-77.45449829,39.47337341),"
Yellow Springs Elementary School
8717 Yellow Springs Rd
Frederick, MD 21702

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Yellow Springs Elementary School",'Frederick=' + Frederick.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(Adamstown); map.removeOverlays(Brunswick); map.removeOverlays(Emmitsburg); map.removeOverlays(Frederick); map.removeOverlays(Hillcrest); map.removeOverlays(Ijamsville); map.removeOverlays(Jefferson); map.removeOverlays(Keymar); map.removeOverlays(Libertytown); map.removeOverlays(Middletown); map.removeOverlays(Monrovia); map.removeOverlays(Mt_Airy); map.removeOverlays(Myersville); map.removeOverlays(New_Market); map.removeOverlays(Sabillasville); map.removeOverlays(Thurmont); map.removeOverlays(Walkersville); 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(Frederick);map.removeOverlays(Adamstown); map.removeOverlays(Brunswick); map.removeOverlays(Emmitsburg); map.removeOverlays(Frederick); map.removeOverlays(Hillcrest); map.removeOverlays(Ijamsville); map.removeOverlays(Jefferson); map.removeOverlays(Keymar); map.removeOverlays(Libertytown); map.removeOverlays(Middletown); map.removeOverlays(Monrovia); map.removeOverlays(Mt_Airy); map.removeOverlays(Myersville); map.removeOverlays(New_Market); map.removeOverlays(Sabillasville); map.removeOverlays(Thurmont); map.removeOverlays(Walkersville); map.addOverlays(Adamstown); centerByArray(Adamstown, false, false); cntMarker += Adamstown.length; map.addOverlays(Brunswick); centerByArray(Brunswick, false, false); cntMarker += Brunswick.length; map.addOverlays(Emmitsburg); centerByArray(Emmitsburg, false, false); cntMarker += Emmitsburg.length; map.addOverlays(Frederick); centerByArray(Frederick, false, false); cntMarker += Frederick.length; map.addOverlays(Hillcrest); centerByArray(Hillcrest, false, false); cntMarker += Hillcrest.length; map.addOverlays(Ijamsville); centerByArray(Ijamsville, false, false); cntMarker += Ijamsville.length; map.addOverlays(Jefferson); centerByArray(Jefferson, false, false); cntMarker += Jefferson.length; map.addOverlays(Keymar); centerByArray(Keymar, false, false); cntMarker += Keymar.length; map.addOverlays(Libertytown); centerByArray(Libertytown, false, false); cntMarker += Libertytown.length; map.addOverlays(Middletown); centerByArray(Middletown, false, false); cntMarker += Middletown.length; map.addOverlays(Monrovia); centerByArray(Monrovia, false, false); cntMarker += Monrovia.length; map.addOverlays(Mt_Airy); centerByArray(Mt_Airy, false, false); cntMarker += Mt_Airy.length; map.addOverlays(Myersville); centerByArray(Myersville, false, false); cntMarker += Myersville.length; map.addOverlays(New_Market); centerByArray(New_Market, false, false); cntMarker += New_Market.length; map.addOverlays(Sabillasville); centerByArray(Sabillasville, false, false); cntMarker += Sabillasville.length; map.addOverlays(Thurmont); centerByArray(Thurmont, false, false); cntMarker += Thurmont.length; map.addOverlays(Walkersville); centerByArray(Walkersville, false, false); cntMarker += Walkersville.length; centerByArray(Frederick,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'); } }