function addMarkers() { mySelect = document.getElementById('selection'); Nampa = [];Caldwell = [];Greenleaf = [];Wilder = [];Parma = [];Melba = [];Middleton = [];Notus = [];mySelect.options[mySelect.options.length] = new Option("Caldwell schools",'all=Caldwell'); mySelect.options[mySelect.options.length] = new Option("Greenleaf schools",'all=Greenleaf'); mySelect.options[mySelect.options.length] = new Option("Melba schools",'all=Melba'); mySelect.options[mySelect.options.length] = new Option("Middleton schools",'all=Middleton'); mySelect.options[mySelect.options.length] = new Option("Nampa schools",'all=Nampa'); mySelect.options[mySelect.options.length] = new Option("Notus schools",'all=Notus'); mySelect.options[mySelect.options.length] = new Option("Parma schools",'all=Parma'); mySelect.options[mySelect.options.length] = new Option("Wilder schools",'all=Wilder'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Nampa[Nampa.length] = createMarker(new GPoint(-116.56077576,43.57633209),"
Alpha I Alternative School
312 13th Ave South
Nampa, ID 83686

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Alpha I Alternative School",'Nampa=' + Nampa.length); Nampa[Nampa.length] = createMarker(new GPoint(-116.53105927,43.61243820),"
Birch Elementary School
6900 Birch Lane
Nampa, ID 83687

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Birch Elementary School",'Nampa=' + Nampa.length); Caldwell[Caldwell.length] = createMarker(new GPoint(-116.67298126,43.64015579),"
Caldwell Senior High School
3401 S Indiana
Caldwell, ID 83605

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Caldwell Senior High School",'Caldwell=' + Caldwell.length); Caldwell[Caldwell.length] = createMarker(new GPoint(-116.69797516,43.64458466),"
Canyon Springs Alt High School
107 Poplar
Caldwell, ID 83605

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Canyon Springs Alt High School",'Caldwell=' + Caldwell.length); Nampa[Nampa.length] = createMarker(new GPoint(-116.58351135,43.56315231),"
Centennial Elementary School
522 Mason Lane
Nampa, ID 83686

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Centennial Elementary School",'Nampa=' + Nampa.length); Caldwell[Caldwell.length] = createMarker(new GPoint(-116.77308655,43.68878937),"
Centerpoint Alternative High School
21985 Dixie River Road
Caldwell, ID 83607

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Centerpoint Alternative High School",'Caldwell=' + Caldwell.length); Caldwell[Caldwell.length] = createMarker(new GPoint(-116.66281891,43.60709763),"
Central Canyon Elementary School
16437 Florida Ave
Caldwell, ID 83607

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Central Canyon Elementary School",'Caldwell=' + Caldwell.length); Nampa[Nampa.length] = createMarker(new GPoint(-116.56148529,43.57402802),"
Central Elementary School
1415 5th Street South
Nampa, ID 83651

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Central Elementary School",'Nampa=' + Nampa.length); Greenleaf[Greenleaf.length] = createMarker(new GPoint(-116.81541443,43.67055893),"
Cossa
20567 Whittier Drive
Greenleaf, ID 83626

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cossa",'Greenleaf=' + Greenleaf.length); Nampa[Nampa.length] = createMarker(new GPoint(-116.57324219,43.64649582),"
East Canyon Elementary School
18408 Northside Blvd
Nampa, ID 83687

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("East Canyon Elementary School",'Nampa=' + Nampa.length); Nampa[Nampa.length] = createMarker(new GPoint(-116.51965000,43.54687300),"
East Valley Middle School
4085 E Greenhurst Rd
Nampa, ID 83686

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("East Valley Middle School",'Nampa=' + Nampa.length); Nampa[Nampa.length] = createMarker(new GPoint(-116.53818512,43.55268097),"
Greenhurst Elementary School
1701 Discovery Place
Nampa, ID 83686

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Greenhurst Elementary School",'Nampa=' + Nampa.length); Wilder[Wilder.length] = createMarker(new GPoint(-116.91010284,43.65750122),"
Holmes Elementary School
Po Box 488
Wilder, ID 83676

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Holmes Elementary School",'Wilder=' + Wilder.length); Nampa[Nampa.length] = createMarker(new GPoint(-116.55854700,43.58128000),"
Idaho Arts Charter School
P O Box 326
Nampa, ID 83653

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Idaho Arts Charter School",'Nampa=' + Nampa.length); Nampa[Nampa.length] = createMarker(new GPoint(-116.57463837,43.56138229),"
Idaho Center Of Advanced Technology
203 Lake Lowell Ave
Nampa, ID 83686

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Idaho Center Of Advanced Technology",'Nampa=' + Nampa.length); Nampa[Nampa.length] = createMarker(new GPoint(-116.58359528,43.55447006),"
Iowa Elementary School
626 Iowa
Nampa, ID 83686

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Iowa Elementary School",'Nampa=' + Nampa.length); Caldwell[Caldwell.length] = createMarker(new GPoint(-116.69300842,43.64085007),"
Jefferson Junior High School
3311 South 10th Avenue
Caldwell, ID 83605

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Jefferson Junior High School",'Caldwell=' + Caldwell.length); Caldwell[Caldwell.length] = createMarker(new GPoint(-116.68808000,43.62602500),"
Lewis And Clark Elementary School
1102 E Laster Street
Caldwell, ID 83607

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lewis And Clark Elementary School",'Caldwell=' + Caldwell.length); Nampa[Nampa.length] = createMarker(new GPoint(-116.57350159,43.56769943),"
Liberty Charter School
Po Box 3454
Nampa, ID 83651

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Liberty Charter School",'Nampa=' + Nampa.length); Nampa[Nampa.length] = createMarker(new GPoint(-116.59359741,43.58670044),"
Lincoln Elementary School
94 N Canyon St
Nampa, ID 83651

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lincoln Elementary School",'Nampa=' + Nampa.length); Caldwell[Caldwell.length] = createMarker(new GPoint(-116.68954468,43.65874481),"
Lincoln Elementary School
1200 Grant Street
Caldwell, ID 83605

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lincoln Elementary School",'Caldwell=' + Caldwell.length); Parma[Parma.length] = createMarker(new GPoint(-116.93945312,43.78883743),"
Maxine Johnson Elementary School
607 E Mc Connell St
Parma, ID 83660

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Maxine Johnson Elementary School",'Parma=' + Parma.length); Melba[Melba.length] = createMarker(new GPoint(-116.54630280,43.37649918),"
Melba Elementary School
Po Box 185
Melba, ID 83641

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Melba Elementary School",'Melba=' + Melba.length); Melba[Melba.length] = createMarker(new GPoint(-116.54630280,43.37649918),"
Melba Middle School
Po Box 185
Melba, ID 83641

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Melba Middle School",'Melba=' + Melba.length); Melba[Melba.length] = createMarker(new GPoint(-116.54630280,43.37649918),"
Melba Middle/high School
Po Box 185
Melba, ID 83641

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Melba Middle/high School",'Melba=' + Melba.length); Middleton[Middleton.length] = createMarker(new GPoint(-116.63278961,43.71120071),"
Middleton Heights Elementary School
611 N Highland
Middleton, ID 83644

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Middleton Heights Elementary School",'Middleton=' + Middleton.length); Middleton[Middleton.length] = createMarker(new GPoint(-116.62982178,43.70626450),"
Middleton High School
511 W Main Street
Middleton, ID 83644

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Middleton High School",'Middleton=' + Middleton.length); Middleton[Middleton.length] = createMarker(new GPoint(-116.62828064,43.70626450),"
Middleton Middle School
200 S 4th Ave West
Middleton, ID 83644

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Middleton Middle School",'Middleton=' + Middleton.length); Middleton[Middleton.length] = createMarker(new GPoint(-116.61274719,43.71024704),"
Middleton Mill Creek Elementary School
500 N Middleton Rd
Middleton, ID 83644

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Middleton Mill Creek Elementary School",'Middleton=' + Middleton.length); Middleton[Middleton.length] = createMarker(new GPoint(-116.62982178,43.70626450),"
Middleton Transition School
511 W Main St
Middleton, ID 83644

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Middleton Transition School",'Middleton=' + Middleton.length); Nampa[Nampa.length] = createMarker(new GPoint(-116.51352692,43.60116577),"
Nampa Alternative High School
3201 Ridgecrest Dr
Nampa, ID 83687

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Nampa Alternative High School",'Nampa=' + Nampa.length); Nampa[Nampa.length] = createMarker(new GPoint(-116.57350159,43.56769943),"
Nampa Charter School
Post Office Box 1901
Nampa, ID 83686

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Nampa Charter School",'Nampa=' + Nampa.length); Nampa[Nampa.length] = createMarker(new GPoint(-116.61270905,43.49478912),"
Nampa Teen Parent Alternative High School
8444 Dearborne Road
Nampa, ID 83686

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Nampa Teen Parent Alternative High School",'Nampa=' + Nampa.length); Nampa[Nampa.length] = createMarker(new GPoint(-116.56716300,43.55720300),"
Northwest Childrens Home (alt) High School
504 East Florida
Nampa, ID 83686

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Northwest Childrens Home (alt) High School",'Nampa=' + Nampa.length); Notus[Notus.length] = createMarker(new GPoint(-116.80030060,43.72620010),"
Notus Elementary School
Po Box 256
Notus, ID 83656

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Notus Elementary School",'Notus=' + Notus.length); Notus[Notus.length] = createMarker(new GPoint(-116.80030060,43.72620010),"
Notus Junior Senior High School
Po Box 256
Notus, ID 83656

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Notus Junior Senior High School",'Notus=' + Notus.length); Nampa[Nampa.length] = createMarker(new GPoint(-116.60115814,43.55432129),"
Owyhee Elementary School
2300 W Iowa
Nampa, ID 83686

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Owyhee Elementary School",'Nampa=' + Nampa.length); Nampa[Nampa.length] = createMarker(new GPoint(-116.53039551,43.57048035),"
Park Ridge Elementary School
3313 Parkridge Drive
Nampa, ID 83687

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Park Ridge Elementary School",'Nampa=' + Nampa.length); Nampa[Nampa.length] = createMarker(new GPoint(-116.54934692,43.58254623),"
Parkview Early Childhood Centr Elementary School
609 15th Avenue North
Nampa, ID 83651

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Parkview Early Childhood Centr Elementary School",'Nampa=' + Nampa.length); Parma[Parma.length] = createMarker(new GPoint(-116.93701172,43.78955460),"
Parma High School
908 N 8th St
Parma, ID 83660

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Parma High School",'Parma=' + Parma.length); Parma[Parma.length] = createMarker(new GPoint(-116.93531036,43.78883743),"
Parma Middle School
905 E Mc Connell St
Parma, ID 83660

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Parma Middle School",'Parma=' + Parma.length); Caldwell[Caldwell.length] = createMarker(new GPoint(-116.69285583,43.74663925),"
Purple Sage Elementary School
25709 El Paso Road
Caldwell, ID 83607

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Purple Sage Elementary School",'Caldwell=' + Caldwell.length); Nampa[Nampa.length] = createMarker(new GPoint(-116.53270721,43.53616333),"
Reagan Elementary School
3400 Southside Blvd
Nampa, ID 83686

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Reagan Elementary School",'Nampa=' + Nampa.length); Nampa[Nampa.length] = createMarker(new GPoint(-116.60409546,43.56855774),"
Roosevelt Elementary School
1901 W Roosevelt
Nampa, ID 83686

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Roosevelt Elementary School",'Nampa=' + Nampa.length); Caldwell[Caldwell.length] = createMarker(new GPoint(-116.67810822,43.68410873),"
Sacajawea Elementary School
1710 N Illinois
Caldwell, ID 83605

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sacajawea Elementary School",'Caldwell=' + Caldwell.length); Caldwell[Caldwell.length] = createMarker(new GPoint(-116.60326900,43.63520300),"
Sage Valley Intermediate School
18070 Santa Ana Avenue
Caldwell, ID 83605

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Sage Valley Intermediate School",'Caldwell=' + Caldwell.length); Nampa[Nampa.length] = createMarker(new GPoint(-116.55246735,43.56496429),"
Sherman Elementary School
1521 E Sherman Avenue
Nampa, ID 83686

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sherman Elementary School",'Nampa=' + Nampa.length); Nampa[Nampa.length] = createMarker(new GPoint(-116.55600739,43.54686356),"
Skyview High School
1303 E Greenhurst Rd
Nampa, ID 83686

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Skyview High School",'Nampa=' + Nampa.length); Nampa[Nampa.length] = createMarker(new GPoint(-116.54772949,43.58778763),"
Snake River Elementary School
500 Stampede Drive
Nampa, ID 83687

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Snake River Elementary School",'Nampa=' + Nampa.length); Nampa[Nampa.length] = createMarker(new GPoint(-116.57495880,43.54696274),"
South Middle School
229 West Greenhurst Rd
Nampa, ID 83686

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("South Middle School",'Nampa=' + Nampa.length); Nampa[Nampa.length] = createMarker(new GPoint(-116.56808472,43.52580261),"
Sunny Ridge Elementary School
506 Fletcher Drive
Nampa, ID 83686

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sunny Ridge Elementary School",'Nampa=' + Nampa.length); Caldwell[Caldwell.length] = createMarker(new GPoint(-116.68537140,43.64695358),"
Syringa Middle School
1100 Willow Street
Caldwell, ID 83605

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Syringa Middle School",'Caldwell=' + Caldwell.length); Caldwell[Caldwell.length] = createMarker(new GPoint(-116.64719200,43.65831200),"
Thomas Jefferson Charter
4112 Sky Way
Caldwell, ID 83605

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Thomas Jefferson Charter",'Caldwell=' + Caldwell.length); Caldwell[Caldwell.length] = createMarker(new GPoint(-116.67789459,43.61860275),"
Vallivue High School
1407 Homedale Rd
Caldwell, ID 83607

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Vallivue High School",'Caldwell=' + Caldwell.length); Caldwell[Caldwell.length] = createMarker(new GPoint(-116.69292450,43.60959625),"
Vallivue Middle School
16412 S 10th Avenue
Caldwell, ID 83607

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Vallivue Middle School",'Caldwell=' + Caldwell.length); Caldwell[Caldwell.length] = createMarker(new GPoint(-116.67970276,43.66710281),"
Van Buren Elementary School
516 North 11th Avenue
Caldwell, ID 83605

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Van Buren Elementary School",'Caldwell=' + Caldwell.length); Nampa[Nampa.length] = createMarker(new GPoint(-116.60974000,43.60997300),"
Visions (alt) High School
2407 Caldwell Boulevard
Nampa, ID 83686

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Visions (alt) High School",'Nampa=' + Nampa.length); Caldwell[Caldwell.length] = createMarker(new GPoint(-116.68487549,43.65702820),"
Washington Elementary School
1500 Fillmore Street
Caldwell, ID 83605

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Washington Elementary School",'Caldwell=' + Caldwell.length); Caldwell[Caldwell.length] = createMarker(new GPoint(-116.78336334,43.63267136),"
West Canyon Elementary School
19548 Ustick Road
Caldwell, ID 83607

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("West Canyon Elementary School",'Caldwell=' + Caldwell.length); Nampa[Nampa.length] = createMarker(new GPoint(-116.59279633,43.57427216),"
West Middle School
28 S Midland Blvd
Nampa, ID 83651

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("West Middle School",'Nampa=' + Nampa.length); Wilder[Wilder.length] = createMarker(new GPoint(-116.91010284,43.65750122),"
Wilder Middle/high School
Po Box 488
Wilder, ID 83676

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wilder Middle/high School",'Wilder=' + Wilder.length); Nampa[Nampa.length] = createMarker(new GPoint(-116.60223200,43.58318600),"
Willow Creek Elementary School
1580 Smith Avenue
Nampa, ID 83651

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Willow Creek Elementary School",'Nampa=' + Nampa.length); Caldwell[Caldwell.length] = createMarker(new GPoint(-116.69394684,43.64765167),"
Wilson Elementary School
400 E Linden
Caldwell, ID 83605

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wilson Elementary School",'Caldwell=' + Caldwell.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(Caldwell); map.removeOverlays(Greenleaf); map.removeOverlays(Melba); map.removeOverlays(Middleton); map.removeOverlays(Nampa); map.removeOverlays(Notus); map.removeOverlays(Parma); map.removeOverlays(Wilder); 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(Nampa);map.removeOverlays(Caldwell); map.removeOverlays(Greenleaf); map.removeOverlays(Melba); map.removeOverlays(Middleton); map.removeOverlays(Nampa); map.removeOverlays(Notus); map.removeOverlays(Parma); map.removeOverlays(Wilder); map.addOverlays(Caldwell); centerByArray(Caldwell, false, false); cntMarker += Caldwell.length; map.addOverlays(Greenleaf); centerByArray(Greenleaf, false, false); cntMarker += Greenleaf.length; map.addOverlays(Melba); centerByArray(Melba, false, false); cntMarker += Melba.length; map.addOverlays(Middleton); centerByArray(Middleton, false, false); cntMarker += Middleton.length; map.addOverlays(Nampa); centerByArray(Nampa, false, false); cntMarker += Nampa.length; map.addOverlays(Notus); centerByArray(Notus, false, false); cntMarker += Notus.length; map.addOverlays(Parma); centerByArray(Parma, false, false); cntMarker += Parma.length; map.addOverlays(Wilder); centerByArray(Wilder, false, false); cntMarker += Wilder.length; centerByArray(Nampa,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'); } }