function addMarkers()
{
mySelect = document.getElementById('selection');
Albion = [];Battle_Creek = [];Athens = [];Bedford = [];Marshall = [];East_Leroy = [];Springfield = [];Homer = [];Parma = [];Tekonsha = [];mySelect.options[mySelect.options.length] = new Option("Albion schools",'all=Albion');
mySelect.options[mySelect.options.length] = new Option("Athens schools",'all=Athens');
mySelect.options[mySelect.options.length] = new Option("Battle Creek schools",'all=Battle_Creek');
mySelect.options[mySelect.options.length] = new Option("Bedford schools",'all=Bedford');
mySelect.options[mySelect.options.length] = new Option("East Leroy schools",'all=East_Leroy');
mySelect.options[mySelect.options.length] = new Option("Homer schools",'all=Homer');
mySelect.options[mySelect.options.length] = new Option("Marshall schools",'all=Marshall');
mySelect.options[mySelect.options.length] = new Option("Parma schools",'all=Parma');
mySelect.options[mySelect.options.length] = new Option("Springfield schools",'all=Springfield');
mySelect.options[mySelect.options.length] = new Option("Tekonsha schools",'all=Tekonsha');
mySelect.options[mySelect.options.length] = new Option("---------------------------",'');
Albion[Albion.length] = createMarker(new GPoint(-84.75441742,42.24511719),"
",iconGr);
mySelect.options[mySelect.options.length] = new Option("Albion Alternative Education",'Albion=' + Albion.length);
Albion[Albion.length] = createMarker(new GPoint(-84.74995422,42.25893784),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Albion Senior High School",'Albion=' + Albion.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.15518188,42.31310272),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Alternative Community Educat",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.19293976,42.32680511),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Ann J. Kellogg School",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.21383667,42.30228806),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Arbor Academy",'Battle_Creek=' + Battle_Creek.length);
Athens[Athens.length] = createMarker(new GPoint(-85.23255157,42.08636475),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Athens High School",'Athens=' + Athens.length);
Athens[Athens.length] = createMarker(new GPoint(-85.22938538,42.08446503),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Athens Middle School",'Athens=' + Athens.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.23368073,42.26076126),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Battle Creek Area Learning Center",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.18197632,42.32232666),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Battle Creek Central High School",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.22512817,42.32233047),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Battle Creek Math-sci Center",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.13561249,42.27223587),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Beadle Lake Elementary School",'Battle_Creek=' + Battle_Creek.length);
Bedford[Bedford.length] = createMarker(new GPoint(-85.23171997,42.39592743),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Bedford Elementary School",'Bedford=' + Bedford.length);
Albion[Albion.length] = createMarker(new GPoint(-84.74851227,42.25624084),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Caldwell Elementary School",'Albion=' + Albion.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.17337799,42.33935165),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Calhoun Area Technology Center",'Battle_Creek=' + Battle_Creek.length);
Marshall[Marshall.length] = createMarker(new GPoint(-84.93659973,42.28319168),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Calhoun Co. Juvenile Home School",'Marshall=' + Marshall.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.20628357,42.31010056),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Coburn School",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.13535309,42.32294846),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Doris Klaussen Dev. Center",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.20043945,42.33847809),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Dudley School",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.17968750,42.32114410),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Early Childhood Education Elementary School",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.23368073,42.26076126),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Early Childhood-prep Elementary School",'Battle_Creek=' + Battle_Creek.length);
East_Leroy[East_Leroy.length] = createMarker(new GPoint(-85.21434784,42.16636276),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("East Leroy Elementary School",'East_Leroy=' + East_Leroy.length);
Springfield[Springfield.length] = createMarker(new GPoint(-85.23856354,42.32293701),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Endeavor Charter Academy",'Springfield=' + Springfield.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.17306519,42.30812073),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Franklin School",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.17519379,42.32995224),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Fremont School",'Battle_Creek=' + Battle_Creek.length);
Marshall[Marshall.length] = createMarker(new GPoint(-84.95181274,42.27423859),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Gordon Elementary School",'Marshall=' + Marshall.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.15338898,42.26115036),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Harper Creek High School",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.15039062,42.26116180),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Harper Creek Junior High School",'Battle_Creek=' + Battle_Creek.length);
Albion[Albion.length] = createMarker(new GPoint(-84.73639679,42.24527740),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Harrington Elementary School",'Albion=' + Albion.length);
Homer[Homer.length] = createMarker(new GPoint(-84.80886841,42.14294434),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Homer Community High School",'Homer=' + Homer.length);
Homer[Homer.length] = createMarker(new GPoint(-84.80886841,42.14294434),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Homer Middle School",'Homer=' + Homer.length);
Marshall[Marshall.length] = createMarker(new GPoint(-84.95724487,42.26096344),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hughes Elementary School",'Marshall=' + Marshall.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.21408844,42.30332184),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Lakeview Alternative Educati High School",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.22858429,42.29565048),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Lakeview High School",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.21655273,42.30311203),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Lakeview Junior High School",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.24210358,42.34999847),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lamora Park School",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.20256042,42.32753754),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Level Park School",'Battle_Creek=' + Battle_Creek.length);
Homer[Homer.length] = createMarker(new GPoint(-84.80886841,42.14294434),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lillian Fletcher Elementary School",'Homer=' + Homer.length);
Marshall[Marshall.length] = createMarker(new GPoint(-84.95861053,42.27096176),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Madison Elementary School",'Marshall=' + Marshall.length);
Marshall[Marshall.length] = createMarker(new GPoint(-84.88254547,42.30496216),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mar Lee School",'Marshall=' + Marshall.length);
Marshall[Marshall.length] = createMarker(new GPoint(-84.94184113,42.25208664),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Marshall Academy",'Marshall=' + Marshall.length);
Marshall[Marshall.length] = createMarker(new GPoint(-84.96770477,42.27313614),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Marshall Alternative High School",'Marshall=' + Marshall.length);
Marshall[Marshall.length] = createMarker(new GPoint(-84.95468140,42.28276443),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Marshall High School",'Marshall=' + Marshall.length);
Marshall[Marshall.length] = createMarker(new GPoint(-84.95861053,42.27096176),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Marshall Middle School",'Marshall=' + Marshall.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.16719818,42.32359314),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mckinley Elementary School",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.21391296,42.30377960),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Michigan School Readiness Preschool",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.21649933,42.39540100),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Michigan Youth Challenge Academy",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.19624329,42.27721024),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Minges Brook School",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.21002960,42.33895493),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Northwestern Junior High School",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.20999908,42.33885193),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Northwestern Middle School",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.18093109,42.31734467),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Operation Graduation High School",'Battle_Creek=' + Battle_Creek.length);
Parma[Parma.length] = createMarker(new GPoint(-84.59671021,42.25532532),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Parma Elementary School",'Parma=' + Parma.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.13050079,42.37013626),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Pennfield Central School",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.13050079,42.37013626),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Pennfield Dunlap Middle School",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.13050079,42.37013626),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Pennfield North School",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.13050079,42.37013626),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Pennfield Purdy School",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.13050079,42.37013626),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Pennfield Senior High School",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.15869141,42.30956268),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Post Elementary School",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.20706177,42.30114746),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Prairieview School",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.18932343,42.29049683),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Riverside Elementary School",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.19662476,42.30859375),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Roosevelt School",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.19451904,42.23196411),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Sonoma School",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.15511322,42.31313705),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("South Hill Academy",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.19628143,42.31296158),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Southwestern Academy",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.19609070,42.31278229),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Southwestern Junior High School",'Battle_Creek=' + Battle_Creek.length);
Springfield[Springfield.length] = createMarker(new GPoint(-85.24647522,42.32639694),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Springfield Middle School",'Springfield=' + Springfield.length);
Albion[Albion.length] = createMarker(new GPoint(-84.80095673,42.28176117),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Starr Commonwealth For Boys",'Albion=' + Albion.length);
Tekonsha[Tekonsha.length] = createMarker(new GPoint(-84.98893738,42.09183884),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Tekonsha Elementary School",'Tekonsha=' + Tekonsha.length);
Tekonsha[Tekonsha.length] = createMarker(new GPoint(-84.98972321,42.09086990),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Tekonsha Middle School",'Tekonsha=' + Tekonsha.length);
Tekonsha[Tekonsha.length] = createMarker(new GPoint(-84.98972321,42.09086990),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Tekonsha Senior High School",'Tekonsha=' + Tekonsha.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.21408844,42.30332184),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Territorial School",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.23107147,42.34044266),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Urbandale School",'Battle_Creek=' + Battle_Creek.length);
Springfield[Springfield.length] = createMarker(new GPoint(-85.24497223,42.32653809),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Valley View Elementary School",'Springfield=' + Springfield.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.15560913,42.33179855),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Verona School",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.18110657,42.32172775),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("W.k. Kellogg Junior High School",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.18104553,42.32187653),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("W.k. Kellogg Middle School",'Battle_Creek=' + Battle_Creek.length);
Marshall[Marshall.length] = createMarker(new GPoint(-84.95468140,42.28097153),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Walters Elementary School",'Marshall=' + Marshall.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.19021606,42.33886337),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Washington Academy",'Battle_Creek=' + Battle_Creek.length);
Albion[Albion.length] = createMarker(new GPoint(-84.76367950,42.25793839),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Washington Gardner Elementary School",'Albion=' + Albion.length);
Albion[Albion.length] = createMarker(new GPoint(-84.74840546,42.24693680),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Washington Gardner Middle School",'Albion=' + Albion.length);
Albion[Albion.length] = createMarker(new GPoint(-84.74840546,42.24693680),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Washington Gardner Open School",'Albion=' + Albion.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.19036865,42.33864212),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Washington School",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.11116028,42.30719376),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Wattles Park Elementary School",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.22799683,42.28720856),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Westlake Elementary School",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.20240021,42.31713486),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Wilson Academy",'Battle_Creek=' + Battle_Creek.length);
Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.22000122,42.30009842),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Wilson School",'Battle_Creek=' + Battle_Creek.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(Albion);
map.removeOverlays(Athens);
map.removeOverlays(Battle_Creek);
map.removeOverlays(Bedford);
map.removeOverlays(East_Leroy);
map.removeOverlays(Homer);
map.removeOverlays(Marshall);
map.removeOverlays(Parma);
map.removeOverlays(Springfield);
map.removeOverlays(Tekonsha);
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(Albion);map.removeOverlays(Albion);
map.removeOverlays(Athens);
map.removeOverlays(Battle_Creek);
map.removeOverlays(Bedford);
map.removeOverlays(East_Leroy);
map.removeOverlays(Homer);
map.removeOverlays(Marshall);
map.removeOverlays(Parma);
map.removeOverlays(Springfield);
map.removeOverlays(Tekonsha);
map.addOverlays(Albion);
centerByArray(Albion, false, false);
cntMarker += Albion.length;
map.addOverlays(Athens);
centerByArray(Athens, false, false);
cntMarker += Athens.length;
map.addOverlays(Battle_Creek);
centerByArray(Battle_Creek, false, false);
cntMarker += Battle_Creek.length;
map.addOverlays(Bedford);
centerByArray(Bedford, false, false);
cntMarker += Bedford.length;
map.addOverlays(East_Leroy);
centerByArray(East_Leroy, false, false);
cntMarker += East_Leroy.length;
map.addOverlays(Homer);
centerByArray(Homer, false, false);
cntMarker += Homer.length;
map.addOverlays(Marshall);
centerByArray(Marshall, false, false);
cntMarker += Marshall.length;
map.addOverlays(Parma);
centerByArray(Parma, false, false);
cntMarker += Parma.length;
map.addOverlays(Springfield);
centerByArray(Springfield, false, false);
cntMarker += Springfield.length;
map.addOverlays(Tekonsha);
centerByArray(Tekonsha, false, false);
cntMarker += Tekonsha.length;
centerByArray(Albion,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');
}
}