function addMarkers(){
mySelect = document.getElementById('selection');
Bloomington = [];Zumbrota = [];North_Saint_Paul = [];Coon_Rapids = [];West_Saint_Paul = [];Burnsville = [];Hutchinson = [];Shakopee = [];New_Ulm = [];Delano = [];Sauk_Rapids = [];Minneapolis = [];Fairfax = [];Princeton = [];Rochester = [];Saint_Paul_Park = [];Redwood_Falls = [];Lewiston = [];Bemidji = [];Balaton = [];Stillwater = [];Loretto = [];Marshall = [];Saint_Paul = [];Goodhue = [];Lake_City = [];Dakota = [];Red_Wing = [];Caledonia = [];Sleepy_Eye = [];Mankato = [];Winona = [];Arlington = [];Cannon_Falls = [];Saint_James = [];Saint_Peter = [];Saint_Louis_Park = [];Belle_Plaine = [];Nicollet = [];Plymouth = [];Sanborn = [];mySelect.options[mySelect.options.length] = new Option("Arlington schools",'all=Arlington');
mySelect.options[mySelect.options.length] = new Option("Balaton schools",'all=Balaton');
mySelect.options[mySelect.options.length] = new Option("Belle Plaine schools",'all=Belle_Plaine');
mySelect.options[mySelect.options.length] = new Option("Bemidji schools",'all=Bemidji');
mySelect.options[mySelect.options.length] = new Option("Bloomington schools",'all=Bloomington');
mySelect.options[mySelect.options.length] = new Option("Burnsville schools",'all=Burnsville');
mySelect.options[mySelect.options.length] = new Option("Caledonia schools",'all=Caledonia');
mySelect.options[mySelect.options.length] = new Option("Cannon Falls schools",'all=Cannon_Falls');
mySelect.options[mySelect.options.length] = new Option("Coon Rapids schools",'all=Coon_Rapids');
mySelect.options[mySelect.options.length] = new Option("Dakota schools",'all=Dakota');
mySelect.options[mySelect.options.length] = new Option("Delano schools",'all=Delano');
mySelect.options[mySelect.options.length] = new Option("Fairfax schools",'all=Fairfax');
mySelect.options[mySelect.options.length] = new Option("Goodhue schools",'all=Goodhue');
mySelect.options[mySelect.options.length] = new Option("Hutchinson schools",'all=Hutchinson');
mySelect.options[mySelect.options.length] = new Option("Lake City schools",'all=Lake_City');
mySelect.options[mySelect.options.length] = new Option("Lewiston schools",'all=Lewiston');
mySelect.options[mySelect.options.length] = new Option("Loretto schools",'all=Loretto');
mySelect.options[mySelect.options.length] = new Option("Mankato schools",'all=Mankato');
mySelect.options[mySelect.options.length] = new Option("Marshall schools",'all=Marshall');
mySelect.options[mySelect.options.length] = new Option("Minneapolis schools",'all=Minneapolis');
mySelect.options[mySelect.options.length] = new Option("New Ulm schools",'all=New_Ulm');
mySelect.options[mySelect.options.length] = new Option("Nicollet schools",'all=Nicollet');
mySelect.options[mySelect.options.length] = new Option("North Saint Paul schools",'all=North_Saint_Paul');
mySelect.options[mySelect.options.length] = new Option("Plymouth schools",'all=Plymouth');
mySelect.options[mySelect.options.length] = new Option("Princeton schools",'all=Princeton');
mySelect.options[mySelect.options.length] = new Option("Red Wing schools",'all=Red_Wing');
mySelect.options[mySelect.options.length] = new Option("Redwood Falls schools",'all=Redwood_Falls');
mySelect.options[mySelect.options.length] = new Option("Rochester schools",'all=Rochester');
mySelect.options[mySelect.options.length] = new Option("Saint James schools",'all=Saint_James');
mySelect.options[mySelect.options.length] = new Option("Saint Louis Park schools",'all=Saint_Louis_Park');
mySelect.options[mySelect.options.length] = new Option("Saint Paul schools",'all=Saint_Paul');
mySelect.options[mySelect.options.length] = new Option("Saint Paul Park schools",'all=Saint_Paul_Park');
mySelect.options[mySelect.options.length] = new Option("Saint Peter schools",'all=Saint_Peter');
mySelect.options[mySelect.options.length] = new Option("Sanborn schools",'all=Sanborn');
mySelect.options[mySelect.options.length] = new Option("Sauk Rapids schools",'all=Sauk_Rapids');
mySelect.options[mySelect.options.length] = new Option("Shakopee schools",'all=Shakopee');
mySelect.options[mySelect.options.length] = new Option("Sleepy Eye schools",'all=Sleepy_Eye');
mySelect.options[mySelect.options.length] = new Option("Stillwater schools",'all=Stillwater');
mySelect.options[mySelect.options.length] = new Option("West Saint Paul schools",'all=West_Saint_Paul');
mySelect.options[mySelect.options.length] = new Option("Winona schools",'all=Winona');
mySelect.options[mySelect.options.length] = new Option("Zumbrota schools",'all=Zumbrota');
mySelect.options[mySelect.options.length] = new Option("---------------------------",'');
Bloomington[Bloomington.length] = createMarker(new GPoint(-93.38412300,44.81145200),"
",iconGr);
mySelect.options[mySelect.options.length] = new Option("Bloomington Living Hope Lutheran School",'Bloomington=' + Bloomington.length);
Zumbrota[Zumbrota.length] = createMarker(new GPoint(-92.66668400,44.29226300),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Christ Lutheran School",'Zumbrota=' + Zumbrota.length);
North_Saint_Paul[North_Saint_Paul.length] = createMarker(new GPoint(-92.99597700,45.02119400),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Christ Lutheran School",'North_Saint_Paul=' + North_Saint_Paul.length);
Coon_Rapids[Coon_Rapids.length] = createMarker(new GPoint(-93.27543100,45.15015900),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Cross Of Christ Lutheran School",'Coon_Rapids=' + Coon_Rapids.length);
West_Saint_Paul[West_Saint_Paul.length] = createMarker(new GPoint(-93.08860800,44.88733700),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Crown Of Life Lutheran School",'West_Saint_Paul=' + West_Saint_Paul.length);
Burnsville[Burnsville.length] = createMarker(new GPoint(-93.27451900,44.74196200),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Good Shepherd Lutheran School",'Burnsville=' + Burnsville.length);
Hutchinson[Hutchinson.length] = createMarker(new GPoint(-94.46088200,44.91829200),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Immanuel Lutheran School",'Hutchinson=' + Hutchinson.length);
Shakopee[Shakopee.length] = createMarker(new GPoint(-93.40745700,44.75777400),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Living Hope Lutheran School",'Shakopee=' + Shakopee.length);
New_Ulm[New_Ulm.length] = createMarker(new GPoint(-94.46383600,44.30578700),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Minnesota Valley Lutheran High School",'New_Ulm=' + New_Ulm.length);
Delano[Delano.length] = createMarker(new GPoint(-93.78335400,45.04176300),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Mt Olive Lutheran School",'Delano=' + Delano.length);
Sauk_Rapids[Sauk_Rapids.length] = createMarker(new GPoint(-94.18208200,45.60217000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Petra Lutheran School",'Sauk_Rapids=' + Sauk_Rapids.length);
Minneapolis[Minneapolis.length] = createMarker(new GPoint(-93.27648400,44.93212300),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Pilgrim Lutheran School",'Minneapolis=' + Minneapolis.length);
Fairfax[Fairfax.length] = createMarker(new GPoint(-94.72276900,44.53354700),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Prairie Lutheran Elementary School",'Fairfax=' + Fairfax.length);
Fairfax[Fairfax.length] = createMarker(new GPoint(-94.72380000,44.53360000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Prairie Lutheran Schools",'Fairfax=' + Fairfax.length);
Princeton[Princeton.length] = createMarker(new GPoint(-93.56246400,45.57326300),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Princeton Evang Lutheran School",'Princeton=' + Princeton.length);
Rochester[Rochester.length] = createMarker(new GPoint(-92.49229000,44.07076000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Resurrection Lutheran School",'Rochester=' + Rochester.length);
Saint_Paul_Park[Saint_Paul_Park.length] = createMarker(new GPoint(-92.98865400,44.84017900),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Andrew Lutheran School",'Saint_Paul_Park=' + Saint_Paul_Park.length);
West_Saint_Paul[West_Saint_Paul.length] = createMarker(new GPoint(-93.07536900,44.90959900),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Croix Lutheran High School",'West_Saint_Paul=' + West_Saint_Paul.length);
Minneapolis[Minneapolis.length] = createMarker(new GPoint(-93.25817200,44.99856300),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. John Lutheran School",'Minneapolis=' + Minneapolis.length);
Redwood_Falls[Redwood_Falls.length] = createMarker(new GPoint(-95.11992300,44.53523700),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. John Lutheran School",'Redwood_Falls=' + Redwood_Falls.length);
Lewiston[Lewiston.length] = createMarker(new GPoint(-91.88909000,43.95527500),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. John's Ev Lutheran School",'Lewiston=' + Lewiston.length);
Bemidji[Bemidji.length] = createMarker(new GPoint(-94.91235500,47.50492000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Mark Lutheran Elementary School",'Bemidji=' + Bemidji.length);
New_Ulm[New_Ulm.length] = createMarker(new GPoint(-94.46617800,44.30781800),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Paul's Lutheran School",'New_Ulm=' + New_Ulm.length);
Balaton[Balaton.length] = createMarker(new GPoint(-95.87875900,44.23274100),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Peter Lutheran School",'Balaton=' + Balaton.length);
Stillwater[Stillwater.length] = createMarker(new GPoint(-92.80395100,45.03933700),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Salem Lutheran School",'Stillwater=' + Stillwater.length);
Loretto[Loretto.length] = createMarker(new GPoint(-93.66610400,45.12929400),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Salem Lutheran School",'Loretto=' + Loretto.length);
Marshall[Marshall.length] = createMarker(new GPoint(-95.76908800,44.45511200),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Samuel Lutheran School",'Marshall=' + Marshall.length);
Saint_Paul[Saint_Paul.length] = createMarker(new GPoint(-93.06806300,44.96140100),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St John Lutheran School",'Saint_Paul=' + Saint_Paul.length);
Goodhue[Goodhue.length] = createMarker(new GPoint(-92.58481800,44.41770900),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St Johns Ev Lutheran School",'Goodhue=' + Goodhue.length);
Lake_City[Lake_City.length] = createMarker(new GPoint(-92.27187600,44.44688300),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St Johns Lutheran School",'Lake_City=' + Lake_City.length);
Dakota[Dakota.length] = createMarker(new GPoint(-91.39380000,43.91490000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St Johns Lutheran School",'Dakota=' + Dakota.length);
Red_Wing[Red_Wing.length] = createMarker(new GPoint(-92.53438700,44.56312500),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St Johns Lutheran School",'Red_Wing=' + Red_Wing.length);
Caledonia[Caledonia.length] = createMarker(new GPoint(-91.49560900,43.64006600),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St John's Evang Lutheran School",'Caledonia=' + Caledonia.length);
Sleepy_Eye[Sleepy_Eye.length] = createMarker(new GPoint(-94.72009100,44.29594600),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St John's Lutheran School",'Sleepy_Eye=' + Sleepy_Eye.length);
Mankato[Mankato.length] = createMarker(new GPoint(-94.02472000,44.15623700),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St Mark Lutheran School",'Mankato=' + Mankato.length);
Bemidji[Bemidji.length] = createMarker(new GPoint(-94.91294100,47.50490300),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St Mark's Lutheran School",'Bemidji=' + Bemidji.length);
Winona[Winona.length] = createMarker(new GPoint(-91.65759700,44.05223700),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St Matthews Lutheran School",'Winona=' + Winona.length);
Arlington[Arlington.length] = createMarker(new GPoint(-94.08345400,44.60614400),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St Paul Lutheran School",'Arlington=' + Arlington.length);
Cannon_Falls[Cannon_Falls.length] = createMarker(new GPoint(-92.92149100,44.50732200),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St Paul's Lutheran Elementary School",'Cannon_Falls=' + Cannon_Falls.length);
Saint_James[Saint_James.length] = createMarker(new GPoint(-94.62297900,43.98143700),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St Pauls Lutheran School",'Saint_James=' + Saint_James.length);
Saint_Peter[Saint_Peter.length] = createMarker(new GPoint(-93.96170200,44.32393900),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St Peter Lutheran School",'Saint_Peter=' + Saint_Peter.length);
Saint_Louis_Park[Saint_Louis_Park.length] = createMarker(new GPoint(-93.37870900,44.94963700),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Timothy Lutheran School",'Saint_Louis_Park=' + Saint_Louis_Park.length);
Belle_Plaine[Belle_Plaine.length] = createMarker(new GPoint(-93.77427500,44.62419400),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Trinity Lutheran School",'Belle_Plaine=' + Belle_Plaine.length);
Nicollet[Nicollet.length] = createMarker(new GPoint(-94.18620000,44.27300000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Trinity Lutheran School",'Nicollet=' + Nicollet.length);
Plymouth[Plymouth.length] = createMarker(new GPoint(-93.46377200,45.01741900),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("West Lutheran High School",'Plymouth=' + Plymouth.length);
Sanborn[Sanborn.length] = createMarker(new GPoint(-95.13050000,44.22040000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Zion Lutheran School",'Sanborn=' + Sanborn.length);
map.removeOverlays(Arlington);
map.removeOverlays(Balaton);
map.removeOverlays(Belle_Plaine);
map.removeOverlays(Bemidji);
map.removeOverlays(Bloomington);
map.removeOverlays(Burnsville);
map.removeOverlays(Caledonia);
map.removeOverlays(Cannon_Falls);
map.removeOverlays(Coon_Rapids);
map.removeOverlays(Dakota);
map.removeOverlays(Delano);
map.removeOverlays(Fairfax);
map.removeOverlays(Goodhue);
map.removeOverlays(Hutchinson);
map.removeOverlays(Lake_City);
map.removeOverlays(Lewiston);
map.removeOverlays(Loretto);
map.removeOverlays(Mankato);
map.removeOverlays(Marshall);
map.removeOverlays(Minneapolis);
map.removeOverlays(New_Ulm);
map.removeOverlays(Nicollet);
map.removeOverlays(North_Saint_Paul);
map.removeOverlays(Plymouth);
map.removeOverlays(Princeton);
map.removeOverlays(Red_Wing);
map.removeOverlays(Redwood_Falls);
map.removeOverlays(Rochester);
map.removeOverlays(Saint_James);
map.removeOverlays(Saint_Louis_Park);
map.removeOverlays(Saint_Paul);
map.removeOverlays(Saint_Paul_Park);
map.removeOverlays(Saint_Peter);
map.removeOverlays(Sanborn);
map.removeOverlays(Sauk_Rapids);
map.removeOverlays(Shakopee);
map.removeOverlays(Sleepy_Eye);
map.removeOverlays(Stillwater);
map.removeOverlays(West_Saint_Paul);
map.removeOverlays(Winona);
map.removeOverlays(Zumbrota);
setTimeout(function(){map.addOverlays(Arlington)},1000);
setTimeout(function(){map.addOverlays(Balaton)},1000);
setTimeout(function(){map.addOverlays(Belle_Plaine)},1000);
setTimeout(function(){map.addOverlays(Bemidji)},1000);
setTimeout(function(){map.addOverlays(Bloomington)},1000);
setTimeout(function(){map.addOverlays(Burnsville)},1000);
setTimeout(function(){map.addOverlays(Caledonia)},1000);
setTimeout(function(){map.addOverlays(Cannon_Falls)},1000);
setTimeout(function(){map.addOverlays(Coon_Rapids)},1000);
setTimeout(function(){map.addOverlays(Dakota)},1000);
setTimeout(function(){map.addOverlays(Delano)},1000);
setTimeout(function(){map.addOverlays(Fairfax)},1000);
setTimeout(function(){map.addOverlays(Goodhue)},1000);
setTimeout(function(){map.addOverlays(Hutchinson)},1000);
setTimeout(function(){map.addOverlays(Lake_City)},1000);
setTimeout(function(){map.addOverlays(Lewiston)},1000);
setTimeout(function(){map.addOverlays(Loretto)},1000);
setTimeout(function(){map.addOverlays(Mankato)},1000);
setTimeout(function(){map.addOverlays(Marshall)},1000);
setTimeout(function(){map.addOverlays(Minneapolis)},1000);
setTimeout(function(){map.addOverlays(New_Ulm)},1000);
setTimeout(function(){map.addOverlays(Nicollet)},1000);
setTimeout(function(){map.addOverlays(North_Saint_Paul)},1000);
setTimeout(function(){map.addOverlays(Plymouth)},1000);
setTimeout(function(){map.addOverlays(Princeton)},1000);
setTimeout(function(){map.addOverlays(Red_Wing)},1000);
setTimeout(function(){map.addOverlays(Redwood_Falls)},1000);
setTimeout(function(){map.addOverlays(Rochester)},1000);
setTimeout(function(){map.addOverlays(Saint_James)},1000);
setTimeout(function(){map.addOverlays(Saint_Louis_Park)},1000);
setTimeout(function(){map.addOverlays(Saint_Paul)},1000);
setTimeout(function(){map.addOverlays(Saint_Paul_Park)},1000);
setTimeout(function(){map.addOverlays(Saint_Peter)},1000);
setTimeout(function(){map.addOverlays(Sanborn)},1000);
setTimeout(function(){map.addOverlays(Sauk_Rapids)},1000);
setTimeout(function(){map.addOverlays(Shakopee)},1000);
setTimeout(function(){map.addOverlays(Sleepy_Eye)},1000);
setTimeout(function(){map.addOverlays(Stillwater)},1000);
setTimeout(function(){map.addOverlays(West_Saint_Paul)},1000);
setTimeout(function(){map.addOverlays(Winona)},1000);
setTimeout(function(){map.addOverlays(Zumbrota)},1000);
maxLng = -91.39380000;
maxLat = 47.50492000;
minLng = -95.87875900;
minLat = 43.64006600;
reCenterMap();
} // 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,11);
/*
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(Arlington);
map.removeOverlays(Balaton);
map.removeOverlays(Belle_Plaine);
map.removeOverlays(Bemidji);
map.removeOverlays(Bloomington);
map.removeOverlays(Burnsville);
map.removeOverlays(Caledonia);
map.removeOverlays(Cannon_Falls);
map.removeOverlays(Coon_Rapids);
map.removeOverlays(Dakota);
map.removeOverlays(Delano);
map.removeOverlays(Fairfax);
map.removeOverlays(Goodhue);
map.removeOverlays(Hutchinson);
map.removeOverlays(Lake_City);
map.removeOverlays(Lewiston);
map.removeOverlays(Loretto);
map.removeOverlays(Mankato);
map.removeOverlays(Marshall);
map.removeOverlays(Minneapolis);
map.removeOverlays(New_Ulm);
map.removeOverlays(Nicollet);
map.removeOverlays(North_Saint_Paul);
map.removeOverlays(Plymouth);
map.removeOverlays(Princeton);
map.removeOverlays(Red_Wing);
map.removeOverlays(Redwood_Falls);
map.removeOverlays(Rochester);
map.removeOverlays(Saint_James);
map.removeOverlays(Saint_Louis_Park);
map.removeOverlays(Saint_Paul);
map.removeOverlays(Saint_Paul_Park);
map.removeOverlays(Saint_Peter);
map.removeOverlays(Sanborn);
map.removeOverlays(Sauk_Rapids);
map.removeOverlays(Shakopee);
map.removeOverlays(Sleepy_Eye);
map.removeOverlays(Stillwater);
map.removeOverlays(West_Saint_Paul);
map.removeOverlays(Winona);
map.removeOverlays(Zumbrota);
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(Bloomington);map.removeOverlays(Arlington);
map.removeOverlays(Balaton);
map.removeOverlays(Belle_Plaine);
map.removeOverlays(Bemidji);
map.removeOverlays(Bloomington);
map.removeOverlays(Burnsville);
map.removeOverlays(Caledonia);
map.removeOverlays(Cannon_Falls);
map.removeOverlays(Coon_Rapids);
map.removeOverlays(Dakota);
map.removeOverlays(Delano);
map.removeOverlays(Fairfax);
map.removeOverlays(Goodhue);
map.removeOverlays(Hutchinson);
map.removeOverlays(Lake_City);
map.removeOverlays(Lewiston);
map.removeOverlays(Loretto);
map.removeOverlays(Mankato);
map.removeOverlays(Marshall);
map.removeOverlays(Minneapolis);
map.removeOverlays(New_Ulm);
map.removeOverlays(Nicollet);
map.removeOverlays(North_Saint_Paul);
map.removeOverlays(Plymouth);
map.removeOverlays(Princeton);
map.removeOverlays(Red_Wing);
map.removeOverlays(Redwood_Falls);
map.removeOverlays(Rochester);
map.removeOverlays(Saint_James);
map.removeOverlays(Saint_Louis_Park);
map.removeOverlays(Saint_Paul);
map.removeOverlays(Saint_Paul_Park);
map.removeOverlays(Saint_Peter);
map.removeOverlays(Sanborn);
map.removeOverlays(Sauk_Rapids);
map.removeOverlays(Shakopee);
map.removeOverlays(Sleepy_Eye);
map.removeOverlays(Stillwater);
map.removeOverlays(West_Saint_Paul);
map.removeOverlays(Winona);
map.removeOverlays(Zumbrota);
map.addOverlays(Arlington);
centerByArray(Arlington, false, false);
cntMarker += Arlington.length;
map.addOverlays(Balaton);
centerByArray(Balaton, false, false);
cntMarker += Balaton.length;
map.addOverlays(Belle_Plaine);
centerByArray(Belle_Plaine, false, false);
cntMarker += Belle_Plaine.length;
map.addOverlays(Bemidji);
centerByArray(Bemidji, false, false);
cntMarker += Bemidji.length;
map.addOverlays(Bloomington);
centerByArray(Bloomington, false, false);
cntMarker += Bloomington.length;
map.addOverlays(Burnsville);
centerByArray(Burnsville, false, false);
cntMarker += Burnsville.length;
map.addOverlays(Caledonia);
centerByArray(Caledonia, false, false);
cntMarker += Caledonia.length;
map.addOverlays(Cannon_Falls);
centerByArray(Cannon_Falls, false, false);
cntMarker += Cannon_Falls.length;
map.addOverlays(Coon_Rapids);
centerByArray(Coon_Rapids, false, false);
cntMarker += Coon_Rapids.length;
map.addOverlays(Dakota);
centerByArray(Dakota, false, false);
cntMarker += Dakota.length;
map.addOverlays(Delano);
centerByArray(Delano, false, false);
cntMarker += Delano.length;
map.addOverlays(Fairfax);
centerByArray(Fairfax, false, false);
cntMarker += Fairfax.length;
map.addOverlays(Goodhue);
centerByArray(Goodhue, false, false);
cntMarker += Goodhue.length;
map.addOverlays(Hutchinson);
centerByArray(Hutchinson, false, false);
cntMarker += Hutchinson.length;
map.addOverlays(Lake_City);
centerByArray(Lake_City, false, false);
cntMarker += Lake_City.length;
map.addOverlays(Lewiston);
centerByArray(Lewiston, false, false);
cntMarker += Lewiston.length;
map.addOverlays(Loretto);
centerByArray(Loretto, false, false);
cntMarker += Loretto.length;
map.addOverlays(Mankato);
centerByArray(Mankato, false, false);
cntMarker += Mankato.length;
map.addOverlays(Marshall);
centerByArray(Marshall, false, false);
cntMarker += Marshall.length;
map.addOverlays(Minneapolis);
centerByArray(Minneapolis, false, false);
cntMarker += Minneapolis.length;
map.addOverlays(New_Ulm);
centerByArray(New_Ulm, false, false);
cntMarker += New_Ulm.length;
map.addOverlays(Nicollet);
centerByArray(Nicollet, false, false);
cntMarker += Nicollet.length;
map.addOverlays(North_Saint_Paul);
centerByArray(North_Saint_Paul, false, false);
cntMarker += North_Saint_Paul.length;
map.addOverlays(Plymouth);
centerByArray(Plymouth, false, false);
cntMarker += Plymouth.length;
map.addOverlays(Princeton);
centerByArray(Princeton, false, false);
cntMarker += Princeton.length;
map.addOverlays(Red_Wing);
centerByArray(Red_Wing, false, false);
cntMarker += Red_Wing.length;
map.addOverlays(Redwood_Falls);
centerByArray(Redwood_Falls, false, false);
cntMarker += Redwood_Falls.length;
map.addOverlays(Rochester);
centerByArray(Rochester, false, false);
cntMarker += Rochester.length;
map.addOverlays(Saint_James);
centerByArray(Saint_James, false, false);
cntMarker += Saint_James.length;
map.addOverlays(Saint_Louis_Park);
centerByArray(Saint_Louis_Park, false, false);
cntMarker += Saint_Louis_Park.length;
map.addOverlays(Saint_Paul);
centerByArray(Saint_Paul, false, false);
cntMarker += Saint_Paul.length;
map.addOverlays(Saint_Paul_Park);
centerByArray(Saint_Paul_Park, false, false);
cntMarker += Saint_Paul_Park.length;
map.addOverlays(Saint_Peter);
centerByArray(Saint_Peter, false, false);
cntMarker += Saint_Peter.length;
map.addOverlays(Sanborn);
centerByArray(Sanborn, false, false);
cntMarker += Sanborn.length;
map.addOverlays(Sauk_Rapids);
centerByArray(Sauk_Rapids, false, false);
cntMarker += Sauk_Rapids.length;
map.addOverlays(Shakopee);
centerByArray(Shakopee, false, false);
cntMarker += Shakopee.length;
map.addOverlays(Sleepy_Eye);
centerByArray(Sleepy_Eye, false, false);
cntMarker += Sleepy_Eye.length;
map.addOverlays(Stillwater);
centerByArray(Stillwater, false, false);
cntMarker += Stillwater.length;
map.addOverlays(West_Saint_Paul);
centerByArray(West_Saint_Paul, false, false);
cntMarker += West_Saint_Paul.length;
map.addOverlays(Winona);
centerByArray(Winona, false, false);
cntMarker += Winona.length;
map.addOverlays(Zumbrota);
centerByArray(Zumbrota, false, false);
cntMarker += Zumbrota.length;
centerByArray(Bloomington,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///31415,15012,15325,15136,15236,15250,15313,15199,32531,14825,14909,15167,15241,14874,15184,15025,31415,15161,15180,14957,15181,15278,15091,15200,15093,15060,15162,15238,15307,14847,15065,15182,15157,15073,15243,15300,15158,15118,14984,15339,15059,34382,15186,15090,14885,15136,15226,14848,/all');
//window.open('/map.php?type=2&schools=31415,15012,15325,15136,15236,15250,15313,15199,32531,14825,14909,15167,15241,14874,15184,15025,31415,15161,15180,14957,15181,15278,15091,15200,15093,15060,15162,15238,15307,14847,15065,15182,15157,15073,15243,15300,15158,15118,14984,15339,15059,34382,15186,15090,14885,15136,15226,14848,&school_level=&radius=&zipcode=&school_type_search=&school_type_code=');
}
}
function createMarker(point, label, icon)
{
var marker = new GMarker(point, icon);
var html = label;
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(html);
});
return marker;
}