function addMarkers()
{
mySelect = document.getElementById('selection');
Tucson = [];Fort_Mohave = [];Mohave_Valley = [];Phoenix = [];Lake_Havasu_City = [];Beaver_Dam = [];Littlefield = [];Golden_Valley = [];Bullhead_City = [];Kingman = [];Cottonwood = [];Colorado_City = [];Centennial_Park = [];Fredonia = [];Dolan_Springs = [];Peach_Springs = [];Wikieup = [];Topock = [];Yucca = [];mySelect.options[mySelect.options.length] = new Option("Beaver Dam schools",'all=Beaver_Dam');
mySelect.options[mySelect.options.length] = new Option("Bullhead City schools",'all=Bullhead_City');
mySelect.options[mySelect.options.length] = new Option("Centennial Park schools",'all=Centennial_Park');
mySelect.options[mySelect.options.length] = new Option("Colorado City schools",'all=Colorado_City');
mySelect.options[mySelect.options.length] = new Option("Cottonwood schools",'all=Cottonwood');
mySelect.options[mySelect.options.length] = new Option("Dolan Springs schools",'all=Dolan_Springs');
mySelect.options[mySelect.options.length] = new Option("Fort Mohave schools",'all=Fort_Mohave');
mySelect.options[mySelect.options.length] = new Option("Fredonia schools",'all=Fredonia');
mySelect.options[mySelect.options.length] = new Option("Golden Valley schools",'all=Golden_Valley');
mySelect.options[mySelect.options.length] = new Option("Kingman schools",'all=Kingman');
mySelect.options[mySelect.options.length] = new Option("Lake Havasu City schools",'all=Lake_Havasu_City');
mySelect.options[mySelect.options.length] = new Option("Littlefield schools",'all=Littlefield');
mySelect.options[mySelect.options.length] = new Option("Mohave Valley schools",'all=Mohave_Valley');
mySelect.options[mySelect.options.length] = new Option("Peach Springs schools",'all=Peach_Springs');
mySelect.options[mySelect.options.length] = new Option("Phoenix schools",'all=Phoenix');
mySelect.options[mySelect.options.length] = new Option("Topock schools",'all=Topock');
mySelect.options[mySelect.options.length] = new Option("Tucson schools",'all=Tucson');
mySelect.options[mySelect.options.length] = new Option("Wikieup schools",'all=Wikieup');
mySelect.options[mySelect.options.length] = new Option("Yucca schools",'all=Yucca');
mySelect.options[mySelect.options.length] = new Option("---------------------------",'');
Tucson[Tucson.length] = createMarker(new GPoint(-110.88710022,32.25120163),"
",iconGr);
mySelect.options[mySelect.options.length] = new Option("Academic Success Charter School",'Tucson=' + Tucson.length);
Fort_Mohave[Fort_Mohave.length] = createMarker(new GPoint(-10.00000000,10.00000000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Academy Of Building Industries",'Fort_Mohave=' + Fort_Mohave.length);
Mohave_Valley[Mohave_Valley.length] = createMarker(new GPoint(-114.13020325,34.92369843),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Aha Macav High School",'Mohave_Valley=' + Mohave_Valley.length);
Phoenix[Phoenix.length] = createMarker(new GPoint(-112.07363129,33.46824646),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Amerischools Children's Academy - Phoenix",'Phoenix=' + Phoenix.length);
Tucson[Tucson.length] = createMarker(new GPoint(-110.97163391,32.23897552),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Amerischools Children's Academy - Tucson",'Tucson=' + Tucson.length);
Lake_Havasu_City[Lake_Havasu_City.length] = createMarker(new GPoint(-114.27629852,34.46788788),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Arrowhead West",'Lake_Havasu_City=' + Lake_Havasu_City.length);
Beaver_Dam[Beaver_Dam.length] = createMarker(new GPoint(-113.85299683,36.78990173),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Beaver Dam Elementary School",'Beaver_Dam=' + Beaver_Dam.length);
Littlefield[Littlefield.length] = createMarker(new GPoint(-113.92907800,36.88875900),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Beaver Dam High School",'Littlefield=' + Littlefield.length);
Golden_Valley[Golden_Valley.length] = createMarker(new GPoint(-114.22232819,35.20023727),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Black Mountain Elementary School",'Golden_Valley=' + Golden_Valley.length);
Bullhead_City[Bullhead_City.length] = createMarker(new GPoint(-114.61272430,35.10786438),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Bullhead City Junior High School",'Bullhead_City=' + Bullhead_City.length);
Bullhead_City[Bullhead_City.length] = createMarker(new GPoint(-114.58998871,35.02983856),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Camp Mohave Elementary School",'Bullhead_City=' + Bullhead_City.length);
Kingman[Kingman.length] = createMarker(new GPoint(-113.86009979,35.39189911),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Cedar Hills School",'Kingman=' + Kingman.length);
Kingman[Kingman.length] = createMarker(new GPoint(-114.01698303,35.26853561),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Cerbat Elementary School",'Kingman=' + Kingman.length);
Cottonwood[Cottonwood.length] = createMarker(new GPoint(-112.01660156,34.71770096),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Clearview Charter School - Blue Skies Campus",'Cottonwood=' + Cottonwood.length);
Cottonwood[Cottonwood.length] = createMarker(new GPoint(-112.01660156,34.71770096),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Clearview Charter School - Four Winds Campus",'Cottonwood=' + Cottonwood.length);
Colorado_City[Colorado_City.length] = createMarker(new GPoint(-113.01159668,36.85549927),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Colorado City Elementary School",'Colorado_City=' + Colorado_City.length);
Colorado_City[Colorado_City.length] = createMarker(new GPoint(-113.01159668,36.85549927),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Colorado City High School",'Colorado_City=' + Colorado_City.length);
Colorado_City[Colorado_City.length] = createMarker(new GPoint(-113.01159668,36.85549927),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Colorado City Junior High School",'Colorado_City=' + Colorado_City.length);
Bullhead_City[Bullhead_City.length] = createMarker(new GPoint(-114.61272430,35.10786438),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Coyote Canyon School",'Bullhead_City=' + Bullhead_City.length);
Lake_Havasu_City[Lake_Havasu_City.length] = createMarker(new GPoint(-72.61089325,41.79253769),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Daytona Middle School",'Lake_Havasu_City=' + Lake_Havasu_City.length);
Lake_Havasu_City[Lake_Havasu_City.length] = createMarker(new GPoint(-114.29371643,34.45474625),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Desert Technology High School",'Lake_Havasu_City=' + Lake_Havasu_City.length);
Lake_Havasu_City[Lake_Havasu_City.length] = createMarker(new GPoint(-113.94029999,34.54529953),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Desert Technology High School (charter)",'Lake_Havasu_City=' + Lake_Havasu_City.length);
Bullhead_City[Bullhead_City.length] = createMarker(new GPoint(-114.61272430,35.10786438),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Desert Valley Elementary School",'Bullhead_City=' + Bullhead_City.length);
Bullhead_City[Bullhead_City.length] = createMarker(new GPoint(-114.61272430,35.10786438),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Diamondback Elementary School",'Bullhead_City=' + Bullhead_City.length);
Lake_Havasu_City[Lake_Havasu_City.length] = createMarker(new GPoint(-114.32885900,34.50204300),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Distant Learning",'Lake_Havasu_City=' + Lake_Havasu_City.length);
Golden_Valley[Golden_Valley.length] = createMarker(new GPoint(-114.23626709,35.21651459),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("E.a.g.l.e. Academy",'Golden_Valley=' + Golden_Valley.length);
Golden_Valley[Golden_Valley.length] = createMarker(new GPoint(-114.29060364,35.23609924),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("E.a.g.l.e. Academy (charter)",'Golden_Valley=' + Golden_Valley.length);
Fort_Mohave[Fort_Mohave.length] = createMarker(new GPoint(-114.60058594,35.02163696),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Excel Education Centers Fort Mohave, Llc High School",'Fort_Mohave=' + Fort_Mohave.length);
Fort_Mohave[Fort_Mohave.length] = createMarker(new GPoint(-114.58966827,34.99686432),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Fort Mohave Elementary School",'Fort_Mohave=' + Fort_Mohave.length);
Bullhead_City[Bullhead_City.length] = createMarker(new GPoint(-114.54951477,35.07942581),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Fox Creek Junior High School",'Bullhead_City=' + Bullhead_City.length);
Lake_Havasu_City[Lake_Havasu_City.length] = createMarker(new GPoint(-114.31659698,34.50933075),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Havasupai Elementary School",'Lake_Havasu_City=' + Lake_Havasu_City.length);
Kingman[Kingman.length] = createMarker(new GPoint(-114.01123047,35.19265366),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hualapai Elementary School",'Kingman=' + Kingman.length);
Lake_Havasu_City[Lake_Havasu_City.length] = createMarker(new GPoint(-114.29114532,34.50021362),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Jamaica Elementary School",'Lake_Havasu_City=' + Lake_Havasu_City.length);
Kingman[Kingman.length] = createMarker(new GPoint(-114.02471924,35.21761322),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Kingman Academy Of Learning - High School",'Kingman=' + Kingman.length);
Kingman[Kingman.length] = createMarker(new GPoint(-114.02471924,35.21761322),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Kingman Academy Of Learning - Intermediate School",'Kingman=' + Kingman.length);
Kingman[Kingman.length] = createMarker(new GPoint(-114.02496338,35.21773911),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Kingman Academy Of Learning - Middle School",'Kingman=' + Kingman.length);
Kingman[Kingman.length] = createMarker(new GPoint(-114.02471924,35.21761322),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Kingman Academy Of Learning - Middle School (chart",'Kingman=' + Kingman.length);
Kingman[Kingman.length] = createMarker(new GPoint(-114.02496338,35.21773911),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Kingman Academy Of Learning - Primary School",'Kingman=' + Kingman.length);
Kingman[Kingman.length] = createMarker(new GPoint(-114.02471924,35.21761322),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Kingman Academy Of Learning - Primary School (char",'Kingman=' + Kingman.length);
Kingman[Kingman.length] = createMarker(new GPoint(-114.01132965,35.24538040),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Kingman High School - North",'Kingman=' + Kingman.length);
Kingman[Kingman.length] = createMarker(new GPoint(-114.06113434,35.19191360),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Kingman High School - South",'Kingman=' + Kingman.length);
Kingman[Kingman.length] = createMarker(new GPoint(-114.03254700,35.21413803),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Kingman Junior High School",'Kingman=' + Kingman.length);
Kingman[Kingman.length] = createMarker(new GPoint(-114.00267029,35.23953629),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("La Senita Elementary School",'Kingman=' + Kingman.length);
Lake_Havasu_City[Lake_Havasu_City.length] = createMarker(new GPoint(-114.34825400,34.50978000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Lake Havasu Charter School",'Lake_Havasu_City=' + Lake_Havasu_City.length);
Lake_Havasu_City[Lake_Havasu_City.length] = createMarker(new GPoint(-114.32857513,34.51807404),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Lake Havasu High School",'Lake_Havasu_City=' + Lake_Havasu_City.length);
Kingman[Kingman.length] = createMarker(new GPoint(-114.01731873,35.21403885),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Manzanita Elementary School",'Kingman=' + Kingman.length);
Centennial_Park[Centennial_Park.length] = createMarker(new GPoint(-112.55400085,34.59519958),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Masada Charter School",'Centennial_Park=' + Centennial_Park.length);
Tucson[Tucson.length] = createMarker(new GPoint(-110.99889374,32.27206421),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Mathematics And Science Achievement School",'Tucson=' + Tucson.length);
Fredonia[Fredonia.length] = createMarker(new GPoint(-112.34290314,36.72919846),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Moccasin Elementary School",'Fredonia=' + Fredonia.length);
Bullhead_City[Bullhead_City.length] = createMarker(new GPoint(-114.62443400,35.10062300),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mohave Accelerated Elementary School",'Bullhead_City=' + Bullhead_City.length);
Bullhead_City[Bullhead_City.length] = createMarker(new GPoint(-114.13020325,34.92369843),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Mohave Accelerated Learning Center",'Bullhead_City=' + Bullhead_City.length);
Bullhead_City[Bullhead_City.length] = createMarker(new GPoint(-114.59816742,35.10546112),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Mohave High School",'Bullhead_City=' + Bullhead_City.length);
Mohave_Valley[Mohave_Valley.length] = createMarker(new GPoint(-114.60073853,34.90977859),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mohave Valley Elementary School",'Mohave_Valley=' + Mohave_Valley.length);
Mohave_Valley[Mohave_Valley.length] = createMarker(new GPoint(-114.13020325,34.92369843),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Mohave Valley Junior High School",'Mohave_Valley=' + Mohave_Valley.length);
Bullhead_City[Bullhead_City.length] = createMarker(new GPoint(-114.61272430,35.10786438),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mountain View Elementary School",'Bullhead_City=' + Bullhead_City.length);
Dolan_Springs[Dolan_Springs.length] = createMarker(new GPoint(-114.58059692,35.85390091),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Mt Tipton Elementary School",'Dolan_Springs=' + Dolan_Springs.length);
Peach_Springs[Peach_Springs.length] = createMarker(new GPoint(-113.28679657,35.65140152),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Music Mountain Jr./sr. High School",'Peach_Springs=' + Peach_Springs.length);
Lake_Havasu_City[Lake_Havasu_City.length] = createMarker(new GPoint(-114.34249878,34.51604080),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Nautilus Elementary School",'Lake_Havasu_City=' + Lake_Havasu_City.length);
Lake_Havasu_City[Lake_Havasu_City.length] = createMarker(new GPoint(-114.27205658,34.46321487),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Oro Grande Elementary School",'Lake_Havasu_City=' + Lake_Havasu_City.length);
Wikieup[Wikieup.length] = createMarker(new GPoint(-113.61000061,34.69910049),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Owens Elementary School",'Wikieup=' + Wikieup.length);
Kingman[Kingman.length] = createMarker(new GPoint(-114.05169678,35.19264984),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Palo Christi Elementary School",'Kingman=' + Kingman.length);
Kingman[Kingman.length] = createMarker(new GPoint(-114.01132965,35.24538040),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Pass School",'Kingman=' + Kingman.length);
Peach_Springs[Peach_Springs.length] = createMarker(new GPoint(-113.28679657,35.65140152),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Peach Springs School",'Peach_Springs=' + Peach_Springs.length);
Phoenix[Phoenix.length] = createMarker(new GPoint(-112.11464500,33.58416500),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Pillar Academy Of Business & Finance",'Phoenix=' + Phoenix.length);
Mohave_Valley[Mohave_Valley.length] = createMarker(new GPoint(-114.56707764,34.89495468),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("River Valley High School",'Mohave_Valley=' + Mohave_Valley.length);
Lake_Havasu_City[Lake_Havasu_City.length] = createMarker(new GPoint(-114.33370209,34.48569870),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Smoketree Elementary School",'Lake_Havasu_City=' + Lake_Havasu_City.length);
Lake_Havasu_City[Lake_Havasu_City.length] = createMarker(new GPoint(-114.29924011,34.48526382),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Starline Elementary School",'Lake_Havasu_City=' + Lake_Havasu_City.length);
Bullhead_City[Bullhead_City.length] = createMarker(new GPoint(-114.52729797,35.19068146),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Sunrise Elementary School",'Bullhead_City=' + Bullhead_City.length);
Lake_Havasu_City[Lake_Havasu_City.length] = createMarker(new GPoint(-114.26841736,34.48860168),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Telesis Preparatory",'Lake_Havasu_City=' + Lake_Havasu_City.length);
Lake_Havasu_City[Lake_Havasu_City.length] = createMarker(new GPoint(-114.31716156,34.49159622),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Telesis Preparatory Academy",'Lake_Havasu_City=' + Lake_Havasu_City.length);
Lake_Havasu_City[Lake_Havasu_City.length] = createMarker(new GPoint(-114.33370209,34.48569870),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Telesis Preparatory Academy (charter)",'Lake_Havasu_City=' + Lake_Havasu_City.length);
Lake_Havasu_City[Lake_Havasu_City.length] = createMarker(new GPoint(-114.29033661,34.47067642),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Thunderbolt Middle School",'Lake_Havasu_City=' + Lake_Havasu_City.length);
Topock[Topock.length] = createMarker(new GPoint(-114.47959900,34.77040100),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Topock Elementary School",'Topock=' + Topock.length);
Peach_Springs[Peach_Springs.length] = createMarker(new GPoint(-113.28679657,35.65140152),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Valentine Elementary School",'Peach_Springs=' + Peach_Springs.length);
Bullhead_City[Bullhead_City.length] = createMarker(new GPoint(-114.59784698,35.03343582),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Young Scholars Academy",'Bullhead_City=' + Bullhead_City.length);
Bullhead_City[Bullhead_City.length] = createMarker(new GPoint(-114.59794617,35.03325653),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Young Scholars Academy (charter)",'Bullhead_City=' + Bullhead_City.length);
Yucca[Yucca.length] = createMarker(new GPoint(-114.15090179,34.86959839),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Yucca Elementary School",'Yucca=' + Yucca.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(Beaver_Dam);
map.removeOverlays(Bullhead_City);
map.removeOverlays(Centennial_Park);
map.removeOverlays(Colorado_City);
map.removeOverlays(Cottonwood);
map.removeOverlays(Dolan_Springs);
map.removeOverlays(Fort_Mohave);
map.removeOverlays(Fredonia);
map.removeOverlays(Golden_Valley);
map.removeOverlays(Kingman);
map.removeOverlays(Lake_Havasu_City);
map.removeOverlays(Littlefield);
map.removeOverlays(Mohave_Valley);
map.removeOverlays(Peach_Springs);
map.removeOverlays(Phoenix);
map.removeOverlays(Topock);
map.removeOverlays(Tucson);
map.removeOverlays(Wikieup);
map.removeOverlays(Yucca);
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(Tucson);map.removeOverlays(Beaver_Dam);
map.removeOverlays(Bullhead_City);
map.removeOverlays(Centennial_Park);
map.removeOverlays(Colorado_City);
map.removeOverlays(Cottonwood);
map.removeOverlays(Dolan_Springs);
map.removeOverlays(Fort_Mohave);
map.removeOverlays(Fredonia);
map.removeOverlays(Golden_Valley);
map.removeOverlays(Kingman);
map.removeOverlays(Lake_Havasu_City);
map.removeOverlays(Littlefield);
map.removeOverlays(Mohave_Valley);
map.removeOverlays(Peach_Springs);
map.removeOverlays(Phoenix);
map.removeOverlays(Topock);
map.removeOverlays(Tucson);
map.removeOverlays(Wikieup);
map.removeOverlays(Yucca);
map.addOverlays(Beaver_Dam);
centerByArray(Beaver_Dam, false, false);
cntMarker += Beaver_Dam.length;
map.addOverlays(Bullhead_City);
centerByArray(Bullhead_City, false, false);
cntMarker += Bullhead_City.length;
map.addOverlays(Centennial_Park);
centerByArray(Centennial_Park, false, false);
cntMarker += Centennial_Park.length;
map.addOverlays(Colorado_City);
centerByArray(Colorado_City, false, false);
cntMarker += Colorado_City.length;
map.addOverlays(Cottonwood);
centerByArray(Cottonwood, false, false);
cntMarker += Cottonwood.length;
map.addOverlays(Dolan_Springs);
centerByArray(Dolan_Springs, false, false);
cntMarker += Dolan_Springs.length;
map.addOverlays(Fort_Mohave);
centerByArray(Fort_Mohave, false, false);
cntMarker += Fort_Mohave.length;
map.addOverlays(Fredonia);
centerByArray(Fredonia, false, false);
cntMarker += Fredonia.length;
map.addOverlays(Golden_Valley);
centerByArray(Golden_Valley, false, false);
cntMarker += Golden_Valley.length;
map.addOverlays(Kingman);
centerByArray(Kingman, false, false);
cntMarker += Kingman.length;
map.addOverlays(Lake_Havasu_City);
centerByArray(Lake_Havasu_City, false, false);
cntMarker += Lake_Havasu_City.length;
map.addOverlays(Littlefield);
centerByArray(Littlefield, false, false);
cntMarker += Littlefield.length;
map.addOverlays(Mohave_Valley);
centerByArray(Mohave_Valley, false, false);
cntMarker += Mohave_Valley.length;
map.addOverlays(Peach_Springs);
centerByArray(Peach_Springs, false, false);
cntMarker += Peach_Springs.length;
map.addOverlays(Phoenix);
centerByArray(Phoenix, false, false);
cntMarker += Phoenix.length;
map.addOverlays(Topock);
centerByArray(Topock, false, false);
cntMarker += Topock.length;
map.addOverlays(Tucson);
centerByArray(Tucson, false, false);
cntMarker += Tucson.length;
map.addOverlays(Wikieup);
centerByArray(Wikieup, false, false);
cntMarker += Wikieup.length;
map.addOverlays(Yucca);
centerByArray(Yucca, false, false);
cntMarker += Yucca.length;
centerByArray(Tucson,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');
}
}