function addMarkers() { mySelect = document.getElementById('selection'); Aliquippa = [];Ambridge = [];Freedom = [];Beaver = [];Monaca = [];Beaver_Falls = [];Conway = [];Midland = [];Koppel = [];New_Brighton = [];Darlington = [];Ellwood_City = [];Rochester = [];Industry = [];Hookstown = [];Baden = [];mySelect.options[mySelect.options.length] = new Option("Aliquippa schools",'all=Aliquippa'); mySelect.options[mySelect.options.length] = new Option("Ambridge schools",'all=Ambridge'); mySelect.options[mySelect.options.length] = new Option("Baden schools",'all=Baden'); mySelect.options[mySelect.options.length] = new Option("Beaver schools",'all=Beaver'); mySelect.options[mySelect.options.length] = new Option("Beaver Falls schools",'all=Beaver_Falls'); mySelect.options[mySelect.options.length] = new Option("Conway schools",'all=Conway'); mySelect.options[mySelect.options.length] = new Option("Darlington schools",'all=Darlington'); mySelect.options[mySelect.options.length] = new Option("Ellwood City schools",'all=Ellwood_City'); mySelect.options[mySelect.options.length] = new Option("Freedom schools",'all=Freedom'); mySelect.options[mySelect.options.length] = new Option("Hookstown schools",'all=Hookstown'); mySelect.options[mySelect.options.length] = new Option("Industry schools",'all=Industry'); mySelect.options[mySelect.options.length] = new Option("Koppel schools",'all=Koppel'); mySelect.options[mySelect.options.length] = new Option("Midland schools",'all=Midland'); mySelect.options[mySelect.options.length] = new Option("Monaca schools",'all=Monaca'); mySelect.options[mySelect.options.length] = new Option("New Brighton schools",'all=New_Brighton'); mySelect.options[mySelect.options.length] = new Option("Rochester schools",'all=Rochester'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Aliquippa[Aliquippa.length] = createMarker(new GPoint(-80.27886963,40.60891342),"
Aliquippa Elementary School
800 21st St
Aliquippa, PA 15001

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Aliquippa Elementary School",'Aliquippa=' + Aliquippa.length); Aliquippa[Aliquippa.length] = createMarker(new GPoint(-80.25672150,40.60913849),"
Aliquippa Middle School
100 Harding Ave
Aliquippa, PA 15001

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Aliquippa Middle School",'Aliquippa=' + Aliquippa.length); Aliquippa[Aliquippa.length] = createMarker(new GPoint(-80.25694600,40.60912500),"
Aliquippa MiddleSchool
100 Harding Ave
Aliquippa, PA 15001

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Aliquippa MiddleSchool",'Aliquippa=' + Aliquippa.length); Aliquippa[Aliquippa.length] = createMarker(new GPoint(-80.25672150,40.60913849),"
Aliquippa Senior High School
100 Harding Ave
Aliquippa, PA 15001

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Aliquippa Senior High School",'Aliquippa=' + Aliquippa.length); Ambridge[Ambridge.length] = createMarker(new GPoint(-80.22544861,40.59139633),"
Ambridge Area High School
1101 Highland Ave
Ambridge, PA 15003

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ambridge Area High School",'Ambridge=' + Ambridge.length); Freedom[Freedom.length] = createMarker(new GPoint(-80.21219635,40.66777039),"
Ambridge Area Junior High School
401 1st St
Freedom, PA 15042

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Ambridge Area Junior High School",'Freedom=' + Freedom.length); Ambridge[Ambridge.length] = createMarker(new GPoint(-80.22518158,40.60214615),"
Anthony Wayne Elementary School
2001 Lenz Ave
Ambridge, PA 15003

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Anthony Wayne Elementary School",'Ambridge=' + Ambridge.length); Beaver[Beaver.length] = createMarker(new GPoint(-80.33657600,40.70738900),"
Beaver Area Academic Charter School
Gypsy Glen Rd
Beaver, PA 15009

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Beaver Area Academic Charter School",'Beaver=' + Beaver.length); Beaver[Beaver.length] = createMarker(new GPoint(-80.31759644,40.69760132),"
Beaver Area Middle School
Gypsy Glen
Beaver, PA 15009

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Beaver Area Middle School",'Beaver=' + Beaver.length); Beaver[Beaver.length] = createMarker(new GPoint(-80.31759644,40.69760132),"
Beaver Area Senior High School
Gypsy Glen
Beaver, PA 15009

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Beaver Area Senior High School",'Beaver=' + Beaver.length); Monaca[Monaca.length] = createMarker(new GPoint(-80.30838013,40.65497589),"
Beaver County Avts
145 Poplar Drive
Monaca, PA 15061

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Beaver County Avts",'Monaca=' + Monaca.length); Beaver_Falls[Beaver_Falls.length] = createMarker(new GPoint(-80.32097626,40.75814056),"
Beaver Falls Area Senior High School
1701 8th Ave
Beaver Falls, PA 15010

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Beaver Falls Area Senior High School",'Beaver_Falls=' + Beaver_Falls.length); Beaver_Falls[Beaver_Falls.length] = createMarker(new GPoint(-80.32097626,40.75714493),"
Beaver Falls Middle School
1601 8th Ave
Beaver Falls, PA 15010

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Beaver Falls Middle School",'Beaver_Falls=' + Beaver_Falls.length); Beaver_Falls[Beaver_Falls.length] = createMarker(new GPoint(-80.34194183,40.80937958),"
Big Beaver Elementary School
Friendship Drive
Beaver Falls, PA 15010

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Big Beaver Elementary School",'Beaver_Falls=' + Beaver_Falls.length); Freedom[Freedom.length] = createMarker(new GPoint(-80.20620728,40.70153046),"
Big Knob Elementary School
205 Fezell Rd
Freedom, PA 15042

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Big Knob Elementary School",'Freedom=' + Freedom.length); Beaver_Falls[Beaver_Falls.length] = createMarker(new GPoint(-80.39857483,40.76427460),"
Blackhawk High School
500 Blackhawk Rd
Beaver Falls, PA 15010

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Blackhawk High School",'Beaver_Falls=' + Beaver_Falls.length); Beaver_Falls[Beaver_Falls.length] = createMarker(new GPoint(-80.37557220,40.76886749),"
Blackhawk Intermediate School
603 Shenango Rd
Beaver Falls, PA 15010

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Blackhawk Intermediate School",'Beaver_Falls=' + Beaver_Falls.length); Beaver[Beaver.length] = createMarker(new GPoint(-80.40325165,40.70579147),"
Brighton Township Elementary School
2220 Dutch Ridge Road
Beaver, PA 15009

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Brighton Township Elementary School",'Beaver=' + Beaver.length); Monaca[Monaca.length] = createMarker(new GPoint(-80.29930115,40.66540146),"
Center Area Middle School
160 Baker Road Ext
Monaca, PA 15061

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Center Area Middle School",'Monaca=' + Monaca.length); Monaca[Monaca.length] = createMarker(new GPoint(-80.29930115,40.66540146),"
Center Area Senior High School
160 Baker Road Ext
Monaca, PA 15061

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Center Area Senior High School",'Monaca=' + Monaca.length); Beaver_Falls[Beaver_Falls.length] = createMarker(new GPoint(-80.32099400,40.75599500),"
Central Elementary School
805 15th Street
Beaver Falls, PA 15010

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Central Elementary School",'Beaver_Falls=' + Beaver_Falls.length); Beaver[Beaver.length] = createMarker(new GPoint(-80.30556488,40.69669724),"
College Square Elementary School
375 College Ave
Beaver, PA 15009

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("College Square Elementary School",'Beaver=' + Beaver.length); Conway[Conway.length] = createMarker(new GPoint(-80.23725891,40.65740204),"
Conway Elementary School
801 First Ave
Conway, PA 15027

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Conway Elementary School",'Conway=' + Conway.length); Freedom[Freedom.length] = createMarker(new GPoint(-80.21206665,40.66702271),"
Economy Elementary School
100 First Street
Freedom, PA 15042

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Economy Elementary School",'Freedom=' + Freedom.length); Midland[Midland.length] = createMarker(new GPoint(-80.47000122,40.69232178),"
Fairview Elementary School
343 Ridgemont Dr
Midland, PA 15059

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fairview Elementary School",'Midland=' + Midland.length); Monaca[Monaca.length] = createMarker(new GPoint(-80.26470184,40.67573547),"
Fifth Ward Elementary School
2590 Ridge Rd
Monaca, PA 15061

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Fifth Ward Elementary School",'Monaca=' + Monaca.length); Freedom[Freedom.length] = createMarker(new GPoint(-80.25173187,40.68558121),"
Freedom Area Middle School
1701 8th Ave
Freedom, PA 15042

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Freedom Area Middle School",'Freedom=' + Freedom.length); Freedom[Freedom.length] = createMarker(new GPoint(-80.24055481,40.67859650),"
Freedom Area Senior High School
1190 Bulldog Dr
Freedom, PA 15042

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Freedom Area Senior High School",'Freedom=' + Freedom.length); Monaca[Monaca.length] = createMarker(new GPoint(-80.27703857,40.68104935),"
High School Elementary School
1500 Allen Ave
Monaca, PA 15061

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("High School Elementary School",'Monaca=' + Monaca.length); Ambridge[Ambridge.length] = createMarker(new GPoint(-80.21316528,40.59262466),"
Highland Elementary School
1052 Highland Ave
Ambridge, PA 15003

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Highland Elementary School",'Ambridge=' + Ambridge.length); Beaver_Falls[Beaver_Falls.length] = createMarker(new GPoint(-80.37409973,40.75740814),"
Highland Middle School
402 Shenango Rd
Beaver Falls, PA 15010

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Highland Middle School",'Beaver_Falls=' + Beaver_Falls.length); Aliquippa[Aliquippa.length] = createMarker(new GPoint(-80.27954865,40.57771683),"
Hopewell Elementary School
3000 Kane Road
Aliquippa, PA 15001

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hopewell Elementary School",'Aliquippa=' + Aliquippa.length); Aliquippa[Aliquippa.length] = createMarker(new GPoint(-80.26261902,40.58964539),"
Hopewell Junior High School
2354 Brodhead Rd
Aliquippa, PA 15001

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Hopewell Junior High School",'Aliquippa=' + Aliquippa.length); Aliquippa[Aliquippa.length] = createMarker(new GPoint(-80.25433350,40.58916855),"
Hopewell Senior High School
1215 Longvue Ave
Aliquippa, PA 15001

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hopewell Senior High School",'Aliquippa=' + Aliquippa.length); Aliquippa[Aliquippa.length] = createMarker(new GPoint(-80.28399658,40.60409927),"
Independence Elementary School
Rr 1 Box 103
Aliquippa, PA 15001

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Independence Elementary School",'Aliquippa=' + Aliquippa.length); Koppel[Koppel.length] = createMarker(new GPoint(-80.32592010,40.83555984),"
Koppel Elementary School
2nd Avenue
Koppel, PA 16136

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Koppel Elementary School",'Koppel=' + Koppel.length); Monaca[Monaca.length] = createMarker(new GPoint(-80.27922058,40.69288635),"
Mangin Elementary School
998 Indiana Ave
Monaca, PA 15061

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mangin Elementary School",'Monaca=' + Monaca.length); Aliquippa[Aliquippa.length] = createMarker(new GPoint(-80.26049042,40.59276962),"
Margaret Ross Elementary School
1955 Maratta Rd
Aliquippa, PA 15001

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Margaret Ross Elementary School",'Aliquippa=' + Aliquippa.length); Midland[Midland.length] = createMarker(new GPoint(-80.45157623,40.64013672),"
Midland El/ms Elementary School
173 7th St
Midland, PA 15059

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Midland El/ms Elementary School",'Midland=' + Midland.length); Monaca[Monaca.length] = createMarker(new GPoint(-80.27703857,40.68104935),"
Monaca Junior Senior High School
1500 Allen Ave
Monaca, PA 15061

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Monaca Junior Senior High School",'Monaca=' + Monaca.length); New_Brighton[New_Brighton.length] = createMarker(new GPoint(-80.30264282,40.73351288),"
New Brighton Area Elementary School
3200 43rd St
New Brighton, PA 15066

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("New Brighton Area Elementary School",'New_Brighton=' + New_Brighton.length); New_Brighton[New_Brighton.length] = createMarker(new GPoint(-80.30264282,40.73351288),"
New Brighton Area High School
3200 43rd St
New Brighton, PA 15066

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Brighton Area High School",'New_Brighton=' + New_Brighton.length); New_Brighton[New_Brighton.length] = createMarker(new GPoint(-80.30668640,40.73628998),"
New Brighton Area Middle School
901 Penn Ave
New Brighton, PA 15066

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("New Brighton Area Middle School",'New_Brighton=' + New_Brighton.length); Darlington[Darlington.length] = createMarker(new GPoint(-80.41869354,40.81072235),"
Northwestern Primary School
256 Elmwood Blvd
Darlington, PA 16115

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Northwestern Primary School",'Darlington=' + Darlington.length); Beaver_Falls[Beaver_Falls.length] = createMarker(new GPoint(-80.33452606,40.74799347),"
Patterson Primary School
701 Darlington Rd
Beaver Falls, PA 15010

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Patterson Primary School",'Beaver_Falls=' + Beaver_Falls.length); Aliquippa[Aliquippa.length] = createMarker(new GPoint(-80.36373901,40.60768890),"
Raccoon Elementary School
3949 Patterson Rd
Aliquippa, PA 15001

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Raccoon Elementary School",'Aliquippa=' + Aliquippa.length); Ellwood_City[Ellwood_City.length] = createMarker(new GPoint(-80.25849152,40.83313370),"
Riverside High School
300 Country Club Dr
Ellwood City, PA 16117

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Riverside High School",'Ellwood_City=' + Ellwood_City.length); Ellwood_City[Ellwood_City.length] = createMarker(new GPoint(-80.25849152,40.83313370),"
Riverside Kdg Center
300 Country Club Dr
Ellwood City, PA 16117

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Riverside Kdg Center",'Ellwood_City=' + Ellwood_City.length); Ellwood_City[Ellwood_City.length] = createMarker(new GPoint(-80.25833893,40.83305740),"
Riverside Middle School
302 Country Club Dr
Ellwood City, PA 16117

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Riverside Middle School",'Ellwood_City=' + Ellwood_City.length); Ellwood_City[Ellwood_City.length] = createMarker(new GPoint(-80.25833893,40.83305740),"
Riverside Primary Center
302 Country Club Drive
Ellwood City, PA 16117

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Riverside Primary Center",'Ellwood_City=' + Ellwood_City.length); Rochester[Rochester.length] = createMarker(new GPoint(-80.27770233,40.70754623),"
Rochester Area Elementary School
540 Reno St
Rochester, PA 15074

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Rochester Area Elementary School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-80.27770233,40.70754623),"
Rochester Area High School
540 Reno St
Rochester, PA 15074

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rochester Area High School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-80.27770233,40.70754623),"
Rochester Area Middle School
540 Reno St
Rochester, PA 15074

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Rochester Area Middle School",'Rochester=' + Rochester.length); Industry[Industry.length] = createMarker(new GPoint(-80.42470551,40.67041779),"
Snyder Elementary School
215 Engle Rd
Industry, PA 15052

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Snyder Elementary School",'Industry=' + Industry.length); Beaver_Falls[Beaver_Falls.length] = createMarker(new GPoint(-80.31529999,40.75609970),"
South Elementary School
4th Avenue Pine Street
Beaver Falls, PA 15010

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("South Elementary School",'Beaver_Falls=' + Beaver_Falls.length); Hookstown[Hookstown.length] = createMarker(new GPoint(-80.47328186,40.60033035),"
South Side Elementary School
4949 State Route 151
Hookstown, PA 15050

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("South Side Elementary School",'Hookstown=' + Hookstown.length); Hookstown[Hookstown.length] = createMarker(new GPoint(-80.47328186,40.60033035),"
South Side High School
4949 State Route 151
Hookstown, PA 15050

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("South Side High School",'Hookstown=' + Hookstown.length); Hookstown[Hookstown.length] = createMarker(new GPoint(-80.47328186,40.60033035),"
South Side Middle School
4949 State Route 151
Hookstown, PA 15050

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("South Side Middle School",'Hookstown=' + Hookstown.length); Baden[Baden.length] = createMarker(new GPoint(-80.22369385,40.63096237),"
State Street Elementary School
600 Harmony Road
Baden, PA 15005

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("State Street Elementary School",'Baden=' + Baden.length); Monaca[Monaca.length] = createMarker(new GPoint(-80.29916382,40.66550827),"
Todd Lane Elementary School
113 Todd Ln
Monaca, PA 15061

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Todd Lane Elementary School",'Monaca=' + Monaca.length); Industry[Industry.length] = createMarker(new GPoint(-80.42449951,40.67065430),"
Western Beaver Co Junior Senior High School
216 Engle Rd
Industry, PA 15052

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Western Beaver Co Junior Senior High School",'Industry=' + Industry.length); Midland[Midland.length] = createMarker(new GPoint(-80.45494843,40.63803101),"
Western Pennsylvania Cyber Charter School
900 Midland Avenue
Midland, PA 15059

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Western Pennsylvania Cyber Charter School",'Midland=' + Midland.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(Aliquippa); map.removeOverlays(Ambridge); map.removeOverlays(Baden); map.removeOverlays(Beaver); map.removeOverlays(Beaver_Falls); map.removeOverlays(Conway); map.removeOverlays(Darlington); map.removeOverlays(Ellwood_City); map.removeOverlays(Freedom); map.removeOverlays(Hookstown); map.removeOverlays(Industry); map.removeOverlays(Koppel); map.removeOverlays(Midland); map.removeOverlays(Monaca); map.removeOverlays(New_Brighton); map.removeOverlays(Rochester); 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(Aliquippa);map.removeOverlays(Aliquippa); map.removeOverlays(Ambridge); map.removeOverlays(Baden); map.removeOverlays(Beaver); map.removeOverlays(Beaver_Falls); map.removeOverlays(Conway); map.removeOverlays(Darlington); map.removeOverlays(Ellwood_City); map.removeOverlays(Freedom); map.removeOverlays(Hookstown); map.removeOverlays(Industry); map.removeOverlays(Koppel); map.removeOverlays(Midland); map.removeOverlays(Monaca); map.removeOverlays(New_Brighton); map.removeOverlays(Rochester); map.addOverlays(Aliquippa); centerByArray(Aliquippa, false, false); cntMarker += Aliquippa.length; map.addOverlays(Ambridge); centerByArray(Ambridge, false, false); cntMarker += Ambridge.length; map.addOverlays(Baden); centerByArray(Baden, false, false); cntMarker += Baden.length; map.addOverlays(Beaver); centerByArray(Beaver, false, false); cntMarker += Beaver.length; map.addOverlays(Beaver_Falls); centerByArray(Beaver_Falls, false, false); cntMarker += Beaver_Falls.length; map.addOverlays(Conway); centerByArray(Conway, false, false); cntMarker += Conway.length; map.addOverlays(Darlington); centerByArray(Darlington, false, false); cntMarker += Darlington.length; map.addOverlays(Ellwood_City); centerByArray(Ellwood_City, false, false); cntMarker += Ellwood_City.length; map.addOverlays(Freedom); centerByArray(Freedom, false, false); cntMarker += Freedom.length; map.addOverlays(Hookstown); centerByArray(Hookstown, false, false); cntMarker += Hookstown.length; map.addOverlays(Industry); centerByArray(Industry, false, false); cntMarker += Industry.length; map.addOverlays(Koppel); centerByArray(Koppel, false, false); cntMarker += Koppel.length; map.addOverlays(Midland); centerByArray(Midland, false, false); cntMarker += Midland.length; map.addOverlays(Monaca); centerByArray(Monaca, false, false); cntMarker += Monaca.length; map.addOverlays(New_Brighton); centerByArray(New_Brighton, false, false); cntMarker += New_Brighton.length; map.addOverlays(Rochester); centerByArray(Rochester, false, false); cntMarker += Rochester.length; centerByArray(Aliquippa,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'); } }