function addMarkers()
{
mySelect = document.getElementById('selection');
Coolidge = [];Apache_Junction = [];Phoenix = [];Florence = [];San_Manuel = [];Casa_Grande = [];Bapchule = [];Eloy = [];Queen_Creek = [];Superior = [];Maricopa = [];Oracle = [];Picacho = [];Tucson = [];Kearny = [];Red_Rock = [];Sacaton = [];Stanfield = [];Winkelman = [];mySelect.options[mySelect.options.length] = new Option("Apache Junction schools",'all=Apache_Junction');
mySelect.options[mySelect.options.length] = new Option("Bapchule schools",'all=Bapchule');
mySelect.options[mySelect.options.length] = new Option("Casa Grande schools",'all=Casa_Grande');
mySelect.options[mySelect.options.length] = new Option("Coolidge schools",'all=Coolidge');
mySelect.options[mySelect.options.length] = new Option("Eloy schools",'all=Eloy');
mySelect.options[mySelect.options.length] = new Option("Florence schools",'all=Florence');
mySelect.options[mySelect.options.length] = new Option("Kearny schools",'all=Kearny');
mySelect.options[mySelect.options.length] = new Option("Maricopa schools",'all=Maricopa');
mySelect.options[mySelect.options.length] = new Option("Oracle schools",'all=Oracle');
mySelect.options[mySelect.options.length] = new Option("Phoenix schools",'all=Phoenix');
mySelect.options[mySelect.options.length] = new Option("Picacho schools",'all=Picacho');
mySelect.options[mySelect.options.length] = new Option("Queen Creek schools",'all=Queen_Creek');
mySelect.options[mySelect.options.length] = new Option("Red Rock schools",'all=Red_Rock');
mySelect.options[mySelect.options.length] = new Option("Sacaton schools",'all=Sacaton');
mySelect.options[mySelect.options.length] = new Option("San Manuel schools",'all=San_Manuel');
mySelect.options[mySelect.options.length] = new Option("Stanfield schools",'all=Stanfield');
mySelect.options[mySelect.options.length] = new Option("Superior schools",'all=Superior');
mySelect.options[mySelect.options.length] = new Option("Tucson schools",'all=Tucson');
mySelect.options[mySelect.options.length] = new Option("Winkelman schools",'all=Winkelman');
mySelect.options[mySelect.options.length] = new Option("---------------------------",'');
Coolidge[Coolidge.length] = createMarker(new GPoint(-111.52051900,32.98804400),"
",iconRd);
mySelect.options[mySelect.options.length] = new Option("Academy Of Excellence - Central Arizona",'Coolidge=' + Coolidge.length);
Coolidge[Coolidge.length] = createMarker(new GPoint(-111.86795700,33.26021700),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Akimel O'otham Pee Posh (3rd & 4th)",'Coolidge=' + Coolidge.length);
Coolidge[Coolidge.length] = createMarker(new GPoint(-111.51702900,32.97762500),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Akimel O'otham Pee Posh (k-2)",'Coolidge=' + Coolidge.length);
Apache_Junction[Apache_Junction.length] = createMarker(new GPoint(-111.56298828,33.39316177),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Apache Junction Alternative Education Center",'Apache_Junction=' + Apache_Junction.length);
Apache_Junction[Apache_Junction.length] = createMarker(new GPoint(-111.56235400,33.42994000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Apache Junction High School",'Apache_Junction=' + Apache_Junction.length);
Apache_Junction[Apache_Junction.length] = createMarker(new GPoint(-111.55624390,33.41496277),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Apache Trail High School",'Apache_Junction=' + Apache_Junction.length);
Apache_Junction[Apache_Junction.length] = createMarker(new GPoint(-111.55624390,33.41496277),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Apex Academy",'Apache_Junction=' + Apache_Junction.length);
Phoenix[Phoenix.length] = createMarker(new GPoint(-112.13844200,33.47670000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Asp - Florence West/a.c.i.",'Phoenix=' + Phoenix.length);
Florence[Florence.length] = createMarker(new GPoint(-111.32849884,32.97560120),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Aspc-eyman",'Florence=' + Florence.length);
Florence[Florence.length] = createMarker(new GPoint(-111.32849884,32.97560120),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Aspc-florence",'Florence=' + Florence.length);
San_Manuel[San_Manuel.length] = createMarker(new GPoint(-110.67610168,32.69129944),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Avenue B School",'San_Manuel=' + San_Manuel.length);
Coolidge[Coolidge.length] = createMarker(new GPoint(-111.52410126,32.95429993),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Barely Bears Child Development Elementary School",'Coolidge=' + Coolidge.length);
Coolidge[Coolidge.length] = createMarker(new GPoint(-10.00000000,10.00000000),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Blackwater Community School",'Coolidge=' + Coolidge.length);
Casa_Grande[Casa_Grande.length] = createMarker(new GPoint(-111.73295593,32.90893555),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Cactus Middle School",'Casa_Grande=' + Casa_Grande.length);
Bapchule[Bapchule.length] = createMarker(new GPoint(-111.92140198,33.13850021),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Casa Blanca Day School",'Bapchule=' + Bapchule.length);
Bapchule[Bapchule.length] = createMarker(new GPoint(-111.87249756,33.13629913),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Casa Blanca Middle School (charter)",'Bapchule=' + Bapchule.length);
Casa_Grande[Casa_Grande.length] = createMarker(new GPoint(-111.75616455,32.88703537),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Casa Grande Middle School",'Casa_Grande=' + Casa_Grande.length);
Casa_Grande[Casa_Grande.length] = createMarker(new GPoint(-111.73948600,32.93585700),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Casa Grande Union High School",'Casa_Grande=' + Casa_Grande.length);
Casa_Grande[Casa_Grande.length] = createMarker(new GPoint(-111.74843597,32.88644409),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Casa Verde High School",'Casa_Grande=' + Casa_Grande.length);
Casa_Grande[Casa_Grande.length] = createMarker(new GPoint(-111.74843597,32.88644409),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Central Arizona Valley Institute Of Technology High School",'Casa_Grande=' + Casa_Grande.length);
Casa_Grande[Casa_Grande.length] = createMarker(new GPoint(-111.73525238,32.90893555),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Cholla Elementary School",'Casa_Grande=' + Casa_Grande.length);
Coolidge[Coolidge.length] = createMarker(new GPoint(-111.52056885,32.98819351),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Clearview Central Arizona Elementary School",'Coolidge=' + Coolidge.length);
Coolidge[Coolidge.length] = createMarker(new GPoint(-111.52833500,32.98156900),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Coolidge High School",'Coolidge=' + Coolidge.length);
Coolidge[Coolidge.length] = createMarker(new GPoint(-111.52670288,32.96829987),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Coolidge High School Success Center",'Coolidge=' + Coolidge.length);
Florence[Florence.length] = createMarker(new GPoint(-111.36613200,33.03844200),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Copper Basin",'Florence=' + Florence.length);
Casa_Grande[Casa_Grande.length] = createMarker(new GPoint(-111.74446106,32.89655685),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Cottonwood Elementary School",'Casa_Grande=' + Casa_Grande.length);
Eloy[Eloy.length] = createMarker(new GPoint(-111.55033875,32.75961685),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Curiel Annex School",'Eloy=' + Eloy.length);
Eloy[Eloy.length] = createMarker(new GPoint(-111.55033875,32.75961685),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Curiel School",'Eloy=' + Eloy.length);
Apache_Junction[Apache_Junction.length] = createMarker(new GPoint(-111.56323242,33.39212036),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Desert Shadows Middle School",'Apache_Junction=' + Apache_Junction.length);
Apache_Junction[Apache_Junction.length] = createMarker(new GPoint(-111.54611900,33.42279500),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Desert Vista Elementary School",'Apache_Junction=' + Apache_Junction.length);
Casa_Grande[Casa_Grande.length] = createMarker(new GPoint(-111.74843597,32.88644409),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Desert Winds High School",'Casa_Grande=' + Casa_Grande.length);
San_Manuel[San_Manuel.length] = createMarker(new GPoint(-110.67610168,32.69129944),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("El Camino Education Center",'San_Manuel=' + San_Manuel.length);
Eloy[Eloy.length] = createMarker(new GPoint(-111.55033875,32.75961685),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Eloy Intermediate School",'Eloy=' + Eloy.length);
Eloy[Eloy.length] = createMarker(new GPoint(-111.55033875,32.75961685),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Eloy Junior High School",'Eloy=' + Eloy.length);
Casa_Grande[Casa_Grande.length] = createMarker(new GPoint(-111.73796082,32.88333511),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Evergreen Elementary School",'Casa_Grande=' + Casa_Grande.length);
San_Manuel[San_Manuel.length] = createMarker(new GPoint(-110.67610168,32.69129944),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("First Avenue Elementary School",'San_Manuel=' + San_Manuel.length);
Florence[Florence.length] = createMarker(new GPoint(-111.32849884,32.97560120),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Florence High School",'Florence=' + Florence.length);
Florence[Florence.length] = createMarker(new GPoint(-111.32849884,32.97560120),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Florence K-8 Elementary School",'Florence=' + Florence.length);
Florence[Florence.length] = createMarker(new GPoint(-111.32849884,32.97560120),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Florence Middle School",'Florence=' + Florence.length);
Florence[Florence.length] = createMarker(new GPoint(-111.32849884,32.97560120),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Florence Unified High School",'Florence=' + Florence.length);
Apache_Junction[Apache_Junction.length] = createMarker(new GPoint(-111.50525665,33.40776443),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Four Peaks Elementary School",'Apache_Junction=' + Apache_Junction.length);
Apache_Junction[Apache_Junction.length] = createMarker(new GPoint(-111.43806458,33.36201096),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Gold Canyon Elementary School",'Apache_Junction=' + Apache_Junction.length);
Coolidge[Coolidge.length] = createMarker(new GPoint(-111.53276062,32.98475647),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Hohokam Middle School",'Coolidge=' + Coolidge.length);
Bapchule[Bapchule.length] = createMarker(new GPoint(-111.92140198,33.13850021),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Ira H. Hayes Memorial Applied Learning Center",'Bapchule=' + Bapchule.length);
Casa_Grande[Casa_Grande.length] = createMarker(new GPoint(-111.73113251,32.88983536),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Ironwood School",'Casa_Grande=' + Casa_Grande.length);
Queen_Creek[Queen_Creek.length] = createMarker(new GPoint(-111.56449890,33.21070099),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("J O Combs Elementary School",'Queen_Creek=' + Queen_Creek.length);
Queen_Creek[Queen_Creek.length] = createMarker(new GPoint(-111.55493300,33.23686500),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Jack Harmon Elementary School",'Queen_Creek=' + Queen_Creek.length);
Superior[Superior.length] = createMarker(new GPoint(-111.10930634,33.28027725),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("John F Kennedy School",'Superior=' + Superior.length);
Queen_Creek[Queen_Creek.length] = createMarker(new GPoint(-111.60289764,33.23690033),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Kathryn Sue Simonton Elementary School",'Queen_Creek=' + Queen_Creek.length);
San_Manuel[San_Manuel.length] = createMarker(new GPoint(-110.67610168,32.69129944),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mammoth Elementary School",'San_Manuel=' + San_Manuel.length);
Maricopa[Maricopa.length] = createMarker(new GPoint(-112.05107117,33.05314255),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Maricopa Elementary School",'Maricopa=' + Maricopa.length);
Maricopa[Maricopa.length] = createMarker(new GPoint(-112.05107117,33.05314255),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Maricopa High School",'Maricopa=' + Maricopa.length);
Maricopa[Maricopa.length] = createMarker(new GPoint(-112.05107117,33.05314255),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Maricopa Middle School",'Maricopa=' + Maricopa.length);
Maricopa[Maricopa.length] = createMarker(new GPoint(-112.09470367,32.96860123),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Maricopa Unified High School",'Maricopa=' + Maricopa.length);
Casa_Grande[Casa_Grande.length] = createMarker(new GPoint(-111.75618744,32.88048172),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mary C O'brien Elementary School",'Casa_Grande=' + Casa_Grande.length);
Coolidge[Coolidge.length] = createMarker(new GPoint(-111.52670288,32.96829987),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Mccray Academy",'Coolidge=' + Coolidge.length);
Coolidge[Coolidge.length] = createMarker(new GPoint(-111.52383423,32.98021317),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mccray Elementary School",'Coolidge=' + Coolidge.length);
Casa_Grande[Casa_Grande.length] = createMarker(new GPoint(-111.71436310,32.87361526),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mesquite Elementary School",'Casa_Grande=' + Casa_Grande.length);
Apache_Junction[Apache_Junction.length] = createMarker(new GPoint(-111.54519653,33.39194107),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Morningstar Academy",'Apache_Junction=' + Apache_Junction.length);
Oracle[Oracle.length] = createMarker(new GPoint(-110.76976013,32.61127853),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mountain Vista School",'Oracle=' + Oracle.length);
Coolidge[Coolidge.length] = createMarker(new GPoint(-111.52400200,32.98024700),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("North Elementary School",'Coolidge=' + Coolidge.length);
Oracle[Oracle.length] = createMarker(new GPoint(-110.76976013,32.61127853),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Oracle Ridge School",'Oracle=' + Oracle.length);
Casa_Grande[Casa_Grande.length] = createMarker(new GPoint(-111.74233246,32.87400055),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Palo Verde School",'Casa_Grande=' + Casa_Grande.length);
Apache_Junction[Apache_Junction.length] = createMarker(new GPoint(-111.42896271,33.34248352),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Peralta Trail Elementary School",'Apache_Junction=' + Apache_Junction.length);
Picacho[Picacho.length] = createMarker(new GPoint(-111.40380096,32.65140152),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Picacho School",'Picacho=' + Picacho.length);
Maricopa[Maricopa.length] = createMarker(new GPoint(-112.05042700,33.05417100),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Pima Butte",'Maricopa=' + Maricopa.length);
Casa_Grande[Casa_Grande.length] = createMarker(new GPoint(-111.72471100,32.87959600),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Pinal County Special Ed Prog",'Casa_Grande=' + Casa_Grande.length);
Casa_Grande[Casa_Grande.length] = createMarker(new GPoint(-111.92649841,33.39220047),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Pinnacle High School - Casa Grande",'Casa_Grande=' + Casa_Grande.length);
Tucson[Tucson.length] = createMarker(new GPoint(-111.75209808,32.87973785),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Ppep Tec - Alice S. Paul Learning Center",'Tucson=' + Tucson.length);
Kearny[Kearny.length] = createMarker(new GPoint(-110.94029999,33.08689880),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Ray Elementary School",'Kearny=' + Kearny.length);
Kearny[Kearny.length] = createMarker(new GPoint(-110.94029999,33.08689880),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Ray High School",'Kearny=' + Kearny.length);
Kearny[Kearny.length] = createMarker(new GPoint(-110.94029999,33.08689880),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Ray Primary School",'Kearny=' + Kearny.length);
Red_Rock[Red_Rock.length] = createMarker(new GPoint(-111.42919922,32.53929901),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Red Rock Elementary School",'Red_Rock=' + Red_Rock.length);
Sacaton[Sacaton.length] = createMarker(new GPoint(-111.75420380,33.09299850),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Sacaton Elementary School",'Sacaton=' + Sacaton.length);
Sacaton[Sacaton.length] = createMarker(new GPoint(-111.75420380,33.09299850),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Sacaton Middle School",'Sacaton=' + Sacaton.length);
Casa_Grande[Casa_Grande.length] = createMarker(new GPoint(-111.75305939,32.89214706),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Saguaro Elementary School",'Casa_Grande=' + Casa_Grande.length);
San_Manuel[San_Manuel.length] = createMarker(new GPoint(-110.62765300,32.61358500),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("San Manual Jr. High School",'San_Manuel=' + San_Manuel.length);
San_Manuel[San_Manuel.length] = createMarker(new GPoint(-110.67610168,32.69129944),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("San Manual Junior High School",'San_Manuel=' + San_Manuel.length);
Queen_Creek[Queen_Creek.length] = createMarker(new GPoint(-111.60289764,33.23690033),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("San Tan Heights Elementary School",'Queen_Creek=' + Queen_Creek.length);
Eloy[Eloy.length] = createMarker(new GPoint(-111.55491800,32.75842800),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Santa Cruz Valley Union High School",'Eloy=' + Eloy.length);
Maricopa[Maricopa.length] = createMarker(new GPoint(-112.07050323,32.97389984),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Santa Rosa Elementary School",'Maricopa=' + Maricopa.length);
Oracle[Oracle.length] = createMarker(new GPoint(-110.77649689,32.60829926),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Sierra Oaks School",'Oracle=' + Oracle.length);
Florence[Florence.length] = createMarker(new GPoint(-111.36613200,33.03844200),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Skyline Ranch Elementary School",'Florence=' + Florence.length);
Stanfield[Stanfield.length] = createMarker(new GPoint(-111.95529938,32.86679840),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Stanfield Elementary School",'Stanfield=' + Stanfield.length);
Superior[Superior.length] = createMarker(new GPoint(-111.09963989,33.29524231),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Superior Junior High School",'Superior=' + Superior.length);
Superior[Superior.length] = createMarker(new GPoint(-111.09524536,33.29441833),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Superior Junior/senior High School",'Superior=' + Superior.length);
Superior[Superior.length] = createMarker(new GPoint(-111.09963989,33.29524231),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Superior School",'Superior=' + Superior.length);
Superior[Superior.length] = createMarker(new GPoint(-111.11730957,33.28553009),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Superior Senior High School",'Superior=' + Superior.length);
Apache_Junction[Apache_Junction.length] = createMarker(new GPoint(-111.56356049,33.41007614),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Superstition Mountain Elementary School",'Apache_Junction=' + Apache_Junction.length);
Apache_Junction[Apache_Junction.length] = createMarker(new GPoint(-111.50782776,33.40056229),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Thunder Mountain Middle School",'Apache_Junction=' + Apache_Junction.length);
Eloy[Eloy.length] = createMarker(new GPoint(-111.61923981,32.78571701),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Toltec Elementary School",'Eloy=' + Eloy.length);
Eloy[Eloy.length] = createMarker(new GPoint(-111.61923981,32.78571701),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Toltec Middle School",'Eloy=' + Eloy.length);
Bapchule[Bapchule.length] = createMarker(new GPoint(-111.92140198,33.13850021),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Vah-ki Middle School",'Bapchule=' + Bapchule.length);
Sacaton[Sacaton.length] = createMarker(new GPoint(-111.75420380,33.09299850),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Vechij Himdag Mashchamakud High School",'Sacaton=' + Sacaton.length);
Casa_Grande[Casa_Grande.length] = createMarker(new GPoint(-111.75032400,32.87954500),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Villa Oasis Interscholastic Center For Education",'Casa_Grande=' + Casa_Grande.length);
Queen_Creek[Queen_Creek.length] = createMarker(new GPoint(-111.55678558,33.15034866),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Walker Butte K-8 Elementary School",'Queen_Creek=' + Queen_Creek.length);
Queen_Creek[Queen_Creek.length] = createMarker(new GPoint(-111.55587006,33.14884949),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Walker Butte School",'Queen_Creek=' + Queen_Creek.length);
Coolidge[Coolidge.length] = createMarker(new GPoint(-111.52410126,32.95370102),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("West Elementary School",'Coolidge=' + Coolidge.length);
Winkelman[Winkelman.length] = createMarker(new GPoint(-110.75559998,32.99769974),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Winkelman Primary School",'Winkelman=' + Winkelman.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(Apache_Junction);
map.removeOverlays(Bapchule);
map.removeOverlays(Casa_Grande);
map.removeOverlays(Coolidge);
map.removeOverlays(Eloy);
map.removeOverlays(Florence);
map.removeOverlays(Kearny);
map.removeOverlays(Maricopa);
map.removeOverlays(Oracle);
map.removeOverlays(Phoenix);
map.removeOverlays(Picacho);
map.removeOverlays(Queen_Creek);
map.removeOverlays(Red_Rock);
map.removeOverlays(Sacaton);
map.removeOverlays(San_Manuel);
map.removeOverlays(Stanfield);
map.removeOverlays(Superior);
map.removeOverlays(Tucson);
map.removeOverlays(Winkelman);
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(Coolidge);map.removeOverlays(Apache_Junction);
map.removeOverlays(Bapchule);
map.removeOverlays(Casa_Grande);
map.removeOverlays(Coolidge);
map.removeOverlays(Eloy);
map.removeOverlays(Florence);
map.removeOverlays(Kearny);
map.removeOverlays(Maricopa);
map.removeOverlays(Oracle);
map.removeOverlays(Phoenix);
map.removeOverlays(Picacho);
map.removeOverlays(Queen_Creek);
map.removeOverlays(Red_Rock);
map.removeOverlays(Sacaton);
map.removeOverlays(San_Manuel);
map.removeOverlays(Stanfield);
map.removeOverlays(Superior);
map.removeOverlays(Tucson);
map.removeOverlays(Winkelman);
map.addOverlays(Apache_Junction);
centerByArray(Apache_Junction, false, false);
cntMarker += Apache_Junction.length;
map.addOverlays(Bapchule);
centerByArray(Bapchule, false, false);
cntMarker += Bapchule.length;
map.addOverlays(Casa_Grande);
centerByArray(Casa_Grande, false, false);
cntMarker += Casa_Grande.length;
map.addOverlays(Coolidge);
centerByArray(Coolidge, false, false);
cntMarker += Coolidge.length;
map.addOverlays(Eloy);
centerByArray(Eloy, false, false);
cntMarker += Eloy.length;
map.addOverlays(Florence);
centerByArray(Florence, false, false);
cntMarker += Florence.length;
map.addOverlays(Kearny);
centerByArray(Kearny, false, false);
cntMarker += Kearny.length;
map.addOverlays(Maricopa);
centerByArray(Maricopa, false, false);
cntMarker += Maricopa.length;
map.addOverlays(Oracle);
centerByArray(Oracle, false, false);
cntMarker += Oracle.length;
map.addOverlays(Phoenix);
centerByArray(Phoenix, false, false);
cntMarker += Phoenix.length;
map.addOverlays(Picacho);
centerByArray(Picacho, false, false);
cntMarker += Picacho.length;
map.addOverlays(Queen_Creek);
centerByArray(Queen_Creek, false, false);
cntMarker += Queen_Creek.length;
map.addOverlays(Red_Rock);
centerByArray(Red_Rock, false, false);
cntMarker += Red_Rock.length;
map.addOverlays(Sacaton);
centerByArray(Sacaton, false, false);
cntMarker += Sacaton.length;
map.addOverlays(San_Manuel);
centerByArray(San_Manuel, false, false);
cntMarker += San_Manuel.length;
map.addOverlays(Stanfield);
centerByArray(Stanfield, false, false);
cntMarker += Stanfield.length;
map.addOverlays(Superior);
centerByArray(Superior, false, false);
cntMarker += Superior.length;
map.addOverlays(Tucson);
centerByArray(Tucson, false, false);
cntMarker += Tucson.length;
map.addOverlays(Winkelman);
centerByArray(Winkelman, false, false);
cntMarker += Winkelman.length;
centerByArray(Coolidge,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');
}
}