function addMarkers() { mySelect = document.getElementById('selection'); Warren = [];Masury = [];Newton_Falls = [];Kinsman = [];Vienna = [];Leavittsburg = [];North_Bloomfield = [];Niles = [];Bristolville = [];West_Farmington = [];Brookfield = [];Southington = [];Cortland = [];Youngstown = [];Girard = [];Farmdale = [];Hartford = [];Hubbard = [];Mc_Donald = [];Mesopotamia = [];Mineral_Ridge = [];Fowler = [];mySelect.options[mySelect.options.length] = new Option("Bristolville schools",'all=Bristolville'); mySelect.options[mySelect.options.length] = new Option("Brookfield schools",'all=Brookfield'); mySelect.options[mySelect.options.length] = new Option("Cortland schools",'all=Cortland'); mySelect.options[mySelect.options.length] = new Option("Farmdale schools",'all=Farmdale'); mySelect.options[mySelect.options.length] = new Option("Fowler schools",'all=Fowler'); mySelect.options[mySelect.options.length] = new Option("Girard schools",'all=Girard'); mySelect.options[mySelect.options.length] = new Option("Hartford schools",'all=Hartford'); mySelect.options[mySelect.options.length] = new Option("Hubbard schools",'all=Hubbard'); mySelect.options[mySelect.options.length] = new Option("Kinsman schools",'all=Kinsman'); mySelect.options[mySelect.options.length] = new Option("Leavittsburg schools",'all=Leavittsburg'); mySelect.options[mySelect.options.length] = new Option("Masury schools",'all=Masury'); mySelect.options[mySelect.options.length] = new Option("Mc Donald schools",'all=Mc_Donald'); mySelect.options[mySelect.options.length] = new Option("Mesopotamia schools",'all=Mesopotamia'); mySelect.options[mySelect.options.length] = new Option("Mineral Ridge schools",'all=Mineral_Ridge'); mySelect.options[mySelect.options.length] = new Option("Newton Falls schools",'all=Newton_Falls'); mySelect.options[mySelect.options.length] = new Option("Niles schools",'all=Niles'); mySelect.options[mySelect.options.length] = new Option("North Bloomfield schools",'all=North_Bloomfield'); mySelect.options[mySelect.options.length] = new Option("Southington schools",'all=Southington'); mySelect.options[mySelect.options.length] = new Option("Vienna schools",'all=Vienna'); mySelect.options[mySelect.options.length] = new Option("Warren schools",'all=Warren'); mySelect.options[mySelect.options.length] = new Option("West Farmington schools",'all=West_Farmington'); mySelect.options[mySelect.options.length] = new Option("Youngstown schools",'all=Youngstown'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Warren[Warren.length] = createMarker(new GPoint(-80.83473900,41.24551800),"
",iconRd); mySelect.options[mySelect.options.length] = new Option("Academy Of Arts And Humanities",'Warren=' + Warren.length); Masury[Masury.length] = createMarker(new GPoint(-80.52137756,41.21984100),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Addison Elementary School",'Masury=' + Masury.length); Warren[Warren.length] = createMarker(new GPoint(-80.84947968,41.23236084),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Alden Elementary School",'Warren=' + Warren.length); Newton_Falls[Newton_Falls.length] = createMarker(new GPoint(-80.96983337,41.18813705),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Arlington Elementary School",'Newton_Falls=' + Newton_Falls.length); Warren[Warren.length] = createMarker(new GPoint(-80.83473900,41.24551800),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Arts And Science Academy",'Warren=' + Warren.length); Kinsman[Kinsman.length] = createMarker(new GPoint(-80.55999756,41.46020126),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Badger High School",'Kinsman=' + Kinsman.length); Kinsman[Kinsman.length] = createMarker(new GPoint(-80.58853912,41.44382858),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Badger Middle School",'Kinsman=' + Kinsman.length); Vienna[Vienna.length] = createMarker(new GPoint(-80.66967773,41.22513580),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Baker Elementary School",'Vienna=' + Vienna.length); Leavittsburg[Leavittsburg.length] = createMarker(new GPoint(-80.87142181,41.25457382),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Bascom Elementary School",'Leavittsburg=' + Leavittsburg.length); Warren[Warren.length] = createMarker(new GPoint(-80.77925873,41.29258728),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Bazetta Elementary School",'Warren=' + Warren.length); North_Bloomfield[North_Bloomfield.length] = createMarker(new GPoint(-80.87340546,41.46416473),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Bloomfield High School",'North_Bloomfield=' + North_Bloomfield.length); Niles[Niles.length] = createMarker(new GPoint(-80.76709747,41.19224167),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Bonham Elementary School",'Niles=' + Niles.length); Bristolville[Bristolville.length] = createMarker(new GPoint(-80.86009979,41.38019943),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Bristol High School",'Bristolville=' + Bristolville.length); Bristolville[Bristolville.length] = createMarker(new GPoint(-80.86009979,41.38019943),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Bristol Middle School",'Bristolville=' + Bristolville.length); West_Farmington[West_Farmington.length] = createMarker(new GPoint(-80.97869873,41.36800003),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Bristol-farmington Elementary School",'West_Farmington=' + West_Farmington.length); Brookfield[Brookfield.length] = createMarker(new GPoint(-80.57330322,41.23709869),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Brookfield High School",'Brookfield=' + Brookfield.length); Brookfield[Brookfield.length] = createMarker(new GPoint(-80.57330322,41.23709869),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Brookfield Middle School",'Brookfield=' + Brookfield.length); Southington[Southington.length] = createMarker(new GPoint(-80.95725250,41.30853653),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Chalker High School",'Southington=' + Southington.length); Warren[Warren.length] = createMarker(new GPoint(-80.85037994,41.31038666),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Champion Central Elementary School",'Warren=' + Warren.length); Warren[Warren.length] = createMarker(new GPoint(-80.85263062,41.31645203),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Champion High School",'Warren=' + Warren.length); Warren[Warren.length] = createMarker(new GPoint(-80.86546326,41.30270004),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Champion Middle School",'Warren=' + Warren.length); Cortland[Cortland.length] = createMarker(new GPoint(-80.72721863,41.33462524),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Cortland Elementary School",'Cortland=' + Cortland.length); Cortland[Cortland.length] = createMarker(new GPoint(-80.69129944,41.30833435),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Currie Elementary School",'Cortland=' + Cortland.length); Warren[Warren.length] = createMarker(new GPoint(-80.78284454,41.23034668),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Devon Elementary School",'Warren=' + Warren.length); Youngstown[Youngstown.length] = createMarker(new GPoint(-80.65751648,41.15445328),"",iconRd); mySelect.options[mySelect.options.length] = new Option("E J Blott Elementary School",'Youngstown=' + Youngstown.length); Warren[Warren.length] = createMarker(new GPoint(-80.79833221,41.23416138),"",iconBl); mySelect.options[mySelect.options.length] = new Option("East Middle School",'Warren=' + Warren.length); Warren[Warren.length] = createMarker(new GPoint(-80.84272766,41.24809265),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Emerson Elementary School",'Warren=' + Warren.length); Niles[Niles.length] = createMarker(new GPoint(-80.76750183,41.17505646),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Garfield Elementary School",'Niles=' + Niles.length); Warren[Warren.length] = createMarker(new GPoint(-80.78548431,41.23913574),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Garfield Elementary School",'Warren=' + Warren.length); Girard[Girard.length] = createMarker(new GPoint(-80.68910980,41.15796280),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Girard Intermediate Middle School",'Girard=' + Girard.length); Girard[Girard.length] = createMarker(new GPoint(-80.69391632,41.15443039),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Girard Junior High School",'Girard=' + Girard.length); Girard[Girard.length] = createMarker(new GPoint(-80.69409943,41.15446854),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Girard Senior High School",'Girard=' + Girard.length); Warren[Warren.length] = createMarker(new GPoint(-80.90609741,41.19589996),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Gordon D James Career Center",'Warren=' + Warren.length); Farmdale[Farmdale.length] = createMarker(new GPoint(-80.66735840,41.46216202),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Gustavus Elementary School",'Farmdale=' + Farmdale.length); Hartford[Hartford.length] = createMarker(new GPoint(-80.56860352,41.31129837),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Hartford Elementary School",'Hartford=' + Hartford.length); Warren[Warren.length] = createMarker(new GPoint(-80.82841492,41.24874496),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Hb Turner Middle School",'Warren=' + Warren.length); Warren[Warren.length] = createMarker(new GPoint(-80.83608246,41.22785187),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Horace Mann Elementary School",'Warren=' + Warren.length); Warren[Warren.length] = createMarker(new GPoint(-80.74535370,41.25788879),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Howland Glen Elementary School",'Warren=' + Warren.length); Warren[Warren.length] = createMarker(new GPoint(-80.74611664,41.23987579),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Howland High School",'Warren=' + Warren.length); Warren[Warren.length] = createMarker(new GPoint(-80.74281311,41.23576355),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Howland Middle School",'Warren=' + Warren.length); Warren[Warren.length] = createMarker(new GPoint(-80.72200012,41.22365570),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Howland Springs Elementary School",'Warren=' + Warren.length); Hubbard[Hubbard.length] = createMarker(new GPoint(-80.58148193,41.15205765),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Hubbard High School",'Hubbard=' + Hubbard.length); Niles[Niles.length] = createMarker(new GPoint(-80.77400208,41.18629074),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Jackson Elementary School",'Niles=' + Niles.length); Warren[Warren.length] = createMarker(new GPoint(-80.82958221,41.22166443),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Jefferson Elementary School",'Warren=' + Warren.length); Leavittsburg[Leavittsburg.length] = createMarker(new GPoint(-80.87595367,41.23976135),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Labrae High School",'Leavittsburg=' + Leavittsburg.length); Warren[Warren.length] = createMarker(new GPoint(-80.80051422,41.23179626),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Laird Ave Elementary School",'Warren=' + Warren.length); Cortland[Cortland.length] = createMarker(new GPoint(-80.72631836,41.31996155),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Lakeview High School",'Cortland=' + Cortland.length); Cortland[Cortland.length] = createMarker(new GPoint(-80.72431183,41.31716156),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Lakeview Middle School",'Cortland=' + Cortland.length); Leavittsburg[Leavittsburg.length] = createMarker(new GPoint(-80.87648010,41.22656250),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Leavitt Elementary School",'Leavittsburg=' + Leavittsburg.length); Youngstown[Youngstown.length] = createMarker(new GPoint(-80.65750122,41.15476990),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Liberty High School",'Youngstown=' + Youngstown.length); Warren[Warren.length] = createMarker(new GPoint(-80.81262207,41.23492050),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Life Skills Of Trumbull County High School",'Warren=' + Warren.length); Niles[Niles.length] = createMarker(new GPoint(-80.75184631,41.19258499),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Lincoln Elementary School",'Niles=' + Niles.length); Warren[Warren.length] = createMarker(new GPoint(-80.78810883,41.24688721),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Lincoln Elementary School",'Warren=' + Warren.length); Warren[Warren.length] = createMarker(new GPoint(-80.85739899,41.16677856),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Lordstown Elementary School",'Warren=' + Warren.length); Warren[Warren.length] = createMarker(new GPoint(-80.79266357,41.17029953),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Lordstown High School",'Warren=' + Warren.length); North_Bloomfield[North_Bloomfield.length] = createMarker(new GPoint(-80.75836945,41.46203613),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Maplewood Elementary School",'North_Bloomfield=' + North_Bloomfield.length); Cortland[Cortland.length] = createMarker(new GPoint(-80.73338318,41.38936234),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Maplewood High School",'Cortland=' + Cortland.length); Cortland[Cortland.length] = createMarker(new GPoint(-80.67200470,41.38903809),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Maplewood Middle School",'Cortland=' + Cortland.length); Vienna[Vienna.length] = createMarker(new GPoint(-80.66228485,41.23793793),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Mathews High School",'Vienna=' + Vienna.length); Mc_Donald[Mc_Donald.length] = createMarker(new GPoint(-80.72768402,41.16166306),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Mcdonald High School",'Mc_Donald=' + Mc_Donald.length); Warren[Warren.length] = createMarker(new GPoint(-80.84737396,41.26206207),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Mcguffey Elementary School",'Warren=' + Warren.length); Warren[Warren.length] = createMarker(new GPoint(-80.80225372,41.24773788),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Mckinley Elementary School",'Warren=' + Warren.length); Niles[Niles.length] = createMarker(new GPoint(-80.76077271,41.18755722),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Mckinley High School",'Niles=' + Niles.length); Mesopotamia[Mesopotamia.length] = createMarker(new GPoint(-80.95449829,41.45949936),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Mesopotamia Elementary School",'Mesopotamia=' + Mesopotamia.length); Mineral_Ridge[Mineral_Ridge.length] = createMarker(new GPoint(-80.77165222,41.14534378),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Mineral Ridge High School",'Mineral_Ridge=' + Mineral_Ridge.length); Mineral_Ridge[Mineral_Ridge.length] = createMarker(new GPoint(-80.76903534,41.14186478),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Mineral Ridge Middle School",'Mineral_Ridge=' + Mineral_Ridge.length); Warren[Warren.length] = createMarker(new GPoint(-80.73071289,41.24846268),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Mines Elementary School",'Warren=' + Warren.length); Fowler[Fowler.length] = createMarker(new GPoint(-80.60769653,41.30450058),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Neal Middle School",'Fowler=' + Fowler.length); Newton_Falls[Newton_Falls.length] = createMarker(new GPoint(-80.96899414,41.18322372),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Newton Falls High School",'Newton_Falls=' + Newton_Falls.length); Newton_Falls[Newton_Falls.length] = createMarker(new GPoint(-80.96138500,41.17329300),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Newton Falls Junior High School",'Newton_Falls=' + Newton_Falls.length); Newton_Falls[Newton_Falls.length] = createMarker(new GPoint(-80.96899414,41.18322372),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Newton Falls Middle School",'Newton_Falls=' + Newton_Falls.length); Niles[Niles.length] = createMarker(new GPoint(-80.76512146,41.17541122),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Niles Middle School",'Niles=' + Niles.length); Warren[Warren.length] = createMarker(new GPoint(-80.76411438,41.22766876),"",iconRd); mySelect.options[mySelect.options.length] = new Option("North Rd Elementary School",'Warren=' + Warren.length); Girard[Girard.length] = createMarker(new GPoint(-80.68910980,41.15796280),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Prospect Elementary School",'Girard=' + Girard.length); Hubbard[Hubbard.length] = createMarker(new GPoint(-80.58138275,41.15468216),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Reed Middle School",'Hubbard=' + Hubbard.length); Warren[Warren.length] = createMarker(new GPoint(-80.82348633,41.25041962),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Roosevelt Elementary School",'Warren=' + Warren.length); Mc_Donald[Mc_Donald.length] = createMarker(new GPoint(-80.72668457,41.16506195),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Roosevelt Elementary School",'Mc_Donald=' + Mc_Donald.length); Hubbard[Hubbard.length] = createMarker(new GPoint(-80.57080841,41.15773773),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Roosevelt Elementary School",'Hubbard=' + Hubbard.length); Mineral_Ridge[Mineral_Ridge.length] = createMarker(new GPoint(-80.75367737,41.13826370),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Seaborn Elementary School",'Mineral_Ridge=' + Mineral_Ridge.length); Warren[Warren.length] = createMarker(new GPoint(-80.85617828,41.24381638),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Secrest Elementary School",'Warren=' + Warren.length); Southington[Southington.length] = createMarker(new GPoint(-80.95725250,41.30853653),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Southington Elementary School",'Southington=' + Southington.length); Southington[Southington.length] = createMarker(new GPoint(-80.95725250,41.30853653),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Southington Middle School",'Southington=' + Southington.length); Masury[Masury.length] = createMarker(new GPoint(-80.53699493,41.21194839),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Stevenson Elementary School",'Masury=' + Masury.length); Warren[Warren.length] = createMarker(new GPoint(-80.78610100,41.22056500),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Summit Academy Warren",'Warren=' + Warren.length); Warren[Warren.length] = createMarker(new GPoint(-80.79266357,41.17029953),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Tctc Adult Training Center",'Warren=' + Warren.length); Warren[Warren.length] = createMarker(new GPoint(-80.83219147,41.28116226),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Trumbull Career & Technical Center",'Warren=' + Warren.length); Newton_Falls[Newton_Falls.length] = createMarker(new GPoint(-80.96232605,41.20190048),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Vaughn Elementary School",'Newton_Falls=' + Newton_Falls.length); Warren[Warren.length] = createMarker(new GPoint(-80.84947968,41.23369980),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Warren City Practical Nursing",'Warren=' + Warren.length); Warren[Warren.length] = createMarker(new GPoint(-80.80566406,41.24460983),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Warren G Harding High School",'Warren=' + Warren.length); Warren[Warren.length] = createMarker(new GPoint(-80.84947968,41.23369980),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Warren Western Reserve Middle School",'Warren=' + Warren.length); Niles[Niles.length] = createMarker(new GPoint(-80.74478149,41.18965149),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Washington Elementary School",'Niles=' + Niles.length); Warren[Warren.length] = createMarker(new GPoint(-80.78812408,41.21393585),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Washington High School",'Warren=' + Warren.length); Youngstown[Youngstown.length] = createMarker(new GPoint(-80.65771484,41.15620804),"",iconBl); mySelect.options[mySelect.options.length] = new Option("William S Guy Middle School",'Youngstown=' + Youngstown.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(Bristolville); map.removeOverlays(Brookfield); map.removeOverlays(Cortland); map.removeOverlays(Farmdale); map.removeOverlays(Fowler); map.removeOverlays(Girard); map.removeOverlays(Hartford); map.removeOverlays(Hubbard); map.removeOverlays(Kinsman); map.removeOverlays(Leavittsburg); map.removeOverlays(Masury); map.removeOverlays(Mc_Donald); map.removeOverlays(Mesopotamia); map.removeOverlays(Mineral_Ridge); map.removeOverlays(Newton_Falls); map.removeOverlays(Niles); map.removeOverlays(North_Bloomfield); map.removeOverlays(Southington); map.removeOverlays(Vienna); map.removeOverlays(Warren); map.removeOverlays(West_Farmington); map.removeOverlays(Youngstown); 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(Warren);map.removeOverlays(Bristolville); map.removeOverlays(Brookfield); map.removeOverlays(Cortland); map.removeOverlays(Farmdale); map.removeOverlays(Fowler); map.removeOverlays(Girard); map.removeOverlays(Hartford); map.removeOverlays(Hubbard); map.removeOverlays(Kinsman); map.removeOverlays(Leavittsburg); map.removeOverlays(Masury); map.removeOverlays(Mc_Donald); map.removeOverlays(Mesopotamia); map.removeOverlays(Mineral_Ridge); map.removeOverlays(Newton_Falls); map.removeOverlays(Niles); map.removeOverlays(North_Bloomfield); map.removeOverlays(Southington); map.removeOverlays(Vienna); map.removeOverlays(Warren); map.removeOverlays(West_Farmington); map.removeOverlays(Youngstown); map.addOverlays(Bristolville); centerByArray(Bristolville, false, false); cntMarker += Bristolville.length; map.addOverlays(Brookfield); centerByArray(Brookfield, false, false); cntMarker += Brookfield.length; map.addOverlays(Cortland); centerByArray(Cortland, false, false); cntMarker += Cortland.length; map.addOverlays(Farmdale); centerByArray(Farmdale, false, false); cntMarker += Farmdale.length; map.addOverlays(Fowler); centerByArray(Fowler, false, false); cntMarker += Fowler.length; map.addOverlays(Girard); centerByArray(Girard, false, false); cntMarker += Girard.length; map.addOverlays(Hartford); centerByArray(Hartford, false, false); cntMarker += Hartford.length; map.addOverlays(Hubbard); centerByArray(Hubbard, false, false); cntMarker += Hubbard.length; map.addOverlays(Kinsman); centerByArray(Kinsman, false, false); cntMarker += Kinsman.length; map.addOverlays(Leavittsburg); centerByArray(Leavittsburg, false, false); cntMarker += Leavittsburg.length; map.addOverlays(Masury); centerByArray(Masury, false, false); cntMarker += Masury.length; map.addOverlays(Mc_Donald); centerByArray(Mc_Donald, false, false); cntMarker += Mc_Donald.length; map.addOverlays(Mesopotamia); centerByArray(Mesopotamia, false, false); cntMarker += Mesopotamia.length; map.addOverlays(Mineral_Ridge); centerByArray(Mineral_Ridge, false, false); cntMarker += Mineral_Ridge.length; map.addOverlays(Newton_Falls); centerByArray(Newton_Falls, false, false); cntMarker += Newton_Falls.length; map.addOverlays(Niles); centerByArray(Niles, false, false); cntMarker += Niles.length; map.addOverlays(North_Bloomfield); centerByArray(North_Bloomfield, false, false); cntMarker += North_Bloomfield.length; map.addOverlays(Southington); centerByArray(Southington, false, false); cntMarker += Southington.length; map.addOverlays(Vienna); centerByArray(Vienna, false, false); cntMarker += Vienna.length; map.addOverlays(Warren); centerByArray(Warren, false, false); cntMarker += Warren.length; map.addOverlays(West_Farmington); centerByArray(West_Farmington, false, false); cntMarker += West_Farmington.length; map.addOverlays(Youngstown); centerByArray(Youngstown, false, false); cntMarker += Youngstown.length; centerByArray(Warren,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'); } }