function addMarkers()
{
mySelect = document.getElementById('selection');
Dade_City = [];New_Port_Richey = [];Port_Richey = [];Zephyrhills = [];Land_Olakes = [];Lutz = [];Holiday = [];Hudson = [];San_Antonio = [];Spring_Hill = [];Land_O_Lakes = [];Elfers = [];Wesley_Chapel = [];Lacoochee = [];mySelect.options[mySelect.options.length] = new Option("Dade City schools",'all=Dade_City');
mySelect.options[mySelect.options.length] = new Option("Elfers schools",'all=Elfers');
mySelect.options[mySelect.options.length] = new Option("Holiday schools",'all=Holiday');
mySelect.options[mySelect.options.length] = new Option("Hudson schools",'all=Hudson');
mySelect.options[mySelect.options.length] = new Option("Lacoochee schools",'all=Lacoochee');
mySelect.options[mySelect.options.length] = new Option("Land O Lakes schools",'all=Land_O_Lakes');
mySelect.options[mySelect.options.length] = new Option("Land Olakes schools",'all=Land_Olakes');
mySelect.options[mySelect.options.length] = new Option("Lutz schools",'all=Lutz');
mySelect.options[mySelect.options.length] = new Option("New Port Richey schools",'all=New_Port_Richey');
mySelect.options[mySelect.options.length] = new Option("Port Richey schools",'all=Port_Richey');
mySelect.options[mySelect.options.length] = new Option("San Antonio schools",'all=San_Antonio');
mySelect.options[mySelect.options.length] = new Option("Spring Hill schools",'all=Spring_Hill');
mySelect.options[mySelect.options.length] = new Option("Wesley Chapel schools",'all=Wesley_Chapel');
mySelect.options[mySelect.options.length] = new Option("Zephyrhills schools",'all=Zephyrhills');
mySelect.options[mySelect.options.length] = new Option("---------------------------",'');
Dade_City[Dade_City.length] = createMarker(new GPoint(-82.24877167,27.87174416),"
",iconRd);
mySelect.options[mySelect.options.length] = new Option("Academy At Farm",'Dade_City=' + Dade_City.length);
New_Port_Richey[New_Port_Richey.length] = createMarker(new GPoint(-82.71548600,28.25024300),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Anclote Elementary School",'New_Port_Richey=' + New_Port_Richey.length);
New_Port_Richey[New_Port_Richey.length] = createMarker(new GPoint(-82.66625214,28.31978035),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Bayonet Point Middle School",'New_Port_Richey=' + New_Port_Richey.length);
New_Port_Richey[New_Port_Richey.length] = createMarker(new GPoint(-82.69062042,28.27316284),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Calusa Elementary School",'New_Port_Richey=' + New_Port_Richey.length);
Dade_City[Dade_City.length] = createMarker(new GPoint(-82.17942810,28.30293655),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Centennial Elementary School",'Dade_City=' + Dade_City.length);
Dade_City[Dade_City.length] = createMarker(new GPoint(-82.17935944,28.30293655),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Centennial Middle School",'Dade_City=' + Dade_City.length);
Port_Richey[Port_Richey.length] = createMarker(new GPoint(-82.68407440,28.28026390),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Chasco Elementary School",'Port_Richey=' + Port_Richey.length);
Port_Richey[Port_Richey.length] = createMarker(new GPoint(-82.68679047,28.28026390),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Chasco Middle School",'Port_Richey=' + Port_Richey.length);
Zephyrhills[Zephyrhills.length] = createMarker(new GPoint(-82.24597168,28.21012688),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Chester Taylor Elementary School",'Zephyrhills=' + Zephyrhills.length);
Zephyrhills[Zephyrhills.length] = createMarker(new GPoint(-82.24597168,28.21012688),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Chester W. Taylor Elementary School",'Zephyrhills=' + Zephyrhills.length);
New_Port_Richey[New_Port_Richey.length] = createMarker(new GPoint(-82.69049835,28.23903656),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Cotee River Elementary School",'New_Port_Richey=' + New_Port_Richey.length);
Land_Olakes[Land_Olakes.length] = createMarker(new GPoint(-81.51306600,31.24519300),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Countryside Montessori Academy",'Land_Olakes=' + Land_Olakes.length);
New_Port_Richey[New_Port_Richey.length] = createMarker(new GPoint(-82.65074158,28.26898193),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Cypress Elementary School",'New_Port_Richey=' + New_Port_Richey.length);
Port_Richey[Port_Richey.length] = createMarker(new GPoint(-82.66735077,28.31463623),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Dayspring Academy",'Port_Richey=' + Port_Richey.length);
New_Port_Richey[New_Port_Richey.length] = createMarker(new GPoint(-82.69775000,28.22727900),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Deer Park Elementary School",'New_Port_Richey=' + New_Port_Richey.length);
Lutz[Lutz.length] = createMarker(new GPoint(-82.41097260,28.17588806),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Denham Oaks Elementary School",'Lutz=' + Lutz.length);
New_Port_Richey[New_Port_Richey.length] = createMarker(new GPoint(-82.69105530,28.27122879),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("F.k. Marchman Technical Education Center",'New_Port_Richey=' + New_Port_Richey.length);
Port_Richey[Port_Richey.length] = createMarker(new GPoint(-82.67775726,28.30203629),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Fox Hollow Elementary School",'Port_Richey=' + Port_Richey.length);
New_Port_Richey[New_Port_Richey.length] = createMarker(new GPoint(-82.71699524,28.23516273),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Gulf High School",'New_Port_Richey=' + New_Port_Richey.length);
New_Port_Richey[New_Port_Richey.length] = createMarker(new GPoint(-82.70840454,28.24263763),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Gulf Middle School",'New_Port_Richey=' + New_Port_Richey.length);
Holiday[Holiday.length] = createMarker(new GPoint(-84.20726013,33.48814774),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Gulfside Elementary School",'Holiday=' + Holiday.length);
Hudson[Hudson.length] = createMarker(new GPoint(-82.69509125,28.36443710),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hudson Elementary School",'Hudson=' + Hudson.length);
Hudson[Hudson.length] = createMarker(new GPoint(-82.64543915,28.36643791),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Hudson High School",'Hudson=' + Hudson.length);
Hudson[Hudson.length] = createMarker(new GPoint(-82.64543915,28.36866951),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Hudson Middle School",'Hudson=' + Hudson.length);
Dade_City[Dade_City.length] = createMarker(new GPoint(-82.22310638,28.34390068),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("James Irvin Education Center",'Dade_City=' + Dade_City.length);
New_Port_Richey[New_Port_Richey.length] = createMarker(new GPoint(-82.72103882,28.23156357),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("James M. Marlowe Elementary School",'New_Port_Richey=' + New_Port_Richey.length);
New_Port_Richey[New_Port_Richey.length] = createMarker(new GPoint(-82.66664886,28.19214821),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("James W. Mitchell High School",'New_Port_Richey=' + New_Port_Richey.length);
San_Antonio[San_Antonio.length] = createMarker(new GPoint(-82.34731293,28.32428169),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Juvenile Detention Center",'San_Antonio=' + San_Antonio.length);
Dade_City[Dade_City.length] = createMarker(new GPoint(-82.17491150,28.45773697),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lacoochee Elementary School",'Dade_City=' + Dade_City.length);
Land_Olakes[Land_Olakes.length] = createMarker(new GPoint(-84.33754600,34.06076700),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lake Myrtle Elementary School",'Land_Olakes=' + Land_Olakes.length);
Land_Olakes[Land_Olakes.length] = createMarker(new GPoint(-10.00000000,10.00000000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Land O'lakes High School",'Land_Olakes=' + Land_Olakes.length);
New_Port_Richey[New_Port_Richey.length] = createMarker(new GPoint(-82.73655701,28.21908760),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Language Academy",'New_Port_Richey=' + New_Port_Richey.length);
New_Port_Richey[New_Port_Richey.length] = createMarker(new GPoint(-82.64703500,28.20751000),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Longleaf Elementary School",'New_Port_Richey=' + New_Port_Richey.length);
New_Port_Richey[New_Port_Richey.length] = createMarker(new GPoint(-82.67795563,28.27344704),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Mandala Treatment Center",'New_Port_Richey=' + New_Port_Richey.length);
Spring_Hill[Spring_Hill.length] = createMarker(new GPoint(-82.54560852,28.37253761),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mary Giella Elementary School",'Spring_Hill=' + Spring_Hill.length);
Land_O_Lakes[Land_O_Lakes.length] = createMarker(new GPoint(-82.49514900,28.25001000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Migrant Education Program",'Land_O_Lakes=' + Land_O_Lakes.length);
Elfers[Elfers.length] = createMarker(new GPoint(-82.71549988,28.20919991),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mittye P. Locke Elementary School",'Elfers=' + Elfers.length);
New_Port_Richey[New_Port_Richey.length] = createMarker(new GPoint(-82.61105347,28.33085442),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Moon Lake Elementary School",'New_Port_Richey=' + New_Port_Richey.length);
Dade_City[Dade_City.length] = createMarker(new GPoint(-82.19577789,28.36459923),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Moore-mickens Education Center",'Dade_City=' + Dade_City.length);
New_Port_Richey[New_Port_Richey.length] = createMarker(new GPoint(-82.71952057,28.23915100),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("New Port Richey Marine Institute",'New_Port_Richey=' + New_Port_Richey.length);
Hudson[Hudson.length] = createMarker(new GPoint(-82.64524078,28.36475563),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Northwest Elementary School",'Hudson=' + Hudson.length);
New_Port_Richey[New_Port_Richey.length] = createMarker(new GPoint(-82.72007751,28.23836899),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Pace For Girls, Pasco",'New_Port_Richey=' + New_Port_Richey.length);
Land_O_Lakes[Land_O_Lakes.length] = createMarker(new GPoint(-82.49514900,28.25001000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Pasco County Superintendent's Office",'Land_O_Lakes=' + Land_O_Lakes.length);
Dade_City[Dade_City.length] = createMarker(new GPoint(-82.19721985,28.35956383),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Pasco Elementary School",'Dade_City=' + Dade_City.length);
Dade_City[Dade_City.length] = createMarker(new GPoint(-82.20687103,28.35250092),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Pasco High School",'Dade_City=' + Dade_City.length);
Dade_City[Dade_City.length] = createMarker(new GPoint(-82.19581100,28.36010600),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Pasco Middle School",'Dade_City=' + Dade_City.length);
Land_Olakes[Land_Olakes.length] = createMarker(new GPoint(-81.59166300,31.13018600),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Pine View Elementary School",'Land_Olakes=' + Land_Olakes.length);
Land_O_Lakes[Land_O_Lakes.length] = createMarker(new GPoint(-82.42753600,28.23515800),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Pine View Middle School",'Land_O_Lakes=' + Land_O_Lakes.length);
Zephyrhills[Zephyrhills.length] = createMarker(new GPoint(-82.35719299,28.26146126),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Quail Hollow Elementary School",'Zephyrhills=' + Zephyrhills.length);
Dade_City[Dade_City.length] = createMarker(new GPoint(-82.19337463,28.36883736),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("R. B. Cox Elementary School",'Dade_City=' + Dade_City.length);
Zephyrhills[Zephyrhills.length] = createMarker(new GPoint(-82.17908478,28.24019623),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Raymond B. Stewart Middle School",'Zephyrhills=' + Zephyrhills.length);
New_Port_Richey[New_Port_Richey.length] = createMarker(new GPoint(-82.67465210,28.26803970),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Richard Milburn Academy",'New_Port_Richey=' + New_Port_Richey.length);
New_Port_Richey[New_Port_Richey.length] = createMarker(new GPoint(-82.71575165,28.25655365),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Richey Elementary School",'New_Port_Richey=' + New_Port_Richey.length);
New_Port_Richey[New_Port_Richey.length] = createMarker(new GPoint(-82.68823242,28.27316284),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Ridgewood High School",'New_Port_Richey=' + New_Port_Richey.length);
New_Port_Richey[New_Port_Richey.length] = createMarker(new GPoint(-82.62100983,28.26981926),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("River Ridge Middle/high School",'New_Port_Richey=' + New_Port_Richey.length);
Dade_City[Dade_City.length] = createMarker(new GPoint(-82.19337463,28.36883736),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Rodney B. Cox Elementary School",'Dade_City=' + Dade_City.length);
San_Antonio[San_Antonio.length] = createMarker(new GPoint(-82.29370117,28.33110046),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("San Antonio Boys Village - Hrs",'San_Antonio=' + San_Antonio.length);
Dade_City[Dade_City.length] = createMarker(new GPoint(-82.28050995,28.35396385),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("San Antonio Elementary School",'Dade_City=' + Dade_City.length);
Wesley_Chapel[Wesley_Chapel.length] = createMarker(new GPoint(-82.34851837,28.17436028),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Sand Pine Elementary School",'Wesley_Chapel=' + Wesley_Chapel.length);
Land_Olakes[Land_Olakes.length] = createMarker(new GPoint(-82.46405029,28.23285675),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Sanders Elementary School",'Land_Olakes=' + Land_Olakes.length);
Land_Olakes[Land_Olakes.length] = createMarker(new GPoint(-84.48040700,33.67019300),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Sanders Memorial Elementary School",'Land_Olakes=' + Land_Olakes.length);
New_Port_Richey[New_Port_Richey.length] = createMarker(new GPoint(-82.66625214,28.31893730),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Schrader Elementary School",'New_Port_Richey=' + New_Port_Richey.length);
New_Port_Richey[New_Port_Richey.length] = createMarker(new GPoint(-82.71952057,28.23915100),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Schwettman Education Center",'New_Port_Richey=' + New_Port_Richey.length);
Wesley_Chapel[Wesley_Chapel.length] = createMarker(new GPoint(-10.00000000,10.00000000),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Seven Oaks Elementary School",'Wesley_Chapel=' + Wesley_Chapel.length);
New_Port_Richey[New_Port_Richey.length] = createMarker(new GPoint(-82.68172455,28.20614433),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Seven Springs Elementary School",'New_Port_Richey=' + New_Port_Richey.length);
New_Port_Richey[New_Port_Richey.length] = createMarker(new GPoint(-82.66663361,28.19401932),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Seven Springs Middle School",'New_Port_Richey=' + New_Port_Richey.length);
Spring_Hill[Spring_Hill.length] = createMarker(new GPoint(-82.55124664,28.41922760),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Shady Hills Elementary School",'Spring_Hill=' + Spring_Hill.length);
Dade_City[Dade_City.length] = createMarker(new GPoint(-82.18713400,28.36461000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Sheriff's Detention Center",'Dade_City=' + Dade_City.length);
Holiday[Holiday.length] = createMarker(new GPoint(-82.73423004,28.19828606),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Sunray Elementary School",'Holiday=' + Holiday.length);
Lutz[Lutz.length] = createMarker(new GPoint(-82.45589447,28.18799400),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Sunshine Youth Services",'Lutz=' + Lutz.length);
Zephyrhills[Zephyrhills.length] = createMarker(new GPoint(-82.31002808,28.25530815),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Thomas E. Weightman Middle School",'Zephyrhills=' + Zephyrhills.length);
New_Port_Richey[New_Port_Richey.length] = createMarker(new GPoint(-82.63716888,28.18907356),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Trinity Elementary School",'New_Port_Richey=' + New_Port_Richey.length);
Wesley_Chapel[Wesley_Chapel.length] = createMarker(new GPoint(-82.31645966,28.25643730),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Wesley Chapel Elementary School",'Wesley_Chapel=' + Wesley_Chapel.length);
Wesley_Chapel[Wesley_Chapel.length] = createMarker(new GPoint(-82.30999756,28.25530815),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Wesley Chapel High School",'Wesley_Chapel=' + Wesley_Chapel.length);
Zephyrhills[Zephyrhills.length] = createMarker(new GPoint(-82.18964386,28.24066353),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("West Zephyrhills Elementary School",'Zephyrhills=' + Zephyrhills.length);
Land_Olakes[Land_Olakes.length] = createMarker(new GPoint(-84.91659900,34.45712600),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Wilson Academy",'Land_Olakes=' + Land_Olakes.length);
Lacoochee[Lacoochee.length] = createMarker(new GPoint(-82.17220306,28.46549988),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Withlacoochee Residential Juvenile Facility (",'Lacoochee=' + Lacoochee.length);
Zephyrhills[Zephyrhills.length] = createMarker(new GPoint(-82.18517303,28.24823761),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Woodland Elementary School",'Zephyrhills=' + Zephyrhills.length);
Zephyrhills[Zephyrhills.length] = createMarker(new GPoint(-82.18005371,28.24941444),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Zephyrhills High School",'Zephyrhills=' + Zephyrhills.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(Dade_City);
map.removeOverlays(Elfers);
map.removeOverlays(Holiday);
map.removeOverlays(Hudson);
map.removeOverlays(Lacoochee);
map.removeOverlays(Land_O_Lakes);
map.removeOverlays(Land_Olakes);
map.removeOverlays(Lutz);
map.removeOverlays(New_Port_Richey);
map.removeOverlays(Port_Richey);
map.removeOverlays(San_Antonio);
map.removeOverlays(Spring_Hill);
map.removeOverlays(Wesley_Chapel);
map.removeOverlays(Zephyrhills);
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(Dade_City);map.removeOverlays(Dade_City);
map.removeOverlays(Elfers);
map.removeOverlays(Holiday);
map.removeOverlays(Hudson);
map.removeOverlays(Lacoochee);
map.removeOverlays(Land_O_Lakes);
map.removeOverlays(Land_Olakes);
map.removeOverlays(Lutz);
map.removeOverlays(New_Port_Richey);
map.removeOverlays(Port_Richey);
map.removeOverlays(San_Antonio);
map.removeOverlays(Spring_Hill);
map.removeOverlays(Wesley_Chapel);
map.removeOverlays(Zephyrhills);
map.addOverlays(Dade_City);
centerByArray(Dade_City, false, false);
cntMarker += Dade_City.length;
map.addOverlays(Elfers);
centerByArray(Elfers, false, false);
cntMarker += Elfers.length;
map.addOverlays(Holiday);
centerByArray(Holiday, false, false);
cntMarker += Holiday.length;
map.addOverlays(Hudson);
centerByArray(Hudson, false, false);
cntMarker += Hudson.length;
map.addOverlays(Lacoochee);
centerByArray(Lacoochee, false, false);
cntMarker += Lacoochee.length;
map.addOverlays(Land_O_Lakes);
centerByArray(Land_O_Lakes, false, false);
cntMarker += Land_O_Lakes.length;
map.addOverlays(Land_Olakes);
centerByArray(Land_Olakes, false, false);
cntMarker += Land_Olakes.length;
map.addOverlays(Lutz);
centerByArray(Lutz, false, false);
cntMarker += Lutz.length;
map.addOverlays(New_Port_Richey);
centerByArray(New_Port_Richey, false, false);
cntMarker += New_Port_Richey.length;
map.addOverlays(Port_Richey);
centerByArray(Port_Richey, false, false);
cntMarker += Port_Richey.length;
map.addOverlays(San_Antonio);
centerByArray(San_Antonio, false, false);
cntMarker += San_Antonio.length;
map.addOverlays(Spring_Hill);
centerByArray(Spring_Hill, false, false);
cntMarker += Spring_Hill.length;
map.addOverlays(Wesley_Chapel);
centerByArray(Wesley_Chapel, false, false);
cntMarker += Wesley_Chapel.length;
map.addOverlays(Zephyrhills);
centerByArray(Zephyrhills, false, false);
cntMarker += Zephyrhills.length;
centerByArray(Dade_City,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');
}
}