function addMarkers()
{
mySelect = document.getElementById('selection');
Longmont = [];Lafayette = [];Boulder = [];Louisville = [];Superior = [];Erie = [];Gold_Hill = [];Jamestown = [];Lyons = [];Nederland = [];Niwot = [];Fort_Collins = [];mySelect.options[mySelect.options.length] = new Option("Boulder schools",'all=Boulder');
mySelect.options[mySelect.options.length] = new Option("Erie schools",'all=Erie');
mySelect.options[mySelect.options.length] = new Option("Fort Collins schools",'all=Fort_Collins');
mySelect.options[mySelect.options.length] = new Option("Gold Hill schools",'all=Gold_Hill');
mySelect.options[mySelect.options.length] = new Option("Jamestown schools",'all=Jamestown');
mySelect.options[mySelect.options.length] = new Option("Lafayette schools",'all=Lafayette');
mySelect.options[mySelect.options.length] = new Option("Longmont schools",'all=Longmont');
mySelect.options[mySelect.options.length] = new Option("Louisville schools",'all=Louisville');
mySelect.options[mySelect.options.length] = new Option("Lyons schools",'all=Lyons');
mySelect.options[mySelect.options.length] = new Option("Nederland schools",'all=Nederland');
mySelect.options[mySelect.options.length] = new Option("Niwot schools",'all=Niwot');
mySelect.options[mySelect.options.length] = new Option("Superior schools",'all=Superior');
mySelect.options[mySelect.options.length] = new Option("---------------------------",'');
Longmont[Longmont.length] = createMarker(new GPoint(-105.11164093,40.15203857),"
",iconGr);
mySelect.options[mySelect.options.length] = new Option("Adult Education/lincoln Center",'Longmont=' + Longmont.length);
Longmont[Longmont.length] = createMarker(new GPoint(-105.08677800,40.19383000),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Alpine Elementary School",'Longmont=' + Longmont.length);
Longmont[Longmont.length] = createMarker(new GPoint(-105.16315600,40.14347500),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Altona Middle School",'Longmont=' + Longmont.length);
Lafayette[Lafayette.length] = createMarker(new GPoint(-105.08654022,39.98690033),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Angevine Middle School",'Lafayette=' + Lafayette.length);
Boulder[Boulder.length] = createMarker(new GPoint(-105.19918060,40.01456451),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Arapahoe Ridge High School",'Boulder=' + Boulder.length);
Boulder[Boulder.length] = createMarker(new GPoint(-105.26761627,40.00023651),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Base Line Middle School-arts Focus",'Boulder=' + Boulder.length);
Boulder[Boulder.length] = createMarker(new GPoint(-105.26273346,39.98100662),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Bear Creek Elementary School",'Boulder=' + Boulder.length);
Boulder[Boulder.length] = createMarker(new GPoint(-105.24390411,40.00383759),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Boulder Community School/integrated Studies Elementary School",'Boulder=' + Boulder.length);
Boulder[Boulder.length] = createMarker(new GPoint(-105.27339172,40.01446152),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Boulder High School",'Boulder=' + Boulder.length);
Boulder[Boulder.length] = createMarker(new GPoint(-105.22070312,40.04600143),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Boulder Prep Charter High School",'Boulder=' + Boulder.length);
Longmont[Longmont.length] = createMarker(new GPoint(-105.10758209,40.17672348),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Burlington Elementary School",'Longmont=' + Longmont.length);
Boulder[Boulder.length] = createMarker(new GPoint(-105.28007507,40.02273941),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Casey Middle School",'Boulder=' + Boulder.length);
Lafayette[Lafayette.length] = createMarker(new GPoint(-105.08555603,39.98666382),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Centaurus High School",'Lafayette=' + Lafayette.length);
Boulder[Boulder.length] = createMarker(new GPoint(-105.26882935,40.04443741),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Centennial Middle School",'Boulder=' + Boulder.length);
Longmont[Longmont.length] = createMarker(new GPoint(-105.10816193,40.16614914),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Central Elementary School",'Longmont=' + Longmont.length);
Louisville[Louisville.length] = createMarker(new GPoint(-105.15731812,39.98239136),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Coal Creek Elementary School",'Louisville=' + Louisville.length);
Boulder[Boulder.length] = createMarker(new GPoint(-105.27052307,40.03180695),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Columbine Elementary School",'Boulder=' + Boulder.length);
Longmont[Longmont.length] = createMarker(new GPoint(-105.10379791,40.17242050),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Columbine Elementary School",'Longmont=' + Longmont.length);
Boulder[Boulder.length] = createMarker(new GPoint(-105.27137756,40.00342178),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Community Montessori School",'Boulder=' + Boulder.length);
Boulder[Boulder.length] = createMarker(new GPoint(-105.24863434,39.99100876),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Creekside Elementary School At Martin Park",'Boulder=' + Boulder.length);
Boulder[Boulder.length] = createMarker(new GPoint(-105.27300262,40.05093765),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Crest View Elementary School",'Boulder=' + Boulder.length);
Boulder[Boulder.length] = createMarker(new GPoint(-105.17803955,40.00210190),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Douglass Elementary School",'Boulder=' + Boulder.length);
Longmont[Longmont.length] = createMarker(new GPoint(-105.14057159,40.14524841),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Eagle Crest Elementary School",'Longmont=' + Longmont.length);
Boulder[Boulder.length] = createMarker(new GPoint(-105.23461914,40.00757599),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Eisenhower Elementary School",'Boulder=' + Boulder.length);
Superior[Superior.length] = createMarker(new GPoint(-105.15957642,39.92108154),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Eldorado K-8 Elementary School",'Superior=' + Superior.length);
Erie[Erie.length] = createMarker(new GPoint(-105.03829956,40.04100037),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Erie Elementary School",'Erie=' + Erie.length);
Boulder[Boulder.length] = createMarker(new GPoint(-105.24157715,39.97276306),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Fairview High School",'Boulder=' + Boulder.length);
Longmont[Longmont.length] = createMarker(new GPoint(-105.06425476,40.18366241),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Fall River Elementary School",'Longmont=' + Longmont.length);
Louisville[Louisville.length] = createMarker(new GPoint(-105.15774536,39.96829987),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Fireside Elementary School",'Louisville=' + Louisville.length);
Longmont[Longmont.length] = createMarker(new GPoint(-105.19608400,40.07582600),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Flagstaff Charter School",'Longmont=' + Longmont.length);
Boulder[Boulder.length] = createMarker(new GPoint(-105.28542328,40.00779343),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Flatirons Elementary School",'Boulder=' + Boulder.length);
Boulder[Boulder.length] = createMarker(new GPoint(-105.28418732,40.03513718),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Foothill Elementary School",'Boulder=' + Boulder.length);
Gold_Hill[Gold_Hill.length] = createMarker(new GPoint(-106.04218292,39.47423935),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Gold Hill Elementary School",'Gold_Hill=' + Gold_Hill.length);
Boulder[Boulder.length] = createMarker(new GPoint(-105.25637054,39.99266052),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Halcyon School (special Education)",'Boulder=' + Boulder.length);
Boulder[Boulder.length] = createMarker(new GPoint(-105.17285156,40.05806351),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Heatherwood Elementary School",'Boulder=' + Boulder.length);
Longmont[Longmont.length] = createMarker(new GPoint(-105.08571625,40.18116379),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Heritage Middle School",'Longmont=' + Longmont.length);
Boulder[Boulder.length] = createMarker(new GPoint(-105.24390411,40.00383759),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("High Peaks Elementary School",'Boulder=' + Boulder.length);
Boulder[Boulder.length] = createMarker(new GPoint(-105.23746490,39.99323654),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Horizons K-8 Alternative Charter School",'Boulder=' + Boulder.length);
Longmont[Longmont.length] = createMarker(new GPoint(-105.17823792,40.19158554),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hygiene Elementary School",'Longmont=' + Longmont.length);
Longmont[Longmont.length] = createMarker(new GPoint(-105.11697388,40.14317322),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Indian Peaks Elementary School",'Longmont=' + Longmont.length);
Jamestown[Jamestown.length] = createMarker(new GPoint(-105.38806915,40.11466980),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Jamestown Elementary School",'Jamestown=' + Jamestown.length);
Lafayette[Lafayette.length] = createMarker(new GPoint(-105.09587860,39.99834442),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lafayette Elementary School",'Lafayette=' + Lafayette.length);
Longmont[Longmont.length] = createMarker(new GPoint(-105.10112000,40.16576767),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Loma Linda Elementary School",'Longmont=' + Longmont.length);
Longmont[Longmont.length] = createMarker(new GPoint(-105.14788818,40.18653488),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Longmont Estates Elementary School",'Longmont=' + Longmont.length);
Longmont[Longmont.length] = createMarker(new GPoint(-105.12119293,40.14760971),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Longmont High School",'Longmont=' + Longmont.length);
Longmont[Longmont.length] = createMarker(new GPoint(-105.11653900,40.18348312),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Longs Peak Middle School",'Longmont=' + Longmont.length);
Louisville[Louisville.length] = createMarker(new GPoint(-105.13784790,39.97470856),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Louisville Elementary School",'Louisville=' + Louisville.length);
Louisville[Louisville.length] = createMarker(new GPoint(-105.13237762,39.98309708),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Louisville Middle School",'Louisville=' + Louisville.length);
Lyons[Lyons.length] = createMarker(new GPoint(-105.34339905,40.23479843),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lyons Elementary School",'Lyons=' + Lyons.length);
Lyons[Lyons.length] = createMarker(new GPoint(-105.34339905,40.23479843),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Lyons Middle/senior High School",'Lyons=' + Lyons.length);
Boulder[Boulder.length] = createMarker(new GPoint(-105.22915649,39.99348450),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Manhattan School Of Arts And Academics",'Boulder=' + Boulder.length);
Boulder[Boulder.length] = createMarker(new GPoint(-105.28560638,40.02036285),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mapleton Elementary School",'Boulder=' + Boulder.length);
Boulder[Boulder.length] = createMarker(new GPoint(-105.26027679,39.97233963),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mesa Elementary School",'Boulder=' + Boulder.length);
Louisville[Louisville.length] = createMarker(new GPoint(-105.14065552,39.95074081),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Monarch High School",'Louisville=' + Louisville.length);
Louisville[Louisville.length] = createMarker(new GPoint(-105.14205170,39.95074081),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Monarch K-8 School",'Louisville=' + Louisville.length);
Longmont[Longmont.length] = createMarker(new GPoint(-105.11465454,40.18348312),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mountain View Elementary School",'Longmont=' + Longmont.length);
Nederland[Nederland.length] = createMarker(new GPoint(-105.49569702,39.96419907),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Nederland Elementary School",'Nederland=' + Nederland.length);
Nederland[Nederland.length] = createMarker(new GPoint(-105.52728271,39.95237732),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Nederland Middle-senior High School",'Nederland=' + Nederland.length);
Boulder[Boulder.length] = createMarker(new GPoint(-105.21051025,40.00346375),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Nevin Platt Middle School",'Boulder=' + Boulder.length);
Boulder[Boulder.length] = createMarker(new GPoint(-105.25172424,39.98266220),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("New Vista High School",'Boulder=' + Boulder.length);
Niwot[Niwot.length] = createMarker(new GPoint(-105.14603424,40.10038376),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Niwot Elementary School",'Niwot=' + Niwot.length);
Niwot[Niwot.length] = createMarker(new GPoint(-105.14209747,40.10184860),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Niwot High School",'Niwot=' + Niwot.length);
Longmont[Longmont.length] = createMarker(new GPoint(-105.10919952,40.19318771),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Northridge Elementary School",'Longmont=' + Longmont.length);
Longmont[Longmont.length] = createMarker(new GPoint(-105.12113953,40.14718246),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Olde Columbine High School",'Longmont=' + Longmont.length);
Lafayette[Lafayette.length] = createMarker(new GPoint(-105.08100128,39.98743820),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Peak To Peak Charter School",'Lafayette=' + Lafayette.length);
Lafayette[Lafayette.length] = createMarker(new GPoint(-105.09030914,40.00033569),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Pioneer Bilingual Elementary School",'Lafayette=' + Lafayette.length);
Longmont[Longmont.length] = createMarker(new GPoint(-105.00029755,40.15499878),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Prairie Ridge Elementary School",'Longmont=' + Longmont.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.02661896,40.52333832),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Psd Mountain Crest Alternative Program High School",'Fort_Collins=' + Fort_Collins.length);
Longmont[Longmont.length] = createMarker(new GPoint(-105.07743835,40.16668320),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Rocky Mountain Elementary School",'Longmont=' + Longmont.length);
Lafayette[Lafayette.length] = createMarker(new GPoint(-105.10884857,39.98085403),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Ryan Elementary School",'Lafayette=' + Lafayette.length);
Longmont[Longmont.length] = createMarker(new GPoint(-105.11904144,40.19833374),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Sanborn Elementary School",'Longmont=' + Longmont.length);
Lafayette[Lafayette.length] = createMarker(new GPoint(-105.08337402,39.98957062),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Sanchez Elementary School",'Lafayette=' + Lafayette.length);
Longmont[Longmont.length] = createMarker(new GPoint(-105.26374054,40.14528656),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Silver Creek School",'Longmont=' + Longmont.length);
Longmont[Longmont.length] = createMarker(new GPoint(-105.07888031,40.18150330),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Skyline High School",'Longmont=' + Longmont.length);
Boulder[Boulder.length] = createMarker(new GPoint(-105.24922180,40.03049850),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Sojourner Charter School",'Boulder=' + Boulder.length);
Boulder[Boulder.length] = createMarker(new GPoint(-105.24581909,39.97474289),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Southern Hills Middle School",'Boulder=' + Boulder.length);
Longmont[Longmont.length] = createMarker(new GPoint(-105.09747314,40.18435287),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Spangler Elementary School",'Longmont=' + Longmont.length);
Boulder[Boulder.length] = createMarker(new GPoint(-105.23709869,39.98580170),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Summit Middle Charter School",'Boulder=' + Boulder.length);
Longmont[Longmont.length] = createMarker(new GPoint(-105.12104034,40.14538574),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Sunset Middle School",'Longmont=' + Longmont.length);
Superior[Superior.length] = createMarker(new GPoint(-105.15765381,39.93736649),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Superior Elementary School",'Superior=' + Superior.length);
Longmont[Longmont.length] = createMarker(new GPoint(-105.06104200,40.17733900),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Trail Ridge Middle School",'Longmont=' + Longmont.length);
Longmont[Longmont.length] = createMarker(new GPoint(-105.10215759,40.15129089),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Twin Peaks Charter Academy",'Longmont=' + Longmont.length);
Boulder[Boulder.length] = createMarker(new GPoint(-105.27232361,40.00464249),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("University Hill Elementary School",'Boulder=' + Boulder.length);
Longmont[Longmont.length] = createMarker(new GPoint(-105.10223389,40.15455627),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Ute Creek Secondary Charter Academy",'Longmont=' + Longmont.length);
Fort_Collins[Fort_Collins.length] = createMarker(new GPoint(-105.12330627,40.58918381),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Village School",'Fort_Collins=' + Fort_Collins.length);
Boulder[Boulder.length] = createMarker(new GPoint(-105.28170013,40.02813721),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Washington Bilingual Elementary School",'Boulder=' + Boulder.length);
Longmont[Longmont.length] = createMarker(new GPoint(-105.14936829,40.14321899),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Westview Middle School",'Longmont=' + Longmont.length);
Boulder[Boulder.length] = createMarker(new GPoint(-105.26998901,40.02191925),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Whittier Elementary School",'Boulder=' + Boulder.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(Boulder);
map.removeOverlays(Erie);
map.removeOverlays(Fort_Collins);
map.removeOverlays(Gold_Hill);
map.removeOverlays(Jamestown);
map.removeOverlays(Lafayette);
map.removeOverlays(Longmont);
map.removeOverlays(Louisville);
map.removeOverlays(Lyons);
map.removeOverlays(Nederland);
map.removeOverlays(Niwot);
map.removeOverlays(Superior);
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(Longmont);map.removeOverlays(Boulder);
map.removeOverlays(Erie);
map.removeOverlays(Fort_Collins);
map.removeOverlays(Gold_Hill);
map.removeOverlays(Jamestown);
map.removeOverlays(Lafayette);
map.removeOverlays(Longmont);
map.removeOverlays(Louisville);
map.removeOverlays(Lyons);
map.removeOverlays(Nederland);
map.removeOverlays(Niwot);
map.removeOverlays(Superior);
map.addOverlays(Boulder);
centerByArray(Boulder, false, false);
cntMarker += Boulder.length;
map.addOverlays(Erie);
centerByArray(Erie, false, false);
cntMarker += Erie.length;
map.addOverlays(Fort_Collins);
centerByArray(Fort_Collins, false, false);
cntMarker += Fort_Collins.length;
map.addOverlays(Gold_Hill);
centerByArray(Gold_Hill, false, false);
cntMarker += Gold_Hill.length;
map.addOverlays(Jamestown);
centerByArray(Jamestown, false, false);
cntMarker += Jamestown.length;
map.addOverlays(Lafayette);
centerByArray(Lafayette, false, false);
cntMarker += Lafayette.length;
map.addOverlays(Longmont);
centerByArray(Longmont, false, false);
cntMarker += Longmont.length;
map.addOverlays(Louisville);
centerByArray(Louisville, false, false);
cntMarker += Louisville.length;
map.addOverlays(Lyons);
centerByArray(Lyons, false, false);
cntMarker += Lyons.length;
map.addOverlays(Nederland);
centerByArray(Nederland, false, false);
cntMarker += Nederland.length;
map.addOverlays(Niwot);
centerByArray(Niwot, false, false);
cntMarker += Niwot.length;
map.addOverlays(Superior);
centerByArray(Superior, false, false);
cntMarker += Superior.length;
centerByArray(Longmont,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');
}
}