function addMarkers()
{
mySelect = document.getElementById('selection');
Loveland = [];Fort_Collins = [];Berthoud = [];La_Porte = [];Ft_Collins = [];Estes_Park = [];Wellington = [];Livermore = [];Red_Feather_Lakes = [];Bellvue = [];Timnath = [];mySelect.options[mySelect.options.length] = new Option("Bellvue schools",'all=Bellvue');
mySelect.options[mySelect.options.length] = new Option("Berthoud schools",'all=Berthoud');
mySelect.options[mySelect.options.length] = new Option("Estes Park schools",'all=Estes_Park');
mySelect.options[mySelect.options.length] = new Option("Fort Collins schools",'all=Fort_Collins');
mySelect.options[mySelect.options.length] = new Option("Ft Collins schools",'all=Ft_Collins');
mySelect.options[mySelect.options.length] = new Option("La Porte schools",'all=La_Porte');
mySelect.options[mySelect.options.length] = new Option("Livermore schools",'all=Livermore');
mySelect.options[mySelect.options.length] = new Option("Loveland schools",'all=Loveland');
mySelect.options[mySelect.options.length] = new Option("Red Feather Lakes schools",'all=Red_Feather_Lakes');
mySelect.options[mySelect.options.length] = new Option("Timnath schools",'all=Timnath');
mySelect.options[mySelect.options.length] = new Option("Wellington schools",'all=Wellington');
mySelect.options[mySelect.options.length] = new Option("---------------------------",'');
Loveland[Loveland.length] = createMarker(new GPoint(-105.09072113,40.37411118),"
",iconRd);
mySelect.options[mySelect.options.length] = new Option("B F Kitchen Elementary School",'Loveland=' + Loveland.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.05560303,40.54489899),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Bacon Elementary School",'Fort_Collins=' + Fort_Collins.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.06749725,40.56698990),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Barton Prekindergarten",'Fort_Collins=' + Fort_Collins.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.12053680,40.56747055),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Bauder Elementary School",'Fort_Collins=' + Fort_Collins.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.08573914,40.54656982),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Beattie Elementary School",'Fort_Collins=' + Fort_Collins.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.09643555,40.56948853),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Bennett Elementary School",'Fort_Collins=' + Fort_Collins.length);
Berthoud[Berthoud.length] = createMarker(new GPoint(-105.08264923,40.31248474),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Berthoud Elementary School",'Berthoud=' + Berthoud.length);
Berthoud[Berthoud.length] = createMarker(new GPoint(-105.08614349,40.29798508),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Berthoud High School",'Berthoud=' + Berthoud.length);
Loveland[Loveland.length] = createMarker(new GPoint(-105.18996429,40.41788864),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Big Thompson Elementary School",'Loveland=' + Loveland.length);
Loveland[Loveland.length] = createMarker(new GPoint(-105.08074951,40.39532852),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Bill Reed Middle School",'Loveland=' + Loveland.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.11513519,40.55948257),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Blevins Junior High School",'Fort_Collins=' + Fort_Collins.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.06426239,40.54174042),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Boltz Junior High School",'Fort_Collins=' + Fort_Collins.length);
La_Porte[La_Porte.length] = createMarker(new GPoint(-105.15670013,40.65769958),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Cache La Poudre Elementary School",'La_Porte=' + La_Porte.length);
La_Porte[La_Porte.length] = createMarker(new GPoint(-105.15670013,40.65769958),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Cache La Poudre Junior High School",'La_Porte=' + La_Porte.length);
Loveland[Loveland.length] = createMarker(new GPoint(-105.09955597,40.35137939),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Carrie Martin Elementary School",'Loveland=' + Loveland.length);
Loveland[Loveland.length] = createMarker(new GPoint(-105.09877777,40.42891693),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Centennial Elementary School",'Loveland=' + Loveland.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.08135223,40.57799911),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Centennial High School",'Fort_Collins=' + Fort_Collins.length);
Loveland[Loveland.length] = createMarker(new GPoint(-105.06816101,40.41918564),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Conrad Ball Middle School",'Loveland=' + Loveland.length);
Ft_Collins[Ft_Collins.length] = createMarker(new GPoint(-105.06948090,40.47150421),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Cottonwood Plains Elementary School",'Ft_Collins=' + Ft_Collins.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.09153748,40.58158112),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Dunn Elementary School",'Fort_Collins=' + Fort_Collins.length);
Estes_Park[Estes_Park.length] = createMarker(new GPoint(-105.52870178,40.36520004),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Estes Park Elementary School",'Estes_Park=' + Estes_Park.length);
Estes_Park[Estes_Park.length] = createMarker(new GPoint(-105.49595642,40.37128448),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Estes Park High School",'Estes_Park=' + Estes_Park.length);
Estes_Park[Estes_Park.length] = createMarker(new GPoint(-105.52870178,40.36520004),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Estes Park Intermediate School",'Estes_Park=' + Estes_Park.length);
Estes_Park[Estes_Park.length] = createMarker(new GPoint(-105.52870178,40.36520004),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Estes Park Middle School",'Estes_Park=' + Estes_Park.length);
Wellington[Wellington.length] = createMarker(new GPoint(-105.00170898,40.70928192),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Eyestone Elementary School",'Wellington=' + Wellington.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.03789520,40.54115295),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Fort Collins High School",'Fort_Collins=' + Fort_Collins.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.02006600,40.51626200),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Fossil Ridge High School",'Fort_Collins=' + Fort_Collins.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.05560303,40.54489899),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Frontier High School",'Fort_Collins=' + Fort_Collins.length);
Loveland[Loveland.length] = createMarker(new GPoint(-105.08762360,40.39877319),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Garfield Elementary School",'Loveland=' + Loveland.length);
Loveland[Loveland.length] = createMarker(new GPoint(-105.06629181,40.40716934),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Harold Ferguson High School",'Loveland=' + Loveland.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.07023621,40.57418060),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Harris Bilingual Elementary School",'Fort_Collins=' + Fort_Collins.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.12114716,40.59308624),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Irish Elementary School",'Fort_Collins=' + Fort_Collins.length);
Berthoud[Berthoud.length] = createMarker(new GPoint(-105.08113861,40.30097961),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Ivy Stockwell Elementary School",'Berthoud=' + Berthoud.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.10393524,40.52678299),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Johnson Elementary School",'Fort_Collins=' + Fort_Collins.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.02006600,40.51626200),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Kinard Junior High School",'Fort_Collins=' + Fort_Collins.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.04814148,40.52711105),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Kruse Elementary School",'Fort_Collins=' + Fort_Collins.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.09585571,40.58523941),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lab Elementary School For Creative Learning",'Fort_Collins=' + Fort_Collins.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.02203369,40.57648087),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Laurel Elementary School",'Fort_Collins=' + Fort_Collins.length);
Loveland[Loveland.length] = createMarker(new GPoint(-105.08014679,40.44235229),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Laurene Edmondson Elementary School",'Loveland=' + Loveland.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.06694031,40.56897736),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Lesher Junior High School",'Fort_Collins=' + Fort_Collins.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.02932739,40.56460571),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Liberty Common Charter School",'Fort_Collins=' + Fort_Collins.length);
Loveland[Loveland.length] = createMarker(new GPoint(-105.09018707,40.42500305),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lincoln Elementary School",'Loveland=' + Loveland.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.10593414,40.59638214),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Lincoln Junior High School",'Fort_Collins=' + Fort_Collins.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.03314972,40.53122330),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Linton Elementary School",'Fort_Collins=' + Fort_Collins.length);
Livermore[Livermore.length] = createMarker(new GPoint(-105.22165680,40.79364014),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Livermore Elementary School",'Livermore=' + Livermore.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.08737183,40.53319550),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lopez Elementary School",'Fort_Collins=' + Fort_Collins.length);
Loveland[Loveland.length] = createMarker(new GPoint(-105.08923340,40.42156982),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Loveland High School",'Loveland=' + Loveland.length);
Loveland[Loveland.length] = createMarker(new GPoint(-105.11341858,40.43953705),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Lucile Erwin Middle School",'Loveland=' + Loveland.length);
Loveland[Loveland.length] = createMarker(new GPoint(-105.05249786,40.40451813),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Madison Early Childhood Center",'Loveland=' + Loveland.length);
Loveland[Loveland.length] = createMarker(new GPoint(-105.06528473,40.42171478),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mary Blair Elementary School",'Loveland=' + Loveland.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.08702087,40.51882553),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mc Graw Elementary School",'Fort_Collins=' + Fort_Collins.length);
Loveland[Loveland.length] = createMarker(new GPoint(-105.06854248,40.40802383),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Monroe Elementary School",'Loveland=' + Loveland.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.11002350,40.57836533),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Moore Elementary School",'Fort_Collins=' + Fort_Collins.length);
Loveland[Loveland.length] = createMarker(new GPoint(-105.02571869,40.40606308),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Mountain View High School",'Loveland=' + Loveland.length);
Loveland[Loveland.length] = createMarker(new GPoint(-105.12514496,40.39395905),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Namaqua Elementary School",'Loveland=' + Loveland.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-72.77889600,41.51826600),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("O'dea Elementary School",'Fort_Collins=' + Fort_Collins.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.11946106,40.54053497),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Olander Elementary School",'Fort_Collins=' + Fort_Collins.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.11604309,40.55303574),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Peak Alternative Program",'Fort_Collins=' + Fort_Collins.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.09674072,40.55258179),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Pioneer Charter School",'Fort_Collins=' + Fort_Collins.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.12103271,40.58563232),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Poudre High School",'Fort_Collins=' + Fort_Collins.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.08931732,40.58944702),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Poudre Transition Center",'Fort_Collins=' + Fort_Collins.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.02355957,40.51848602),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Preston Junior High School",'Fort_Collins=' + Fort_Collins.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.10191345,40.59104156),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Putnam Elementary School",'Fort_Collins=' + Fort_Collins.length);
Red_Feather_Lakes[Red_Feather_Lakes.length] = createMarker(new GPoint(-105.67359924,40.83509827),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Red Feather Lakes Elementary School",'Red_Feather_Lakes=' + Red_Feather_Lakes.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.05792999,40.56318283),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Ridgeview Classical Charter Schools",'Fort_Collins=' + Fort_Collins.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.05229950,40.56258011),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Riffenburgh Elementary School",'Fort_Collins=' + Fort_Collins.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.10023499,40.54618073),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Rocky Mountain High School",'Fort_Collins=' + Fort_Collins.length);
Loveland[Loveland.length] = createMarker(new GPoint(-105.10678864,40.38399887),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Sarah Milner Elementary School",'Loveland=' + Loveland.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.04975891,40.54279327),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Shepardson Elementary School",'Fort_Collins=' + Fort_Collins.length);
Loveland[Loveland.length] = createMarker(new GPoint(-105.07258606,40.43569183),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Stansberry Elementary School",'Loveland=' + Loveland.length);
Bellvue[Bellvue.length] = createMarker(new GPoint(-105.35727692,40.61907959),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Stove Prairie Elementary School",'Bellvue=' + Bellvue.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.05678558,40.61483765),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Tavelli Elementary School",'Fort_Collins=' + Fort_Collins.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.07633209,40.73639297),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Teen Learning Center",'Fort_Collins=' + Fort_Collins.length);
Loveland[Loveland.length] = createMarker(new GPoint(-105.10340881,40.38710403),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Thompson Valley High School",'Loveland=' + Loveland.length);
Timnath[Timnath.length] = createMarker(new GPoint(-104.98200226,40.52920151),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Timnath Elementary School",'Timnath=' + Timnath.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.02860260,40.52023315),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Traut Core Elementary School",'Fort_Collins=' + Fort_Collins.length);
Loveland[Loveland.length] = createMarker(new GPoint(-105.07811737,40.39740753),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Truscott Elementary School",'Loveland=' + Loveland.length);
Berthoud[Berthoud.length] = createMarker(new GPoint(-105.08655548,40.30618286),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Turner Middle School",'Berthoud=' + Berthoud.length);
Loveland[Loveland.length] = createMarker(new GPoint(-105.10297394,40.40795135),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Van Buren Elementary School",'Loveland=' + Loveland.length);
Loveland[Loveland.length] = createMarker(new GPoint(-105.11042023,40.38426208),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Walt Clark Middle School",'Loveland=' + Loveland.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.10408020,40.52668381),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Webber Junior High School",'Fort_Collins=' + Fort_Collins.length);
Wellington[Wellington.length] = createMarker(new GPoint(-105.00131226,40.70932388),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Wellington Junior High School",'Wellington=' + Wellington.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.06887054,40.51277542),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Werner Elementary School",'Fort_Collins=' + Fort_Collins.length);
Loveland[Loveland.length] = createMarker(new GPoint(-105.05420685,40.39171219),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Winona Elementary School",'Loveland=' + Loveland.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.05560303,40.54489899),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Zach Elementary School",'Fort_Collins=' + Fort_Collins.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(Bellvue);
map.removeOverlays(Berthoud);
map.removeOverlays(Estes_Park);
map.removeOverlays(Fort_Collins);
map.removeOverlays(Ft_Collins);
map.removeOverlays(La_Porte);
map.removeOverlays(Livermore);
map.removeOverlays(Loveland);
map.removeOverlays(Red_Feather_Lakes);
map.removeOverlays(Timnath);
map.removeOverlays(Wellington);
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(Loveland);map.removeOverlays(Bellvue);
map.removeOverlays(Berthoud);
map.removeOverlays(Estes_Park);
map.removeOverlays(Fort_Collins);
map.removeOverlays(Ft_Collins);
map.removeOverlays(La_Porte);
map.removeOverlays(Livermore);
map.removeOverlays(Loveland);
map.removeOverlays(Red_Feather_Lakes);
map.removeOverlays(Timnath);
map.removeOverlays(Wellington);
map.addOverlays(Bellvue);
centerByArray(Bellvue, false, false);
cntMarker += Bellvue.length;
map.addOverlays(Berthoud);
centerByArray(Berthoud, false, false);
cntMarker += Berthoud.length;
map.addOverlays(Estes_Park);
centerByArray(Estes_Park, false, false);
cntMarker += Estes_Park.length;
map.addOverlays(Fort_Collins);
centerByArray(Fort_Collins, false, false);
cntMarker += Fort_Collins.length;
map.addOverlays(Ft_Collins);
centerByArray(Ft_Collins, false, false);
cntMarker += Ft_Collins.length;
map.addOverlays(La_Porte);
centerByArray(La_Porte, false, false);
cntMarker += La_Porte.length;
map.addOverlays(Livermore);
centerByArray(Livermore, false, false);
cntMarker += Livermore.length;
map.addOverlays(Loveland);
centerByArray(Loveland, false, false);
cntMarker += Loveland.length;
map.addOverlays(Red_Feather_Lakes);
centerByArray(Red_Feather_Lakes, false, false);
cntMarker += Red_Feather_Lakes.length;
map.addOverlays(Timnath);
centerByArray(Timnath, false, false);
cntMarker += Timnath.length;
map.addOverlays(Wellington);
centerByArray(Wellington, false, false);
cntMarker += Wellington.length;
centerByArray(Loveland,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');
}
}