function addMarkers()
{
mySelect = document.getElementById('selection');
Eagar = [];Alpine = [];Show_Low = [];Chinle = [];Many_Farms = [];Concho = [];St_Johns = [];Red_Valley = [];Dennehotso = [];Ft_Defiance = [];Ganado = [];Holbrook = [];St_Michaels = [];Tsaile = [];Lukachukai = [];Mcnary = [];Fort_Defiance = [];Stjohns = [];Springerville = [];Houck = [];Teec_Nos_Pos = [];Pinetop = [];Rock_Point = [];Round_Rock = [];Sanders = [];Vernon = [];Chambers = [];Window_Rock = [];mySelect.options[mySelect.options.length] = new Option("Alpine schools",'all=Alpine');
mySelect.options[mySelect.options.length] = new Option("Chambers schools",'all=Chambers');
mySelect.options[mySelect.options.length] = new Option("Chinle schools",'all=Chinle');
mySelect.options[mySelect.options.length] = new Option("Concho schools",'all=Concho');
mySelect.options[mySelect.options.length] = new Option("Dennehotso schools",'all=Dennehotso');
mySelect.options[mySelect.options.length] = new Option("Eagar schools",'all=Eagar');
mySelect.options[mySelect.options.length] = new Option("Fort Defiance schools",'all=Fort_Defiance');
mySelect.options[mySelect.options.length] = new Option("Ft Defiance schools",'all=Ft_Defiance');
mySelect.options[mySelect.options.length] = new Option("Ganado schools",'all=Ganado');
mySelect.options[mySelect.options.length] = new Option("Holbrook schools",'all=Holbrook');
mySelect.options[mySelect.options.length] = new Option("Houck schools",'all=Houck');
mySelect.options[mySelect.options.length] = new Option("Lukachukai schools",'all=Lukachukai');
mySelect.options[mySelect.options.length] = new Option("Many Farms schools",'all=Many_Farms');
mySelect.options[mySelect.options.length] = new Option("Mcnary schools",'all=Mcnary');
mySelect.options[mySelect.options.length] = new Option("Pinetop schools",'all=Pinetop');
mySelect.options[mySelect.options.length] = new Option("Red Valley schools",'all=Red_Valley');
mySelect.options[mySelect.options.length] = new Option("Rock Point schools",'all=Rock_Point');
mySelect.options[mySelect.options.length] = new Option("Round Rock schools",'all=Round_Rock');
mySelect.options[mySelect.options.length] = new Option("Sanders schools",'all=Sanders');
mySelect.options[mySelect.options.length] = new Option("Show Low schools",'all=Show_Low');
mySelect.options[mySelect.options.length] = new Option("Springerville schools",'all=Springerville');
mySelect.options[mySelect.options.length] = new Option("St Johns schools",'all=St_Johns');
mySelect.options[mySelect.options.length] = new Option("St Michaels schools",'all=St_Michaels');
mySelect.options[mySelect.options.length] = new Option("Stjohns schools",'all=Stjohns');
mySelect.options[mySelect.options.length] = new Option("Teec Nos Pos schools",'all=Teec_Nos_Pos');
mySelect.options[mySelect.options.length] = new Option("Tsaile schools",'all=Tsaile');
mySelect.options[mySelect.options.length] = new Option("Vernon schools",'all=Vernon');
mySelect.options[mySelect.options.length] = new Option("Window Rock schools",'all=Window_Rock');
mySelect.options[mySelect.options.length] = new Option("---------------------------",'');
Eagar[Eagar.length] = createMarker(new GPoint(-109.25212097,34.10892105),"
",iconGr);
mySelect.options[mySelect.options.length] = new Option("4-winds Academy",'Eagar=' + Eagar.length);
Alpine[Alpine.length] = createMarker(new GPoint(-109.13289642,33.82939911),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Alpine Elementary School",'Alpine=' + Alpine.length);
Show_Low[Show_Low.length] = createMarker(new GPoint(-110.05277252,34.24477768),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Blue Ridge High School",'Show_Low=' + Show_Low.length);
Chinle[Chinle.length] = createMarker(new GPoint(-109.58699799,36.12490082),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Canyon De Chelly Elementary School",'Chinle=' + Chinle.length);
Many_Farms[Many_Farms.length] = createMarker(new GPoint(-109.62889862,36.43970108),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Chinle Boarding School",'Many_Farms=' + Many_Farms.length);
Chinle[Chinle.length] = createMarker(new GPoint(-109.58699799,36.12490082),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Chinle Elementary School",'Chinle=' + Chinle.length);
Chinle[Chinle.length] = createMarker(new GPoint(-109.58534100,36.15510400),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Chinle High School",'Chinle=' + Chinle.length);
Chinle[Chinle.length] = createMarker(new GPoint(-109.54759979,36.10699844),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Chinle Junior High School",'Chinle=' + Chinle.length);
Chinle[Chinle.length] = createMarker(new GPoint(-109.58699799,36.12490082),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Chinle Kindergarten Center",'Chinle=' + Chinle.length);
Chinle[Chinle.length] = createMarker(new GPoint(-109.54769897,36.10649872),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Chinle Primary School",'Chinle=' + Chinle.length);
Concho[Concho.length] = createMarker(new GPoint(-109.72499847,34.42689896),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Concho Elementary School",'Concho=' + Concho.length);
St_Johns[St_Johns.length] = createMarker(new GPoint(-109.36289978,34.49789810),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Coronado Elementary School",'St_Johns=' + St_Johns.length);
Chinle[Chinle.length] = createMarker(new GPoint(-109.55206299,36.15305710),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Cottonwood Day School",'Chinle=' + Chinle.length);
Red_Valley[Red_Valley.length] = createMarker(new GPoint(-109.35199738,36.63570023),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Cove Day School",'Red_Valley=' + Red_Valley.length);
Dennehotso[Dennehotso.length] = createMarker(new GPoint(-109.84703064,36.84579849),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Dennehotso Boarding School",'Dennehotso=' + Dennehotso.length);
Ft_Defiance[Ft_Defiance.length] = createMarker(new GPoint(-109.07579803,35.74440002),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Fort Defiance Elementary School",'Ft_Defiance=' + Ft_Defiance.length);
Ganado[Ganado.length] = createMarker(new GPoint(-109.54260400,35.70891500),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Ganado High School",'Ganado=' + Ganado.length);
Ganado[Ganado.length] = createMarker(new GPoint(-109.29799652,35.65549850),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Ganado Intermediate School",'Ganado=' + Ganado.length);
Ganado[Ganado.length] = createMarker(new GPoint(-109.29799652,35.65549850),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Ganado Middle School",'Ganado=' + Ganado.length);
Ganado[Ganado.length] = createMarker(new GPoint(-109.29799652,35.65549850),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Ganado Primary School",'Ganado=' + Ganado.length);
Ganado[Ganado.length] = createMarker(new GPoint(-109.29799652,35.65549850),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Greasewood Springs Community School, Inc. Elementary School",'Ganado=' + Ganado.length);
Holbrook[Holbrook.length] = createMarker(new GPoint(-110.16616800,34.90712000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Holbrook Dormitory",'Holbrook=' + Holbrook.length);
St_Michaels[St_Michaels.length] = createMarker(new GPoint(-109.09578705,35.64469147),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hunters Point Boarding School",'St_Michaels=' + St_Michaels.length);
Ft_Defiance[Ft_Defiance.length] = createMarker(new GPoint(-109.07579803,35.74440002),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Integrated Preschool",'Ft_Defiance=' + Ft_Defiance.length);
Tsaile[Tsaile.length] = createMarker(new GPoint(-112.06483459,33.51295853),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("International Commerce Institute - Tsaile",'Tsaile=' + Tsaile.length);
Chinle[Chinle.length] = createMarker(new GPoint(-109.55716000,36.14720700),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Jeehdeez'a Academy (low Mountain)",'Chinle=' + Chinle.length);
Ganado[Ganado.length] = createMarker(new GPoint(-109.54260400,35.70891500),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Kin Dah Lich' I Olta",'Ganado=' + Ganado.length);
Ganado[Ganado.length] = createMarker(new GPoint(-109.29799652,35.65549850),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Kin Dah Lichii Olta' Charter School",'Ganado=' + Ganado.length);
Lukachukai[Lukachukai.length] = createMarker(new GPoint(-109.22778320,36.41630936),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lukachukai Boarding School",'Lukachukai=' + Lukachukai.length);
Chinle[Chinle.length] = createMarker(new GPoint(-109.58699799,36.12490082),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Many Farms Elementary School",'Chinle=' + Chinle.length);
Many_Farms[Many_Farms.length] = createMarker(new GPoint(-109.62889862,36.43970108),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Many Farms High School",'Many_Farms=' + Many_Farms.length);
Mcnary[Mcnary.length] = createMarker(new GPoint(-109.85340118,34.07509995),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mcnary Elementary School",'Mcnary=' + Mcnary.length);
St_Johns[St_Johns.length] = createMarker(new GPoint(-109.36289978,34.49789810),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Mountainaire Academy",'St_Johns=' + St_Johns.length);
Fort_Defiance[Fort_Defiance.length] = createMarker(new GPoint(-109.52326200,35.65186200),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Navajo Immersion",'Fort_Defiance=' + Fort_Defiance.length);
Ganado[Ganado.length] = createMarker(new GPoint(-109.54155731,35.71131134),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Nazlini Boarding School",'Ganado=' + Ganado.length);
Ganado[Ganado.length] = createMarker(new GPoint(-109.29799652,35.65549850),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Nazlini Charter School",'Ganado=' + Ganado.length);
Stjohns[Stjohns.length] = createMarker(new GPoint(-109.36289978,34.49789810),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("New Visions Academy - Saint John's Campus",'Stjohns=' + Stjohns.length);
Springerville[Springerville.length] = createMarker(new GPoint(-109.26654816,34.13295746),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("New Visions Academy-springerville Campus High School",'Springerville=' + Springerville.length);
Show_Low[Show_Low.length] = createMarker(new GPoint(-110.02860260,34.25299072),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Northern Az Academy For Career Dev. - Show Low",'Show_Low=' + Show_Low.length);
Houck[Houck.length] = createMarker(new GPoint(-109.20629883,35.28300095),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Pine Springs Day School",'Houck=' + Houck.length);
Teec_Nos_Pos[Teec_Nos_Pos.length] = createMarker(new GPoint(-109.40830231,36.76369858),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Red Mesa Elementary School",'Teec_Nos_Pos=' + Teec_Nos_Pos.length);
Teec_Nos_Pos[Teec_Nos_Pos.length] = createMarker(new GPoint(-109.09162400,36.92327000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Red Mesa High School",'Teec_Nos_Pos=' + Teec_Nos_Pos.length);
Teec_Nos_Pos[Teec_Nos_Pos.length] = createMarker(new GPoint(-109.40830231,36.76369858),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Red Mesa Junior High School",'Teec_Nos_Pos=' + Teec_Nos_Pos.length);
Red_Valley[Red_Valley.length] = createMarker(new GPoint(-109.34652710,36.63451004),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Red Rock Day School",'Red_Valley=' + Red_Valley.length);
Pinetop[Pinetop.length] = createMarker(new GPoint(-109.90989685,34.11299896),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Renaissance Academy - San Juan Campus",'Pinetop=' + Pinetop.length);
St_Johns[St_Johns.length] = createMarker(new GPoint(-109.31529999,34.46920013),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Renaissance Academy - San Juan Campus (charter)",'St_Johns=' + St_Johns.length);
Pinetop[Pinetop.length] = createMarker(new GPoint(-109.91329956,34.11840057),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Renaissance Academy - Anasazi Campus (charter)",'Pinetop=' + Pinetop.length);
Show_Low[Show_Low.length] = createMarker(new GPoint(-110.04820251,34.12879944),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Renaissance Academy - John Reeder Campus (charter)",'Show_Low=' + Show_Low.length);
Eagar[Eagar.length] = createMarker(new GPoint(-109.90989685,34.11299896),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Renaissance Academy - Malpais Campus",'Eagar=' + Eagar.length);
Eagar[Eagar.length] = createMarker(new GPoint(-109.31159973,33.97019958),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Renaissance Academy - Malpais Campus (charter)",'Eagar=' + Eagar.length);
St_Johns[St_Johns.length] = createMarker(new GPoint(-109.88770294,34.15795898),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Renaissance Academy - Saint Johns Campus",'St_Johns=' + St_Johns.length);
St_Johns[St_Johns.length] = createMarker(new GPoint(-109.31529999,34.46920013),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Renaissance Academy - Saint Johns Campus (charter)",'St_Johns=' + St_Johns.length);
Rock_Point[Rock_Point.length] = createMarker(new GPoint(-109.62566376,36.71813965),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Rock Point Community School",'Rock_Point=' + Rock_Point.length);
Chinle[Chinle.length] = createMarker(new GPoint(-109.55206299,36.15305710),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Rough Rock Demonstration School",'Chinle=' + Chinle.length);
Round_Rock[Round_Rock.length] = createMarker(new GPoint(-109.40830231,36.76369858),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Round Rock Elementary School",'Round_Rock=' + Round_Rock.length);
Springerville[Springerville.length] = createMarker(new GPoint(-109.48999786,34.18209839),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Round Valley High School",'Springerville=' + Springerville.length);
Springerville[Springerville.length] = createMarker(new GPoint(-109.48999786,34.18209839),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Round Valley Intermediate School",'Springerville=' + Springerville.length);
Springerville[Springerville.length] = createMarker(new GPoint(-109.48999786,34.18209839),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Round Valley Middle School",'Springerville=' + Springerville.length);
Springerville[Springerville.length] = createMarker(new GPoint(-109.48999786,34.18209839),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Round Valley Primary School",'Springerville=' + Springerville.length);
Sanders[Sanders.length] = createMarker(new GPoint(-109.33300018,35.21630096),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Sanders Elementary School",'Sanders=' + Sanders.length);
Sanders[Sanders.length] = createMarker(new GPoint(-109.33300018,35.21630096),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Sanders Middle School",'Sanders=' + Sanders.length);
Sanders[Sanders.length] = createMarker(new GPoint(-109.33300018,35.21630096),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Sanders Valley High School",'Sanders=' + Sanders.length);
Fort_Defiance[Fort_Defiance.length] = createMarker(new GPoint(-109.52326200,35.65186200),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Sawmill Elementary School",'Fort_Defiance=' + Fort_Defiance.length);
St_Johns[St_Johns.length] = createMarker(new GPoint(-109.36558900,34.50676500),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St Johns High Schools",'St_Johns=' + St_Johns.length);
St_Johns[St_Johns.length] = createMarker(new GPoint(-109.36289978,34.49789810),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St Johns High Schools",'St_Johns=' + St_Johns.length);
St_Johns[St_Johns.length] = createMarker(new GPoint(-109.36289978,34.49789810),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("St Johns Middle School",'St_Johns=' + St_Johns.length);
Teec_Nos_Pos[Teec_Nos_Pos.length] = createMarker(new GPoint(-109.09162400,36.92327000),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("T'iis Nazbas (teecnospos) Community School",'Teec_Nos_Pos=' + Teec_Nos_Pos.length);
Chinle[Chinle.length] = createMarker(new GPoint(-109.54759979,36.10699844),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Tsaile Elementary School",'Chinle=' + Chinle.length);
Fort_Defiance[Fort_Defiance.length] = createMarker(new GPoint(-109.07579803,35.74440002),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Tse Ho Tso Intermediate Learning Center",'Fort_Defiance=' + Fort_Defiance.length);
Ft_Defiance[Ft_Defiance.length] = createMarker(new GPoint(-109.07579803,35.74440002),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Tse Ho Tso Middle School",'Ft_Defiance=' + Ft_Defiance.length);
Ft_Defiance[Ft_Defiance.length] = createMarker(new GPoint(-109.07579803,35.74440002),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Tse Ho Tso Primary Learning Center",'Ft_Defiance=' + Ft_Defiance.length);
Chinle[Chinle.length] = createMarker(new GPoint(-109.58699799,36.12490082),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Turquoise Dawn Alternative High School",'Chinle=' + Chinle.length);
Sanders[Sanders.length] = createMarker(new GPoint(-109.33300018,35.21630096),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Valley High School",'Sanders=' + Sanders.length);
Vernon[Vernon.length] = createMarker(new GPoint(-109.69249725,34.25540161),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Vernon Elementary School",'Vernon=' + Vernon.length);
Chambers[Chambers.length] = createMarker(new GPoint(-109.43373871,35.19101715),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Wide Ruins Community School",'Chambers=' + Chambers.length);
Chambers[Chambers.length] = createMarker(new GPoint(-109.45809937,35.01070023),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Wide Ruins Junior High School",'Chambers=' + Chambers.length);
Chambers[Chambers.length] = createMarker(new GPoint(-109.45580292,35.01089859),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Wide Ruins Junior High School (charter)",'Chambers=' + Chambers.length);
Window_Rock[Window_Rock.length] = createMarker(new GPoint(-109.05190277,35.68050003),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Window Rock Elementary School",'Window_Rock=' + Window_Rock.length);
Fort_Defiance[Fort_Defiance.length] = createMarker(new GPoint(-109.07579803,35.74440002),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Window Rock High School",'Fort_Defiance=' + Fort_Defiance.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(Alpine);
map.removeOverlays(Chambers);
map.removeOverlays(Chinle);
map.removeOverlays(Concho);
map.removeOverlays(Dennehotso);
map.removeOverlays(Eagar);
map.removeOverlays(Fort_Defiance);
map.removeOverlays(Ft_Defiance);
map.removeOverlays(Ganado);
map.removeOverlays(Holbrook);
map.removeOverlays(Houck);
map.removeOverlays(Lukachukai);
map.removeOverlays(Many_Farms);
map.removeOverlays(Mcnary);
map.removeOverlays(Pinetop);
map.removeOverlays(Red_Valley);
map.removeOverlays(Rock_Point);
map.removeOverlays(Round_Rock);
map.removeOverlays(Sanders);
map.removeOverlays(Show_Low);
map.removeOverlays(Springerville);
map.removeOverlays(St_Johns);
map.removeOverlays(St_Michaels);
map.removeOverlays(Stjohns);
map.removeOverlays(Teec_Nos_Pos);
map.removeOverlays(Tsaile);
map.removeOverlays(Vernon);
map.removeOverlays(Window_Rock);
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(Eagar);map.removeOverlays(Alpine);
map.removeOverlays(Chambers);
map.removeOverlays(Chinle);
map.removeOverlays(Concho);
map.removeOverlays(Dennehotso);
map.removeOverlays(Eagar);
map.removeOverlays(Fort_Defiance);
map.removeOverlays(Ft_Defiance);
map.removeOverlays(Ganado);
map.removeOverlays(Holbrook);
map.removeOverlays(Houck);
map.removeOverlays(Lukachukai);
map.removeOverlays(Many_Farms);
map.removeOverlays(Mcnary);
map.removeOverlays(Pinetop);
map.removeOverlays(Red_Valley);
map.removeOverlays(Rock_Point);
map.removeOverlays(Round_Rock);
map.removeOverlays(Sanders);
map.removeOverlays(Show_Low);
map.removeOverlays(Springerville);
map.removeOverlays(St_Johns);
map.removeOverlays(St_Michaels);
map.removeOverlays(Stjohns);
map.removeOverlays(Teec_Nos_Pos);
map.removeOverlays(Tsaile);
map.removeOverlays(Vernon);
map.removeOverlays(Window_Rock);
map.addOverlays(Alpine);
centerByArray(Alpine, false, false);
cntMarker += Alpine.length;
map.addOverlays(Chambers);
centerByArray(Chambers, false, false);
cntMarker += Chambers.length;
map.addOverlays(Chinle);
centerByArray(Chinle, false, false);
cntMarker += Chinle.length;
map.addOverlays(Concho);
centerByArray(Concho, false, false);
cntMarker += Concho.length;
map.addOverlays(Dennehotso);
centerByArray(Dennehotso, false, false);
cntMarker += Dennehotso.length;
map.addOverlays(Eagar);
centerByArray(Eagar, false, false);
cntMarker += Eagar.length;
map.addOverlays(Fort_Defiance);
centerByArray(Fort_Defiance, false, false);
cntMarker += Fort_Defiance.length;
map.addOverlays(Ft_Defiance);
centerByArray(Ft_Defiance, false, false);
cntMarker += Ft_Defiance.length;
map.addOverlays(Ganado);
centerByArray(Ganado, false, false);
cntMarker += Ganado.length;
map.addOverlays(Holbrook);
centerByArray(Holbrook, false, false);
cntMarker += Holbrook.length;
map.addOverlays(Houck);
centerByArray(Houck, false, false);
cntMarker += Houck.length;
map.addOverlays(Lukachukai);
centerByArray(Lukachukai, false, false);
cntMarker += Lukachukai.length;
map.addOverlays(Many_Farms);
centerByArray(Many_Farms, false, false);
cntMarker += Many_Farms.length;
map.addOverlays(Mcnary);
centerByArray(Mcnary, false, false);
cntMarker += Mcnary.length;
map.addOverlays(Pinetop);
centerByArray(Pinetop, false, false);
cntMarker += Pinetop.length;
map.addOverlays(Red_Valley);
centerByArray(Red_Valley, false, false);
cntMarker += Red_Valley.length;
map.addOverlays(Rock_Point);
centerByArray(Rock_Point, false, false);
cntMarker += Rock_Point.length;
map.addOverlays(Round_Rock);
centerByArray(Round_Rock, false, false);
cntMarker += Round_Rock.length;
map.addOverlays(Sanders);
centerByArray(Sanders, false, false);
cntMarker += Sanders.length;
map.addOverlays(Show_Low);
centerByArray(Show_Low, false, false);
cntMarker += Show_Low.length;
map.addOverlays(Springerville);
centerByArray(Springerville, false, false);
cntMarker += Springerville.length;
map.addOverlays(St_Johns);
centerByArray(St_Johns, false, false);
cntMarker += St_Johns.length;
map.addOverlays(St_Michaels);
centerByArray(St_Michaels, false, false);
cntMarker += St_Michaels.length;
map.addOverlays(Stjohns);
centerByArray(Stjohns, false, false);
cntMarker += Stjohns.length;
map.addOverlays(Teec_Nos_Pos);
centerByArray(Teec_Nos_Pos, false, false);
cntMarker += Teec_Nos_Pos.length;
map.addOverlays(Tsaile);
centerByArray(Tsaile, false, false);
cntMarker += Tsaile.length;
map.addOverlays(Vernon);
centerByArray(Vernon, false, false);
cntMarker += Vernon.length;
map.addOverlays(Window_Rock);
centerByArray(Window_Rock, false, false);
cntMarker += Window_Rock.length;
centerByArray(Eagar,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');
}
}