function addMarkers() { mySelect = document.getElementById('selection'); Yuma = [];Wellton = [];San_Luis = [];Dateland = [];Somerton = [];Roll = [];Tucson = [];mySelect.options[mySelect.options.length] = new Option("Dateland schools",'all=Dateland'); mySelect.options[mySelect.options.length] = new Option("Roll schools",'all=Roll'); mySelect.options[mySelect.options.length] = new Option("San Luis schools",'all=San_Luis'); mySelect.options[mySelect.options.length] = new Option("Somerton schools",'all=Somerton'); mySelect.options[mySelect.options.length] = new Option("Tucson schools",'all=Tucson'); mySelect.options[mySelect.options.length] = new Option("Wellton schools",'all=Wellton'); mySelect.options[mySelect.options.length] = new Option("Yuma schools",'all=Yuma'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Yuma[Yuma.length] = createMarker(new GPoint(-114.62933350,32.69836426),"
Alice Byrne Elementary School
811 W. 16th Street
Yuma, AZ 85364

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Alice Byrne Elementary School",'Yuma=' + Yuma.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.64900208,32.70190048),"
Amerischools Academy - Yuma
2098 S. 3rd Ave.
Yuma, AZ 85364

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Amerischools Academy - Yuma",'Yuma=' + Yuma.length); Wellton[Wellton.length] = createMarker(new GPoint(-114.02226257,32.68622208),"
Antelope Union High School
9168 South Ave 36 East
Wellton, AZ 85356

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Antelope Union High School",'Wellton=' + Wellton.length); San_Luis[San_Luis.length] = createMarker(new GPoint(-114.77760315,32.49399948),"
Arizona Desert Elementary School
P.o. Box 6870
San Luis, AZ 85349

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Arizona Desert Elementary School",'San_Luis=' + San_Luis.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.62390137,32.68700027),"
Aspc-yuma
Po Box 4279
Yuma, AZ 85366

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Aspc-yuma",'Yuma=' + Yuma.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.65274048,32.67690659),"
Az-tec High School
2330 W. 28th Street
Yuma, AZ 85364

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Az-tec High School",'Yuma=' + Yuma.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.65013885,32.67690277),"
Az-tec High School (charter)
2795 S. Avenue B
Yuma, AZ 85364

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Az-tec High School (charter)",'Yuma=' + Yuma.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.61583710,32.68503952),"
C W Mcgraw Elementary School
2345 S Arizona Ave
Yuma, AZ 85364

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("C W Mcgraw Elementary School",'Yuma=' + Yuma.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.62464400,32.69855800),"
Carpe Diem Academy
P.o. Box 6502
Yuma, AZ 85366

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Carpe Diem Academy",'Yuma=' + Yuma.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.62458038,32.72521973),"
Castle Dome Middle School
2353 S. Otondo Drive
Yuma, AZ 85365

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Castle Dome Middle School",'Yuma=' + Yuma.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.65290833,32.69133759),"
Centennial Middle School
2650 W. 20th Street
Yuma, AZ 85364

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Centennial Middle School",'Yuma=' + Yuma.length); San_Luis[San_Luis.length] = createMarker(new GPoint(-114.79183960,32.50757980),"
Cesar Chavez Elementary School
P.o. Box 6870
San Luis, AZ 85349

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cesar Chavez Elementary School",'San_Luis=' + San_Luis.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.64430237,32.72798157),"
Cibola High School
4100 W 20th St
Yuma, AZ 85364

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cibola High School",'Yuma=' + Yuma.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.62171936,32.66987991),"
Crane Middle School
4450 West 32nd Street
Yuma, AZ 85364

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Crane Middle School",'Yuma=' + Yuma.length); Dateland[Dateland.length] = createMarker(new GPoint(-113.46530151,32.83010101),"
Dateland Elementary School
1300 S. Ave. 64e, P. O. Box 3
Dateland, AZ 85333

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Dateland Elementary School",'Dateland=' + Dateland.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.50446320,32.68449783),"
Desert Mesa Elementary School
2350 S Avenue 7 12 Miles E.
Yuma, AZ 85365

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Desert Mesa Elementary School",'Yuma=' + Yuma.length); Somerton[Somerton.length] = createMarker(new GPoint(-114.71849823,32.56829834),"
Desert Sonora Elementary School
P. O. Box 3200
Somerton, AZ 85350

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Desert Sonora Elementary School",'Somerton=' + Somerton.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.61909485,32.67986298),"
Desert View Academy
P.o. Box 6502
Yuma, AZ 85366

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Desert View Academy",'Yuma=' + Yuma.length); San_Luis[San_Luis.length] = createMarker(new GPoint(-114.79183960,32.50757980),"
Desert View Elementary School
P.o. Box 6870
San Luis, AZ 85349

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Desert View Elementary School",'San_Luis=' + San_Luis.length); San_Luis[San_Luis.length] = createMarker(new GPoint(-111.95721600,32.08018300),"
Ed Pastor Elementary 4
Po Box 6870
San Luis, AZ 85349

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ed Pastor Elementary 4",'San_Luis=' + San_Luis.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.66639709,32.69863510),"
Educational Opportunity Center
3810 W 16 Street
Yuma, AZ 85364

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Educational Opportunity Center",'Yuma=' + Yuma.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.66639709,32.69863510),"
Educational Opportunity Center (charter)
3834 W. 16th Street
Yuma, AZ 85364

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Educational Opportunity Center (charter)",'Yuma=' + Yuma.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.62471008,32.71879959),"
Fourth Avenue Junior High School
450 S. 4th Avenue
Yuma, AZ 85364

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Fourth Avenue Junior High School",'Yuma=' + Yuma.length); San_Luis[San_Luis.length] = createMarker(new GPoint(-114.77760315,32.49399948),"
Gadsden Elementary School
P. O. Box 6870
San Luis, AZ 85349

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Gadsden Elementary School",'San_Luis=' + San_Luis.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.64602300,32.67443400),"
Gary A. Knox Elementary School
2926 South 21st Drive
Yuma, AZ 85364

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Gary A. Knox Elementary School",'Yuma=' + Yuma.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.63633728,32.71776199),"
George Washington Carver Elementary School
1347 W. 5th Street
Yuma, AZ 85364

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("George Washington Carver Elementary School",'Yuma=' + Yuma.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.61583710,32.68674469),"
Gila Vista Junior High School
2245 S. Arizona Ave
Yuma, AZ 85365

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Gila Vista Junior High School",'Yuma=' + Yuma.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.61325836,32.68783569),"
Gwyneth Ham Elementary School
840 E. 22nd Street
Yuma, AZ 85365

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Gwyneth Ham Elementary School",'Yuma=' + Yuma.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.66757965,32.69879532),"
H L Suverkrup Elementary School
1590 Ave C
Yuma, AZ 85364

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("H L Suverkrup Elementary School",'Yuma=' + Yuma.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.62390137,32.68700027),"
Harvest Preparatory Academy
P.o. Box 6826
Yuma, AZ 85366

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Harvest Preparatory Academy",'Yuma=' + Yuma.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.59423828,32.67870331),"
James B Rolle School
2711 S. Engler Avenue
Yuma, AZ 85365

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("James B Rolle School",'Yuma=' + Yuma.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.62458038,32.72521973),"
James D Price School
Yuma Proving Ground
Yuma, AZ 85365

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("James D Price School",'Yuma=' + Yuma.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.54779816,32.68510056),"
Juniper Tree Academy (charter)
2363 South Kennedy Lane
Yuma, AZ 85365

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Juniper Tree Academy (charter)",'Yuma=' + Yuma.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.63326263,32.67144775),"
Kofa High School
3100 Ave A
Yuma, AZ 85364

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kofa High School",'Yuma=' + Yuma.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.49562073,32.69268036),"
Mary A Otondo Elementary School
2251 Otondo Drive
Yuma, AZ 85365

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mary A Otondo Elementary School",'Yuma=' + Yuma.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.62476349,32.71803665),"
Mary E Post Elementary School
400 West 5th Street
Yuma, AZ 85364

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Mary E Post Elementary School",'Yuma=' + Yuma.length); Roll[Roll.length] = createMarker(new GPoint(-113.97069550,32.75198364),"
Mohawk Valley School
5151 S. Avenue 39e
Roll, AZ 85347

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mohawk Valley School",'Roll=' + Roll.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.63456726,32.70566177),"
O C Johnson School
1201w 12th Street
Yuma, AZ 85364

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("O C Johnson School",'Yuma=' + Yuma.length); Somerton[Somerton.length] = createMarker(new GPoint(-114.71849823,32.56829834),"
Orange Grove Elementary School
Po Box 3200
Somerton, AZ 85350

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Orange Grove Elementary School",'Somerton=' + Somerton.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.62982178,32.67442703),"
Palmcroft Elementary School
901 Palmcroft Drive
Yuma, AZ 85364

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Palmcroft Elementary School",'Yuma=' + Yuma.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.64566040,32.71596146),"
Pecan Grove Elementary School
600 S. 21st Avenue
Yuma, AZ 85364

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pecan Grove Elementary School",'Yuma=' + Yuma.length); San_Luis[San_Luis.length] = createMarker(new GPoint(-114.79183960,32.50757980),"
Ppep Tec - Cesar Chavez Learning Center
1233 N. Main Street
San Luis, AZ 85349

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ppep Tec - Cesar Chavez Learning Center",'San_Luis=' + San_Luis.length); Tucson[Tucson.length] = createMarker(new GPoint(-114.71849823,32.56829834),"
Ppep Tec - Jose Yepez Learning Center
1840 E. Benson Hwy.
Tucson, AZ 85714

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ppep Tec - Jose Yepez Learning Center",'Tucson=' + Tucson.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.65529633,32.69106293),"
Pueblo Elementary School
2803 W 20th St
Yuma, AZ 85364

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pueblo Elementary School",'Yuma=' + Yuma.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.62915039,32.68644714),"
R Pete Woodard Junior High School
2250 8th Avenue
Yuma, AZ 85364

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("R Pete Woodard Junior High School",'Yuma=' + Yuma.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.66756439,32.71088791),"
Rancho Viejo Elementary School
1020 Avenue C
Yuma, AZ 85364

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Rancho Viejo Elementary School",'Yuma=' + Yuma.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.62155914,32.68403625),"
Ray Drysdale High School
200 W 24th Street
Yuma, AZ 85364

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ray Drysdale High School",'Yuma=' + Yuma.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.62155914,32.68403625),"
Ray Drysdale Middle School
200 W 24th Street
Yuma, AZ 85364

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ray Drysdale Middle School",'Yuma=' + Yuma.length); San_Luis[San_Luis.length] = createMarker(new GPoint(-111.95721600,32.08018300),"
Rio Colorado Elementary School
Po Box 6870
San Luis, AZ 85349

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Rio Colorado Elementary School",'San_Luis=' + San_Luis.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.46211500,32.67773200),"
Ron Watson Middle School
9851 E. 28th St.
Yuma, AZ 85365

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Ron Watson Middle School",'Yuma=' + Yuma.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.65913391,32.69850159),"
Ronald Reagan Fundamental School
3200 W 16th St
Yuma, AZ 85364

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ronald Reagan Fundamental School",'Yuma=' + Yuma.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.62636566,32.71803665),"
Roosevelt School
550 5th St
Yuma, AZ 85364

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Roosevelt School",'Yuma=' + Yuma.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.66749200,32.70532400),"
Salida Del Sol Elementary School
910 S. Ave. C
Yuma, AZ 85364

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Salida Del Sol Elementary School",'Yuma=' + Yuma.length); San_Luis[San_Luis.length] = createMarker(new GPoint(-114.79183960,32.50757980),"
San Luis High School
P. O. Box 7380
San Luis, AZ 85349

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("San Luis High School",'San_Luis=' + San_Luis.length); San_Luis[San_Luis.length] = createMarker(new GPoint(-111.95721600,32.08018300),"
San Luis Middle School
P.o. Box 6870
San Luis, AZ 85349

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("San Luis Middle School",'San_Luis=' + San_Luis.length); Somerton[Somerton.length] = createMarker(new GPoint(-114.71849823,32.56829834),"
Somerton Middle School
1011 N. Somerton Ave.
Somerton, AZ 85350

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Somerton Middle School",'Somerton=' + Somerton.length); San_Luis[San_Luis.length] = createMarker(new GPoint(-114.76099700,32.49556300),"
Southwest Jr. High School
963 N.8th Avenue
San Luis, AZ 85349

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Southwest Jr. High School",'San_Luis=' + San_Luis.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.38840900,32.67767800),"
Sunrise Elementary School
9943 East 28th Street
Yuma, AZ 85367

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sunrise Elementary School",'Yuma=' + Yuma.length); Somerton[Somerton.length] = createMarker(new GPoint(-114.71849823,32.56829834),"
Tierra Del Sol Elementary School
Po Box 3200
Somerton, AZ 85350

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Tierra Del Sol Elementary School",'Somerton=' + Somerton.length); Somerton[Somerton.length] = createMarker(new GPoint(-114.70978200,32.59665000),"
Valle Del Encanto Learning Center
P. O. Box 3200
Somerton, AZ 85350

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Valle Del Encanto Learning Center",'Somerton=' + Somerton.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.67617798,32.69096375),"
Valley Horizon Elementary School
4501 West 20th St
Yuma, AZ 85364

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Valley Horizon Elementary School",'Yuma=' + Yuma.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.62286377,32.68453217),"
Vista Alternative School
2350 Virginia Drive
Yuma, AZ 85364

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Vista Alternative School",'Yuma=' + Yuma.length); Wellton[Wellton.length] = createMarker(new GPoint(-114.19120026,32.77479935),"
Wellton Elementary School
P.o. Box 517
Wellton, AZ 85356

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wellton Elementary School",'Wellton=' + Wellton.length); Yuma[Yuma.length] = createMarker(new GPoint(-114.62715912,32.71956253),"
Yuma High School
400 6th Ave
Yuma, AZ 85364

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Yuma High School",'Yuma=' + Yuma.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(Dateland); map.removeOverlays(Roll); map.removeOverlays(San_Luis); map.removeOverlays(Somerton); map.removeOverlays(Tucson); map.removeOverlays(Wellton); map.removeOverlays(Yuma); 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(Yuma);map.removeOverlays(Dateland); map.removeOverlays(Roll); map.removeOverlays(San_Luis); map.removeOverlays(Somerton); map.removeOverlays(Tucson); map.removeOverlays(Wellton); map.removeOverlays(Yuma); map.addOverlays(Dateland); centerByArray(Dateland, false, false); cntMarker += Dateland.length; map.addOverlays(Roll); centerByArray(Roll, false, false); cntMarker += Roll.length; map.addOverlays(San_Luis); centerByArray(San_Luis, false, false); cntMarker += San_Luis.length; map.addOverlays(Somerton); centerByArray(Somerton, false, false); cntMarker += Somerton.length; map.addOverlays(Tucson); centerByArray(Tucson, false, false); cntMarker += Tucson.length; map.addOverlays(Wellton); centerByArray(Wellton, false, false); cntMarker += Wellton.length; map.addOverlays(Yuma); centerByArray(Yuma, false, false); cntMarker += Yuma.length; centerByArray(Yuma,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'); } }