function addMarkers(){ mySelect = document.getElementById('selection'); Plymouth = [];Duxbury = [];Brockton = [];Hanover = [];West_Bridgewater = [];West__Bridgewa = [];Marion = [];Hingham = [];Rockland = [];Whitman = [];Scituate = [];Lakeville = [];Carver = [];Norwell = [];W_Bridgewater = [];Abington = [];Kingston = [];Bridgewater = [];Marshfield = [];mySelect.options[mySelect.options.length] = new Option("Abington schools",'all=Abington'); mySelect.options[mySelect.options.length] = new Option("Bridgewater schools",'all=Bridgewater'); mySelect.options[mySelect.options.length] = new Option("Brockton schools",'all=Brockton'); mySelect.options[mySelect.options.length] = new Option("Carver schools",'all=Carver'); mySelect.options[mySelect.options.length] = new Option("Duxbury schools",'all=Duxbury'); mySelect.options[mySelect.options.length] = new Option("Hanover schools",'all=Hanover'); mySelect.options[mySelect.options.length] = new Option("Hingham schools",'all=Hingham'); mySelect.options[mySelect.options.length] = new Option("Kingston schools",'all=Kingston'); mySelect.options[mySelect.options.length] = new Option("Lakeville schools",'all=Lakeville'); mySelect.options[mySelect.options.length] = new Option("Marion schools",'all=Marion'); mySelect.options[mySelect.options.length] = new Option("Marshfield schools",'all=Marshfield'); mySelect.options[mySelect.options.length] = new Option("Norwell schools",'all=Norwell'); mySelect.options[mySelect.options.length] = new Option("Plymouth schools",'all=Plymouth'); mySelect.options[mySelect.options.length] = new Option("Rockland schools",'all=Rockland'); mySelect.options[mySelect.options.length] = new Option("Scituate schools",'all=Scituate'); mySelect.options[mySelect.options.length] = new Option("W Bridgewater schools",'all=W_Bridgewater'); mySelect.options[mySelect.options.length] = new Option("West Bridgewater schools",'all=West_Bridgewater'); mySelect.options[mySelect.options.length] = new Option("West Bridgewa schools",'all=West__Bridgewa'); mySelect.options[mySelect.options.length] = new Option("Whitman schools",'all=Whitman'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Plymouth[Plymouth.length] = createMarker(new GPoint(-70.58658800,41.85841600),"
The Baird Center
900 Ship Pond Road
Plymouth, MA 02360
All-boys school, 3-11
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("The Baird Center",'Plymouth=' + Plymouth.length); Duxbury[Duxbury.length] = createMarker(new GPoint(-70.71789500,42.00734900),"
Bay Farm Montessori Academy
145 Loring Street
Duxbury, MA 02332
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bay Farm Montessori Academy",'Duxbury=' + Duxbury.length); Brockton[Brockton.length] = createMarker(new GPoint(-71.01376800,42.05809700),"
Brockton Christian School
1367 Main St
Brockton, MA 02301
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Brockton Christian School",'Brockton=' + Brockton.length); Brockton[Brockton.length] = createMarker(new GPoint(-71.00726900,42.08069700),"
Brockton Sda Elementary School
37 Erie Avenue
Brockton, MA 02302
Co-ed school, PK-4
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Brockton Sda Elementary School",'Brockton=' + Brockton.length); Hanover[Hanover.length] = createMarker(new GPoint(-70.81952600,42.11668300),"
Cardinal Cushing Centers, Inc.
405 Washington Street
Hanover, MA 02339
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cardinal Cushing Centers, Inc.",'Hanover=' + Hanover.length); West_Bridgewater[West_Bridgewater.length] = createMarker(new GPoint(-71.03173400,42.01635300),"
Children's World Learning Center
393 W Center Street
West Bridgewater, MA 02379
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Children's World Learning Center",'West_Bridgewater=' + West_Bridgewater.length); West__Bridgewa[West__Bridgewa.length] = createMarker(new GPoint(-71.05681600,42.03714800),"
Childrens Express Learning Cen
359 Manley St
West Bridgewa, MA 02379
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Childrens Express Learning Cen",'West__Bridgewa=' + West__Bridgewa.length); Marion[Marion.length] = createMarker(new GPoint(-70.75750000,41.71000000),"
The Children's Depot
381 Front Streetpo Box 36
Marion, MA 02738
Co-ed school, K-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Children's Depot",'Marion=' + Marion.length); Hingham[Hingham.length] = createMarker(new GPoint(-70.89261500,42.24897900),"
Derby Academy
56 Burditt Avenue
Hingham, MA 02043
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Derby Academy",'Hingham=' + Hingham.length); Plymouth[Plymouth.length] = createMarker(new GPoint(-70.73633600,41.93145000),"
Fellowship Christian Academy
267 Carver Rd
Plymouth, MA 02360
Co-ed school, PK-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Fellowship Christian Academy",'Plymouth=' + Plymouth.length); Brockton[Brockton.length] = createMarker(new GPoint(-71.03335900,42.11216800),"
Field House Day School
1100 N Main Street
Brockton, MA 02301
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Field House Day School",'Brockton=' + Brockton.length); Duxbury[Duxbury.length] = createMarker(new GPoint(-70.72525400,42.01408800),"
Good Shepherd Christian Academy
2 Tremont Street
Duxbury, MA 02332
Co-ed school, PK-7
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Good Shepherd Christian Academy",'Duxbury=' + Duxbury.length); Rockland[Rockland.length] = createMarker(new GPoint(-70.91477600,42.13356000),"
Holy Family Elementary School
6 Delprete Avenue
Rockland, MA 02370
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holy Family Elementary School",'Rockland=' + Rockland.length); Whitman[Whitman.length] = createMarker(new GPoint(-70.91988000,42.08408100),"
Hope Christian School
503 South Avenue
Whitman, MA 02382
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hope Christian School",'Whitman=' + Whitman.length); Scituate[Scituate.length] = createMarker(new GPoint(-70.75941300,42.17183700),"
Inly School
46 Watch Hill Drive
Scituate, MA 02066
Co-ed school, NS-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Inly School",'Scituate=' + Scituate.length); Lakeville[Lakeville.length] = createMarker(new GPoint(-70.94854400,41.87509200),"
Kalia Kids Learning Center
104 Charles Eldridge Road
Lakeville, MA 02347
Co-ed school, PK-4
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kalia Kids Learning Center",'Lakeville=' + Lakeville.length); Brockton[Brockton.length] = createMarker(new GPoint(-71.01947200,42.08640600),"
Keys Of The Kingdom Christian
33 N Main Street
Brockton, MA 02301
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Keys Of The Kingdom Christian",'Brockton=' + Brockton.length); Plymouth[Plymouth.length] = createMarker(new GPoint(-70.71739300,41.92387700),"
Kidsport Learning Center
109 South Meadow Road
Plymouth, MA 02360
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kidsport Learning Center",'Plymouth=' + Plymouth.length); Carver[Carver.length] = createMarker(new GPoint(-70.77190500,41.89101400),"
Kidstop Early Childhood Center, Inc.
90 Main Street
Carver, MA 02330
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kidstop Early Childhood Center, Inc.",'Carver=' + Carver.length); Norwell[Norwell.length] = createMarker(new GPoint(-70.86009700,42.16035900),"
Kindercare Learning Center #1554
380 Washington Street
Norwell, MA 02061
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kindercare Learning Center #1554",'Norwell=' + Norwell.length); W_Bridgewater[W_Bridgewater.length] = createMarker(new GPoint(-71.01900000,42.01748000),"
Kiner Care Learning Center #1318
199 West Center Street
W. Bridgewater, MA 02379
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kiner Care Learning Center #1318",'W_Bridgewater=' + W_Bridgewater.length); Brockton[Brockton.length] = createMarker(new GPoint(-70.99231900,42.09868100),"
Labelle Day School
600 East Ashland Street
Brockton, MA 02302
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Labelle Day School",'Brockton=' + Brockton.length); Plymouth[Plymouth.length] = createMarker(new GPoint(-70.68483800,41.97450800),"
Little Red Schoolhouse
1 Prince Street
Plymouth, MA 02360
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Little Red Schoolhouse",'Plymouth=' + Plymouth.length); West_Bridgewater[West_Bridgewater.length] = createMarker(new GPoint(-71.02230000,42.02330000),"
Magic Touch Nursery Pre School Center
Po Box 285
West Bridgewater, MA 02379
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Magic Touch Nursery Pre School Center",'West_Bridgewater=' + West_Bridgewater.length); Rockland[Rockland.length] = createMarker(new GPoint(-70.90507500,42.09468700),"
The Master's Academy
525 Beech Street
Rockland, MA 02370
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Master's Academy",'Rockland=' + Rockland.length); Brockton[Brockton.length] = createMarker(new GPoint(-71.00370700,42.06277700),"
May Center For Education And Neurorehabilitation
596 Summer Street
Brockton, MA 02302
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("May Center For Education And Neurorehabilitation",'Brockton=' + Brockton.length); Lakeville[Lakeville.length] = createMarker(new GPoint(-70.95567900,41.88283300),"
Mulberry Child Care & Preschool
4 Lakeville Business Park
Lakeville, MA 02347
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mulberry Child Care & Preschool",'Lakeville=' + Lakeville.length); Hanover[Hanover.length] = createMarker(new GPoint(-70.82541600,42.12365700),"
Mulberry Child Care & Preschool
673 Washington Street
Hanover, MA 02339
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mulberry Child Care & Preschool",'Hanover=' + Hanover.length); Lakeville[Lakeville.length] = createMarker(new GPoint(-70.97522000,41.81224300),"
Mullein Hill Christian Academy
111 Highland Road
Lakeville, MA 02347
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mullein Hill Christian Academy",'Lakeville=' + Lakeville.length); West_Bridgewater[West_Bridgewater.length] = createMarker(new GPoint(-71.00908400,42.03479500),"
New England Baptist Academy
560 North Main Street
West Bridgewater, MA 02379
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New England Baptist Academy",'West_Bridgewater=' + West_Bridgewater.length); Plymouth[Plymouth.length] = createMarker(new GPoint(-70.55881300,41.81264500),"
New Testament Christian School
1120 Long Pond Road
Plymouth, MA 02360
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Testament Christian School",'Plymouth=' + Plymouth.length); Duxbury[Duxbury.length] = createMarker(new GPoint(-70.73723200,42.03237300),"
Noahs Ark Day School
136 Summer Street
Duxbury, MA 02332
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Noahs Ark Day School",'Duxbury=' + Duxbury.length); Hingham[Hingham.length] = createMarker(new GPoint(-70.90183800,42.18053300),"
Old Colony Montessori School
20 Derby Street
Hingham, MA 02043
Co-ed school, PK-4
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Old Colony Montessori School",'Hingham=' + Hingham.length); Hanover[Hanover.length] = createMarker(new GPoint(-70.82111400,42.11424700),"
Our Little Angels Preschool
197 Rockland Street
Hanover, MA 02339
school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Our Little Angels Preschool",'Hanover=' + Hanover.length); Abington[Abington.length] = createMarker(new GPoint(-70.97440100,42.13498000),"
Preschool Playmates
Po Box 64
Abington, MA 02351
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Preschool Playmates",'Abington=' + Abington.length); Plymouth[Plymouth.length] = createMarker(new GPoint(-70.65915000,41.94330400),"
Radius Pediatric Center Day School At Plymouth
123 South Street
Plymouth, MA 02360
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Radius Pediatric Center Day School At Plymouth",'Plymouth=' + Plymouth.length); Norwell[Norwell.length] = createMarker(new GPoint(-70.87897900,42.16565500),"
The Ridge Hill School
102 High Street
Norwell, MA 02061
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Ridge Hill School",'Norwell=' + Norwell.length); Brockton[Brockton.length] = createMarker(new GPoint(-71.01066800,42.08642300),"
Sacred Heart Elementary School
243 Court Street
Brockton, MA 02302
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sacred Heart Elementary School",'Brockton=' + Brockton.length); Kingston[Kingston.length] = createMarker(new GPoint(-70.73437700,41.95044800),"
Sacred Heart Elementary School
329 Bishops Highway
Kingston, MA 02364
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sacred Heart Elementary School",'Kingston=' + Kingston.length); Kingston[Kingston.length] = createMarker(new GPoint(-70.73406900,41.94795700),"
Sacred Heart Pre-primary School
363 Bishops Highway
Kingston, MA 02364
Co-ed school, K-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sacred Heart Pre-primary School",'Kingston=' + Kingston.length); Abington[Abington.length] = createMarker(new GPoint(-70.93661600,42.11635100),"
St. Bridget School
455 Plymouth Street
Abington, MA 02351
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Bridget School",'Abington=' + Abington.length); Brockton[Brockton.length] = createMarker(new GPoint(-71.01184900,42.10200700),"
St. Casimir School
26 Saint Casimir Avenue
Brockton, MA 02302
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Casimir School",'Brockton=' + Brockton.length); Brockton[Brockton.length] = createMarker(new GPoint(-71.02000300,42.09903600),"
St. Edward Elementary School
631 North Main Street
Brockton, MA 02401
Co-ed school, NS-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Edward Elementary School",'Brockton=' + Brockton.length); West_Bridgewater[West_Bridgewater.length] = createMarker(new GPoint(-71.05281700,42.02379300),"
Small World Montessori
395 West Street
West Bridgewater, MA 02379
school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Small World Montessori",'West_Bridgewater=' + West_Bridgewater.length); Bridgewater[Bridgewater.length] = createMarker(new GPoint(-70.94792500,41.99017900),"
Southbrook Academy
792 Plymouth Street
Bridgewater, MA 02324
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Southbrook Academy",'Bridgewater=' + Bridgewater.length); Hingham[Hingham.length] = createMarker(new GPoint(-70.89036900,42.24344700),"
St Paul Elementary School
18 Fearing Road
Hingham, MA 02043
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Paul Elementary School",'Hingham=' + Hingham.length); Marshfield[Marshfield.length] = createMarker(new GPoint(-70.71040200,42.09121100),"
Steeple School Of Trinity Church
Po Box 397
Marshfield, MA 02051
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Steeple School Of Trinity Church",'Marshfield=' + Marshfield.length); Plymouth[Plymouth.length] = createMarker(new GPoint(-70.70813800,41.95560000),"
Superkids Of Plymouth
15 Richards Road
Plymouth, MA 02360
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Superkids Of Plymouth",'Plymouth=' + Plymouth.length); Brockton[Brockton.length] = createMarker(new GPoint(-71.03835200,42.06170000),"
Tinker Bell Kindergarten
816 Ash Street
Brockton, MA 02301
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Tinker Bell Kindergarten",'Brockton=' + Brockton.length); Norwell[Norwell.length] = createMarker(new GPoint(-70.87768600,42.15618600),"
Wearguard Child Development Center
141 Longwater Drive
Norwell, MA 02061
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wearguard Child Development Center",'Norwell=' + Norwell.length); Brockton[Brockton.length] = createMarker(new GPoint(-71.06413200,42.07077500),"
Westfield Child Center
470 Torrey Street
Brockton, MA 02301
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Westfield Child Center",'Brockton=' + Brockton.length); Kingston[Kingston.length] = createMarker(new GPoint(-70.72243300,41.98946200),"
Wooded Acres Child Care
168 Main Street
Kingston, MA 02364
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wooded Acres Child Care",'Kingston=' + Kingston.length); Plymouth[Plymouth.length] = createMarker(new GPoint(-70.71182200,41.89584600),"
Woodside School & Community Resource Center
34 Southers Marsh Lane
Plymouth, MA 02360
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Woodside School & Community Resource Center",'Plymouth=' + Plymouth.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(Abington); map.removeOverlays(Bridgewater); map.removeOverlays(Brockton); map.removeOverlays(Carver); map.removeOverlays(Duxbury); map.removeOverlays(Hanover); map.removeOverlays(Hingham); map.removeOverlays(Kingston); map.removeOverlays(Lakeville); map.removeOverlays(Marion); map.removeOverlays(Marshfield); map.removeOverlays(Norwell); map.removeOverlays(Plymouth); map.removeOverlays(Rockland); map.removeOverlays(Scituate); map.removeOverlays(W_Bridgewater); map.removeOverlays(West_Bridgewater); map.removeOverlays(West__Bridgewa); map.removeOverlays(Whitman); 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(Plymouth);map.removeOverlays(Abington); map.removeOverlays(Bridgewater); map.removeOverlays(Brockton); map.removeOverlays(Carver); map.removeOverlays(Duxbury); map.removeOverlays(Hanover); map.removeOverlays(Hingham); map.removeOverlays(Kingston); map.removeOverlays(Lakeville); map.removeOverlays(Marion); map.removeOverlays(Marshfield); map.removeOverlays(Norwell); map.removeOverlays(Plymouth); map.removeOverlays(Rockland); map.removeOverlays(Scituate); map.removeOverlays(W_Bridgewater); map.removeOverlays(West_Bridgewater); map.removeOverlays(West__Bridgewa); map.removeOverlays(Whitman); map.addOverlays(Abington); centerByArray(Abington, false, false); cntMarker += Abington.length; map.addOverlays(Bridgewater); centerByArray(Bridgewater, false, false); cntMarker += Bridgewater.length; map.addOverlays(Brockton); centerByArray(Brockton, false, false); cntMarker += Brockton.length; map.addOverlays(Carver); centerByArray(Carver, false, false); cntMarker += Carver.length; map.addOverlays(Duxbury); centerByArray(Duxbury, false, false); cntMarker += Duxbury.length; map.addOverlays(Hanover); centerByArray(Hanover, false, false); cntMarker += Hanover.length; map.addOverlays(Hingham); centerByArray(Hingham, false, false); cntMarker += Hingham.length; map.addOverlays(Kingston); centerByArray(Kingston, false, false); cntMarker += Kingston.length; map.addOverlays(Lakeville); centerByArray(Lakeville, false, false); cntMarker += Lakeville.length; map.addOverlays(Marion); centerByArray(Marion, false, false); cntMarker += Marion.length; map.addOverlays(Marshfield); centerByArray(Marshfield, false, false); cntMarker += Marshfield.length; map.addOverlays(Norwell); centerByArray(Norwell, false, false); cntMarker += Norwell.length; map.addOverlays(Plymouth); centerByArray(Plymouth, false, false); cntMarker += Plymouth.length; map.addOverlays(Rockland); centerByArray(Rockland, false, false); cntMarker += Rockland.length; map.addOverlays(Scituate); centerByArray(Scituate, false, false); cntMarker += Scituate.length; map.addOverlays(W_Bridgewater); centerByArray(W_Bridgewater, false, false); cntMarker += W_Bridgewater.length; map.addOverlays(West_Bridgewater); centerByArray(West_Bridgewater, false, false); cntMarker += West_Bridgewater.length; map.addOverlays(West__Bridgewa); centerByArray(West__Bridgewa, false, false); cntMarker += West__Bridgewa.length; map.addOverlays(Whitman); centerByArray(Whitman, false, false); cntMarker += Whitman.length; centerByArray(Plymouth,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; }