function addMarkers(){ mySelect = document.getElementById('selection'); Hobart = [];Gary = [];Hammond = [];Merrillville = [];Griffith = [];Highland = [];Crown_Point = [];Schererville = [];East_Chicago = [];Lake_Station = [];Lowell = [];Saint_John = [];Dyer = [];Whiting = [];Munster = [];mySelect.options[mySelect.options.length] = new Option("Crown Point schools",'all=Crown_Point'); mySelect.options[mySelect.options.length] = new Option("Dyer schools",'all=Dyer'); mySelect.options[mySelect.options.length] = new Option("East Chicago schools",'all=East_Chicago'); mySelect.options[mySelect.options.length] = new Option("Gary schools",'all=Gary'); mySelect.options[mySelect.options.length] = new Option("Griffith schools",'all=Griffith'); mySelect.options[mySelect.options.length] = new Option("Hammond schools",'all=Hammond'); mySelect.options[mySelect.options.length] = new Option("Highland schools",'all=Highland'); mySelect.options[mySelect.options.length] = new Option("Hobart schools",'all=Hobart'); mySelect.options[mySelect.options.length] = new Option("Lake Station schools",'all=Lake_Station'); mySelect.options[mySelect.options.length] = new Option("Lowell schools",'all=Lowell'); mySelect.options[mySelect.options.length] = new Option("Merrillville schools",'all=Merrillville'); mySelect.options[mySelect.options.length] = new Option("Munster schools",'all=Munster'); mySelect.options[mySelect.options.length] = new Option("Saint John schools",'all=Saint_John'); mySelect.options[mySelect.options.length] = new Option("Schererville schools",'all=Schererville'); mySelect.options[mySelect.options.length] = new Option("Whiting schools",'all=Whiting'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Hobart[Hobart.length] = createMarker(new GPoint(-87.27735300,41.50798700),"
Abc Academy
480 W 61st Avenue
Hobart, IN 46342
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Abc Academy",'Hobart=' + Hobart.length); Gary[Gary.length] = createMarker(new GPoint(-87.34877000,41.54874700),"
Ambassador Academy
1001 W Ridge Road
Gary, IN 46408
Co-ed school, PK-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ambassador Academy",'Gary=' + Gary.length); Hammond[Hammond.length] = createMarker(new GPoint(-87.51340000,41.61390000),"
Aodc Christian Academy
Po Box 723
Hammond, IN 46325
Co-ed school, KG-4
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Aodc Christian Academy",'Hammond=' + Hammond.length); Merrillville[Merrillville.length] = createMarker(new GPoint(-87.34631100,41.48547800),"
Aquinas Catholic Community School
801 W 73rd Avenue
Merrillville, IN 46410
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Aquinas Catholic Community School",'Merrillville=' + Merrillville.length); Griffith[Griffith.length] = createMarker(new GPoint(-87.42751600,41.52521600),"
Bible Baptist School
231 North Broad Street
Griffith, IN 46319
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bible Baptist School",'Griffith=' + Griffith.length); Gary[Gary.length] = createMarker(new GPoint(-87.35758300,41.54406300),"
Blessed Sacrament School
1775 W. 41st Ave.
Gary, IN 46408
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Blessed Sacrament School",'Gary=' + Gary.length); Gary[Gary.length] = createMarker(new GPoint(-87.27966900,41.59656800),"
Christ Baptist Christian Academy
4700 E 7th Avenue
Gary, IN 46403
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christ Baptist Christian Academy",'Gary=' + Gary.length); Gary[Gary.length] = createMarker(new GPoint(-87.33776700,41.54053700),"
Christian Academy Ministry
110 W 43rd Ave
Gary, IN 46408
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christian Academy Ministry",'Gary=' + Gary.length); Hammond[Hammond.length] = createMarker(new GPoint(-87.52181600,41.58709100),"
City Baptist Schools
4925 Sohl Avenue
Hammond, IN 46327
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("City Baptist Schools",'Hammond=' + Hammond.length); Highland[Highland.length] = createMarker(new GPoint(-87.43259400,41.55877200),"
Cline Av Bap Childcare/presch
8600 Cline Ave
Highland, IN 46322
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cline Av Bap Childcare/presch",'Highland=' + Highland.length); Crown_Point[Crown_Point.length] = createMarker(new GPoint(-87.37038400,41.42746300),"
Crown Point Christian School
Po Box 1337 909 Greenwood Avenue
Crown Point, IN 46308
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Crown Point Christian School",'Crown_Point=' + Crown_Point.length); Schererville[Schererville.length] = createMarker(new GPoint(-87.39974400,41.48694000),"
Forest Ridge Academy
7300 Forest Ridge Drive
Schererville, IN 46375
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Forest Ridge Academy",'Schererville=' + Schererville.length); East_Chicago[East_Chicago.length] = createMarker(new GPoint(-87.47958300,41.62596000),"
Greater First Christian Aca
4858 Olcott Ave
East Chicago, IN 46312
Co-ed school, PK-4
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Greater First Christian Aca",'East_Chicago=' + East_Chicago.length); Highland[Highland.length] = createMarker(new GPoint(-87.46955800,41.55196300),"
Happy Days Child Care & Learni
2450 Lincoln
Highland, IN 46322
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Happy Days Child Care & Learni",'Highland=' + Highland.length); Hammond[Hammond.length] = createMarker(new GPoint(-87.59070000,41.77316300),"
Hazel Young Academy
6947 Hohman Avenue
Hammond, IN 46324
Co-ed school, PK-7
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hazel Young Academy",'Hammond=' + Hammond.length); Highland[Highland.length] = createMarker(new GPoint(-87.45582600,41.55401500),"
Highland Christian School
3040 Ridge Road
Highland, IN 46322
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Highland Christian School",'Highland=' + Highland.length); Hobart[Hobart.length] = createMarker(new GPoint(-87.26674500,41.53653700),"
Hobart Baptist School
1 N Pennsylvania Street
Hobart, IN 46342
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hobart Baptist School",'Hobart=' + Hobart.length); East_Chicago[East_Chicago.length] = createMarker(new GPoint(-87.44396200,41.64219500),"
Indiana Harbor Catholic Elementary School
3916 Pulaski Street
East Chicago, IN 46312
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Indiana Harbor Catholic Elementary School",'East_Chicago=' + East_Chicago.length); Merrillville[Merrillville.length] = createMarker(new GPoint(-87.37880000,41.47210000),"
Laurel Preparatory Academy
7525 Taft Street
Merrillville, IN 46410
Co-ed school, PK-7
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Laurel Preparatory Academy",'Merrillville=' + Merrillville.length); Hobart[Hobart.length] = createMarker(new GPoint(-87.24045000,41.55083700),"
Li'l Kids
7846 East Ridge Rd
Hobart, IN 46342
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Li'l Kids",'Hobart=' + Hobart.length); Lake_Station[Lake_Station.length] = createMarker(new GPoint(-87.23814900,41.57980200),"
Liberty Baptist Academy
2075 Rush Pl
Lake Station, IN 46405
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Liberty Baptist Academy",'Lake_Station=' + Lake_Station.length); Lowell[Lowell.length] = createMarker(new GPoint(-87.46995000,41.24446500),"
Lowell Christian Academy
Po Box 206
Lowell, IN 46356
Co-ed school, PK-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lowell Christian Academy",'Lowell=' + Lowell.length); Gary[Gary.length] = createMarker(new GPoint(-87.36346800,41.60203700),"
M C Bennett Holiness School
2134 W 5th Avenue
Gary, IN 46404
Co-ed school, -
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("M C Bennett Holiness School",'Gary=' + Gary.length); Hobart[Hobart.length] = createMarker(new GPoint(-87.30801500,41.51436700),"
Montessori Academy In The Oaks
2109 57th Street
Hobart, IN 46342
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori Academy In The Oaks",'Hobart=' + Hobart.length); Hammond[Hammond.length] = createMarker(new GPoint(-87.52181500,41.60567300),"
Montessori Childrens Schoolhouse
5935 Hohman Avenue
Hammond, IN 46320
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori Childrens Schoolhouse",'Hammond=' + Hammond.length); Crown_Point[Crown_Point.length] = createMarker(new GPoint(-87.23910400,41.42642200),"
Northwest Adventist Christian School
10570 Randolph Street
Crown Point, IN 46307
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Northwest Adventist Christian School",'Crown_Point=' + Crown_Point.length); Highland[Highland.length] = createMarker(new GPoint(-87.45613100,41.55561200),"
Our Lady Of Grace School
3025 Highway Avenue
Highland, IN 46322
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Our Lady Of Grace School",'Highland=' + Highland.length); Crown_Point[Crown_Point.length] = createMarker(new GPoint(-87.35488200,41.40967000),"
Pathway Christian School
495 S Indiana Avenue
Crown Point, IN 46307
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pathway Christian School",'Crown_Point=' + Crown_Point.length); Hobart[Hobart.length] = createMarker(new GPoint(-87.25580500,41.53390400),"
St. Bridget School
107 Main Street
Hobart, IN 46342
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Bridget School",'Hobart=' + Hobart.length); Lowell[Lowell.length] = createMarker(new GPoint(-87.43008200,41.28833900),"
St. Edward School
210 S Nichols St
Lowell, IN 46356
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Edward School",'Lowell=' + Lowell.length); Saint_John[Saint_John.length] = createMarker(new GPoint(-87.47033500,41.44828100),"
St. John Evangelist Elementary School
9400 Wicker Avenue
Saint John, IN 46373
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. John Evangelist Elementary School",'Saint_John=' + Saint_John.length); Dyer[Dyer.length] = createMarker(new GPoint(-87.51657900,41.49356300),"
St. Joseph School
430 Joliet Street
Dyer, IN 46311
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Joseph School",'Dyer=' + Dyer.length); Gary[Gary.length] = createMarker(new GPoint(-87.34028200,41.57589300),"
Sda Mizpah Church School
2350 Jefferson Street
Gary, IN 46407
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sda Mizpah Church School",'Gary=' + Gary.length); Hammond[Hammond.length] = createMarker(new GPoint(-87.44238300,41.59506800),"
The Shepherd's Academy
6518 Grand Ave
Hammond, IN 46323
Co-ed school, 3-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Shepherd's Academy",'Hammond=' + Hammond.length); Merrillville[Merrillville.length] = createMarker(new GPoint(-87.33199900,41.45531700),"
Small Fry Academy
216 East 90th Dr
Merrillville, IN 46410
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Small Fry Academy",'Merrillville=' + Merrillville.length); Gary[Gary.length] = createMarker(new GPoint(-87.36408300,41.59267800),"
Spirit Of God Accelerated Education
1010 Roosevelt Street
Gary, IN 46404
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Spirit Of God Accelerated Education",'Gary=' + Gary.length); Gary[Gary.length] = createMarker(new GPoint(-87.34931300,41.59996300),"
Sr Thea Bowman Elementary School
975 West Sixth Avenue
Gary, IN 46402
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sr Thea Bowman Elementary School",'Gary=' + Gary.length); Hammond[Hammond.length] = createMarker(new GPoint(-87.51461500,41.63514500),"
St Casimir School
4329 Cameron Avenue
Hammond, IN 46327
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Casimir School",'Hammond=' + Hammond.length); Hammond[Hammond.length] = createMarker(new GPoint(-87.44691500,41.59497800),"
St Catherine Of Siena
6525 Kentucky Ave
Hammond, IN 46323
Co-ed school, PK-7
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Catherine Of Siena",'Hammond=' + Hammond.length); Whiting[Whiting.length] = createMarker(new GPoint(-87.50209300,41.67968600),"
St John The Baptist Catholic School
1844 Lincoln Avenue
Whiting, IN 46394
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St John The Baptist Catholic School",'Whiting=' + Whiting.length); Hammond[Hammond.length] = createMarker(new GPoint(-87.49937900,41.58393700),"
St John Bosco Elementary School
1231 171st Place
Hammond, IN 46324
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St John Bosco Elementary School",'Hammond=' + Hammond.length); Crown_Point[Crown_Point.length] = createMarker(new GPoint(-87.36152600,41.41620800),"
St Mary Catholic Community School
405 E Joliet Street
Crown Point, IN 46307
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Mary Catholic Community School",'Crown_Point=' + Crown_Point.length); Griffith[Griffith.length] = createMarker(new GPoint(-87.42751600,41.53062400),"
St Mary School
525 N Broad Street
Griffith, IN 46319
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Mary School",'Griffith=' + Griffith.length); Schererville[Schererville.length] = createMarker(new GPoint(-87.45204100,41.49109600),"
St Micheal Elementary School
16 W Wilhelm Street
Schererville, IN 46375
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Micheal Elementary School",'Schererville=' + Schererville.length); Munster[Munster.length] = createMarker(new GPoint(-87.51611600,41.55768100),"
St Paul's Lutheran School
8601 Harrison Avenue
Munster, IN 46321
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Paul's Lutheran School",'Munster=' + Munster.length); East_Chicago[East_Chicago.length] = createMarker(new GPoint(-87.48098300,41.62430100),"
St Stanislaus School
4930 Indianapolis Blvd
East Chicago, IN 46312
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Stanislaus School",'East_Chicago=' + East_Chicago.length); Munster[Munster.length] = createMarker(new GPoint(-87.50875400,41.56051200),"
St Thomas More School
8435 Calumet Avenue
Munster, IN 46321
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Thomas More School",'Munster=' + Munster.length); Gary[Gary.length] = createMarker(new GPoint(-87.39361500,41.60302400),"
Treasure's Child Dev Center
435 Clark Road
Gary, IN 46406
Co-ed school, PK-4
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Treasure's Child Dev Center",'Gary=' + Gary.length); Crown_Point[Crown_Point.length] = createMarker(new GPoint(-87.35469900,41.41348300),"
Trinity Lutheran School
250 S Indiana Avenue
Crown Point, IN 46307
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity Lutheran School",'Crown_Point=' + Crown_Point.length); Hobart[Hobart.length] = createMarker(new GPoint(-87.24961600,41.52380400),"
Trinity Lutheran School
891 S Linda Street
Hobart, IN 46342
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity Lutheran School",'Hobart=' + Hobart.length); } // End addStateMarkers JavaScript Function // Takes an array of markers and centers/zooms map based on marker range function centerByArray(myArray, recenter, newMaxMin) { if (newMaxMin == true) reMaxMin(myArray); for (var i = 0; i < myArray.length; i++) { var markLng = myArray[i].getPoint().x; var markLat = myArray[i].getPoint().y; if (markLat > maxLat) maxLat = markLat; if (markLng > maxLng) maxLng = markLng; if (markLat < minLat) minLat = markLat; if (markLng < minLng) minLng = markLng; } if (recenter) reCenterMap(); } // Reinit max/mins function reMaxMin(myArray) { maxLng = myArray[0].getPoint().x; maxLat = myArray[0].getPoint().y; minLng = myArray[0].getPoint().x; minLat = myArray[0].getPoint().y; } // Recenter map based on global max/mins function reCenterMap() { var bounds = new GLatLngBounds(); bounds.extend(new GLatLng(minLat, minLng)); bounds.extend(new GLatLng(maxLat, maxLng)); var center_lat = (bounds.getNorthEast().lat() + bounds.getSouthWest().lat()) / 2.0; var center_lng = (bounds.getNorthEast().lng() + bounds.getSouthWest().lng()) / 2.0; var center = new GLatLng(center_lat, center_lng); var zoom = map.getBoundsZoomLevel(bounds); map.setCenter(center,zoom); //map.setCenter(center,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/////1/' + showArray); map.removeOverlays(Crown_Point); map.removeOverlays(Dyer); map.removeOverlays(East_Chicago); map.removeOverlays(Gary); map.removeOverlays(Griffith); map.removeOverlays(Hammond); map.removeOverlays(Highland); map.removeOverlays(Hobart); map.removeOverlays(Lake_Station); map.removeOverlays(Lowell); map.removeOverlays(Merrillville); map.removeOverlays(Munster); map.removeOverlays(Saint_John); map.removeOverlays(Schererville); map.removeOverlays(Whiting); 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(Hobart);map.removeOverlays(Crown_Point); map.removeOverlays(Dyer); map.removeOverlays(East_Chicago); map.removeOverlays(Gary); map.removeOverlays(Griffith); map.removeOverlays(Hammond); map.removeOverlays(Highland); map.removeOverlays(Hobart); map.removeOverlays(Lake_Station); map.removeOverlays(Lowell); map.removeOverlays(Merrillville); map.removeOverlays(Munster); map.removeOverlays(Saint_John); map.removeOverlays(Schererville); map.removeOverlays(Whiting); map.addOverlays(Crown_Point); centerByArray(Crown_Point, false, false); cntMarker += Crown_Point.length; map.addOverlays(Dyer); centerByArray(Dyer, false, false); cntMarker += Dyer.length; map.addOverlays(East_Chicago); centerByArray(East_Chicago, false, false); cntMarker += East_Chicago.length; map.addOverlays(Gary); centerByArray(Gary, false, false); cntMarker += Gary.length; map.addOverlays(Griffith); centerByArray(Griffith, false, false); cntMarker += Griffith.length; map.addOverlays(Hammond); centerByArray(Hammond, false, false); cntMarker += Hammond.length; map.addOverlays(Highland); centerByArray(Highland, false, false); cntMarker += Highland.length; map.addOverlays(Hobart); centerByArray(Hobart, false, false); cntMarker += Hobart.length; map.addOverlays(Lake_Station); centerByArray(Lake_Station, false, false); cntMarker += Lake_Station.length; map.addOverlays(Lowell); centerByArray(Lowell, false, false); cntMarker += Lowell.length; map.addOverlays(Merrillville); centerByArray(Merrillville, false, false); cntMarker += Merrillville.length; map.addOverlays(Munster); centerByArray(Munster, false, false); cntMarker += Munster.length; map.addOverlays(Saint_John); centerByArray(Saint_John, false, false); cntMarker += Saint_John.length; map.addOverlays(Schererville); centerByArray(Schererville, false, false); cntMarker += Schererville.length; map.addOverlays(Whiting); centerByArray(Whiting, false, false); cntMarker += Whiting.length; centerByArray(Hobart,true, false); if (cntMarker > 20) // New window depends on whether or not we're on the search page if (location.href.indexOf('schools-by-distance') == -1) window.open(location.href + '/map/all'); else window.open('/search////all'); //window.open('/map.php?type=1&schools=&school_level=1&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; }