function addMarkers() { mySelect = document.getElementById('selection'); Bethlehem = [];Easton = [];Bangor = [];Nazareth = [];Northampton = [];Freemansburg = [];Bath = [];Walnutport = [];Pen_Argyl = [];Hellertown = [];mySelect.options[mySelect.options.length] = new Option("Bangor schools",'all=Bangor'); mySelect.options[mySelect.options.length] = new Option("Bath schools",'all=Bath'); mySelect.options[mySelect.options.length] = new Option("Bethlehem schools",'all=Bethlehem'); mySelect.options[mySelect.options.length] = new Option("Easton schools",'all=Easton'); mySelect.options[mySelect.options.length] = new Option("Freemansburg schools",'all=Freemansburg'); mySelect.options[mySelect.options.length] = new Option("Hellertown schools",'all=Hellertown'); mySelect.options[mySelect.options.length] = new Option("Nazareth schools",'all=Nazareth'); mySelect.options[mySelect.options.length] = new Option("Northampton schools",'all=Northampton'); mySelect.options[mySelect.options.length] = new Option("Pen Argyl schools",'all=Pen_Argyl'); mySelect.options[mySelect.options.length] = new Option("Walnutport schools",'all=Walnutport'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Bethlehem[Bethlehem.length] = createMarker(new GPoint(-75.40996552,40.65586853),"
Asa Packer Elementary School
1650 Kenwood Dr
Bethlehem, PA 18017

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Asa Packer Elementary School",'Bethlehem=' + Bethlehem.length); Easton[Easton.length] = createMarker(new GPoint(-75.24078369,40.67359924),"
Avona Elementary School
2317 Front Street
Easton, PA 18042

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Avona Elementary School",'Easton=' + Easton.length); Bangor[Bangor.length] = createMarker(new GPoint(-75.15196991,40.88488388),"
Bangor Area High School
187 Five Points Richmond Rd
Bangor, PA 18013

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bangor Area High School",'Bangor=' + Bangor.length); Bangor[Bangor.length] = createMarker(new GPoint(-75.20687103,40.86584854),"
Bangor Area Middle School
401 Points Richmond Rd
Bangor, PA 18013

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Bangor Area Middle School",'Bangor=' + Bangor.length); Bethlehem[Bethlehem.length] = createMarker(new GPoint(-75.33424377,40.66270065),"
Bethlehem Avts
3300 Chester Ave
Bethlehem, PA 18020

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bethlehem Avts",'Bethlehem=' + Bethlehem.length); Bethlehem[Bethlehem.length] = createMarker(new GPoint(-75.38009644,40.60817337),"
Broughal Middle School
125 W Packer Ave
Bethlehem, PA 18015

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Broughal Middle School",'Bethlehem=' + Bethlehem.length); Nazareth[Nazareth.length] = createMarker(new GPoint(-75.32402039,40.79252243),"
Bushkill Elementary School
960 Bushkill Center Rd
Nazareth, PA 18064

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bushkill Elementary School",'Nazareth=' + Nazareth.length); Easton[Easton.length] = createMarker(new GPoint(-75.23641968,40.76403046),"
Career Institute Of Technology
5335 Kesslersville Road
Easton, PA 18040

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Career Institute Of Technology",'Easton=' + Easton.length); Northampton[Northampton.length] = createMarker(new GPoint(-75.46672821,40.65898514),"
Catasauqua Senior High School
2500 W Bullshead Rd
Northampton, PA 18067

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Catasauqua Senior High School",'Northampton=' + Northampton.length); Easton[Easton.length] = createMarker(new GPoint(-75.21794891,40.67640686),"
Cheston Elementary School
723 Coal St
Easton, PA 18042

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cheston Elementary School",'Easton=' + Easton.length); Bangor[Bangor.length] = createMarker(new GPoint(-75.15190125,40.88162994),"
Defranco Elementary School
267 Five Points Richmond Rd
Bangor, PA 18013

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Defranco Elementary School",'Bangor=' + Bangor.length); Bethlehem[Bethlehem.length] = createMarker(new GPoint(-75.35919189,40.61111069),"
Donegan Elementary School
1210 East 4th St
Bethlehem, PA 18015

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Donegan Elementary School",'Bethlehem=' + Bethlehem.length); Bethlehem[Bethlehem.length] = createMarker(new GPoint(-75.34277344,40.66243744),"
East Hills Middle School
2005 Chester Rd
Bethlehem, PA 18017

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("East Hills Middle School",'Bethlehem=' + Bethlehem.length); Easton[Easton.length] = createMarker(new GPoint(-75.24961853,40.68161774),"
Easton Area High School
2601 William Penn Hwy
Easton, PA 18045

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Easton Area High School",'Easton=' + Easton.length); Easton[Easton.length] = createMarker(new GPoint(-75.22706604,40.69053650),"
Easton Area Middle School
1221 Northampton St
Easton, PA 18042

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Easton Area Middle School",'Easton=' + Easton.length); Easton[Easton.length] = createMarker(new GPoint(-75.22084045,40.68833923),"
Farmersville Elementary School
7036 Wm Penn Highway
Easton, PA 18045

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Farmersville Elementary School",'Easton=' + Easton.length); Bangor[Bangor.length] = createMarker(new GPoint(-75.15277863,40.87778854),"
Five Points Elementary School
363 Five Points Richmond Rd
Bangor, PA 18013

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Five Points Elementary School",'Bangor=' + Bangor.length); Easton[Easton.length] = createMarker(new GPoint(-75.21475983,40.71510315),"
Forks Elementary School
1709 Richmond Rd
Easton, PA 18040

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Forks Elementary School",'Easton=' + Easton.length); Bethlehem[Bethlehem.length] = createMarker(new GPoint(-75.33998871,40.66228485),"
Freedom High School
3149 Chester Ave
Bethlehem, PA 18020

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Freedom High School",'Bethlehem=' + Bethlehem.length); Freemansburg[Freemansburg.length] = createMarker(new GPoint(-75.33970642,40.62611771),"
Freemansburg Elementary School
501 Monroe St
Freemansburg, PA 18017

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Freemansburg Elementary School",'Freemansburg=' + Freemansburg.length); Bath[Bath.length] = createMarker(new GPoint(-75.38913727,40.72307968),"
George Wolf Elementary School
300 Allen Street
Bath, PA 18014

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("George Wolf Elementary School",'Bath=' + Bath.length); Bethlehem[Bethlehem.length] = createMarker(new GPoint(-75.34265137,40.65340805),"
Governor Wolf Elementary School
1920 Butztown Rd
Bethlehem, PA 18017

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Governor Wolf Elementary School",'Bethlehem=' + Bethlehem.length); Bethlehem[Bethlehem.length] = createMarker(new GPoint(-75.40128326,40.66900635),"
Hanover Elementary School
3890 Jacksonville Rd
Bethlehem, PA 18017

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hanover Elementary School",'Bethlehem=' + Bethlehem.length); Walnutport[Walnutport.length] = createMarker(new GPoint(-75.53685760,40.76127243),"
Lehigh Township Elementary School
800 Blue Mountain Dr
Walnutport, PA 18088

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lehigh Township Elementary School",'Walnutport=' + Walnutport.length); Bethlehem[Bethlehem.length] = createMarker(new GPoint(-75.37567139,40.65488052),"
Lehigh Valley Academy Regional
Suite 200
Bethlehem, PA 18017

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lehigh Valley Academy Regional",'Bethlehem=' + Bethlehem.length); Bethlehem[Bethlehem.length] = createMarker(new GPoint(-75.37567139,40.65488052),"
Lehigh Valley Charter High School For Performing Arts
675 E Broad Street
Bethlehem, PA 18018

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lehigh Valley Charter High School For Performing Arts",'Bethlehem=' + Bethlehem.length); Bethlehem[Bethlehem.length] = createMarker(new GPoint(-75.37058258,40.62893295),"
Liberty High School
1115 Linden St
Bethlehem, PA 18018

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Liberty High School",'Bethlehem=' + Bethlehem.length); Bethlehem[Bethlehem.length] = createMarker(new GPoint(-75.35642242,40.63801956),"
Lincoln Elementary School
1260 Gresham St
Bethlehem, PA 18017

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lincoln Elementary School",'Bethlehem=' + Bethlehem.length); Nazareth[Nazareth.length] = createMarker(new GPoint(-75.33499146,40.70498657),"
Lower Nazareth Elementary School
4422 Newburg Rd
Nazareth, PA 18064

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lower Nazareth Elementary School",'Nazareth=' + Nazareth.length); Easton[Easton.length] = createMarker(new GPoint(-75.20430756,40.70247269),"
March Elementary School
429 Reeder St
Easton, PA 18042

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("March Elementary School",'Easton=' + Easton.length); Bethlehem[Bethlehem.length] = createMarker(new GPoint(-75.34394073,40.63346481),"
Marvine Elementary School
1425 Livingston St
Bethlehem, PA 18017

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Marvine Elementary School",'Bethlehem=' + Bethlehem.length); Bethlehem[Bethlehem.length] = createMarker(new GPoint(-75.32763672,40.64776230),"
Miller Heights Elementary School
3605 Allen St
Bethlehem, PA 18020

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Miller Heights Elementary School",'Bethlehem=' + Bethlehem.length); Bath[Bath.length] = createMarker(new GPoint(-75.43048859,40.77833939),"
Moore Township Elementary School
2835 Mountain View Dr
Bath, PA 18014

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Moore Township Elementary School",'Bath=' + Bath.length); Nazareth[Nazareth.length] = createMarker(new GPoint(-75.30043030,40.74234009),"
Nazareth Area High School
501 East Center Street
Nazareth, PA 18064

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Nazareth Area High School",'Nazareth=' + Nazareth.length); Nazareth[Nazareth.length] = createMarker(new GPoint(-75.28701019,40.73669815),"
Nazareth Area Middle School
355 Tatamy Rd
Nazareth, PA 18064

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Nazareth Area Middle School",'Nazareth=' + Nazareth.length); Northampton[Northampton.length] = createMarker(new GPoint(-75.49185181,40.68689346),"
Northampton Area Junior High School
1617 Laubach Ave
Northampton, PA 18067

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Northampton Area Junior High School",'Northampton=' + Northampton.length); Northampton[Northampton.length] = createMarker(new GPoint(-75.49185944,40.68693542),"
Northampton Area Senior High School
1619 Laubach Ave
Northampton, PA 18067

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Northampton Area Senior High School",'Northampton=' + Northampton.length); Northampton[Northampton.length] = createMarker(new GPoint(-75.49448395,40.68701553),"
Northampton Borough Elementary School
1677 Lincoln Ave
Northampton, PA 18067

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Northampton Borough Elementary School",'Northampton=' + Northampton.length); Northampton[Northampton.length] = createMarker(new GPoint(-75.49185181,40.68689346),"
Northampton Middle School
1617 Laubach Ave
Northampton, PA 18067

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Northampton Middle School",'Northampton=' + Northampton.length); Bethlehem[Bethlehem.length] = createMarker(new GPoint(-75.36301422,40.62786102),"
Northeast Middle School
1110 Fernwood St
Bethlehem, PA 18018

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Northeast Middle School",'Bethlehem=' + Bethlehem.length); Easton[Easton.length] = createMarker(new GPoint(-75.26799011,40.68714142),"
Palmer Elementary School
3050 Green Pond Rd
Easton, PA 18045

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Palmer Elementary School",'Easton=' + Easton.length); Easton[Easton.length] = createMarker(new GPoint(-75.22901917,40.70598221),"
Paxinosa Elementary School
1315 Echo Trl
Easton, PA 18040

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Paxinosa Elementary School",'Easton=' + Easton.length); Pen_Argyl[Pen_Argyl.length] = createMarker(new GPoint(-75.25984192,40.87104416),"
Pen Argyl Area High School
501 W Laurel Ave
Pen Argyl, PA 18072

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pen Argyl Area High School",'Pen_Argyl=' + Pen_Argyl.length); Easton[Easton.length] = createMarker(new GPoint(-75.24243164,40.67203140),"
Philip F Lauer Middle School
2400 Firmstone St
Easton, PA 18042

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Philip F Lauer Middle School",'Easton=' + Easton.length); Nazareth[Nazareth.length] = createMarker(new GPoint(-75.27838135,40.78853989),"
Plainfield Elementary School
539 School Rd
Nazareth, PA 18064

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Plainfield Elementary School",'Nazareth=' + Nazareth.length); Hellertown[Hellertown.length] = createMarker(new GPoint(-75.32352448,40.57082748),"
Saucon Valley Elementary School
2085 Polk Valley Rd
Hellertown, PA 18055

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Saucon Valley Elementary School",'Hellertown=' + Hellertown.length); Hellertown[Hellertown.length] = createMarker(new GPoint(-75.32244110,40.57089233),"
Saucon Valley Middle School
2095 Polk Valley Rd
Hellertown, PA 18055

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Saucon Valley Middle School",'Hellertown=' + Hellertown.length); Hellertown[Hellertown.length] = createMarker(new GPoint(-75.32186890,40.57065201),"
Saucon Valley Senior High School
2100 Polk Valley Rd
Hellertown, PA 18055

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Saucon Valley Senior High School",'Hellertown=' + Hellertown.length); Nazareth[Nazareth.length] = createMarker(new GPoint(-75.30127716,40.74129868),"
Shafer Elementary School
49 S Liberty St
Nazareth, PA 18064

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Shafer Elementary School",'Nazareth=' + Nazareth.length); Easton[Easton.length] = createMarker(new GPoint(-75.23043823,40.70748138),"
Shawnee Middle School
1010 Echo Trl
Easton, PA 18040

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Shawnee Middle School",'Easton=' + Easton.length); Bethlehem[Bethlehem.length] = createMarker(new GPoint(-75.35984802,40.64696884),"
Spring Garden Elementary School
901 North Blvd
Bethlehem, PA 18017

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Spring Garden Elementary School",'Bethlehem=' + Bethlehem.length); Bethlehem[Bethlehem.length] = createMarker(new GPoint(-75.36807251,40.62326431),"
Thomas Jefferson Elementary School
404 E North St
Bethlehem, PA 18018

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Thomas Jefferson Elementary School",'Bethlehem=' + Bethlehem.length); Easton[Easton.length] = createMarker(new GPoint(-75.25460052,40.71604156),"
Tracy Elementary School
1243 Tatamy Rd
Easton, PA 18045

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Tracy Elementary School",'Easton=' + Easton.length); Bangor[Bangor.length] = createMarker(new GPoint(-75.21260834,40.84418488),"
Washington Elementary School
381 Washington Blvd
Bangor, PA 18013

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Washington Elementary School",'Bangor=' + Bangor.length); Northampton[Northampton.length] = createMarker(new GPoint(-75.44808960,40.68677521),"
Weaversville Intensive Trmt Un
6710 Weaversville Rd
Northampton, PA 18067

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Weaversville Intensive Trmt Un",'Northampton=' + Northampton.length); Bethlehem[Bethlehem.length] = createMarker(new GPoint(-75.38151550,40.62786865),"
William Penn Elementary School
1002 Main St
Bethlehem, PA 18018

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("William Penn Elementary School",'Bethlehem=' + Bethlehem.length); Easton[Easton.length] = createMarker(new GPoint(-75.23664093,40.64013672),"
Williams Township Elementary School
2660 Morgan Hill Rd
Easton, PA 18042

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Williams Township Elementary School",'Easton=' + Easton.length); Easton[Easton.length] = createMarker(new GPoint(-75.24446106,40.68501282),"
Wilson Area High School
424 Warrior Ln
Easton, PA 18042

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wilson Area High School",'Easton=' + Easton.length); Easton[Easton.length] = createMarker(new GPoint(-75.24298096,40.68554688),"
Wilson Borough Elementary School
301 S 21st St
Easton, PA 18042

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wilson Borough Elementary School",'Easton=' + Easton.length); Pen_Argyl[Pen_Argyl.length] = createMarker(new GPoint(-75.28363037,40.83776093),"
Wind Gap Middle School
1620 Teels Rd
Pen Argyl, PA 18072

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Wind Gap Middle School",'Pen_Argyl=' + Pen_Argyl.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(Bangor); map.removeOverlays(Bath); map.removeOverlays(Bethlehem); map.removeOverlays(Easton); map.removeOverlays(Freemansburg); map.removeOverlays(Hellertown); map.removeOverlays(Nazareth); map.removeOverlays(Northampton); map.removeOverlays(Pen_Argyl); map.removeOverlays(Walnutport); 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(Bethlehem);map.removeOverlays(Bangor); map.removeOverlays(Bath); map.removeOverlays(Bethlehem); map.removeOverlays(Easton); map.removeOverlays(Freemansburg); map.removeOverlays(Hellertown); map.removeOverlays(Nazareth); map.removeOverlays(Northampton); map.removeOverlays(Pen_Argyl); map.removeOverlays(Walnutport); map.addOverlays(Bangor); centerByArray(Bangor, false, false); cntMarker += Bangor.length; map.addOverlays(Bath); centerByArray(Bath, false, false); cntMarker += Bath.length; map.addOverlays(Bethlehem); centerByArray(Bethlehem, false, false); cntMarker += Bethlehem.length; map.addOverlays(Easton); centerByArray(Easton, false, false); cntMarker += Easton.length; map.addOverlays(Freemansburg); centerByArray(Freemansburg, false, false); cntMarker += Freemansburg.length; map.addOverlays(Hellertown); centerByArray(Hellertown, false, false); cntMarker += Hellertown.length; map.addOverlays(Nazareth); centerByArray(Nazareth, false, false); cntMarker += Nazareth.length; map.addOverlays(Northampton); centerByArray(Northampton, false, false); cntMarker += Northampton.length; map.addOverlays(Pen_Argyl); centerByArray(Pen_Argyl, false, false); cntMarker += Pen_Argyl.length; map.addOverlays(Walnutport); centerByArray(Walnutport, false, false); cntMarker += Walnutport.length; centerByArray(Bethlehem,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'); } }