function addMarkers() { mySelect = document.getElementById('selection'); Markleysburg = [];Fairchance = [];Uniontown = [];Mcclellandtown = [];Point_Marion = [];Belle_Vernon = [];Brownsville = [];Connellsville = [];New_Salem = [];East_Millsboro = [];Perryopolis = [];Melcroft = [];Dunbar = [];Vanderbilt = [];Mc_Clellandtown = [];Masontown = [];Smithfield = [];Normalville = [];Farmington = [];mySelect.options[mySelect.options.length] = new Option("Belle Vernon schools",'all=Belle_Vernon'); mySelect.options[mySelect.options.length] = new Option("Brownsville schools",'all=Brownsville'); mySelect.options[mySelect.options.length] = new Option("Connellsville schools",'all=Connellsville'); mySelect.options[mySelect.options.length] = new Option("Dunbar schools",'all=Dunbar'); mySelect.options[mySelect.options.length] = new Option("East Millsboro schools",'all=East_Millsboro'); mySelect.options[mySelect.options.length] = new Option("Fairchance schools",'all=Fairchance'); mySelect.options[mySelect.options.length] = new Option("Farmington schools",'all=Farmington'); mySelect.options[mySelect.options.length] = new Option("Markleysburg schools",'all=Markleysburg'); mySelect.options[mySelect.options.length] = new Option("Masontown schools",'all=Masontown'); mySelect.options[mySelect.options.length] = new Option("Mc Clellandtown schools",'all=Mc_Clellandtown'); mySelect.options[mySelect.options.length] = new Option("Mcclellandtown schools",'all=Mcclellandtown'); mySelect.options[mySelect.options.length] = new Option("Melcroft schools",'all=Melcroft'); mySelect.options[mySelect.options.length] = new Option("New Salem schools",'all=New_Salem'); mySelect.options[mySelect.options.length] = new Option("Normalville schools",'all=Normalville'); mySelect.options[mySelect.options.length] = new Option("Perryopolis schools",'all=Perryopolis'); mySelect.options[mySelect.options.length] = new Option("Point Marion schools",'all=Point_Marion'); mySelect.options[mySelect.options.length] = new Option("Smithfield schools",'all=Smithfield'); mySelect.options[mySelect.options.length] = new Option("Uniontown schools",'all=Uniontown'); mySelect.options[mySelect.options.length] = new Option("Vanderbilt schools",'all=Vanderbilt'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Markleysburg[Markleysburg.length] = createMarker(new GPoint(-79.48827362,39.77367401),"
A J Mcmullen School
4773 National Pike
Markleysburg, PA 15459

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("A J Mcmullen School",'Markleysburg=' + Markleysburg.length); Fairchance[Fairchance.length] = createMarker(new GPoint(-79.75489807,39.81724167),"
A L Wilson Elementary School
25 S Main St
Fairchance, PA 15436

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("A L Wilson Elementary School",'Fairchance=' + Fairchance.length); Uniontown[Uniontown.length] = createMarker(new GPoint(-79.78376007,39.82696533),"
Albert Gallatin Area Senior High School
1119 Twp Dr
Uniontown, PA 15401

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Albert Gallatin Area Senior High School",'Uniontown=' + Uniontown.length); Mcclellandtown[Mcclellandtown.length] = createMarker(new GPoint(-79.90101624,39.84679031),"
Albert Gallatin North Middle School
113 College Avenue
Mcclellandtown, PA 15458

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Albert Gallatin North Middle School",'Mcclellandtown=' + Mcclellandtown.length); Point_Marion[Point_Marion.length] = createMarker(new GPoint(-79.91982269,39.78039932),"
Albert Gallatin South Middle School
224 New Geneva Road
Point Marion, PA 15474

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Albert Gallatin South Middle School",'Point_Marion=' + Point_Marion.length); Belle_Vernon[Belle_Vernon.length] = createMarker(new GPoint(-79.83168793,40.11486435),"
Bellmar Middle School
500 Perry Ave
Belle Vernon, PA 15012

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Bellmar Middle School",'Belle_Vernon=' + Belle_Vernon.length); Uniontown[Uniontown.length] = createMarker(new GPoint(-79.73371887,39.89159393),"
Ben Franklin School
351 Morgantown St
Uniontown, PA 15401

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ben Franklin School",'Uniontown=' + Uniontown.length); Brownsville[Brownsville.length] = createMarker(new GPoint(-79.89489746,40.00805283),"
Brownsville Area High School
One Falcon Drive
Brownsville, PA 15417

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Brownsville Area High School",'Brownsville=' + Brownsville.length); Connellsville[Connellsville.length] = createMarker(new GPoint(-79.56050873,40.05554199),"
Bullskin Elementary School
125 Pleasant Valley Rd
Connellsville, PA 15425

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bullskin Elementary School",'Connellsville=' + Connellsville.length); New_Salem[New_Salem.length] = createMarker(new GPoint(-79.86225128,39.95703125),"
Cardale Elementary School
192 Filbert-orient Rd
New Salem, PA 15468

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cardale Elementary School",'New_Salem=' + New_Salem.length); East_Millsboro[East_Millsboro.length] = createMarker(new GPoint(-79.95085907,39.96385956),"
Central Elementary School
234 Arensburg Rd
East Millsboro, PA 15433

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Central Elementary School",'East_Millsboro=' + East_Millsboro.length); Perryopolis[Perryopolis.length] = createMarker(new GPoint(-79.74680328,40.08885956),"
Central Elementary School
142 Constitution St
Perryopolis, PA 15473

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Central Elementary School",'Perryopolis=' + Perryopolis.length); Uniontown[Uniontown.length] = createMarker(new GPoint(-79.70337677,39.91260147),"
Clark Elementary School
200 Water St
Uniontown, PA 15401

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Clark Elementary School",'Uniontown=' + Uniontown.length); Melcroft[Melcroft.length] = createMarker(new GPoint(-79.37228394,40.06020355),"
Clifford N Pritts Elementary School
1542 Indian Creek Valley Road
Melcroft, PA 15462

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Clifford N Pritts Elementary School",'Melcroft=' + Melcroft.length); Connellsville[Connellsville.length] = createMarker(new GPoint(-79.57704163,40.02494049),"
Connellsville Area Senior High School
201 Falcon Drive
Connellsville, PA 15425

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Connellsville Area Senior High School",'Connellsville=' + Connellsville.length); Connellsville[Connellsville.length] = createMarker(new GPoint(-79.58933258,40.01771164),"
Connellsville Junior High School East
Locust Street Extension
Connellsville, PA 15425

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Connellsville Junior High School East",'Connellsville=' + Connellsville.length); Connellsville[Connellsville.length] = createMarker(new GPoint(-79.61743164,40.01098251),"
Connellsville Junior High School West
215 Falls Ave
Connellsville, PA 15425

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Connellsville Junior High School West",'Connellsville=' + Connellsville.length); Connellsville[Connellsville.length] = createMarker(new GPoint(-79.56501007,40.02161026),"
Connellsville Township Elementary School
730 Rockridge Rd
Connellsville, PA 15425

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Connellsville Township Elementary School",'Connellsville=' + Connellsville.length); Brownsville[Brownsville.length] = createMarker(new GPoint(-79.87242126,40.00261307),"
Cox-donahey Elementary School
200 Thornton Rd
Brownsville, PA 15417

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cox-donahey Elementary School",'Brownsville=' + Brownsville.length); Uniontown[Uniontown.length] = createMarker(new GPoint(-79.78421021,39.82891464),"
D Ferd Swaney Elementary School
1152 Twp Dr
Uniontown, PA 15401

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("D Ferd Swaney Elementary School",'Uniontown=' + Uniontown.length); Dunbar[Dunbar.length] = createMarker(new GPoint(-79.63948059,39.96599197),"
Dunbar Boro Elementary School
175 Pechin Rd
Dunbar, PA 15431

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Dunbar Boro Elementary School",'Dunbar=' + Dunbar.length); Connellsville[Connellsville.length] = createMarker(new GPoint(-79.61977386,40.01959991),"
Dunbar Township Elementary School
711 Ridge Blvd
Connellsville, PA 15425

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Dunbar Township Elementary School",'Connellsville=' + Connellsville.length); Uniontown[Uniontown.length] = createMarker(new GPoint(-79.74296570,39.86316681),"
Fayette County Avts
175 Georges Fairchance Rd
Uniontown, PA 15401

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Fayette County Avts",'Uniontown=' + Uniontown.length); Vanderbilt[Vanderbilt.length] = createMarker(new GPoint(-79.70291138,40.02318573),"
Franklin School
242 Buena Vista Road
Vanderbilt, PA 15486

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Franklin School",'Vanderbilt=' + Vanderbilt.length); Perryopolis[Perryopolis.length] = createMarker(new GPoint(-79.75963593,40.08976364),"
Frazier High School
142 Constitution St
Perryopolis, PA 15473

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Frazier High School",'Perryopolis=' + Perryopolis.length); Perryopolis[Perryopolis.length] = createMarker(new GPoint(-79.75963593,40.08976364),"
Frazier Middle School
142 Constitution St
Perryopolis, PA 15473

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Frazier Middle School",'Perryopolis=' + Perryopolis.length); Point_Marion[Point_Marion.length] = createMarker(new GPoint(-79.91979980,39.78100586),"
Friendship Hill Elementary School
218 New Geneva Rd
Point Marion, PA 15474

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Friendship Hill Elementary School",'Point_Marion=' + Point_Marion.length); Mc_Clellandtown[Mc_Clellandtown.length] = createMarker(new GPoint(-79.85652161,39.86469269),"
George J Plava Elementary School
120 Puritan Rd
Mc Clellandtown, PA 15458

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("George J Plava Elementary School",'Mc_Clellandtown=' + Mc_Clellandtown.length); Uniontown[Uniontown.length] = createMarker(new GPoint(-79.72802734,39.87892914),"
Hatfield Elementary School
370 Derrick Ave
Uniontown, PA 15401

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hatfield Elementary School",'Uniontown=' + Uniontown.length); Uniontown[Uniontown.length] = createMarker(new GPoint(-79.70835114,39.86301422),"
Hutchinson Elementary School
213 Mountain View Road
Uniontown, PA 15401

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hutchinson Elementary School",'Uniontown=' + Uniontown.length); Uniontown[Uniontown.length] = createMarker(new GPoint(-79.71473694,39.90031052),"
Kennedy Elementary School
125 Chaffee Street Ext
Uniontown, PA 15401

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Kennedy Elementary School",'Uniontown=' + Uniontown.length); Uniontown[Uniontown.length] = createMarker(new GPoint(-79.70574951,39.90117645),"
Lafayette School
303 Connellsville St
Uniontown, PA 15401

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lafayette School",'Uniontown=' + Uniontown.length); Uniontown[Uniontown.length] = createMarker(new GPoint(-79.75148010,39.89477539),"
Laurel Highlands Middle School
18-20 Hookton Avenue
Uniontown, PA 15401

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Laurel Highlands Middle School",'Uniontown=' + Uniontown.length); Uniontown[Uniontown.length] = createMarker(new GPoint(-79.71199799,39.91123581),"
Laurel Highlands Senior High School
300 Bailey Ave
Uniontown, PA 15401

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Laurel Highlands Senior High School",'Uniontown=' + Uniontown.length); Markleysburg[Markleysburg.length] = createMarker(new GPoint(-79.48715973,39.72179794),"
Marclay School
111 Bruceton Road
Markleysburg, PA 15459

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Marclay School",'Markleysburg=' + Markleysburg.length); Belle_Vernon[Belle_Vernon.length] = createMarker(new GPoint(-79.83168793,40.11486435),"
Marion Elementary School
500 Perry Ave
Belle Vernon, PA 15012

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Marion Elementary School",'Belle_Vernon=' + Belle_Vernon.length); Uniontown[Uniontown.length] = createMarker(new GPoint(-79.67970276,39.92176437),"
Marshall Elementary School
335 Park Street
Uniontown, PA 15401

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Marshall Elementary School",'Uniontown=' + Uniontown.length); Masontown[Masontown.length] = createMarker(new GPoint(-79.90116119,39.84741974),"
Masontown Elementary School
201 Spring St
Masontown, PA 15461

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Masontown Elementary School",'Masontown=' + Masontown.length); Uniontown[Uniontown.length] = createMarker(new GPoint(-79.77958679,39.93539429),"
Menallen School
7527 National Pike
Uniontown, PA 15401

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Menallen School",'Uniontown=' + Uniontown.length); Connellsville[Connellsville.length] = createMarker(new GPoint(-79.57337952,40.02150726),"
North Fayette County Avts
720 Locust St
Connellsville, PA 15425

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("North Fayette County Avts",'Connellsville=' + Connellsville.length); Perryopolis[Perryopolis.length] = createMarker(new GPoint(-79.75963593,40.08976364),"
Perry Elementary School
142 Constitution St
Perryopolis, PA 15473

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Perry Elementary School",'Perryopolis=' + Perryopolis.length); Brownsville[Brownsville.length] = createMarker(new GPoint(-79.89489746,40.00805283),"
Redstone Middle School
Two Falcon Drive
Brownsville, PA 15417

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Redstone Middle School",'Brownsville=' + Brownsville.length); Smithfield[Smithfield.length] = createMarker(new GPoint(-79.80723572,39.80233765),"
Smithfield Elementary School
23 Liberty St
Smithfield, PA 15479

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Smithfield Elementary School",'Smithfield=' + Smithfield.length); Connellsville[Connellsville.length] = createMarker(new GPoint(-79.58758545,40.00783157),"
South Side Elementary School
1135 Race St
Connellsville, PA 15425

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("South Side Elementary School",'Connellsville=' + Connellsville.length); Normalville[Normalville.length] = createMarker(new GPoint(-79.44663239,40.00166321),"
Springfield Elementary School
14 School House Road
Normalville, PA 15469

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Springfield Elementary School",'Normalville=' + Normalville.length); Uniontown[Uniontown.length] = createMarker(new GPoint(-79.72005463,39.89635849),"
Uniontown Area Senior High School
146 E Fayette St
Uniontown, PA 15401

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Uniontown Area Senior High School",'Uniontown=' + Uniontown.length); Farmington[Farmington.length] = createMarker(new GPoint(-79.56803894,39.80514145),"
Wharton School
136 Elliotsville Road
Farmington, PA 15437

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wharton School",'Farmington=' + Farmington.length); Connellsville[Connellsville.length] = createMarker(new GPoint(-79.58267975,40.02433395),"
Zachariah Connell Elementary School
700 Park St
Connellsville, PA 15425

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Zachariah Connell Elementary School",'Connellsville=' + Connellsville.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(Belle_Vernon); map.removeOverlays(Brownsville); map.removeOverlays(Connellsville); map.removeOverlays(Dunbar); map.removeOverlays(East_Millsboro); map.removeOverlays(Fairchance); map.removeOverlays(Farmington); map.removeOverlays(Markleysburg); map.removeOverlays(Masontown); map.removeOverlays(Mc_Clellandtown); map.removeOverlays(Mcclellandtown); map.removeOverlays(Melcroft); map.removeOverlays(New_Salem); map.removeOverlays(Normalville); map.removeOverlays(Perryopolis); map.removeOverlays(Point_Marion); map.removeOverlays(Smithfield); map.removeOverlays(Uniontown); map.removeOverlays(Vanderbilt); 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(Markleysburg);map.removeOverlays(Belle_Vernon); map.removeOverlays(Brownsville); map.removeOverlays(Connellsville); map.removeOverlays(Dunbar); map.removeOverlays(East_Millsboro); map.removeOverlays(Fairchance); map.removeOverlays(Farmington); map.removeOverlays(Markleysburg); map.removeOverlays(Masontown); map.removeOverlays(Mc_Clellandtown); map.removeOverlays(Mcclellandtown); map.removeOverlays(Melcroft); map.removeOverlays(New_Salem); map.removeOverlays(Normalville); map.removeOverlays(Perryopolis); map.removeOverlays(Point_Marion); map.removeOverlays(Smithfield); map.removeOverlays(Uniontown); map.removeOverlays(Vanderbilt); map.addOverlays(Belle_Vernon); centerByArray(Belle_Vernon, false, false); cntMarker += Belle_Vernon.length; map.addOverlays(Brownsville); centerByArray(Brownsville, false, false); cntMarker += Brownsville.length; map.addOverlays(Connellsville); centerByArray(Connellsville, false, false); cntMarker += Connellsville.length; map.addOverlays(Dunbar); centerByArray(Dunbar, false, false); cntMarker += Dunbar.length; map.addOverlays(East_Millsboro); centerByArray(East_Millsboro, false, false); cntMarker += East_Millsboro.length; map.addOverlays(Fairchance); centerByArray(Fairchance, false, false); cntMarker += Fairchance.length; map.addOverlays(Farmington); centerByArray(Farmington, false, false); cntMarker += Farmington.length; map.addOverlays(Markleysburg); centerByArray(Markleysburg, false, false); cntMarker += Markleysburg.length; map.addOverlays(Masontown); centerByArray(Masontown, false, false); cntMarker += Masontown.length; map.addOverlays(Mc_Clellandtown); centerByArray(Mc_Clellandtown, false, false); cntMarker += Mc_Clellandtown.length; map.addOverlays(Mcclellandtown); centerByArray(Mcclellandtown, false, false); cntMarker += Mcclellandtown.length; map.addOverlays(Melcroft); centerByArray(Melcroft, false, false); cntMarker += Melcroft.length; map.addOverlays(New_Salem); centerByArray(New_Salem, false, false); cntMarker += New_Salem.length; map.addOverlays(Normalville); centerByArray(Normalville, false, false); cntMarker += Normalville.length; map.addOverlays(Perryopolis); centerByArray(Perryopolis, false, false); cntMarker += Perryopolis.length; map.addOverlays(Point_Marion); centerByArray(Point_Marion, false, false); cntMarker += Point_Marion.length; map.addOverlays(Smithfield); centerByArray(Smithfield, false, false); cntMarker += Smithfield.length; map.addOverlays(Uniontown); centerByArray(Uniontown, false, false); cntMarker += Uniontown.length; map.addOverlays(Vanderbilt); centerByArray(Vanderbilt, false, false); cntMarker += Vanderbilt.length; centerByArray(Markleysburg,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'); } }