function addMarkers() { mySelect = document.getElementById('selection'); Arrowsmith = [];Bloomington = [];Carlock = [];Chenoa = [];Normal = [];Colfax = [];Danvers = [];Gridley = [];Heyworth = [];Hudson = [];Le_Roy = [];Lexington = [];Mclean = [];Stanford = [];Towanda = [];Downs = [];mySelect.options[mySelect.options.length] = new Option("Arrowsmith schools",'all=Arrowsmith'); mySelect.options[mySelect.options.length] = new Option("Bloomington schools",'all=Bloomington'); mySelect.options[mySelect.options.length] = new Option("Carlock schools",'all=Carlock'); mySelect.options[mySelect.options.length] = new Option("Chenoa schools",'all=Chenoa'); mySelect.options[mySelect.options.length] = new Option("Colfax schools",'all=Colfax'); mySelect.options[mySelect.options.length] = new Option("Danvers schools",'all=Danvers'); mySelect.options[mySelect.options.length] = new Option("Downs schools",'all=Downs'); mySelect.options[mySelect.options.length] = new Option("Gridley schools",'all=Gridley'); mySelect.options[mySelect.options.length] = new Option("Heyworth schools",'all=Heyworth'); mySelect.options[mySelect.options.length] = new Option("Hudson schools",'all=Hudson'); mySelect.options[mySelect.options.length] = new Option("Le Roy schools",'all=Le_Roy'); mySelect.options[mySelect.options.length] = new Option("Lexington schools",'all=Lexington'); mySelect.options[mySelect.options.length] = new Option("Mclean schools",'all=Mclean'); mySelect.options[mySelect.options.length] = new Option("Normal schools",'all=Normal'); mySelect.options[mySelect.options.length] = new Option("Stanford schools",'all=Stanford'); mySelect.options[mySelect.options.length] = new Option("Towanda schools",'all=Towanda'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Arrowsmith[Arrowsmith.length] = createMarker(new GPoint(-88.63159943,40.44921112),"
Arrowsmith Elementary School
Po Box 8
Arrowsmith, IL 61722

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Arrowsmith Elementary School",'Arrowsmith=' + Arrowsmith.length); Bloomington[Bloomington.length] = createMarker(new GPoint(-88.99709320,40.48697281),"
Bent Elementary School
904 N Roosevelt Ave
Bloomington, IL 61701

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bent Elementary School",'Bloomington=' + Bloomington.length); Bloomington[Bloomington.length] = createMarker(new GPoint(-88.95629883,40.48849869),"
Bloomington Area Voc Center
Po Box 5187
Bloomington, IL 61702

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bloomington Area Voc Center",'Bloomington=' + Bloomington.length); Bloomington[Bloomington.length] = createMarker(new GPoint(-88.97398376,40.48509216),"
Bloomington High School
1202 E Locust St
Bloomington, IL 61701

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bloomington High School",'Bloomington=' + Bloomington.length); Bloomington[Bloomington.length] = createMarker(new GPoint(-88.97772217,40.48661041),"
Bloomington Junior High School
901 N Colton Ave
Bloomington, IL 61701

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Bloomington Junior High School",'Bloomington=' + Bloomington.length); Bloomington[Bloomington.length] = createMarker(new GPoint(-88.99114990,40.44173813),"
Brigham Elementary School
201 Brigham Sch Rd
Bloomington, IL 61704

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Brigham Elementary School",'Bloomington=' + Bloomington.length); Carlock[Carlock.length] = createMarker(new GPoint(-89.11150360,40.60449982),"
Carlock Elementary School
Po Box 190
Carlock, IL 61725

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Carlock Elementary School",'Carlock=' + Carlock.length); Chenoa[Chenoa.length] = createMarker(new GPoint(-88.71601868,40.74353409),"
Chenoa Elementary School
700 S Division St
Chenoa, IL 61726

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Chenoa Elementary School",'Chenoa=' + Chenoa.length); Chenoa[Chenoa.length] = createMarker(new GPoint(-88.71868134,40.73766327),"
Chenoa High School
700 S Division St
Chenoa, IL 61726

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Chenoa High School",'Chenoa=' + Chenoa.length); Normal[Normal.length] = createMarker(new GPoint(-88.98010254,40.50838089),"
Chiddix Junior High School
300 S Walnut St
Normal, IL 61761

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Chiddix Junior High School",'Normal=' + Normal.length); Normal[Normal.length] = createMarker(new GPoint(-88.97363281,40.50485611),"
Colene Hoose Elementary School
600 Grandview Dr
Normal, IL 61761

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Colene Hoose Elementary School",'Normal=' + Normal.length); Colfax[Colfax.length] = createMarker(new GPoint(-88.62779999,40.57279968),"
Colfax Elementary School
300 S Harrison
Colfax, IL 61728

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Colfax Elementary School",'Colfax=' + Colfax.length); Danvers[Danvers.length] = createMarker(new GPoint(-89.17156982,40.53083038),"
Danvers Elementary School
205 N State
Danvers, IL 61732

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Danvers Elementary School",'Danvers=' + Danvers.length); Normal[Normal.length] = createMarker(new GPoint(-88.97999573,40.51531219),"
Eugene Field Elementary School
412 E Cypress St
Normal, IL 61761

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Eugene Field Elementary School",'Normal=' + Normal.length); Normal[Normal.length] = createMarker(new GPoint(-88.99353790,40.52506638),"
Fairview Elementary School
416 Fairview St
Normal, IL 61761

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fairview Elementary School",'Normal=' + Normal.length); Bloomington[Bloomington.length] = createMarker(new GPoint(-89.05410004,40.43946457),"
Fox Creek Elementary School
3910 Fox Creek Rd
Bloomington, IL 61704

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fox Creek Elementary School",'Bloomington=' + Bloomington.length); Normal[Normal.length] = createMarker(new GPoint(-88.98780823,40.49982452),"
Glenn Elementary School
306 Glenn Ave
Normal, IL 61761

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Glenn Elementary School",'Normal=' + Normal.length); Gridley[Gridley.length] = createMarker(new GPoint(-88.88700104,40.74089813),"
Gridley Elementary School
309 Mclean St
Gridley, IL 61744

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Gridley Elementary School",'Gridley=' + Gridley.length); Gridley[Gridley.length] = createMarker(new GPoint(-88.88700104,40.74089813),"
Gridley High School
403 Mclean St
Gridley, IL 61744

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Gridley High School",'Gridley=' + Gridley.length); Gridley[Gridley.length] = createMarker(new GPoint(-88.88700104,40.74089813),"
Gridley Junior High School
Bx 430 4th Mclean
Gridley, IL 61744

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Gridley Junior High School",'Gridley=' + Gridley.length); Normal[Normal.length] = createMarker(new GPoint(-88.92488098,40.52687454),"
Grove Elementary School
1101 N Airport Rd
Normal, IL 61761

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Grove Elementary School",'Normal=' + Normal.length); Heyworth[Heyworth.length] = createMarker(new GPoint(-88.97450256,40.32920074),"
Heyworth Elementary School
100 S Joselyn St
Heyworth, IL 61745

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Heyworth Elementary School",'Heyworth=' + Heyworth.length); Heyworth[Heyworth.length] = createMarker(new GPoint(-88.97450256,40.32920074),"
Heyworth Junior Senior High School
308 W Cleveland
Heyworth, IL 61745

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Heyworth Junior Senior High School",'Heyworth=' + Heyworth.length); Hudson[Hudson.length] = createMarker(new GPoint(-88.98957825,40.60491180),"
Hudson Elementary School
205 S Mclean St
Hudson, IL 61748

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hudson Elementary School",'Hudson=' + Hudson.length); Bloomington[Bloomington.length] = createMarker(new GPoint(-89.00031281,40.47486115),"
Irving Elementary School
602 W Jackson St
Bloomington, IL 61701

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Irving Elementary School",'Bloomington=' + Bloomington.length); Normal[Normal.length] = createMarker(new GPoint(-88.99655000,40.50892300),"
Kingsley Jr High School
303 Kingsley St
Normal, IL 61761

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Kingsley Jr High School",'Normal=' + Normal.length); Le_Roy[Le_Roy.length] = createMarker(new GPoint(-88.75611877,40.35376740),"
Leroy Elementary School
805 N Barnett St
Le Roy, IL 61752

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Leroy Elementary School",'Le_Roy=' + Le_Roy.length); Le_Roy[Le_Roy.length] = createMarker(new GPoint(-88.75708008,40.34706116),"
Leroy High School
505 E Center St
Le Roy, IL 61752

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Leroy High School",'Le_Roy=' + Le_Roy.length); Le_Roy[Le_Roy.length] = createMarker(new GPoint(-88.75708008,40.34706116),"
Leroy Junior High School
505 E Center St
Le Roy, IL 61752

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Leroy Junior High School",'Le_Roy=' + Le_Roy.length); Lexington[Lexington.length] = createMarker(new GPoint(-88.78324890,40.64062119),"
Lexington Elementary School
Po Box 67
Lexington, IL 61753

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lexington Elementary School",'Lexington=' + Lexington.length); Lexington[Lexington.length] = createMarker(new GPoint(-88.78324890,40.64062119),"
Lexington High School
Po Box 67
Lexington, IL 61753

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lexington High School",'Lexington=' + Lexington.length); Lexington[Lexington.length] = createMarker(new GPoint(-88.78324890,40.64062119),"
Lexington Junior High School
Box 67 Wallcherry
Lexington, IL 61753

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Lexington Junior High School",'Lexington=' + Lexington.length); Mclean[Mclean.length] = createMarker(new GPoint(-89.17500305,40.31200027),"
Mclean/waynesville Elementary School
107 S West St
Mclean, IL 61754

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mclean/waynesville Elementary School",'Mclean=' + Mclean.length); Normal[Normal.length] = createMarker(new GPoint(-88.99655151,40.50936890),"
Normal Community High School
3900 E Raab Rd
Normal, IL 61761

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Normal Community High School",'Normal=' + Normal.length); Normal[Normal.length] = createMarker(new GPoint(-89.02153015,40.52120972),"
Normal Community West High School
501 N Parkside Rd
Normal, IL 61761

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Normal Community West High School",'Normal=' + Normal.length); Bloomington[Bloomington.length] = createMarker(new GPoint(-88.94171906,40.51053619),"
Northpoint Elementary School
2602 E College Ave
Bloomington, IL 61704

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Northpoint Elementary School",'Bloomington=' + Bloomington.length); Normal[Normal.length] = createMarker(new GPoint(-89.00166321,40.50534439),"
Oakdale Elementary School
601 S Adelaide St
Normal, IL 61761

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Oakdale Elementary School",'Normal=' + Normal.length); Bloomington[Bloomington.length] = createMarker(new GPoint(-88.97045898,40.47376251),"
Oakland Elementary School
1605 E Oakland Ave
Bloomington, IL 61701

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Oakland Elementary School",'Bloomington=' + Bloomington.length); Stanford[Stanford.length] = createMarker(new GPoint(-89.24568176,40.39630127),"
Olympia High School
7832 N 100 East Rd
Stanford, IL 61774

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Olympia High School",'Stanford=' + Stanford.length); Stanford[Stanford.length] = createMarker(new GPoint(-89.24767303,40.39862061),"
Olympia Middle School
911 E 800 North Rd
Stanford, IL 61774

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Olympia Middle School",'Stanford=' + Stanford.length); Normal[Normal.length] = createMarker(new GPoint(-89.02487946,40.50983810),"
Parkside Elementary School
1900 W College Ave
Normal, IL 61761

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Parkside Elementary School",'Normal=' + Normal.length); Normal[Normal.length] = createMarker(new GPoint(-89.02137756,40.51084518),"
Parkside Junior High School
101 N Parkside Rd
Normal, IL 61761

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Parkside Junior High School",'Normal=' + Normal.length); Bloomington[Bloomington.length] = createMarker(new GPoint(-89.02871704,40.45105362),"
Pepper Ridge Elementary School
2602 Danbury Dr
Bloomington, IL 61704

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pepper Ridge Elementary School",'Bloomington=' + Bloomington.length); Normal[Normal.length] = createMarker(new GPoint(-88.98449707,40.53170013),"
Prairieland Elementary School
1300 E Raab Rd
Normal, IL 61761

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Prairieland Elementary School",'Normal=' + Normal.length); Bloomington[Bloomington.length] = createMarker(new GPoint(-88.99691010,40.47936249),"
Regional Alternative School
408 W Washington
Bloomington, IL 61701

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Regional Alternative School",'Bloomington=' + Bloomington.length); Colfax[Colfax.length] = createMarker(new GPoint(-88.62779999,40.57279968),"
Ridgeview High School
202 E Wood
Colfax, IL 61728

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ridgeview High School",'Colfax=' + Colfax.length); Colfax[Colfax.length] = createMarker(new GPoint(-88.61283400,40.56569500),"
Ridgeview Jr High School
202 E Wood
Colfax, IL 61728

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Ridgeview Jr High School",'Colfax=' + Colfax.length); Bloomington[Bloomington.length] = createMarker(new GPoint(-88.99691010,40.47936249),"
Safe School Program
408 W Washington
Bloomington, IL 61701

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Safe School Program",'Bloomington=' + Bloomington.length); Bloomington[Bloomington.length] = createMarker(new GPoint(-89.01390839,40.47616196),"
Sarah A Raymond School Of Early Educ
1402 W Olive St
Bloomington, IL 61701

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sarah A Raymond School Of Early Educ",'Bloomington=' + Bloomington.length); Bloomington[Bloomington.length] = createMarker(new GPoint(-89.00973511,40.48633575),"
Sheridan Elementary School
1403 W Walnut St
Bloomington, IL 61701

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sheridan Elementary School",'Bloomington=' + Bloomington.length); Stanford[Stanford.length] = createMarker(new GPoint(-89.20690155,40.43899918),"
Stanford Grade School
Box 236 Grant St
Stanford, IL 61774

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Stanford Grade School",'Stanford=' + Stanford.length); Bloomington[Bloomington.length] = createMarker(new GPoint(-88.94615936,40.49338150),"
Stevenson Elementary School
2106 Arrowhead Dr
Bloomington, IL 61704

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Stevenson Elementary School",'Bloomington=' + Bloomington.length); Normal[Normal.length] = createMarker(new GPoint(-88.96053314,40.51284790),"
Sugar Creek Elementary School
200 N Towanda Ave
Normal, IL 61761

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sugar Creek Elementary School",'Normal=' + Normal.length); Normal[Normal.length] = createMarker(new GPoint(-88.98986053,40.51383972),"
Thomas Metcalf School
Isu Campus Box 7000
Normal, IL 61790

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Thomas Metcalf School",'Normal=' + Normal.length); Towanda[Towanda.length] = createMarker(new GPoint(-88.89279938,40.55910110),"
Towanda Elementary School
Box 260
Towanda, IL 61776

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Towanda Elementary School",'Towanda=' + Towanda.length); Downs[Downs.length] = createMarker(new GPoint(-88.86630249,40.38510132),"
Tri-valley Elementary School
409 E Washington St
Downs, IL 61736

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Tri-valley Elementary School",'Downs=' + Downs.length); Downs[Downs.length] = createMarker(new GPoint(-88.86630249,40.38510132),"
Tri-valley High School
503 E Washington St
Downs, IL 61736

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Tri-valley High School",'Downs=' + Downs.length); Downs[Downs.length] = createMarker(new GPoint(-88.86630249,40.38510132),"
Tri-valley Middle School
505 E Washington St
Downs, IL 61736

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Tri-valley Middle School",'Downs=' + Downs.length); Normal[Normal.length] = createMarker(new GPoint(-88.98986053,40.51383972),"
University High School
Isu Campus Box 7100
Normal, IL 61790

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("University High School",'Normal=' + Normal.length); Bloomington[Bloomington.length] = createMarker(new GPoint(-88.97530365,40.47976303),"
Washington Elementary School
1201 E Washington St
Bloomington, IL 61701

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Washington Elementary School",'Bloomington=' + Bloomington.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(Arrowsmith); map.removeOverlays(Bloomington); map.removeOverlays(Carlock); map.removeOverlays(Chenoa); map.removeOverlays(Colfax); map.removeOverlays(Danvers); map.removeOverlays(Downs); map.removeOverlays(Gridley); map.removeOverlays(Heyworth); map.removeOverlays(Hudson); map.removeOverlays(Le_Roy); map.removeOverlays(Lexington); map.removeOverlays(Mclean); map.removeOverlays(Normal); map.removeOverlays(Stanford); map.removeOverlays(Towanda); 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(Arrowsmith);map.removeOverlays(Arrowsmith); map.removeOverlays(Bloomington); map.removeOverlays(Carlock); map.removeOverlays(Chenoa); map.removeOverlays(Colfax); map.removeOverlays(Danvers); map.removeOverlays(Downs); map.removeOverlays(Gridley); map.removeOverlays(Heyworth); map.removeOverlays(Hudson); map.removeOverlays(Le_Roy); map.removeOverlays(Lexington); map.removeOverlays(Mclean); map.removeOverlays(Normal); map.removeOverlays(Stanford); map.removeOverlays(Towanda); map.addOverlays(Arrowsmith); centerByArray(Arrowsmith, false, false); cntMarker += Arrowsmith.length; map.addOverlays(Bloomington); centerByArray(Bloomington, false, false); cntMarker += Bloomington.length; map.addOverlays(Carlock); centerByArray(Carlock, false, false); cntMarker += Carlock.length; map.addOverlays(Chenoa); centerByArray(Chenoa, false, false); cntMarker += Chenoa.length; map.addOverlays(Colfax); centerByArray(Colfax, false, false); cntMarker += Colfax.length; map.addOverlays(Danvers); centerByArray(Danvers, false, false); cntMarker += Danvers.length; map.addOverlays(Downs); centerByArray(Downs, false, false); cntMarker += Downs.length; map.addOverlays(Gridley); centerByArray(Gridley, false, false); cntMarker += Gridley.length; map.addOverlays(Heyworth); centerByArray(Heyworth, false, false); cntMarker += Heyworth.length; map.addOverlays(Hudson); centerByArray(Hudson, false, false); cntMarker += Hudson.length; map.addOverlays(Le_Roy); centerByArray(Le_Roy, false, false); cntMarker += Le_Roy.length; map.addOverlays(Lexington); centerByArray(Lexington, false, false); cntMarker += Lexington.length; map.addOverlays(Mclean); centerByArray(Mclean, false, false); cntMarker += Mclean.length; map.addOverlays(Normal); centerByArray(Normal, false, false); cntMarker += Normal.length; map.addOverlays(Stanford); centerByArray(Stanford, false, false); cntMarker += Stanford.length; map.addOverlays(Towanda); centerByArray(Towanda, false, false); cntMarker += Towanda.length; centerByArray(Arrowsmith,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'); } }