function addMarkers()
{
mySelect = document.getElementById('selection');
Flagstaff = [];Page = [];Fredonia = [];Williams = [];Grand_Canyon = [];Tuba_City = [];Supai = [];Kaibito = [];Parks = [];Tonalea = [];Sedona = [];Winslow = [];mySelect.options[mySelect.options.length] = new Option("Flagstaff schools",'all=Flagstaff');
mySelect.options[mySelect.options.length] = new Option("Fredonia schools",'all=Fredonia');
mySelect.options[mySelect.options.length] = new Option("Grand Canyon schools",'all=Grand_Canyon');
mySelect.options[mySelect.options.length] = new Option("Kaibito schools",'all=Kaibito');
mySelect.options[mySelect.options.length] = new Option("Page schools",'all=Page');
mySelect.options[mySelect.options.length] = new Option("Parks schools",'all=Parks');
mySelect.options[mySelect.options.length] = new Option("Sedona schools",'all=Sedona');
mySelect.options[mySelect.options.length] = new Option("Supai schools",'all=Supai');
mySelect.options[mySelect.options.length] = new Option("Tonalea schools",'all=Tonalea');
mySelect.options[mySelect.options.length] = new Option("Tuba City schools",'all=Tuba_City');
mySelect.options[mySelect.options.length] = new Option("Williams schools",'all=Williams');
mySelect.options[mySelect.options.length] = new Option("Winslow schools",'all=Winslow');
mySelect.options[mySelect.options.length] = new Option("---------------------------",'');
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.64658356,35.20005035),"
",iconGr);
mySelect.options[mySelect.options.length] = new Option("Bright Angel High School",'Flagstaff=' + Flagstaff.length);
Page[Page.length] = createMarker(new GPoint(-111.45431300,36.90304300),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Caviat - Coconino High School",'Page=' + Page.length);
Page[Page.length] = createMarker(new GPoint(-111.45431300,36.90304300),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Caviat - Flagstaff High School",'Page=' + Page.length);
Page[Page.length] = createMarker(new GPoint(-111.45431300,36.90304300),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Caviat - Sinagua High School",'Page=' + Page.length);
Fredonia[Fredonia.length] = createMarker(new GPoint(-112.34290314,36.72919846),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Caviat- Fredonia High School",'Fredonia=' + Fredonia.length);
Williams[Williams.length] = createMarker(new GPoint(-112.23130035,35.42770004),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Caviat- Williams High School",'Williams=' + Williams.length);
Grand_Canyon[Grand_Canyon.length] = createMarker(new GPoint(-112.11750031,36.03129959),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Caviat-grand Canyon High School",'Grand_Canyon=' + Grand_Canyon.length);
Page[Page.length] = createMarker(new GPoint(-111.41989899,36.88090134),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Caviat-page High School",'Page=' + Page.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.65028381,35.19787979),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Charles W Sechrist Elementary School",'Flagstaff=' + Flagstaff.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.62266541,35.21531296),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Coconino High School",'Flagstaff=' + Flagstaff.length);
Page[Page.length] = createMarker(new GPoint(-111.41989899,36.88090134),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Desert View Elementary School",'Page=' + Page.length);
Tuba_City[Tuba_City.length] = createMarker(new GPoint(-111.29969788,36.08509827),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Dzil Libei Elementary School",'Tuba_City=' + Tuba_City.length);
Tuba_City[Tuba_City.length] = createMarker(new GPoint(-111.29969788,36.08509827),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Eagles Nest Intermediate School",'Tuba_City=' + Tuba_City.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.64707947,35.19917679),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Esperanza Academy (grand Canyon Campus)",'Flagstaff=' + Flagstaff.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.65235901,35.20603561),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Eva Marshall Elementary School",'Flagstaff=' + Flagstaff.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.61657715,35.20430756),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Excel Education Centers Flagstaff, Llc",'Flagstaff=' + Flagstaff.length);
Williams[Williams.length] = createMarker(new GPoint(-112.26081848,35.62110138),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Excel Education Centers Flagstaff, Llc- Williams C",'Williams=' + Williams.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.69245148,35.24956894),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Flagstaff Arts And Leadership Academy",'Flagstaff=' + Flagstaff.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.73670197,35.35329819),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Flagstaff Arts And Leadership Academy (charter)",'Flagstaff=' + Flagstaff.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.65132000,35.19817700),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Flagstaff Dormitory",'Flagstaff=' + Flagstaff.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.65139771,35.20367813),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Flagstaff High School",'Flagstaff=' + Flagstaff.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.64488220,35.21333694),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Flagstaff Junior Academy",'Flagstaff=' + Flagstaff.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.64488220,35.21333694),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Flagstaff Junior Academy (charter)",'Flagstaff=' + Flagstaff.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.65267181,35.20706940),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Flagstaff Middle School",'Flagstaff=' + Flagstaff.length);
Fredonia[Fredonia.length] = createMarker(new GPoint(-112.34290314,36.72919846),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Fredonia Elementary School",'Fredonia=' + Fredonia.length);
Fredonia[Fredonia.length] = createMarker(new GPoint(-112.34290314,36.72919846),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Fredonia High School",'Fredonia=' + Fredonia.length);
Tuba_City[Tuba_City.length] = createMarker(new GPoint(-111.29969788,36.08509827),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Gap Primary School",'Tuba_City=' + Tuba_City.length);
Grand_Canyon[Grand_Canyon.length] = createMarker(new GPoint(-112.11750031,36.03129959),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Grand Canyon Elementary School",'Grand_Canyon=' + Grand_Canyon.length);
Grand_Canyon[Grand_Canyon.length] = createMarker(new GPoint(-112.11750031,36.03129959),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Grand Canyon High School",'Grand_Canyon=' + Grand_Canyon.length);
Tuba_City[Tuba_City.length] = createMarker(new GPoint(-111.29969788,36.08509827),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Greyhills High School",'Tuba_City=' + Tuba_City.length);
Supai[Supai.length] = createMarker(new GPoint(-112.49330139,36.12210083),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Havasupai School",'Supai=' + Supai.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.60053253,35.21853638),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("John Q Thomas Elementary School",'Flagstaff=' + Flagstaff.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.64658356,35.20005035),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Juvenile Detention",'Flagstaff=' + Flagstaff.length);
Kaibito[Kaibito.length] = createMarker(new GPoint(-111.23919678,36.47930145),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Kaibeto Boarding School",'Kaibito=' + Kaibito.length);
Page[Page.length] = createMarker(new GPoint(-111.41989899,36.88090134),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lake Powell Academy",'Page=' + Page.length);
Page[Page.length] = createMarker(new GPoint(-111.41989899,36.88090134),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lake Powell Academy (charter)",'Page=' + Page.length);
Page[Page.length] = createMarker(new GPoint(-111.41989899,36.88090134),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lake View Elementary School",'Page=' + Page.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.60604095,35.19876099),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Leupp Public School",'Flagstaff=' + Flagstaff.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.57752991,35.22533798),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Life House Alternative School",'Flagstaff=' + Flagstaff.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.64846802,35.18144608),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lura Kinsey Elementary School",'Flagstaff=' + Flagstaff.length);
Parks[Parks.length] = createMarker(new GPoint(-111.94889832,35.25979996),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Maine Consolidated School",'Parks=' + Parks.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.68096161,35.16865540),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Manuel Demiguel Elementary School",'Flagstaff=' + Flagstaff.length);
Tuba_City[Tuba_City.length] = createMarker(new GPoint(-111.23922729,36.13356018),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Moencopi Day School",'Tuba_City=' + Tuba_City.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.63146210,35.19998932),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Montessori Charter School Of Flagstaff - Campus",'Flagstaff=' + Flagstaff.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.61367035,35.21908569),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Mount Elden Middle School",'Flagstaff=' + Flagstaff.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.61573029,35.21083832),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Mountain English Spanish Academy Of Flagstaff (m.e",'Flagstaff=' + Flagstaff.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.66904449,35.16276169),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mountain School",'Flagstaff=' + Flagstaff.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-116.76240540,47.72239304),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mountain School (charter)",'Flagstaff=' + Flagstaff.length);
Tonalea[Tonalea.length] = createMarker(new GPoint(-110.87210083,35.99200058),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Naa Tsis' Ana (navajo Mountain) Community School",'Tonalea=' + Tonalea.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.58417511,35.22379684),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Neil V Christensen School",'Flagstaff=' + Flagstaff.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.61797333,35.20092010),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Northland Preparatory Academy",'Flagstaff=' + Flagstaff.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.61797333,35.20092010),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Northland Preparatory Academy (charter)",'Flagstaff=' + Flagstaff.length);
Page[Page.length] = createMarker(new GPoint(-111.41989899,36.88090134),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Page High School",'Page=' + Page.length);
Page[Page.length] = createMarker(new GPoint(-111.41989899,36.88090134),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Page Middle School",'Page=' + Page.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.61682892,35.20790482),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Peak School",'Flagstaff=' + Flagstaff.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.66663361,35.19123840),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Pine Forest School",'Flagstaff=' + Flagstaff.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.66616058,35.19128036),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Pine Forest School (charter)",'Flagstaff=' + Flagstaff.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.60432000,35.20887200),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Ponderosa High School",'Flagstaff=' + Flagstaff.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.65629578,35.20330048),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Project New Start High School",'Flagstaff=' + Flagstaff.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.61367035,35.22053909),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Renaissance Magnet Middle School",'Flagstaff=' + Flagstaff.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.64658356,35.20005035),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Secure Care High School",'Flagstaff=' + Flagstaff.length);
Sedona[Sedona.length] = createMarker(new GPoint(-111.76616669,34.86314392),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Sedona Integrated Preschool",'Sedona=' + Sedona.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.60019684,35.19490814),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Sinagua High School",'Flagstaff=' + Flagstaff.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.65211487,35.19308472),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("South Beaver Elementary School",'Flagstaff=' + Flagstaff.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.43260193,35.20429993),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Star Charter School",'Flagstaff=' + Flagstaff.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.52229309,35.26963806),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Sturgeon Cromer Elementary School",'Flagstaff=' + Flagstaff.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.59950256,35.19518280),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Thomas M Knoles Elementary School",'Flagstaff=' + Flagstaff.length);
Winslow[Winslow.length] = createMarker(new GPoint(-110.33799744,35.25849915),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Tolani Lake Elementary School Academy (charter)",'Winslow=' + Winslow.length);
Tonalea[Tonalea.length] = createMarker(new GPoint(-110.87210083,35.99200058),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Tonalea Day (red Lake) School",'Tonalea=' + Tonalea.length);
Page[Page.length] = createMarker(new GPoint(-111.46175800,36.91983700),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Tse'yaato' High School",'Page=' + Page.length);
Tuba_City[Tuba_City.length] = createMarker(new GPoint(-111.29969788,36.08509827),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Tuba City Alternative School",'Tuba_City=' + Tuba_City.length);
Tuba_City[Tuba_City.length] = createMarker(new GPoint(-111.23979950,36.13359833),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Tuba City Boarding School",'Tuba_City=' + Tuba_City.length);
Tuba_City[Tuba_City.length] = createMarker(new GPoint(-111.29969788,36.08509827),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Tuba City High School",'Tuba_City=' + Tuba_City.length);
Tuba_City[Tuba_City.length] = createMarker(new GPoint(-111.29969788,36.08509827),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Tuba City Junior High School",'Tuba_City=' + Tuba_City.length);
Tuba_City[Tuba_City.length] = createMarker(new GPoint(-111.29969788,36.08509827),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Tuba City Primary School",'Tuba_City=' + Tuba_City.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.61585400,35.21070700),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("W F Killip Elementary School",'Flagstaff=' + Flagstaff.length);
Flagstaff[Flagstaff.length] = createMarker(new GPoint(-111.50441000,35.25312900),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Weitzel's Puente De Hozho Bilingual Magnet School",'Flagstaff=' + Flagstaff.length);
Williams[Williams.length] = createMarker(new GPoint(-112.23130035,35.42770004),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Williams Elementary Middle School",'Williams=' + Williams.length);
Williams[Williams.length] = createMarker(new GPoint(-112.23130035,35.42770004),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Williams High School",'Williams=' + Williams.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(Flagstaff);
map.removeOverlays(Fredonia);
map.removeOverlays(Grand_Canyon);
map.removeOverlays(Kaibito);
map.removeOverlays(Page);
map.removeOverlays(Parks);
map.removeOverlays(Sedona);
map.removeOverlays(Supai);
map.removeOverlays(Tonalea);
map.removeOverlays(Tuba_City);
map.removeOverlays(Williams);
map.removeOverlays(Winslow);
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(Flagstaff);map.removeOverlays(Flagstaff);
map.removeOverlays(Fredonia);
map.removeOverlays(Grand_Canyon);
map.removeOverlays(Kaibito);
map.removeOverlays(Page);
map.removeOverlays(Parks);
map.removeOverlays(Sedona);
map.removeOverlays(Supai);
map.removeOverlays(Tonalea);
map.removeOverlays(Tuba_City);
map.removeOverlays(Williams);
map.removeOverlays(Winslow);
map.addOverlays(Flagstaff);
centerByArray(Flagstaff, false, false);
cntMarker += Flagstaff.length;
map.addOverlays(Fredonia);
centerByArray(Fredonia, false, false);
cntMarker += Fredonia.length;
map.addOverlays(Grand_Canyon);
centerByArray(Grand_Canyon, false, false);
cntMarker += Grand_Canyon.length;
map.addOverlays(Kaibito);
centerByArray(Kaibito, false, false);
cntMarker += Kaibito.length;
map.addOverlays(Page);
centerByArray(Page, false, false);
cntMarker += Page.length;
map.addOverlays(Parks);
centerByArray(Parks, false, false);
cntMarker += Parks.length;
map.addOverlays(Sedona);
centerByArray(Sedona, false, false);
cntMarker += Sedona.length;
map.addOverlays(Supai);
centerByArray(Supai, false, false);
cntMarker += Supai.length;
map.addOverlays(Tonalea);
centerByArray(Tonalea, false, false);
cntMarker += Tonalea.length;
map.addOverlays(Tuba_City);
centerByArray(Tuba_City, false, false);
cntMarker += Tuba_City.length;
map.addOverlays(Williams);
centerByArray(Williams, false, false);
cntMarker += Williams.length;
map.addOverlays(Winslow);
centerByArray(Winslow, false, false);
cntMarker += Winslow.length;
centerByArray(Flagstaff,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');
}
}