function addMarkers(){
mySelect = document.getElementById('selection');
Alpena = [];Escanaba = [];University_Center = [];Hancock = [];Centreville = [];Ironwood = [];Grand_Rapids = [];Dearborn = [];Troy = [];Jackson = [];Kalamazoo = [];Battle_Creek = [];Roscommon = [];Benton_Harbor = [];Lansing = [];Detroit = [];Warren = [];Harrison = [];Monroe = [];Sidney = [];Flint = [];Muskegon = [];Petoskey = [];Traverse_City = [];Bloomfield_Hills = [];Livonia = [];Dowagiac = [];Port_Huron = [];Ann_Arbor = [];Scottville = [];mySelect.options[mySelect.options.length] = new Option("Alpena Schools",'all=Alpena');
mySelect.options[mySelect.options.length] = new Option("Ann Arbor Schools",'all=Ann_Arbor');
mySelect.options[mySelect.options.length] = new Option("Battle Creek Schools",'all=Battle_Creek');
mySelect.options[mySelect.options.length] = new Option("Benton Harbor Schools",'all=Benton_Harbor');
mySelect.options[mySelect.options.length] = new Option("Bloomfield Hills Schools",'all=Bloomfield_Hills');
mySelect.options[mySelect.options.length] = new Option("Centreville Schools",'all=Centreville');
mySelect.options[mySelect.options.length] = new Option("Dearborn Schools",'all=Dearborn');
mySelect.options[mySelect.options.length] = new Option("Detroit Schools",'all=Detroit');
mySelect.options[mySelect.options.length] = new Option("Dowagiac Schools",'all=Dowagiac');
mySelect.options[mySelect.options.length] = new Option("Escanaba Schools",'all=Escanaba');
mySelect.options[mySelect.options.length] = new Option("Flint Schools",'all=Flint');
mySelect.options[mySelect.options.length] = new Option("Grand Rapids Schools",'all=Grand_Rapids');
mySelect.options[mySelect.options.length] = new Option("Hancock Schools",'all=Hancock');
mySelect.options[mySelect.options.length] = new Option("Harrison Schools",'all=Harrison');
mySelect.options[mySelect.options.length] = new Option("Ironwood Schools",'all=Ironwood');
mySelect.options[mySelect.options.length] = new Option("Jackson Schools",'all=Jackson');
mySelect.options[mySelect.options.length] = new Option("Kalamazoo Schools",'all=Kalamazoo');
mySelect.options[mySelect.options.length] = new Option("Lansing Schools",'all=Lansing');
mySelect.options[mySelect.options.length] = new Option("Livonia Schools",'all=Livonia');
mySelect.options[mySelect.options.length] = new Option("Monroe Schools",'all=Monroe');
mySelect.options[mySelect.options.length] = new Option("Muskegon Schools",'all=Muskegon');
mySelect.options[mySelect.options.length] = new Option("Petoskey Schools",'all=Petoskey');
mySelect.options[mySelect.options.length] = new Option("Port Huron Schools",'all=Port_Huron');
mySelect.options[mySelect.options.length] = new Option("Roscommon Schools",'all=Roscommon');
mySelect.options[mySelect.options.length] = new Option("Scottville Schools",'all=Scottville');
mySelect.options[mySelect.options.length] = new Option("Sidney Schools",'all=Sidney');
mySelect.options[mySelect.options.length] = new Option("Traverse City Schools",'all=Traverse_City');
mySelect.options[mySelect.options.length] = new Option("Troy Schools",'all=Troy');
mySelect.options[mySelect.options.length] = new Option("University Center Schools",'all=University_Center');
mySelect.options[mySelect.options.length] = new Option("Warren Schools",'all=Warren');
mySelect.options[mySelect.options.length] = new Option("---------------------------",'');
var tmpLatLng=0;
var tmpLen=0;
tmpLatLng=new GLatLng(45.07962400000000258,-83.4447969999999941);
tmpLen=Alpena.length;
Alpena[tmpLen] = createMarker(tmpLatLng,"
",iconGr);
Alpena[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Alpena Community College",'Alpena=' + Alpena.length);
tmpLatLng=new GLatLng(45.77005100000000226,-87.0808640000000053);
tmpLen=Escanaba.length;
Escanaba[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Escanaba[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Bay De Noc Community College",'Escanaba=' + Escanaba.length);
tmpLatLng=new GLatLng(43.55214800000000252,-83.9783390000000053);
tmpLen=University_Center.length;
University_Center[tmpLen] = createMarker(tmpLatLng,"",iconGr);
University_Center[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Delta College",'University_Center=' + University_Center.length);
tmpLatLng=new GLatLng(47.12669900000000211,-88.5892060000000043);
tmpLen=Hancock.length;
Hancock[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Hancock[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Finlandia University",'Hancock=' + Hancock.length);
tmpLatLng=new GLatLng(41.89352399999999931,-85.5069440000000042);
tmpLen=Centreville.length;
Centreville[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Centreville[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Glen Oaks Community College",'Centreville=' + Centreville.length);
tmpLatLng=new GLatLng(46.46656600000000025,-90.1456000000000017);
tmpLen=Ironwood.length;
Ironwood[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Ironwood[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Gogebic Community College",'Ironwood=' + Ironwood.length);
tmpLatLng=new GLatLng(42.96603999999999956,-85.6665729999999996);
tmpLen=Grand_Rapids.length;
Grand_Rapids[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Grand_Rapids[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Grand Rapids Community College",'Grand_Rapids=' + Grand_Rapids.length);
tmpLatLng=new GLatLng(42.32385500000000178,-83.2340149999999994);
tmpLen=Dearborn.length;
Dearborn[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Dearborn[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Henry Ford Community College",'Dearborn=' + Dearborn.length);
tmpLatLng=new GLatLng(42.91526700000000005,-85.5676909999999963);
tmpLen=Grand_Rapids.length;
Grand_Rapids[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Grand_Rapids[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Itt Technical Institute-grand Rapids",'Grand_Rapids=' + Grand_Rapids.length);
tmpLatLng=new GLatLng(42.56328200000000094,-83.1188099999999963);
tmpLen=Troy.length;
Troy[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Troy[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Itt Technical Institute-troy",'Troy=' + Troy.length);
tmpLatLng=new GLatLng(42.16752000000000322,-84.4078760000000016);
tmpLen=Jackson.length;
Jackson[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Jackson[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Jackson Community College",'Jackson=' + Jackson.length);
tmpLatLng=new GLatLng(42.22994899999999773,-85.6824139999999943);
tmpLen=Kalamazoo.length;
Kalamazoo[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Kalamazoo[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Kalamazoo Valley Community College",'Kalamazoo=' + Kalamazoo.length);
tmpLatLng=new GLatLng(42.33450700000000210,-85.1798409999999961);
tmpLen=Battle_Creek.length;
Battle_Creek[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Battle_Creek[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Kellogg Community College",'Battle_Creek=' + Battle_Creek.length);
tmpLatLng=new GLatLng(44.49545400000000228,-84.4108219999999960);
tmpLen=Roscommon.length;
Roscommon[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Roscommon[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Kirtland Community College",'Roscommon=' + Roscommon.length);
tmpLatLng=new GLatLng(42.08957300000000145,-86.3954810000000037);
tmpLen=Benton_Harbor.length;
Benton_Harbor[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Benton_Harbor[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Lake Michigan College",'Benton_Harbor=' + Benton_Harbor.length);
tmpLatLng=new GLatLng(42.73752999999999957,-84.5538180000000068);
tmpLen=Lansing.length;
Lansing[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Lansing[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Lansing Community College",'Lansing=' + Lansing.length);
tmpLatLng=new GLatLng(42.41900799999999804,-83.1702259999999995);
tmpLen=Detroit.length;
Detroit[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Detroit[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Lewis College Of Business",'Detroit=' + Detroit.length);
tmpLatLng=new GLatLng(42.50821499999999986,-82.9765170000000011);
tmpLen=Warren.length;
Warren[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Warren[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Macomb Community College",'Warren=' + Warren.length);
tmpLatLng=new GLatLng(43.96856300000000317,-84.7678030000000006);
tmpLen=Harrison.length;
Harrison[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Harrison[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Mid Michigan Community College",'Harrison=' + Harrison.length);
tmpLatLng=new GLatLng(41.91168900000000263,-83.4748419999999953);
tmpLen=Monroe.length;
Monroe[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Monroe[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Monroe County Community College",'Monroe=' + Monroe.length);
tmpLatLng=new GLatLng(43.25126199999999698,-85.0997789999999980);
tmpLen=Sidney.length;
Sidney[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Sidney[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Montcalm Community College",'Sidney=' + Sidney.length);
tmpLatLng=new GLatLng(43.01791500000000212,-83.6706109999999938);
tmpLen=Flint.length;
Flint[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Flint[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Mott Community College",'Flint=' + Flint.length);
tmpLatLng=new GLatLng(43.24786100000000033,-86.1938669999999973);
tmpLen=Muskegon.length;
Muskegon[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Muskegon[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Muskegon Community College",'Muskegon=' + Muskegon.length);
tmpLatLng=new GLatLng(45.36041500000000326,-84.9556539999999955);
tmpLen=Petoskey.length;
Petoskey[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Petoskey[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("North Central Michigan College",'Petoskey=' + Petoskey.length);
tmpLatLng=new GLatLng(44.76416100000000142,-85.5842870000000033);
tmpLen=Traverse_City.length;
Traverse_City[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Traverse_City[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Northwestern Michigan College",'Traverse_City=' + Traverse_City.length);
tmpLatLng=new GLatLng(42.59615500000000309,-83.2475440000000048);
tmpLen=Bloomfield_Hills.length;
Bloomfield_Hills[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Bloomfield_Hills[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Oakland Community College",'Bloomfield_Hills=' + Bloomfield_Hills.length);
tmpLatLng=new GLatLng(42.42493499999999784,-83.4327339999999963);
tmpLen=Livonia.length;
Livonia[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Livonia[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Schoolcraft College",'Livonia=' + Livonia.length);
tmpLatLng=new GLatLng(41.94782099999999758,-86.0780409999999989);
tmpLen=Dowagiac.length;
Dowagiac[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Dowagiac[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Southwestern Michigan College",'Dowagiac=' + Dowagiac.length);
tmpLatLng=new GLatLng(42.97762000000000171,-82.4272809999999935);
tmpLen=Port_Huron.length;
Port_Huron[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Port_Huron[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("St Clair County Community College",'Port_Huron=' + Port_Huron.length);
tmpLatLng=new GLatLng(42.26695600000000041,-83.6679800000000000);
tmpLen=Ann_Arbor.length;
Ann_Arbor[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Ann_Arbor[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Washtenaw Community College",'Ann_Arbor=' + Ann_Arbor.length);
tmpLatLng=new GLatLng(42.32803799999999938,-83.0542200000000008);
tmpLen=Detroit.length;
Detroit[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Detroit[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Wayne County Community College District",'Detroit=' + Detroit.length);
tmpLatLng=new GLatLng(44.02062399999999797,-86.3402789999999953);
tmpLen=Scottville.length;
Scottville[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Scottville[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("West Shore Community College",'Scottville=' + Scottville.length);
map.removeOverlays(Alpena);
map.removeOverlays(Ann_Arbor);
map.removeOverlays(Battle_Creek);
map.removeOverlays(Benton_Harbor);
map.removeOverlays(Bloomfield_Hills);
map.removeOverlays(Centreville);
map.removeOverlays(Dearborn);
map.removeOverlays(Detroit);
map.removeOverlays(Dowagiac);
map.removeOverlays(Escanaba);
map.removeOverlays(Flint);
map.removeOverlays(Grand_Rapids);
map.removeOverlays(Hancock);
map.removeOverlays(Harrison);
map.removeOverlays(Ironwood);
map.removeOverlays(Jackson);
map.removeOverlays(Kalamazoo);
map.removeOverlays(Lansing);
map.removeOverlays(Livonia);
map.removeOverlays(Monroe);
map.removeOverlays(Muskegon);
map.removeOverlays(Petoskey);
map.removeOverlays(Port_Huron);
map.removeOverlays(Roscommon);
map.removeOverlays(Scottville);
map.removeOverlays(Sidney);
map.removeOverlays(Traverse_City);
map.removeOverlays(Troy);
map.removeOverlays(University_Center);
map.removeOverlays(Warren);
setTimeout(function(){map.addOverlays(Alpena)},1000);
setTimeout(function(){map.addOverlays(Ann_Arbor)},1000);
setTimeout(function(){map.addOverlays(Battle_Creek)},1000);
setTimeout(function(){map.addOverlays(Benton_Harbor)},1000);
setTimeout(function(){map.addOverlays(Bloomfield_Hills)},1000);
setTimeout(function(){map.addOverlays(Centreville)},1000);
setTimeout(function(){map.addOverlays(Dearborn)},1000);
setTimeout(function(){map.addOverlays(Detroit)},1000);
setTimeout(function(){map.addOverlays(Dowagiac)},1000);
setTimeout(function(){map.addOverlays(Escanaba)},1000);
setTimeout(function(){map.addOverlays(Flint)},1000);
setTimeout(function(){map.addOverlays(Grand_Rapids)},1000);
setTimeout(function(){map.addOverlays(Hancock)},1000);
setTimeout(function(){map.addOverlays(Harrison)},1000);
setTimeout(function(){map.addOverlays(Ironwood)},1000);
setTimeout(function(){map.addOverlays(Jackson)},1000);
setTimeout(function(){map.addOverlays(Kalamazoo)},1000);
setTimeout(function(){map.addOverlays(Lansing)},1000);
setTimeout(function(){map.addOverlays(Livonia)},1000);
setTimeout(function(){map.addOverlays(Monroe)},1000);
setTimeout(function(){map.addOverlays(Muskegon)},1000);
setTimeout(function(){map.addOverlays(Petoskey)},1000);
setTimeout(function(){map.addOverlays(Port_Huron)},1000);
setTimeout(function(){map.addOverlays(Roscommon)},1000);
setTimeout(function(){map.addOverlays(Scottville)},1000);
setTimeout(function(){map.addOverlays(Sidney)},1000);
setTimeout(function(){map.addOverlays(Traverse_City)},1000);
setTimeout(function(){map.addOverlays(Troy)},1000);
setTimeout(function(){map.addOverlays(University_Center)},1000);
setTimeout(function(){map.addOverlays(Warren)},1000);
getPoly("","state","","MI");}
// End addStateMarkers JavaScript Function
//open all when map is defined
function openAll() {
if (map) {
selectChange("all");
} else {
setTimeout("openAll()",200);
}
}
// 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].point.x;
var markLat = myArray[i].point.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].point.x;
maxLat = myArray[0].point.y;
minLng = myArray[0].point.x;
minLat = myArray[0].point.y;
}
// Recenter map based on global max/mins
function reCenterMap(){
//alert('#' + minLat + '#' + minLng + '#' + maxLat + '#' + maxLng);
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) {
if (selection.options) {
var _openNewWindow=true;
var myVal = selection.options[selection.selectedIndex].value;
} else {
var _openNewWindow=false;
var myVal=selection;
}
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('schools-by-distance') == -1)
window.open(location.href + '/map/all');
else
window.open('/search////all');
map.removeOverlays(Alpena);
map.removeOverlays(Ann_Arbor);
map.removeOverlays(Battle_Creek);
map.removeOverlays(Benton_Harbor);
map.removeOverlays(Bloomfield_Hills);
map.removeOverlays(Centreville);
map.removeOverlays(Dearborn);
map.removeOverlays(Detroit);
map.removeOverlays(Dowagiac);
map.removeOverlays(Escanaba);
map.removeOverlays(Flint);
map.removeOverlays(Grand_Rapids);
map.removeOverlays(Hancock);
map.removeOverlays(Harrison);
map.removeOverlays(Ironwood);
map.removeOverlays(Jackson);
map.removeOverlays(Kalamazoo);
map.removeOverlays(Lansing);
map.removeOverlays(Livonia);
map.removeOverlays(Monroe);
map.removeOverlays(Muskegon);
map.removeOverlays(Petoskey);
map.removeOverlays(Port_Huron);
map.removeOverlays(Roscommon);
map.removeOverlays(Scottville);
map.removeOverlays(Sidney);
map.removeOverlays(Traverse_City);
map.removeOverlays(Troy);
map.removeOverlays(University_Center);
map.removeOverlays(Warren);
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(Alpena);map.removeOverlays(Alpena);
map.removeOverlays(Ann_Arbor);
map.removeOverlays(Battle_Creek);
map.removeOverlays(Benton_Harbor);
map.removeOverlays(Bloomfield_Hills);
map.removeOverlays(Centreville);
map.removeOverlays(Dearborn);
map.removeOverlays(Detroit);
map.removeOverlays(Dowagiac);
map.removeOverlays(Escanaba);
map.removeOverlays(Flint);
map.removeOverlays(Grand_Rapids);
map.removeOverlays(Hancock);
map.removeOverlays(Harrison);
map.removeOverlays(Ironwood);
map.removeOverlays(Jackson);
map.removeOverlays(Kalamazoo);
map.removeOverlays(Lansing);
map.removeOverlays(Livonia);
map.removeOverlays(Monroe);
map.removeOverlays(Muskegon);
map.removeOverlays(Petoskey);
map.removeOverlays(Port_Huron);
map.removeOverlays(Roscommon);
map.removeOverlays(Scottville);
map.removeOverlays(Sidney);
map.removeOverlays(Traverse_City);
map.removeOverlays(Troy);
map.removeOverlays(University_Center);
map.removeOverlays(Warren);
map.addOverlays(Alpena);
centerByArray(Alpena, false, false);
cntMarker += Alpena.length;
map.addOverlays(Ann_Arbor);
centerByArray(Ann_Arbor, false, false);
cntMarker += Ann_Arbor.length;
map.addOverlays(Battle_Creek);
centerByArray(Battle_Creek, false, false);
cntMarker += Battle_Creek.length;
map.addOverlays(Benton_Harbor);
centerByArray(Benton_Harbor, false, false);
cntMarker += Benton_Harbor.length;
map.addOverlays(Bloomfield_Hills);
centerByArray(Bloomfield_Hills, false, false);
cntMarker += Bloomfield_Hills.length;
map.addOverlays(Centreville);
centerByArray(Centreville, false, false);
cntMarker += Centreville.length;
map.addOverlays(Dearborn);
centerByArray(Dearborn, false, false);
cntMarker += Dearborn.length;
map.addOverlays(Detroit);
centerByArray(Detroit, false, false);
cntMarker += Detroit.length;
map.addOverlays(Dowagiac);
centerByArray(Dowagiac, false, false);
cntMarker += Dowagiac.length;
map.addOverlays(Escanaba);
centerByArray(Escanaba, false, false);
cntMarker += Escanaba.length;
map.addOverlays(Flint);
centerByArray(Flint, false, false);
cntMarker += Flint.length;
map.addOverlays(Grand_Rapids);
centerByArray(Grand_Rapids, false, false);
cntMarker += Grand_Rapids.length;
map.addOverlays(Hancock);
centerByArray(Hancock, false, false);
cntMarker += Hancock.length;
map.addOverlays(Harrison);
centerByArray(Harrison, false, false);
cntMarker += Harrison.length;
map.addOverlays(Ironwood);
centerByArray(Ironwood, false, false);
cntMarker += Ironwood.length;
map.addOverlays(Jackson);
centerByArray(Jackson, false, false);
cntMarker += Jackson.length;
map.addOverlays(Kalamazoo);
centerByArray(Kalamazoo, false, false);
cntMarker += Kalamazoo.length;
map.addOverlays(Lansing);
centerByArray(Lansing, false, false);
cntMarker += Lansing.length;
map.addOverlays(Livonia);
centerByArray(Livonia, false, false);
cntMarker += Livonia.length;
map.addOverlays(Monroe);
centerByArray(Monroe, false, false);
cntMarker += Monroe.length;
map.addOverlays(Muskegon);
centerByArray(Muskegon, false, false);
cntMarker += Muskegon.length;
map.addOverlays(Petoskey);
centerByArray(Petoskey, false, false);
cntMarker += Petoskey.length;
map.addOverlays(Port_Huron);
centerByArray(Port_Huron, false, false);
cntMarker += Port_Huron.length;
map.addOverlays(Roscommon);
centerByArray(Roscommon, false, false);
cntMarker += Roscommon.length;
map.addOverlays(Scottville);
centerByArray(Scottville, false, false);
cntMarker += Scottville.length;
map.addOverlays(Sidney);
centerByArray(Sidney, false, false);
cntMarker += Sidney.length;
map.addOverlays(Traverse_City);
centerByArray(Traverse_City, false, false);
cntMarker += Traverse_City.length;
map.addOverlays(Troy);
centerByArray(Troy, false, false);
cntMarker += Troy.length;
map.addOverlays(University_Center);
centerByArray(University_Center, false, false);
cntMarker += University_Center.length;
map.addOverlays(Warren);
centerByArray(Warren, false, false);
cntMarker += Warren.length;
reCenterMap();
//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');
}
}
function createMarker(point, label, icon){
var marker = new GMarker(point, icon);
var html = label;
GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); });
return marker;
}