function addMarkers() { mySelect = document.getElementById('selection'); Allegan = [];Otsego = [];Fennville = [];South_Haven = [];Hamilton = [];Wayland = [];Holland = [];Dorr = [];Douglas = [];Plainwell = [];Glenn = [];Hopkins = [];Martin = [];Moline = [];Bloomingdale = [];Saugatuck = [];mySelect.options[mySelect.options.length] = new Option("Allegan schools",'all=Allegan'); mySelect.options[mySelect.options.length] = new Option("Bloomingdale schools",'all=Bloomingdale'); mySelect.options[mySelect.options.length] = new Option("Dorr schools",'all=Dorr'); mySelect.options[mySelect.options.length] = new Option("Douglas schools",'all=Douglas'); mySelect.options[mySelect.options.length] = new Option("Fennville schools",'all=Fennville'); mySelect.options[mySelect.options.length] = new Option("Glenn schools",'all=Glenn'); mySelect.options[mySelect.options.length] = new Option("Hamilton schools",'all=Hamilton'); mySelect.options[mySelect.options.length] = new Option("Holland schools",'all=Holland'); mySelect.options[mySelect.options.length] = new Option("Hopkins schools",'all=Hopkins'); mySelect.options[mySelect.options.length] = new Option("Martin schools",'all=Martin'); mySelect.options[mySelect.options.length] = new Option("Moline schools",'all=Moline'); mySelect.options[mySelect.options.length] = new Option("Otsego schools",'all=Otsego'); mySelect.options[mySelect.options.length] = new Option("Plainwell schools",'all=Plainwell'); mySelect.options[mySelect.options.length] = new Option("Saugatuck schools",'all=Saugatuck'); mySelect.options[mySelect.options.length] = new Option("South Haven schools",'all=South_Haven'); mySelect.options[mySelect.options.length] = new Option("Wayland schools",'all=Wayland'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Allegan[Allegan.length] = createMarker(new GPoint(-85.84322357,42.52327347),"
Allegan Alternative High School
550 Fifth Street
Allegan, MI 49010

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Allegan Alternative High School",'Allegan=' + Allegan.length); Allegan[Allegan.length] = createMarker(new GPoint(-85.82702637,42.53483582),"
Allegan Co. Area Math/science Ed. Center
2891 116th Avenue
Allegan, MI 49010

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Allegan Co. Area Math/science Ed. Center",'Allegan=' + Allegan.length); Allegan[Allegan.length] = createMarker(new GPoint(-85.85824585,42.52687454),"
Allegan Co. Development Center
212 Grove Street
Allegan, MI 49010

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Allegan Co. Development Center",'Allegan=' + Allegan.length); Otsego[Otsego.length] = createMarker(new GPoint(-85.69856262,42.46061707),"
Allegan County Even Start Elementary School
112 Kalamazoo Street
Otsego, MI 49078

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Allegan County Even Start Elementary School",'Otsego=' + Otsego.length); Allegan[Allegan.length] = createMarker(new GPoint(-85.86926270,42.58149719),"
Allegan County Youth Home
2243 33rd St.
Allegan, MI 49010

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Allegan County Youth Home",'Allegan=' + Allegan.length); Otsego[Otsego.length] = createMarker(new GPoint(-85.70230103,42.46143723),"
Allegan Elementary School
313 W. Allegan Street
Otsego, MI 49078

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Allegan Elementary School",'Otsego=' + Otsego.length); Allegan[Allegan.length] = createMarker(new GPoint(-85.84322357,42.52327347),"
Allegan High School
550 Fifth Street
Allegan, MI 49010

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Allegan High School",'Allegan=' + Allegan.length); Otsego[Otsego.length] = createMarker(new GPoint(-85.70230103,42.46143723),"
Allegan Street Elementary School
313 W. Allegan Street
Otsego, MI 49078

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Allegan Street Elementary School",'Otsego=' + Otsego.length); Fennville[Fennville.length] = createMarker(new GPoint(-86.15309906,42.58160019),"
Anna Michen Elementary School
P.o. Box 3
Fennville, MI 49408

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Anna Michen Elementary School",'Fennville=' + Fennville.length); Fennville[Fennville.length] = createMarker(new GPoint(-86.15309906,42.58160019),"
Anna Michen Lower Elementary School
P.o. Box 3
Fennville, MI 49408

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Anna Michen Lower Elementary School",'Fennville=' + Fennville.length); Fennville[Fennville.length] = createMarker(new GPoint(-86.15309906,42.58160019),"
Anna Michen Upper Elementary School
P.o. Box 3
Fennville, MI 49408

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Anna Michen Upper Elementary School",'Fennville=' + Fennville.length); Allegan[Allegan.length] = createMarker(new GPoint(-85.82826233,42.53450012),"
Area Technical & Ed. Center
2891 116th Avenue
Allegan, MI 49010

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Area Technical & Ed. Center",'Allegan=' + Allegan.length); South_Haven[South_Haven.length] = createMarker(new GPoint(-86.18722534,42.41923523),"
Baseline Middle School
7357 Baseline Road
South Haven, MI 49090

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Baseline Middle School",'South_Haven=' + South_Haven.length); Hamilton[Hamilton.length] = createMarker(new GPoint(-85.91886139,42.71452332),"
Bentheim Elementary School
4057 38th Street
Hamilton, MI 49419

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bentheim Elementary School",'Hamilton=' + Hamilton.length); Wayland[Wayland.length] = createMarker(new GPoint(-85.64935303,42.67146301),"
Bessie B. Baker School
507 W. Sycamore Street
Wayland, MI 49348

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bessie B. Baker School",'Wayland=' + Wayland.length); Holland[Holland.length] = createMarker(new GPoint(-86.11399841,42.70057297),"
Blue Star Elementary School
3846 58th Street
Holland, MI 49423

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Blue Star Elementary School",'Holland=' + Holland.length); Allegan[Allegan.length] = createMarker(new GPoint(-85.84322357,42.52327347),"
Dawson Elementary School
550 Fifth Street
Allegan, MI 49010

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Dawson Elementary School",'Allegan=' + Allegan.length); Fennville[Fennville.length] = createMarker(new GPoint(-86.15309906,42.58160019),"
Discovery Elementary School
P.o. Box 990
Fennville, MI 49408

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Discovery Elementary School",'Fennville=' + Fennville.length); Otsego[Otsego.length] = createMarker(new GPoint(-85.68996429,42.45212173),"
Dix Street Elementary School
503 Dix Street
Otsego, MI 49078

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Dix Street Elementary School",'Otsego=' + Otsego.length); Dorr[Dorr.length] = createMarker(new GPoint(-85.72180939,42.72218704),"
Dorr School
4159 18th Street
Dorr, MI 49323

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Dorr School",'Dorr=' + Dorr.length); Douglas[Douglas.length] = createMarker(new GPoint(-86.20050049,42.64329910),"
Douglas Elementary School
P.o. Box 818
Douglas, MI 49406

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Douglas Elementary School",'Douglas=' + Douglas.length); Wayland[Wayland.length] = createMarker(new GPoint(-85.56473541,42.66622925),"
Environmental Education Center
3400 Second Street
Wayland, MI 49348

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Environmental Education Center",'Wayland=' + Wayland.length); Fennville[Fennville.length] = createMarker(new GPoint(-86.15309906,42.58160019),"
Fennville High School
P.o. Box 2
Fennville, MI 49408

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Fennville High School",'Fennville=' + Fennville.length); Fennville[Fennville.length] = createMarker(new GPoint(-86.15309906,42.58160019),"
Fennville Middle School
1 Memorial Drive
Fennville, MI 49408

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Fennville Middle School",'Fennville=' + Fennville.length); Fennville[Fennville.length] = createMarker(new GPoint(-86.15309906,42.58160019),"
Fennville Public High School
P.o. Box 2
Fennville, MI 49408

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Fennville Public High School",'Fennville=' + Fennville.length); Plainwell[Plainwell.length] = createMarker(new GPoint(-85.63890076,42.43706894),"
Gilkey Elementary School
707 S. Woodhams Street
Plainwell, MI 49080

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Gilkey Elementary School",'Plainwell=' + Plainwell.length); Glenn[Glenn.length] = createMarker(new GPoint(-86.23020172,42.52230072),"
Glenn Elementary School
P.o. Box 68
Glenn, MI 49416

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Glenn Elementary School",'Glenn=' + Glenn.length); Glenn[Glenn.length] = createMarker(new GPoint(-86.23020172,42.52230072),"
Glenn Public School
P.o. Box 68
Glenn, MI 49416

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Glenn Public School",'Glenn=' + Glenn.length); Hamilton[Hamilton.length] = createMarker(new GPoint(-85.98249817,42.67950058),"
Hamilton Elementary School
3472 M-40
Hamilton, MI 49419

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hamilton Elementary School",'Hamilton=' + Hamilton.length); Hamilton[Hamilton.length] = createMarker(new GPoint(-85.98249817,42.67950058),"
Hamilton High School
4911 136th Avenue
Hamilton, MI 49419

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hamilton High School",'Hamilton=' + Hamilton.length); Hamilton[Hamilton.length] = createMarker(new GPoint(-85.98249817,42.67950058),"
Hamilton Middle School
4845 136th Avenue
Hamilton, MI 49419

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Hamilton Middle School",'Hamilton=' + Hamilton.length); Hopkins[Hopkins.length] = createMarker(new GPoint(-85.74420166,42.62789917),"
Hopkins Elementary School
P.o. Box 278
Hopkins, MI 49328

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hopkins Elementary School",'Hopkins=' + Hopkins.length); Hopkins[Hopkins.length] = createMarker(new GPoint(-85.74420166,42.62789917),"
Hopkins High School
P.o. Box 278
Hopkins, MI 49328

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hopkins High School",'Hopkins=' + Hopkins.length); Hopkins[Hopkins.length] = createMarker(new GPoint(-85.76093292,42.62302399),"
Hopkins Middle School
215 Clark Street
Hopkins, MI 49328

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Hopkins Middle School",'Hopkins=' + Hopkins.length); Allegan[Allegan.length] = createMarker(new GPoint(-85.84322357,42.52327347),"
L.e. White Middle School
550 Fifth Street
Allegan, MI 49010

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("L.e. White Middle School",'Allegan=' + Allegan.length); Holland[Holland.length] = createMarker(new GPoint(-86.10698700,42.76853943),"
Maplewood Elementary School
925 Central Avenue
Holland, MI 49423

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Maplewood Elementary School",'Holland=' + Holland.length); Martin[Martin.length] = createMarker(new GPoint(-85.63870239,42.53839874),"
Martin High School
P.o. Box 241
Martin, MI 49070

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Martin High School",'Martin=' + Martin.length); Moline[Moline.length] = createMarker(new GPoint(-85.66362762,42.73926926),"
Moline School
1148 First Street
Moline, MI 49335

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Moline School",'Moline=' + Moline.length); Allegan[Allegan.length] = createMarker(new GPoint(-85.84322357,42.52327347),"
North Ward Elementary School
550 Fifth Street
Allegan, MI 49010

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("North Ward Elementary School",'Allegan=' + Allegan.length); Otsego[Otsego.length] = createMarker(new GPoint(-85.69611900,42.46038000),"
Otsego High School
540 Washington Street
Otsego, MI 49078

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Otsego High School",'Otsego=' + Otsego.length); Otsego[Otsego.length] = createMarker(new GPoint(-85.70948029,42.45383835),"
Otsego Middle School
538 Washington Street
Otsego, MI 49078

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Otsego Middle School",'Otsego=' + Otsego.length); Allegan[Allegan.length] = createMarker(new GPoint(-85.86017609,42.51771545),"
Outlook Academy
310 Thomas Street
Allegan, MI 48010

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Outlook Academy",'Allegan=' + Allegan.length); Fennville[Fennville.length] = createMarker(new GPoint(-86.10456000,42.59971100),"
Pearl Alternative/adult Education School
4 Memorial Drive
Fennville, MI 49408

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pearl Alternative/adult Education School",'Fennville=' + Fennville.length); Wayland[Wayland.length] = createMarker(new GPoint(-85.64469910,42.67276382),"
Pine Street Elementary School
201 Pine Street
Wayland, MI 49348

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Pine Street Elementary School",'Wayland=' + Wayland.length); Allegan[Allegan.length] = createMarker(new GPoint(-85.84350100,42.52283300),"
Pine Trails Elementary School
550 Fifth Street
Allegan, MI 49010

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pine Trails Elementary School",'Allegan=' + Allegan.length); Plainwell[Plainwell.length] = createMarker(new GPoint(-85.64852905,42.43536377),"
Plainwell High School
684 Starr Road
Plainwell, MI 49080

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Plainwell High School",'Plainwell=' + Plainwell.length); Plainwell[Plainwell.length] = createMarker(new GPoint(-85.64898682,42.43645477),"
Plainwell Middle School
720 Brigham Street
Plainwell, MI 49080

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Plainwell Middle School",'Plainwell=' + Plainwell.length); Plainwell[Plainwell.length] = createMarker(new GPoint(-85.64183900,42.44278900),"
Plainwell Young Adult Program
101 12 S. Main Street
Plainwell, MI 49080

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Plainwell Young Adult Program",'Plainwell=' + Plainwell.length); Bloomingdale[Bloomingdale.length] = createMarker(new GPoint(-85.96630096,42.37779999),"
Pullman Elementary School
P.o. Box 217
Bloomingdale, MI 49026

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pullman Elementary School",'Bloomingdale=' + Bloomingdale.length); Wayland[Wayland.length] = createMarker(new GPoint(-85.63672638,42.67393875),"
R.j. Steeby School
435 E. Superior Street
Wayland, MI 49348

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("R.j. Steeby School",'Wayland=' + Wayland.length); Plainwell[Plainwell.length] = createMarker(new GPoint(-85.63061523,42.44832993),"
Renaissance High School
422 Acorn Street
Plainwell, MI 49080

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Renaissance High School",'Plainwell=' + Plainwell.length); Martin[Martin.length] = createMarker(new GPoint(-85.63870239,42.53839874),"
Robert D. Brandon Elementary School
P.o. Box 241
Martin, MI 49070

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Robert D. Brandon Elementary School",'Martin=' + Martin.length); Holland[Holland.length] = createMarker(new GPoint(-85.99845123,42.73355103),"
Sandyview School
4317 46th Street
Holland, MI 49423

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sandyview School",'Holland=' + Holland.length); Saugatuck[Saugatuck.length] = createMarker(new GPoint(-86.19831848,42.65775681),"
Saugatuck High School
401 Elizabeth Street
Saugatuck, MI 49453

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Saugatuck High School",'Saugatuck=' + Saugatuck.length); Saugatuck[Saugatuck.length] = createMarker(new GPoint(-86.19831848,42.65775681),"
Saugatuck Middle School
401 Elizabeth Street
Saugatuck, MI 49453

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Saugatuck Middle School",'Saugatuck=' + Saugatuck.length); Allegan[Allegan.length] = createMarker(new GPoint(-85.84322357,42.52327347),"
South Ward Alt. Ed School
550 Fifth Street
Allegan, MI 49010

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("South Ward Alt. Ed School",'Allegan=' + Allegan.length); Plainwell[Plainwell.length] = createMarker(new GPoint(-85.65235901,42.43680954),"
Starr Elementary School
601 School Drive
Plainwell, MI 49080

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Starr Elementary School",'Plainwell=' + Plainwell.length); Dorr[Dorr.length] = createMarker(new GPoint(-85.76394653,42.72519684),"
Sycamore Elementary School
2163 142nd Avenue
Dorr, MI 49323

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sycamore Elementary School",'Dorr=' + Dorr.length); Wayland[Wayland.length] = createMarker(new GPoint(-85.62898254,42.67366409),"
Wayland High School
870 E. Superior Street
Wayland, MI 49348

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wayland High School",'Wayland=' + Wayland.length); Wayland[Wayland.length] = createMarker(new GPoint(-85.62802124,42.66324234),"
Wayland Union Middle School
701 Wildcat Drive
Wayland, MI 49348

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Wayland Union Middle School",'Wayland=' + Wayland.length); Wayland[Wayland.length] = createMarker(new GPoint(-85.64173126,42.67439651),"
Wayland Young Adult Program
118 W. Superior Street
Wayland, MI 49348

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wayland Young Adult Program",'Wayland=' + Wayland.length); Allegan[Allegan.length] = createMarker(new GPoint(-85.84322357,42.52327347),"
West Ward Elementary School
550 Fifth Street
Allegan, MI 49010

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("West Ward Elementary School",'Allegan=' + Allegan.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(Allegan); map.removeOverlays(Bloomingdale); map.removeOverlays(Dorr); map.removeOverlays(Douglas); map.removeOverlays(Fennville); map.removeOverlays(Glenn); map.removeOverlays(Hamilton); map.removeOverlays(Holland); map.removeOverlays(Hopkins); map.removeOverlays(Martin); map.removeOverlays(Moline); map.removeOverlays(Otsego); map.removeOverlays(Plainwell); map.removeOverlays(Saugatuck); map.removeOverlays(South_Haven); map.removeOverlays(Wayland); 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(Allegan);map.removeOverlays(Allegan); map.removeOverlays(Bloomingdale); map.removeOverlays(Dorr); map.removeOverlays(Douglas); map.removeOverlays(Fennville); map.removeOverlays(Glenn); map.removeOverlays(Hamilton); map.removeOverlays(Holland); map.removeOverlays(Hopkins); map.removeOverlays(Martin); map.removeOverlays(Moline); map.removeOverlays(Otsego); map.removeOverlays(Plainwell); map.removeOverlays(Saugatuck); map.removeOverlays(South_Haven); map.removeOverlays(Wayland); map.addOverlays(Allegan); centerByArray(Allegan, false, false); cntMarker += Allegan.length; map.addOverlays(Bloomingdale); centerByArray(Bloomingdale, false, false); cntMarker += Bloomingdale.length; map.addOverlays(Dorr); centerByArray(Dorr, false, false); cntMarker += Dorr.length; map.addOverlays(Douglas); centerByArray(Douglas, false, false); cntMarker += Douglas.length; map.addOverlays(Fennville); centerByArray(Fennville, false, false); cntMarker += Fennville.length; map.addOverlays(Glenn); centerByArray(Glenn, false, false); cntMarker += Glenn.length; map.addOverlays(Hamilton); centerByArray(Hamilton, false, false); cntMarker += Hamilton.length; map.addOverlays(Holland); centerByArray(Holland, false, false); cntMarker += Holland.length; map.addOverlays(Hopkins); centerByArray(Hopkins, false, false); cntMarker += Hopkins.length; map.addOverlays(Martin); centerByArray(Martin, false, false); cntMarker += Martin.length; map.addOverlays(Moline); centerByArray(Moline, false, false); cntMarker += Moline.length; map.addOverlays(Otsego); centerByArray(Otsego, false, false); cntMarker += Otsego.length; map.addOverlays(Plainwell); centerByArray(Plainwell, false, false); cntMarker += Plainwell.length; map.addOverlays(Saugatuck); centerByArray(Saugatuck, false, false); cntMarker += Saugatuck.length; map.addOverlays(South_Haven); centerByArray(South_Haven, false, false); cntMarker += South_Haven.length; map.addOverlays(Wayland); centerByArray(Wayland, false, false); cntMarker += Wayland.length; centerByArray(Allegan,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'); } }