function addMarkers() { mySelect = document.getElementById('selection'); Houston = [];Avella = [];Bentleyville = [];Ellsworth = [];Fredericktown = [];Claysville = [];Canonsburg = [];Venetia = [];Burgettstown = [];Coal_Center = [];Monongahela = [];Cecil = [];Mc_Donald = [];Charleroi = [];Donora = [];Finleyville = [];Washington = [];Mcmurray = [];Muse = [];West_Alexander = [];Eighty_Four = [];mySelect.options[mySelect.options.length] = new Option("Avella schools",'all=Avella'); mySelect.options[mySelect.options.length] = new Option("Bentleyville schools",'all=Bentleyville'); mySelect.options[mySelect.options.length] = new Option("Burgettstown schools",'all=Burgettstown'); mySelect.options[mySelect.options.length] = new Option("Canonsburg schools",'all=Canonsburg'); mySelect.options[mySelect.options.length] = new Option("Cecil schools",'all=Cecil'); mySelect.options[mySelect.options.length] = new Option("Charleroi schools",'all=Charleroi'); mySelect.options[mySelect.options.length] = new Option("Claysville schools",'all=Claysville'); mySelect.options[mySelect.options.length] = new Option("Coal Center schools",'all=Coal_Center'); mySelect.options[mySelect.options.length] = new Option("Donora schools",'all=Donora'); mySelect.options[mySelect.options.length] = new Option("Eighty Four schools",'all=Eighty_Four'); mySelect.options[mySelect.options.length] = new Option("Ellsworth schools",'all=Ellsworth'); mySelect.options[mySelect.options.length] = new Option("Finleyville schools",'all=Finleyville'); mySelect.options[mySelect.options.length] = new Option("Fredericktown schools",'all=Fredericktown'); mySelect.options[mySelect.options.length] = new Option("Houston schools",'all=Houston'); mySelect.options[mySelect.options.length] = new Option("Mc Donald schools",'all=Mc_Donald'); mySelect.options[mySelect.options.length] = new Option("Mcmurray schools",'all=Mcmurray'); mySelect.options[mySelect.options.length] = new Option("Monongahela schools",'all=Monongahela'); mySelect.options[mySelect.options.length] = new Option("Muse schools",'all=Muse'); mySelect.options[mySelect.options.length] = new Option("Venetia schools",'all=Venetia'); mySelect.options[mySelect.options.length] = new Option("Washington schools",'all=Washington'); mySelect.options[mySelect.options.length] = new Option("West Alexander schools",'all=West_Alexander'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Houston[Houston.length] = createMarker(new GPoint(-80.22555542,40.23255539),"
Allison Park Elementary School
803 Mcgovern Rd
Houston, PA 15342

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Allison Park Elementary School",'Houston=' + Houston.length); Avella[Avella.length] = createMarker(new GPoint(-80.41700745,40.27309036),"
Avella Area Junior Senior High School
1000 Avella Rd
Avella, PA 15312

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Avella Area Junior Senior High School",'Avella=' + Avella.length); Avella[Avella.length] = createMarker(new GPoint(-80.41700745,40.27309036),"
Avella El Center
1000 Avella Rd
Avella, PA 15312

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Avella El Center",'Avella=' + Avella.length); Bentleyville[Bentleyville.length] = createMarker(new GPoint(-80.02293396,40.12205505),"
Bentworth El Center
100 Bearcat Dr
Bentleyville, PA 15314

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bentworth El Center",'Bentleyville=' + Bentleyville.length); Ellsworth[Ellsworth.length] = createMarker(new GPoint(-80.01670074,40.10414124),"
Bentworth Middle School
Po Box 60
Ellsworth, PA 15331

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Bentworth Middle School",'Ellsworth=' + Ellsworth.length); Bentleyville[Bentleyville.length] = createMarker(new GPoint(-80.02161407,40.12167740),"
Bentworth Senior High School
75 Bearcat Dr
Bentleyville, PA 15314

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bentworth Senior High School",'Bentleyville=' + Bentleyville.length); Fredericktown[Fredericktown.length] = createMarker(new GPoint(-80.03008270,40.02284622),"
Bethlehem-center Elementary School
194 Crawford Rd
Fredericktown, PA 15333

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bethlehem-center Elementary School",'Fredericktown=' + Fredericktown.length); Fredericktown[Fredericktown.length] = createMarker(new GPoint(-80.02429199,40.01910019),"
Bethlehem-center Middle School
136 Crawford Rd
Fredericktown, PA 15333

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Bethlehem-center Middle School",'Fredericktown=' + Fredericktown.length); Fredericktown[Fredericktown.length] = createMarker(new GPoint(-80.02886963,40.02162933),"
Bethlehem-center Senior High School
179 Crawford Rd
Fredericktown, PA 15333

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bethlehem-center Senior High School",'Fredericktown=' + Fredericktown.length); Claysville[Claysville.length] = createMarker(new GPoint(-80.37201691,40.15562820),"
Blaine-buffalo Elementary School
3214 Constitution Blvd
Claysville, PA 15323

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Blaine-buffalo Elementary School",'Claysville=' + Claysville.length); Canonsburg[Canonsburg.length] = createMarker(new GPoint(-80.16582489,40.26033783),"
Borland Manor Elementary School
30 Giffin Dr
Canonsburg, PA 15317

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Borland Manor Elementary School",'Canonsburg=' + Canonsburg.length); Venetia[Venetia.length] = createMarker(new GPoint(-80.06750488,40.26076508),"
Bower Hill Elementary School
424 Bower Hill Road
Venetia, PA 15367

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bower Hill Elementary School",'Venetia=' + Venetia.length); Burgettstown[Burgettstown.length] = createMarker(new GPoint(-80.38886261,40.39692688),"
Burgettstown El Center
100 Bavington Rd
Burgettstown, PA 15021

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Burgettstown El Center",'Burgettstown=' + Burgettstown.length); Burgettstown[Burgettstown.length] = createMarker(new GPoint(-80.38883972,40.39720917),"
Burgettstown Junior Senior High School
104 Bavington Rd
Burgettstown, PA 15021

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Burgettstown Junior Senior High School",'Burgettstown=' + Burgettstown.length); Coal_Center[Coal_Center.length] = createMarker(new GPoint(-79.90038400,40.06988500),"
California Area MiddleSchool
293 Malden Dr
Coal Center, PA 15423

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("California Area MiddleSchool",'Coal_Center=' + Coal_Center.length); Coal_Center[Coal_Center.length] = createMarker(new GPoint(-79.91962433,40.04633713),"
California Area Senior High School
293 Malden Dr
Coal Center, PA 15423

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("California Area Senior High School",'Coal_Center=' + Coal_Center.length); Coal_Center[Coal_Center.length] = createMarker(new GPoint(-79.91962433,40.04633713),"
California K-8 Elementary School
293 Malden Drive
Coal Center, PA 15423

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("California K-8 Elementary School",'Coal_Center=' + Coal_Center.length); Canonsburg[Canonsburg.length] = createMarker(new GPoint(-80.19380188,40.24969864),"
Canon-mcmillan Senior High School
Elm St Extension
Canonsburg, PA 15317

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Canon-mcmillan Senior High School",'Canonsburg=' + Canonsburg.length); Canonsburg[Canonsburg.length] = createMarker(new GPoint(-80.18637848,40.26052094),"
Canonsburg Middle School
25 E College St
Canonsburg, PA 15317

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Canonsburg Middle School",'Canonsburg=' + Canonsburg.length); Monongahela[Monongahela.length] = createMarker(new GPoint(-79.91343689,40.17319489),"
Carroll Middle School
120 Alexander Ave
Monongahela, PA 15063

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Carroll Middle School",'Monongahela=' + Monongahela.length); Cecil[Cecil.length] = createMarker(new GPoint(-80.18443298,40.32942581),"
Cecil Elementary School
36 Cecil Elementary Dr
Cecil, PA 15321

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cecil Elementary School",'Cecil=' + Cecil.length); Mc_Donald[Mc_Donald.length] = createMarker(new GPoint(-80.22391510,40.31856537),"
Cecil Intrmd School
3676 Millers Run Rd
Mc Donald, PA 15057

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Cecil Intrmd School",'Mc_Donald=' + Mc_Donald.length); Charleroi[Charleroi.length] = createMarker(new GPoint(-79.91938782,40.15298843),"
Charleroi Area El Center
75 Fecsen Dr
Charleroi, PA 15022

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Charleroi Area El Center",'Charleroi=' + Charleroi.length); Charleroi[Charleroi.length] = createMarker(new GPoint(-79.91873932,40.15369415),"
Charleroi Area High School
100 Fecsen Dr
Charleroi, PA 15022

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Charleroi Area High School",'Charleroi=' + Charleroi.length); Charleroi[Charleroi.length] = createMarker(new GPoint(-79.91873932,40.15369415),"
Charleroi Area Middle School
100 Fecsen Dr
Charleroi, PA 15022

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Charleroi Area Middle School",'Charleroi=' + Charleroi.length); Houston[Houston.length] = createMarker(new GPoint(-80.21575165,40.23162079),"
Chartiers-houston Junior Senior High School
2050 W Pike St
Houston, PA 15342

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Chartiers-houston Junior Senior High School",'Houston=' + Houston.length); Claysville[Claysville.length] = createMarker(new GPoint(-80.40820312,40.10940170),"
Claysville Elementary School
Po Box 421
Claysville, PA 15323

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Claysville Elementary School",'Claysville=' + Claysville.length); Donora[Donora.length] = createMarker(new GPoint(-79.86560059,40.17702103),"
Donora El Center
401 Waddell
Donora, PA 15033

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Donora El Center",'Donora=' + Donora.length); Claysville[Claysville.length] = createMarker(new GPoint(-80.40399933,40.11399841),"
East-west Finley Elementary School
1525 Pleasant Grove Rd
Claysville, PA 15323

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("East-west Finley Elementary School",'Claysville=' + Claysville.length); Finleyville[Finleyville.length] = createMarker(new GPoint(-80.00385284,40.25284958),"
Finley Middle School
6023 Rt 88
Finleyville, PA 15332

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Finley Middle School",'Finleyville=' + Finleyville.length); Canonsburg[Canonsburg.length] = createMarker(new GPoint(-80.18078613,40.26756287),"
First Street Elementary School
803 1st St
Canonsburg, PA 15317

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("First Street Elementary School",'Canonsburg=' + Canonsburg.length); Mc_Donald[Mc_Donald.length] = createMarker(new GPoint(-80.28191376,40.34790039),"
Fort Cherry El Center
110 Fort Cherry Rd
Mc Donald, PA 15057

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fort Cherry El Center",'Mc_Donald=' + Mc_Donald.length); Mc_Donald[Mc_Donald.length] = createMarker(new GPoint(-80.28191376,40.34790039),"
Fort Cherry Junior Senior High School
110 Fort Cherry Rd
Mc Donald, PA 15057

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Fort Cherry Junior Senior High School",'Mc_Donald=' + Mc_Donald.length); Finleyville[Finleyville.length] = createMarker(new GPoint(-79.99198914,40.25559235),"
Gastonville El Center
3685 Finleyville-elrama Rd
Finleyville, PA 15332

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Gastonville El Center",'Finleyville=' + Finleyville.length); Canonsburg[Canonsburg.length] = createMarker(new GPoint(-80.13022614,40.30879211),"
Hills-hendersonville Elementary School
50 Mayview Rd
Canonsburg, PA 15317

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hills-hendersonville Elementary School",'Canonsburg=' + Canonsburg.length); Washington[Washington.length] = createMarker(new GPoint(-80.28929901,40.12038803),"
Joe Walker Elementary School
2510 Park Ave
Washington, PA 15301

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Joe Walker Elementary School",'Washington=' + Washington.length); Claysville[Claysville.length] = createMarker(new GPoint(-80.36048889,40.14092255),"
Mcguffey High School
86 Mcguffey Dr
Claysville, PA 15323

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mcguffey High School",'Claysville=' + Claysville.length); Claysville[Claysville.length] = createMarker(new GPoint(-80.40820312,40.10940170),"
Mcguffey Intermediate School
Po Box 421
Claysville, PA 15323

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Mcguffey Intermediate School",'Claysville=' + Claysville.length); Claysville[Claysville.length] = createMarker(new GPoint(-80.36048889,40.14092255),"
Mcguffey Middle School
86 Mcguffey Dr
Claysville, PA 15323

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Mcguffey Middle School",'Claysville=' + Claysville.length); Mcmurray[Mcmurray.length] = createMarker(new GPoint(-80.08049011,40.28145599),"
Mcmurray Elementary School
626 E Mcmurray Rd
Mcmurray, PA 15317

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Mcmurray Elementary School",'Mcmurray=' + Mcmurray.length); Charleroi[Charleroi.length] = createMarker(new GPoint(-79.88845062,40.12239075),"
Mon Valley Ctc
1 Guttman Blvd
Charleroi, PA 15022

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mon Valley Ctc",'Charleroi=' + Charleroi.length); Monongahela[Monongahela.length] = createMarker(new GPoint(-79.93672180,40.20541382),"
Monongahela El Center
1200 Chess St
Monongahela, PA 15063

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Monongahela El Center",'Monongahela=' + Monongahela.length); Muse[Muse.length] = createMarker(new GPoint(-80.19876862,40.29280472),"
Muse Elementary School
40 Muse School St Po Box 430
Muse, PA 15350

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Muse Elementary School",'Muse=' + Muse.length); Canonsburg[Canonsburg.length] = createMarker(new GPoint(-80.18377686,40.25214005),"
North Strabane Intrmd School
20 Giffin Drive
Canonsburg, PA 15317

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("North Strabane Intrmd School",'Canonsburg=' + Canonsburg.length); Mcmurray[Mcmurray.length] = createMarker(new GPoint(-80.11855316,40.26922607),"
Peters Township High School
264 E Mcmurray Rd
Mcmurray, PA 15317

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Peters Township High School",'Mcmurray=' + Mcmurray.length); Mcmurray[Mcmurray.length] = createMarker(new GPoint(-80.08087921,40.28147507),"
Peters Township Middle School
625 E Mcmurray Rd
Mcmurray, PA 15317

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Peters Township Middle School",'Mcmurray=' + Mcmurray.length); Mcmurray[Mcmurray.length] = createMarker(new GPoint(-80.12021637,40.26940918),"
Pleasant Valley Elementary School
250 E Mcmurray Rd
Mcmurray, PA 15317

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pleasant Valley Elementary School",'Mcmurray=' + Mcmurray.length); Monongahela[Monongahela.length] = createMarker(new GPoint(-79.98053741,40.19924927),"
Ringgold Senior High School
1 Ram Drive
Monongahela, PA 15063

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ringgold Senior High School",'Monongahela=' + Monongahela.length); Canonsburg[Canonsburg.length] = createMarker(new GPoint(-80.18546295,40.25489426),"
South Central Elementary School
230 S Central Ave
Canonsburg, PA 15317

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("South Central Elementary School",'Canonsburg=' + Canonsburg.length); Washington[Washington.length] = createMarker(new GPoint(-80.21018219,40.18818665),"
Trinity East Elementary School
252 Cameron Rd
Washington, PA 15301

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Trinity East Elementary School",'Washington=' + Washington.length); Washington[Washington.length] = createMarker(new GPoint(-80.26646423,40.14764023),"
Trinity Middle School
50 Scenic Dr
Washington, PA 15301

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Trinity Middle School",'Washington=' + Washington.length); Washington[Washington.length] = createMarker(new GPoint(-80.29938507,40.19989777),"
Trinity North Elementary School
225 Midlan Drive
Washington, PA 15301

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Trinity North Elementary School",'Washington=' + Washington.length); Washington[Washington.length] = createMarker(new GPoint(-80.24996948,40.16348267),"
Trinity Senior High School
231 Park Ave
Washington, PA 15301

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity Senior High School",'Washington=' + Washington.length); Washington[Washington.length] = createMarker(new GPoint(-80.21009827,40.11130142),"
Trinity South Elementary School
2500 S Main Street Ext
Washington, PA 15301

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Trinity South Elementary School",'Washington=' + Washington.length); Washington[Washington.length] = createMarker(new GPoint(-80.26181030,40.15689087),"
Trinity West Elementary School
1041 Gabby Ave
Washington, PA 15301

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Trinity West Elementary School",'Washington=' + Washington.length); Washington[Washington.length] = createMarker(new GPoint(-80.26504517,40.18490982),"
Washington Co Alternative School
1099 Allison Ave
Washington, PA 15301

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Washington Co Alternative School",'Washington=' + Washington.length); Washington[Washington.length] = createMarker(new GPoint(-80.25235748,40.17380142),"
Washington High School
201 Allison Ave
Washington, PA 15301

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Washington High School",'Washington=' + Washington.length); Washington[Washington.length] = createMarker(new GPoint(-80.22311401,40.16807938),"
Washington Park Elementary School
801 E Wheeling St
Washington, PA 15301

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Washington Park Elementary School",'Washington=' + Washington.length); Washington[Washington.length] = createMarker(new GPoint(-80.22311401,40.16807938),"
Washington Park Middle School
801 E Wheeling St
Washington, PA 15301

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Washington Park Middle School",'Washington=' + Washington.length); West_Alexander[West_Alexander.length] = createMarker(new GPoint(-80.49410248,40.10229874),"
West Alexander Elementary School
Po Box 301
West Alexander, PA 15376

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("West Alexander Elementary School",'West_Alexander=' + West_Alexander.length); Canonsburg[Canonsburg.length] = createMarker(new GPoint(-80.24228668,40.25291061),"
Western Area Ctc
688 Western Ave
Canonsburg, PA 15317

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Western Area Ctc",'Canonsburg=' + Canonsburg.length); Eighty_Four[Eighty_Four.length] = createMarker(new GPoint(-80.12782288,40.20746231),"
Wylandville Elementary School
1254 Route 519
Eighty Four, PA 15330

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wylandville Elementary School",'Eighty_Four=' + Eighty_Four.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(Avella); map.removeOverlays(Bentleyville); map.removeOverlays(Burgettstown); map.removeOverlays(Canonsburg); map.removeOverlays(Cecil); map.removeOverlays(Charleroi); map.removeOverlays(Claysville); map.removeOverlays(Coal_Center); map.removeOverlays(Donora); map.removeOverlays(Eighty_Four); map.removeOverlays(Ellsworth); map.removeOverlays(Finleyville); map.removeOverlays(Fredericktown); map.removeOverlays(Houston); map.removeOverlays(Mc_Donald); map.removeOverlays(Mcmurray); map.removeOverlays(Monongahela); map.removeOverlays(Muse); map.removeOverlays(Venetia); map.removeOverlays(Washington); map.removeOverlays(West_Alexander); 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(Houston);map.removeOverlays(Avella); map.removeOverlays(Bentleyville); map.removeOverlays(Burgettstown); map.removeOverlays(Canonsburg); map.removeOverlays(Cecil); map.removeOverlays(Charleroi); map.removeOverlays(Claysville); map.removeOverlays(Coal_Center); map.removeOverlays(Donora); map.removeOverlays(Eighty_Four); map.removeOverlays(Ellsworth); map.removeOverlays(Finleyville); map.removeOverlays(Fredericktown); map.removeOverlays(Houston); map.removeOverlays(Mc_Donald); map.removeOverlays(Mcmurray); map.removeOverlays(Monongahela); map.removeOverlays(Muse); map.removeOverlays(Venetia); map.removeOverlays(Washington); map.removeOverlays(West_Alexander); map.addOverlays(Avella); centerByArray(Avella, false, false); cntMarker += Avella.length; map.addOverlays(Bentleyville); centerByArray(Bentleyville, false, false); cntMarker += Bentleyville.length; map.addOverlays(Burgettstown); centerByArray(Burgettstown, false, false); cntMarker += Burgettstown.length; map.addOverlays(Canonsburg); centerByArray(Canonsburg, false, false); cntMarker += Canonsburg.length; map.addOverlays(Cecil); centerByArray(Cecil, false, false); cntMarker += Cecil.length; map.addOverlays(Charleroi); centerByArray(Charleroi, false, false); cntMarker += Charleroi.length; map.addOverlays(Claysville); centerByArray(Claysville, false, false); cntMarker += Claysville.length; map.addOverlays(Coal_Center); centerByArray(Coal_Center, false, false); cntMarker += Coal_Center.length; map.addOverlays(Donora); centerByArray(Donora, false, false); cntMarker += Donora.length; map.addOverlays(Eighty_Four); centerByArray(Eighty_Four, false, false); cntMarker += Eighty_Four.length; map.addOverlays(Ellsworth); centerByArray(Ellsworth, false, false); cntMarker += Ellsworth.length; map.addOverlays(Finleyville); centerByArray(Finleyville, false, false); cntMarker += Finleyville.length; map.addOverlays(Fredericktown); centerByArray(Fredericktown, false, false); cntMarker += Fredericktown.length; map.addOverlays(Houston); centerByArray(Houston, false, false); cntMarker += Houston.length; map.addOverlays(Mc_Donald); centerByArray(Mc_Donald, false, false); cntMarker += Mc_Donald.length; map.addOverlays(Mcmurray); centerByArray(Mcmurray, false, false); cntMarker += Mcmurray.length; map.addOverlays(Monongahela); centerByArray(Monongahela, false, false); cntMarker += Monongahela.length; map.addOverlays(Muse); centerByArray(Muse, false, false); cntMarker += Muse.length; map.addOverlays(Venetia); centerByArray(Venetia, false, false); cntMarker += Venetia.length; map.addOverlays(Washington); centerByArray(Washington, false, false); cntMarker += Washington.length; map.addOverlays(West_Alexander); centerByArray(West_Alexander, false, false); cntMarker += West_Alexander.length; centerByArray(Houston,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'); } }