function addMarkers(){
mySelect = document.getElementById('selection');
Ames = [];Ankeny = [];Cedar_Rapids = [];Grinnell = [];Fort_Dodge = [];Urbandale = [];Estherville = [];Fairfield = [];Muscatine = [];Forest_City = [];Des_Moines = [];Burlington = [];Council_Bluffs = [];Eldridge = [];North_Liberty = [];Coralville = [];Hull = [];Inwood = [];West_Des_Moines = [];Kanawha = [];Keokuk = [];Creston = [];Bettendorf = [];Mount_Pleasant = [];Newton = [];Mason_City = [];Ocheyedan = [];Ottumwa = [];Pella = [];Sanborn = [];Sheldon = [];Sioux_City = [];Waterloo = [];Wellsburg = [];Indianola = [];mySelect.options[mySelect.options.length] = new Option("Ames schools",'all=Ames');
mySelect.options[mySelect.options.length] = new Option("Ankeny schools",'all=Ankeny');
mySelect.options[mySelect.options.length] = new Option("Bettendorf schools",'all=Bettendorf');
mySelect.options[mySelect.options.length] = new Option("Burlington schools",'all=Burlington');
mySelect.options[mySelect.options.length] = new Option("Cedar Rapids schools",'all=Cedar_Rapids');
mySelect.options[mySelect.options.length] = new Option("Coralville schools",'all=Coralville');
mySelect.options[mySelect.options.length] = new Option("Council Bluffs schools",'all=Council_Bluffs');
mySelect.options[mySelect.options.length] = new Option("Creston schools",'all=Creston');
mySelect.options[mySelect.options.length] = new Option("Des Moines schools",'all=Des_Moines');
mySelect.options[mySelect.options.length] = new Option("Eldridge schools",'all=Eldridge');
mySelect.options[mySelect.options.length] = new Option("Estherville schools",'all=Estherville');
mySelect.options[mySelect.options.length] = new Option("Fairfield schools",'all=Fairfield');
mySelect.options[mySelect.options.length] = new Option("Forest City schools",'all=Forest_City');
mySelect.options[mySelect.options.length] = new Option("Fort Dodge schools",'all=Fort_Dodge');
mySelect.options[mySelect.options.length] = new Option("Grinnell schools",'all=Grinnell');
mySelect.options[mySelect.options.length] = new Option("Hull schools",'all=Hull');
mySelect.options[mySelect.options.length] = new Option("Indianola schools",'all=Indianola');
mySelect.options[mySelect.options.length] = new Option("Inwood schools",'all=Inwood');
mySelect.options[mySelect.options.length] = new Option("Kanawha schools",'all=Kanawha');
mySelect.options[mySelect.options.length] = new Option("Keokuk schools",'all=Keokuk');
mySelect.options[mySelect.options.length] = new Option("Mason City schools",'all=Mason_City');
mySelect.options[mySelect.options.length] = new Option("Mount Pleasant schools",'all=Mount_Pleasant');
mySelect.options[mySelect.options.length] = new Option("Muscatine schools",'all=Muscatine');
mySelect.options[mySelect.options.length] = new Option("Newton schools",'all=Newton');
mySelect.options[mySelect.options.length] = new Option("North Liberty schools",'all=North_Liberty');
mySelect.options[mySelect.options.length] = new Option("Ocheyedan schools",'all=Ocheyedan');
mySelect.options[mySelect.options.length] = new Option("Ottumwa schools",'all=Ottumwa');
mySelect.options[mySelect.options.length] = new Option("Pella schools",'all=Pella');
mySelect.options[mySelect.options.length] = new Option("Sanborn schools",'all=Sanborn');
mySelect.options[mySelect.options.length] = new Option("Sheldon schools",'all=Sheldon');
mySelect.options[mySelect.options.length] = new Option("Sioux City schools",'all=Sioux_City');
mySelect.options[mySelect.options.length] = new Option("Urbandale schools",'all=Urbandale');
mySelect.options[mySelect.options.length] = new Option("Waterloo schools",'all=Waterloo');
mySelect.options[mySelect.options.length] = new Option("Wellsburg schools",'all=Wellsburg');
mySelect.options[mySelect.options.length] = new Option("West Des Moines schools",'all=West_Des_Moines');
mySelect.options[mySelect.options.length] = new Option("---------------------------",'');
Ames[Ames.length] = createMarker(new GPoint(-93.62411300,42.00850200),"
",iconGr);
mySelect.options[mySelect.options.length] = new Option("Ames Christian School",'Ames=' + Ames.length);
Ankeny[Ankeny.length] = createMarker(new GPoint(-93.62190600,41.73199300),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Ankeny Christian Academy",'Ankeny=' + Ankeny.length);
Cedar_Rapids[Cedar_Rapids.length] = createMarker(new GPoint(-91.61524100,41.99526800),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Cedar Valley Christian School",'Cedar_Rapids=' + Cedar_Rapids.length);
Grinnell[Grinnell.length] = createMarker(new GPoint(-92.74645500,41.74633700),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Central Iowa Christian School",'Grinnell=' + Grinnell.length);
Fort_Dodge[Fort_Dodge.length] = createMarker(new GPoint(-94.15252200,42.51583700),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Community Christian School",'Fort_Dodge=' + Fort_Dodge.length);
Urbandale[Urbandale.length] = createMarker(new GPoint(-93.68281200,41.61142700),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Des Moines Christian School",'Urbandale=' + Urbandale.length);
Estherville[Estherville.length] = createMarker(new GPoint(-94.87599500,43.41499100),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Estherville Community Christian School",'Estherville=' + Estherville.length);
Fairfield[Fairfield.length] = createMarker(new GPoint(-91.96297300,40.98606700),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Fairfield Christian School",'Fairfield=' + Fairfield.length);
Muscatine[Muscatine.length] = createMarker(new GPoint(-91.03889600,41.44591300),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Faith Academy",'Muscatine=' + Muscatine.length);
Forest_City[Forest_City.length] = createMarker(new GPoint(-93.63938800,43.27707200),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Forest City Christian School",'Forest_City=' + Forest_City.length);
Des_Moines[Des_Moines.length] = createMarker(new GPoint(-93.71691500,41.64185400),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Gospel Assembly Christian Academy",'Des_Moines=' + Des_Moines.length);
Burlington[Burlington.length] = createMarker(new GPoint(-91.10303400,40.81213000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Great River Christian School",'Burlington=' + Burlington.length);
Council_Bluffs[Council_Bluffs.length] = createMarker(new GPoint(-95.85148600,41.21831100),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Heartland Christian School",'Council_Bluffs=' + Council_Bluffs.length);
Eldridge[Eldridge.length] = createMarker(new GPoint(-90.54549700,41.69218600),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Heritage Christian School",'Eldridge=' + Eldridge.length);
North_Liberty[North_Liberty.length] = createMarker(new GPoint(-91.57664300,41.73350400),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Heritage Christian School",'North_Liberty=' + North_Liberty.length);
Coralville[Coralville.length] = createMarker(new GPoint(-91.58214200,41.69033300),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Hillside Christian School",'Coralville=' + Coralville.length);
Cedar_Rapids[Cedar_Rapids.length] = createMarker(new GPoint(-91.65196200,42.02276300),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Holloway House",'Cedar_Rapids=' + Cedar_Rapids.length);
Hull[Hull.length] = createMarker(new GPoint(-96.14300000,43.19300000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Hull Christian School",'Hull=' + Hull.length);
Inwood[Inwood.length] = createMarker(new GPoint(-96.42905000,43.30530900),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Inwood Christian School",'Inwood=' + Inwood.length);
West_Des_Moines[West_Des_Moines.length] = createMarker(new GPoint(-93.73943900,41.57951300),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Iowa Christian Academy",'West_Des_Moines=' + West_Des_Moines.length);
Cedar_Rapids[Cedar_Rapids.length] = createMarker(new GPoint(-91.67210900,42.00562200),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Isaac Newton Christian Academy",'Cedar_Rapids=' + Cedar_Rapids.length);
Kanawha[Kanawha.length] = createMarker(new GPoint(-93.79033100,42.93790000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Kanawha Christian School",'Kanawha=' + Kanawha.length);
Keokuk[Keokuk.length] = createMarker(new GPoint(-91.40865200,40.39633700),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Keokuk Christian Academy",'Keokuk=' + Keokuk.length);
Creston[Creston.length] = createMarker(new GPoint(-94.37572700,41.06448000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Mayflower Heritage Christian School",'Creston=' + Creston.length);
Bettendorf[Bettendorf.length] = createMarker(new GPoint(-90.51225900,41.56047300),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Morning Star Academy",'Bettendorf=' + Bettendorf.length);
Mount_Pleasant[Mount_Pleasant.length] = createMarker(new GPoint(-91.53124100,40.96318900),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Mt Pleasant Christian School",'Mount_Pleasant=' + Mount_Pleasant.length);
Newton[Newton.length] = createMarker(new GPoint(-93.03190300,41.71009500),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Newton Christian School",'Newton=' + Newton.length);
Mason_City[Mason_City.length] = createMarker(new GPoint(-93.18098600,43.15943600),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("North Iowa Christian School",'Mason_City=' + Mason_City.length);
Ocheyedan[Ocheyedan.length] = createMarker(new GPoint(-95.53928800,43.40979900),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Ocheyedan Christian School",'Ocheyedan=' + Ocheyedan.length);
Ottumwa[Ottumwa.length] = createMarker(new GPoint(-92.40867600,41.02442300),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Ottumwa Christian School",'Ottumwa=' + Ottumwa.length);
Pella[Pella.length] = createMarker(new GPoint(-92.91014400,41.40523100),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Pella Christian Grade School",'Pella=' + Pella.length);
Pella[Pella.length] = createMarker(new GPoint(-92.84770000,41.44370000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Peoria Christian School",'Pella=' + Pella.length);
Sanborn[Sanborn.length] = createMarker(new GPoint(-95.66007100,43.18137600),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Sanborn Christian School",'Sanborn=' + Sanborn.length);
Sheldon[Sheldon.length] = createMarker(new GPoint(-95.83761100,43.17883700),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Sheldon Christian School",'Sheldon=' + Sheldon.length);
Sioux_City[Sioux_City.length] = createMarker(new GPoint(-96.32963600,42.46200800),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Siouxland Community Christian School",'Sioux_City=' + Sioux_City.length);
Waterloo[Waterloo.length] = createMarker(new GPoint(-92.33727500,42.49189700),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Sonrise Christian School And Daycare",'Waterloo=' + Waterloo.length);
Wellsburg[Wellsburg.length] = createMarker(new GPoint(-92.92540300,42.45180000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Timothy Christian School",'Wellsburg=' + Wellsburg.length);
Indianola[Indianola.length] = createMarker(new GPoint(-93.57060000,41.35360000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Victory Christian Academy",'Indianola=' + Indianola.length);
map.removeOverlays(Ames);
map.removeOverlays(Ankeny);
map.removeOverlays(Bettendorf);
map.removeOverlays(Burlington);
map.removeOverlays(Cedar_Rapids);
map.removeOverlays(Coralville);
map.removeOverlays(Council_Bluffs);
map.removeOverlays(Creston);
map.removeOverlays(Des_Moines);
map.removeOverlays(Eldridge);
map.removeOverlays(Estherville);
map.removeOverlays(Fairfield);
map.removeOverlays(Forest_City);
map.removeOverlays(Fort_Dodge);
map.removeOverlays(Grinnell);
map.removeOverlays(Hull);
map.removeOverlays(Indianola);
map.removeOverlays(Inwood);
map.removeOverlays(Kanawha);
map.removeOverlays(Keokuk);
map.removeOverlays(Mason_City);
map.removeOverlays(Mount_Pleasant);
map.removeOverlays(Muscatine);
map.removeOverlays(Newton);
map.removeOverlays(North_Liberty);
map.removeOverlays(Ocheyedan);
map.removeOverlays(Ottumwa);
map.removeOverlays(Pella);
map.removeOverlays(Sanborn);
map.removeOverlays(Sheldon);
map.removeOverlays(Sioux_City);
map.removeOverlays(Urbandale);
map.removeOverlays(Waterloo);
map.removeOverlays(Wellsburg);
map.removeOverlays(West_Des_Moines);
setTimeout(function(){map.addOverlays(Ames)},1000);
setTimeout(function(){map.addOverlays(Ankeny)},1000);
setTimeout(function(){map.addOverlays(Bettendorf)},1000);
setTimeout(function(){map.addOverlays(Burlington)},1000);
setTimeout(function(){map.addOverlays(Cedar_Rapids)},1000);
setTimeout(function(){map.addOverlays(Coralville)},1000);
setTimeout(function(){map.addOverlays(Council_Bluffs)},1000);
setTimeout(function(){map.addOverlays(Creston)},1000);
setTimeout(function(){map.addOverlays(Des_Moines)},1000);
setTimeout(function(){map.addOverlays(Eldridge)},1000);
setTimeout(function(){map.addOverlays(Estherville)},1000);
setTimeout(function(){map.addOverlays(Fairfield)},1000);
setTimeout(function(){map.addOverlays(Forest_City)},1000);
setTimeout(function(){map.addOverlays(Fort_Dodge)},1000);
setTimeout(function(){map.addOverlays(Grinnell)},1000);
setTimeout(function(){map.addOverlays(Hull)},1000);
setTimeout(function(){map.addOverlays(Indianola)},1000);
setTimeout(function(){map.addOverlays(Inwood)},1000);
setTimeout(function(){map.addOverlays(Kanawha)},1000);
setTimeout(function(){map.addOverlays(Keokuk)},1000);
setTimeout(function(){map.addOverlays(Mason_City)},1000);
setTimeout(function(){map.addOverlays(Mount_Pleasant)},1000);
setTimeout(function(){map.addOverlays(Muscatine)},1000);
setTimeout(function(){map.addOverlays(Newton)},1000);
setTimeout(function(){map.addOverlays(North_Liberty)},1000);
setTimeout(function(){map.addOverlays(Ocheyedan)},1000);
setTimeout(function(){map.addOverlays(Ottumwa)},1000);
setTimeout(function(){map.addOverlays(Pella)},1000);
setTimeout(function(){map.addOverlays(Sanborn)},1000);
setTimeout(function(){map.addOverlays(Sheldon)},1000);
setTimeout(function(){map.addOverlays(Sioux_City)},1000);
setTimeout(function(){map.addOverlays(Urbandale)},1000);
setTimeout(function(){map.addOverlays(Waterloo)},1000);
setTimeout(function(){map.addOverlays(Wellsburg)},1000);
setTimeout(function(){map.addOverlays(West_Des_Moines)},1000);
maxLng = -90.51225900;
maxLat = 43.41499100;
minLng = -96.42905000;
minLat = 40.39633700;
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(Ames);
map.removeOverlays(Ankeny);
map.removeOverlays(Bettendorf);
map.removeOverlays(Burlington);
map.removeOverlays(Cedar_Rapids);
map.removeOverlays(Coralville);
map.removeOverlays(Council_Bluffs);
map.removeOverlays(Creston);
map.removeOverlays(Des_Moines);
map.removeOverlays(Eldridge);
map.removeOverlays(Estherville);
map.removeOverlays(Fairfield);
map.removeOverlays(Forest_City);
map.removeOverlays(Fort_Dodge);
map.removeOverlays(Grinnell);
map.removeOverlays(Hull);
map.removeOverlays(Indianola);
map.removeOverlays(Inwood);
map.removeOverlays(Kanawha);
map.removeOverlays(Keokuk);
map.removeOverlays(Mason_City);
map.removeOverlays(Mount_Pleasant);
map.removeOverlays(Muscatine);
map.removeOverlays(Newton);
map.removeOverlays(North_Liberty);
map.removeOverlays(Ocheyedan);
map.removeOverlays(Ottumwa);
map.removeOverlays(Pella);
map.removeOverlays(Sanborn);
map.removeOverlays(Sheldon);
map.removeOverlays(Sioux_City);
map.removeOverlays(Urbandale);
map.removeOverlays(Waterloo);
map.removeOverlays(Wellsburg);
map.removeOverlays(West_Des_Moines);
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(Ames);map.removeOverlays(Ames);
map.removeOverlays(Ankeny);
map.removeOverlays(Bettendorf);
map.removeOverlays(Burlington);
map.removeOverlays(Cedar_Rapids);
map.removeOverlays(Coralville);
map.removeOverlays(Council_Bluffs);
map.removeOverlays(Creston);
map.removeOverlays(Des_Moines);
map.removeOverlays(Eldridge);
map.removeOverlays(Estherville);
map.removeOverlays(Fairfield);
map.removeOverlays(Forest_City);
map.removeOverlays(Fort_Dodge);
map.removeOverlays(Grinnell);
map.removeOverlays(Hull);
map.removeOverlays(Indianola);
map.removeOverlays(Inwood);
map.removeOverlays(Kanawha);
map.removeOverlays(Keokuk);
map.removeOverlays(Mason_City);
map.removeOverlays(Mount_Pleasant);
map.removeOverlays(Muscatine);
map.removeOverlays(Newton);
map.removeOverlays(North_Liberty);
map.removeOverlays(Ocheyedan);
map.removeOverlays(Ottumwa);
map.removeOverlays(Pella);
map.removeOverlays(Sanborn);
map.removeOverlays(Sheldon);
map.removeOverlays(Sioux_City);
map.removeOverlays(Urbandale);
map.removeOverlays(Waterloo);
map.removeOverlays(Wellsburg);
map.removeOverlays(West_Des_Moines);
map.addOverlays(Ames);
centerByArray(Ames, false, false);
cntMarker += Ames.length;
map.addOverlays(Ankeny);
centerByArray(Ankeny, false, false);
cntMarker += Ankeny.length;
map.addOverlays(Bettendorf);
centerByArray(Bettendorf, false, false);
cntMarker += Bettendorf.length;
map.addOverlays(Burlington);
centerByArray(Burlington, false, false);
cntMarker += Burlington.length;
map.addOverlays(Cedar_Rapids);
centerByArray(Cedar_Rapids, false, false);
cntMarker += Cedar_Rapids.length;
map.addOverlays(Coralville);
centerByArray(Coralville, false, false);
cntMarker += Coralville.length;
map.addOverlays(Council_Bluffs);
centerByArray(Council_Bluffs, false, false);
cntMarker += Council_Bluffs.length;
map.addOverlays(Creston);
centerByArray(Creston, false, false);
cntMarker += Creston.length;
map.addOverlays(Des_Moines);
centerByArray(Des_Moines, false, false);
cntMarker += Des_Moines.length;
map.addOverlays(Eldridge);
centerByArray(Eldridge, false, false);
cntMarker += Eldridge.length;
map.addOverlays(Estherville);
centerByArray(Estherville, false, false);
cntMarker += Estherville.length;
map.addOverlays(Fairfield);
centerByArray(Fairfield, false, false);
cntMarker += Fairfield.length;
map.addOverlays(Forest_City);
centerByArray(Forest_City, false, false);
cntMarker += Forest_City.length;
map.addOverlays(Fort_Dodge);
centerByArray(Fort_Dodge, false, false);
cntMarker += Fort_Dodge.length;
map.addOverlays(Grinnell);
centerByArray(Grinnell, false, false);
cntMarker += Grinnell.length;
map.addOverlays(Hull);
centerByArray(Hull, false, false);
cntMarker += Hull.length;
map.addOverlays(Indianola);
centerByArray(Indianola, false, false);
cntMarker += Indianola.length;
map.addOverlays(Inwood);
centerByArray(Inwood, false, false);
cntMarker += Inwood.length;
map.addOverlays(Kanawha);
centerByArray(Kanawha, false, false);
cntMarker += Kanawha.length;
map.addOverlays(Keokuk);
centerByArray(Keokuk, false, false);
cntMarker += Keokuk.length;
map.addOverlays(Mason_City);
centerByArray(Mason_City, false, false);
cntMarker += Mason_City.length;
map.addOverlays(Mount_Pleasant);
centerByArray(Mount_Pleasant, false, false);
cntMarker += Mount_Pleasant.length;
map.addOverlays(Muscatine);
centerByArray(Muscatine, false, false);
cntMarker += Muscatine.length;
map.addOverlays(Newton);
centerByArray(Newton, false, false);
cntMarker += Newton.length;
map.addOverlays(North_Liberty);
centerByArray(North_Liberty, false, false);
cntMarker += North_Liberty.length;
map.addOverlays(Ocheyedan);
centerByArray(Ocheyedan, false, false);
cntMarker += Ocheyedan.length;
map.addOverlays(Ottumwa);
centerByArray(Ottumwa, false, false);
cntMarker += Ottumwa.length;
map.addOverlays(Pella);
centerByArray(Pella, false, false);
cntMarker += Pella.length;
map.addOverlays(Sanborn);
centerByArray(Sanborn, false, false);
cntMarker += Sanborn.length;
map.addOverlays(Sheldon);
centerByArray(Sheldon, false, false);
cntMarker += Sheldon.length;
map.addOverlays(Sioux_City);
centerByArray(Sioux_City, false, false);
cntMarker += Sioux_City.length;
map.addOverlays(Urbandale);
centerByArray(Urbandale, false, false);
cntMarker += Urbandale.length;
map.addOverlays(Waterloo);
centerByArray(Waterloo, false, false);
cntMarker += Waterloo.length;
map.addOverlays(Wellsburg);
centerByArray(Wellsburg, false, false);
cntMarker += Wellsburg.length;
map.addOverlays(West_Des_Moines);
centerByArray(West_Des_Moines, false, false);
cntMarker += West_Des_Moines.length;
centerByArray(Ames,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///10600,10601,8998,10652,10620,10684,10680,31301,10649,10660,10644,10646,10718,10710,10726,10708,10637,10679,10600,10601,8998,10652,10620,10859,10684,10680,31301,33535,10649,10660,10856,10644,10646,10629,10653,10672,10847,10678,10687,10688,10718,10710,10645,10717,10658,10723,10726,10729,10731,10750,10762,10708,10637,32432,10833,10679,/all');
//window.open('/map.php?type=2&schools=10600,10601,8998,10652,10620,10684,10680,31301,10649,10660,10644,10646,10718,10710,10726,10708,10637,10679,10600,10601,8998,10652,10620,10859,10684,10680,31301,33535,10649,10660,10856,10644,10646,10629,10653,10672,10847,10678,10687,10688,10718,10710,10645,10717,10658,10723,10726,10729,10731,10750,10762,10708,10637,32432,10833,10679,&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;
}