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,"
Alpena Community College
666 Johnson St
Alpena, MI 49707

[ View School Profile ]
",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,"
Bay De Noc Community College
2001 N Lincoln Road
Escanaba, MI 49829

[ View School Profile ]
",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,"
Delta College
1961 Delta Road
University Center, MI 48710

[ View School Profile ]
",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,"
Finlandia University
601 Quincy St
Hancock, MI 49930

[ View School Profile ]
",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,"
Glen Oaks Community College
62249 Shimmel Rd
Centreville, MI 49032

[ View School Profile ]
",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,"
Gogebic Community College
E 4946 Jackson Rd
Ironwood, MI 49938

[ View School Profile ]
",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,"
Grand Rapids Community College
143 Bostwick Ave Ne
Grand Rapids, MI 49503

[ View School Profile ]
",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,"
Henry Ford Community College
5101 Evergreen Rd
Dearborn, MI 48128

[ View School Profile ]
",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,"
Itt Technical Institute-grand Rapids
4020 Sparks Dr S.e.
Grand Rapids, MI 49546

[ View School Profile ]
",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,"
Itt Technical Institute-troy
1522 E Big Beaver Rd
Troy, MI 48083

[ View School Profile ]
",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,"
Jackson Community College
2111 Emmons Rd
Jackson, MI 49201

[ View School Profile ]
",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,"
Kalamazoo Valley Community College
6767 West O Ave
Kalamazoo, MI 49003

[ View School Profile ]
",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,"
Kellogg Community College
450 North Ave
Battle Creek, MI 49017

[ View School Profile ]
",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,"
Kirtland Community College
10775 N St Helen Rd
Roscommon, MI 48653

[ View School Profile ]
",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,"
Lake Michigan College
2755 E Napier Ave
Benton Harbor, MI 49022

[ View School Profile ]
",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,"
Lansing Community College
422 N Washington Square
Lansing, MI 48901

[ View School Profile ]
",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,"
Lewis College Of Business
17370 Meyers Rd
Detroit, MI 48235

[ View School Profile ]
",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,"
Macomb Community College
14500 E Twelve Mile Rd
Warren, MI 48088

[ View School Profile ]
",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,"
Mid Michigan Community College
1375 S Clare Ave
Harrison, MI 48625

[ View School Profile ]
",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,"
Monroe County Community College
1555 South Raisinville Road
Monroe, MI 48161

[ View School Profile ]
",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,"
Montcalm Community College
2800 College Dr
Sidney, MI 48885

[ View School Profile ]
",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,"
Mott Community College
1401 E Court St
Flint, MI 48503

[ View School Profile ]
",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,"
Muskegon Community College
221 S Quarterline Rd
Muskegon, MI 49442

[ View School Profile ]
",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,"
North Central Michigan College
1515 Howard St
Petoskey, MI 49770

[ View School Profile ]
",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,"
Northwestern Michigan College
1701 E Front St
Traverse City, MI 49686

[ View School Profile ]
",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,"
Oakland Community College
2480 Opdyke Rd
Bloomfield Hills, MI 48304

[ View School Profile ]
",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,"
Schoolcraft College
18600 Haggerty Road
Livonia, MI 48152

[ View School Profile ]
",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,"
Southwestern Michigan College
58900 Cherry Grove Rd
Dowagiac, MI 49047

[ View School Profile ]
",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,"
St Clair County Community College
323 Erie
Port Huron, MI 48061

[ View School Profile ]
",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,"
Washtenaw Community College
4800 E Huron River Dr
Ann Arbor, MI 48106

[ View School Profile ]
",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,"
Wayne County Community College District
801 W Fort St
Detroit, MI 48226

[ View School Profile ]
",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,"
West Shore Community College
3000 N Stiles Rd
Scottville, MI 49454

[ View School Profile ]
",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; }