function addMarkers() { mySelect = document.getElementById('selection'); Clinton = [];Middletown = [];Portland = [];Higganum = [];East_Hampton = [];Chester = [];Durham = [];Cromwell = [];Westbrook = [];Deep_River = [];Moodus = [];Centerbrook = [];Middlefield = [];Old_Saybrook = [];Killingworth = [];mySelect.options[mySelect.options.length] = new Option("Centerbrook schools",'all=Centerbrook'); mySelect.options[mySelect.options.length] = new Option("Chester schools",'all=Chester'); mySelect.options[mySelect.options.length] = new Option("Clinton schools",'all=Clinton'); mySelect.options[mySelect.options.length] = new Option("Cromwell schools",'all=Cromwell'); mySelect.options[mySelect.options.length] = new Option("Deep River schools",'all=Deep_River'); mySelect.options[mySelect.options.length] = new Option("Durham schools",'all=Durham'); mySelect.options[mySelect.options.length] = new Option("East Hampton schools",'all=East_Hampton'); mySelect.options[mySelect.options.length] = new Option("Higganum schools",'all=Higganum'); mySelect.options[mySelect.options.length] = new Option("Killingworth schools",'all=Killingworth'); mySelect.options[mySelect.options.length] = new Option("Middlefield schools",'all=Middlefield'); mySelect.options[mySelect.options.length] = new Option("Middletown schools",'all=Middletown'); mySelect.options[mySelect.options.length] = new Option("Moodus schools",'all=Moodus'); mySelect.options[mySelect.options.length] = new Option("Old Saybrook schools",'all=Old_Saybrook'); mySelect.options[mySelect.options.length] = new Option("Portland schools",'all=Portland'); mySelect.options[mySelect.options.length] = new Option("Westbrook schools",'all=Westbrook'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Clinton[Clinton.length] = createMarker(new GPoint(-72.52151489,41.27754211),"
Abraham Pierson School
75 East Main St.
Clinton, CT 06413

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Abraham Pierson School",'Clinton=' + Clinton.length); Middletown[Middletown.length] = createMarker(new GPoint(-72.63354492,41.54301834),"
Bielefield School
70 Maynard St.
Middletown, CT 06457

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bielefield School",'Middletown=' + Middletown.length); Portland[Portland.length] = createMarker(new GPoint(-72.63768000,41.57722700),"
Brownstone Intermediate School
314 Main Street
Portland, CT 06480

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Brownstone Intermediate School",'Portland=' + Portland.length); Higganum[Higganum.length] = createMarker(new GPoint(-72.55524445,41.45270157),"
Burr District Elementary School
792 Killingworth Rd.
Higganum, CT 06441

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Burr District Elementary School",'Higganum=' + Higganum.length); East_Hampton[East_Hampton.length] = createMarker(new GPoint(-72.50112152,41.57715988),"
Center School
7 Summit St.
East Hampton, CT 06424

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Center School",'East_Hampton=' + East_Hampton.length); Chester[Chester.length] = createMarker(new GPoint(-72.45890808,41.40499878),"
Chester Elementary School
23 Ridge Rd.
Chester, CT 06412

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Chester Elementary School",'Chester=' + Chester.length); Durham[Durham.length] = createMarker(new GPoint(-72.67181396,41.47637177),"
Coginchaug Regional High School
135 Pickett Ln.
Durham, CT 06422

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Coginchaug Regional High School",'Durham=' + Durham.length); Middletown[Middletown.length] = createMarker(new GPoint(-72.64273071,41.55107498),"
Connecticut Juvenile Training School
1225 Silver St.
Middletown, CT 06457

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Connecticut Juvenile Training School",'Middletown=' + Middletown.length); Cromwell[Cromwell.length] = createMarker(new GPoint(-72.65698242,41.61302567),"
Cromwell High School
Donald Harris Dr.
Cromwell, CT 06416

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cromwell High School",'Cromwell=' + Cromwell.length); Cromwell[Cromwell.length] = createMarker(new GPoint(-72.65588379,41.62683868),"
Cromwell Middle School
9 Mann Memorial Dr.
Cromwell, CT 06416

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Cromwell Middle School",'Cromwell=' + Cromwell.length); Westbrook[Westbrook.length] = createMarker(new GPoint(-72.44770813,41.28583145),"
Daisy Ingraham School
105 Goodspeed Dr.
Westbrook, CT 06498

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Daisy Ingraham School",'Westbrook=' + Westbrook.length); Deep_River[Deep_River.length] = createMarker(new GPoint(-72.43554687,41.38635635),"
Deep River Elementary School
12 River St.
Deep River, CT 06417

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Deep River Elementary School",'Deep_River=' + Deep_River.length); Moodus[Moodus.length] = createMarker(new GPoint(-72.43810272,41.50640106),"
East Haddam Elementary School
P.o. Box 425
Moodus, CT 06469

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("East Haddam Elementary School",'Moodus=' + Moodus.length); East_Hampton[East_Hampton.length] = createMarker(new GPoint(-72.51329041,41.58688736),"
East Hampton High School
15 North Maple St.
East Hampton, CT 06424

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("East Hampton High School",'East_Hampton=' + East_Hampton.length); East_Hampton[East_Hampton.length] = createMarker(new GPoint(-72.52434540,41.57055664),"
East Hampton Middle School
19 Childs Rd.
East Hampton, CT 06424

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("East Hampton Middle School",'East_Hampton=' + East_Hampton.length); Cromwell[Cromwell.length] = createMarker(new GPoint(-72.65869904,41.62017822),"
Edna C. Stevens School
25 Court St.
Cromwell, CT 06416

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Edna C. Stevens School",'Cromwell=' + Cromwell.length); Centerbrook[Centerbrook.length] = createMarker(new GPoint(-72.42202759,41.34949875),"
Essex Elementary School
108 Main St.
Centerbrook, CT 06409

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Essex Elementary School",'Centerbrook=' + Centerbrook.length); Middletown[Middletown.length] = createMarker(new GPoint(-72.63323975,41.52988052),"
Farm Hill School
390 Ridge Rd.
Middletown, CT 06457

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Farm Hill School",'Middletown=' + Middletown.length); Durham[Durham.length] = createMarker(new GPoint(-72.67141724,41.47676468),"
Francis E. Korn School
144 Pickett Ln.
Durham, CT 06422

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Francis E. Korn School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-72.68027496,41.47625351),"
Frank Ward Strong School
191 Main St.
Durham, CT 06422

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Frank Ward Strong School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-72.70319366,41.46149445),"
Frederick Brewster School
126 Tuttle Rd.
Durham, CT 06422

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Frederick Brewster School",'Durham=' + Durham.length); Portland[Portland.length] = createMarker(new GPoint(-72.62290192,41.59238815),"
Gildersleeve School
575 12 Main St.
Portland, CT 06480

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Gildersleeve School",'Portland=' + Portland.length); Higganum[Higganum.length] = createMarker(new GPoint(-72.56111900,41.49738400),"
Haddam Elementary School
272 Route 154
Higganum, CT 06441

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Haddam Elementary School",'Higganum=' + Higganum.length); Higganum[Higganum.length] = createMarker(new GPoint(-72.58312988,41.45139313),"
Haddam-killingworth High School
95 Little City Rd.
Higganum, CT 06441

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Haddam-killingworth High School",'Higganum=' + Higganum.length); Higganum[Higganum.length] = createMarker(new GPoint(-72.58242798,41.45177078),"
Haddam-killingworth Middle School
57 Little City Rd.
Higganum, CT 06441

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Haddam-killingworth Middle School",'Higganum=' + Higganum.length); Middletown[Middletown.length] = createMarker(new GPoint(-72.64707184,41.54158401),"
Homebound
311 Hunting Avenue
Middletown, CT 06457

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Homebound",'Middletown=' + Middletown.length); Clinton[Clinton.length] = createMarker(new GPoint(-72.51923370,41.29789734),"
Jared Eliot School
69 Fairy Dell Rd.
Clinton, CT 06413

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Jared Eliot School",'Clinton=' + Clinton.length); Middlefield[Middlefield.length] = createMarker(new GPoint(-72.72305298,41.51739502),"
John Lyman School
106 Way Rd.
Middlefield, CT 06455

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("John Lyman School",'Middlefield=' + Middlefield.length); Deep_River[Deep_River.length] = createMarker(new GPoint(-72.44840240,41.37680054),"
John Winthrop Junior High School
Po Box 187
Deep River, CT 06417

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("John Winthrop Junior High School",'Deep_River=' + Deep_River.length); Old_Saybrook[Old_Saybrook.length] = createMarker(new GPoint(-72.38118744,41.28768921),"
Kathleen E. Goodwin School
80 Old Boston Post Rd.
Old Saybrook, CT 06475

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Kathleen E. Goodwin School",'Old_Saybrook=' + Old_Saybrook.length); Middletown[Middletown.length] = createMarker(new GPoint(-72.67722321,41.57780457),"
Keigwin Annex Middle School
99 Spurce St.
Middletown, CT 06457

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Keigwin Annex Middle School",'Middletown=' + Middletown.length); Killingworth[Killingworth.length] = createMarker(new GPoint(-72.56493378,41.37134933),"
Killingworth Elementary School
340 Route 81
Killingworth, CT 06419

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Killingworth Elementary School",'Killingworth=' + Killingworth.length); Middletown[Middletown.length] = createMarker(new GPoint(-72.68324280,41.58663940),"
Lawrence School
Kaplan Dr.
Middletown, CT 06457

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lawrence School",'Middletown=' + Middletown.length); Clinton[Clinton.length] = createMarker(new GPoint(-72.52439880,41.30401993),"
Lewin G. Joel Junior School
137a Glenwood Rd.
Clinton, CT 06413

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lewin G. Joel Junior School",'Clinton=' + Clinton.length); Middletown[Middletown.length] = createMarker(new GPoint(-72.66479492,41.54895782),"
Long Lane High School
170 Long Lane, Box 882
Middletown, CT 06457

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Long Lane High School",'Middletown=' + Middletown.length); Middletown[Middletown.length] = createMarker(new GPoint(-72.65582275,41.56608582),"
Macdonough School
66 Spring St.
Middletown, CT 06457

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Macdonough School",'Middletown=' + Middletown.length); East_Hampton[East_Hampton.length] = createMarker(new GPoint(-72.48839569,41.57019424),"
Memorial School
20 Smith St.
East Hampton, CT 06424

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Memorial School",'East_Hampton=' + East_Hampton.length); Middlefield[Middlefield.length] = createMarker(new GPoint(-72.69754028,41.52145767),"
Middlefield Memorial School
124 Hubbard St.
Middlefield, CT 06455

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Middlefield Memorial School",'Middlefield=' + Middlefield.length); Middletown[Middletown.length] = createMarker(new GPoint(-72.64683533,41.54053116),"
Middletown High School
370 Hunting Hill Ave.
Middletown, CT 06457

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Middletown High School",'Middletown=' + Middletown.length); Middletown[Middletown.length] = createMarker(new GPoint(-72.71215820,41.56247711),"
Moody School
300 Country Club Rd.
Middletown, CT 06457

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Moody School",'Middletown=' + Middletown.length); Clinton[Clinton.length] = createMarker(new GPoint(-72.53153229,41.29349899),"
Morgan School
27 Killingworth Tpke.
Clinton, CT 06413

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Morgan School",'Clinton=' + Clinton.length); Moodus[Moodus.length] = createMarker(new GPoint(-72.43810272,41.50640106),"
Nathan Hale-ray High School
P.o. Box 404
Moodus, CT 06469

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Nathan Hale-ray High School",'Moodus=' + Moodus.length); Moodus[Moodus.length] = createMarker(new GPoint(-72.43810272,41.50640106),"
Nathan Hale-ray Middle School
P.o. Box 363
Moodus, CT 06469

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Nathan Hale-ray Middle School",'Moodus=' + Moodus.length); Old_Saybrook[Old_Saybrook.length] = createMarker(new GPoint(-72.37042999,41.29022980),"
Old Saybrook Middle School
60 Sheffield St.
Old Saybrook, CT 06475

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Old Saybrook Middle School",'Old_Saybrook=' + Old_Saybrook.length); Old_Saybrook[Old_Saybrook.length] = createMarker(new GPoint(-72.39620209,41.28748322),"
Old Saybrook Senior High School
1111 Boston Post Rd.
Old Saybrook, CT 06475

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Old Saybrook Senior High School",'Old_Saybrook=' + Old_Saybrook.length); Portland[Portland.length] = createMarker(new GPoint(-72.62512207,41.58059311),"
Portland High School
P.o. Box 73
Portland, CT 06480

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Portland High School",'Portland=' + Portland.length); Portland[Portland.length] = createMarker(new GPoint(-72.63681793,41.57775879),"
Portland Middle School
95 Main St.
Portland, CT 06480

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Portland Middle School",'Portland=' + Portland.length); Middletown[Middletown.length] = createMarker(new GPoint(-72.61181641,41.55870438),"
Riverview Hospital
P.o. Box 2797
Middletown, CT 06457

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Riverview Hospital",'Middletown=' + Middletown.length); Middletown[Middletown.length] = createMarker(new GPoint(-72.67012024,41.54247665),"
Snow School
299 Wadsworth St.
Middletown, CT 06457

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Snow School",'Middletown=' + Middletown.length); Middletown[Middletown.length] = createMarker(new GPoint(-72.67577362,41.56390381),"
Spencer School
207 Westfield St.
Middletown, CT 06457

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Spencer School",'Middletown=' + Middletown.length); Deep_River[Deep_River.length] = createMarker(new GPoint(-72.44773102,41.36840057),"
Valley Regional High School
256 Kelsey Hill Rd.
Deep River, CT 06417

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Valley Regional High School",'Deep_River=' + Deep_River.length); Portland[Portland.length] = createMarker(new GPoint(-72.62570953,41.57931137),"
Valley View School
P.o. Box 469
Portland, CT 06480

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Valley View School",'Portland=' + Portland.length); Middletown[Middletown.length] = createMarker(new GPoint(-72.67355347,41.52750015),"
Vinal Vocational School
60 Daniels St.
Middletown, CT 06457

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Vinal Vocational School",'Middletown=' + Middletown.length); Middletown[Middletown.length] = createMarker(new GPoint(-72.66621399,41.52269363),"
Wesley School
10 Wesleyan Hills Rd.
Middletown, CT 06457

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wesley School",'Middletown=' + Middletown.length); Westbrook[Westbrook.length] = createMarker(new GPoint(-72.45442963,41.29750061),"
Westbrook High School
156 Mcveagh Rd.
Westbrook, CT 06498

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Westbrook High School",'Westbrook=' + Westbrook.length); Westbrook[Westbrook.length] = createMarker(new GPoint(-72.45442963,41.29750061),"
Westbrook Middle School
156 Mcveagh Rd.
Westbrook, CT 06498

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Westbrook Middle School",'Westbrook=' + Westbrook.length); Middletown[Middletown.length] = createMarker(new GPoint(-80.15400800,25.99088200),"
Woodrow Wilson Middle School
1 Wilderman''s Way
Middletown, CT 06457

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Woodrow Wilson Middle School",'Middletown=' + Middletown.length); Cromwell[Cromwell.length] = createMarker(new GPoint(-72.66017200,41.62282600),"
Woodside Intermediate School
30 Woodside Road
Cromwell, CT 06416

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Woodside Intermediate School",'Cromwell=' + Cromwell.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,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) { var myVal = selection.options[selection.selectedIndex].value; map.closeInfoWindow(); // Add entire array based on variable type if (myVal.indexOf('all') != -1 && myVal != 'all') { var temp = myVal.split('='); var showArray = temp[1]; // If Array is > X amount of markers, then open in a new page if (eval(showArray).length > 20) // New window depends on whether or not we're on the search page if (location.href.indexOf('nearby_schools.php') == -1) window.open(location.href + '/map/' + showArray); else window.open('/search////' + showArray); map.removeOverlays(Centerbrook); map.removeOverlays(Chester); map.removeOverlays(Clinton); map.removeOverlays(Cromwell); map.removeOverlays(Deep_River); map.removeOverlays(Durham); map.removeOverlays(East_Hampton); map.removeOverlays(Higganum); map.removeOverlays(Killingworth); map.removeOverlays(Middlefield); map.removeOverlays(Middletown); map.removeOverlays(Moodus); map.removeOverlays(Old_Saybrook); map.removeOverlays(Portland); map.removeOverlays(Westbrook); 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(Clinton);map.removeOverlays(Centerbrook); map.removeOverlays(Chester); map.removeOverlays(Clinton); map.removeOverlays(Cromwell); map.removeOverlays(Deep_River); map.removeOverlays(Durham); map.removeOverlays(East_Hampton); map.removeOverlays(Higganum); map.removeOverlays(Killingworth); map.removeOverlays(Middlefield); map.removeOverlays(Middletown); map.removeOverlays(Moodus); map.removeOverlays(Old_Saybrook); map.removeOverlays(Portland); map.removeOverlays(Westbrook); map.addOverlays(Centerbrook); centerByArray(Centerbrook, false, false); cntMarker += Centerbrook.length; map.addOverlays(Chester); centerByArray(Chester, false, false); cntMarker += Chester.length; map.addOverlays(Clinton); centerByArray(Clinton, false, false); cntMarker += Clinton.length; map.addOverlays(Cromwell); centerByArray(Cromwell, false, false); cntMarker += Cromwell.length; map.addOverlays(Deep_River); centerByArray(Deep_River, false, false); cntMarker += Deep_River.length; map.addOverlays(Durham); centerByArray(Durham, false, false); cntMarker += Durham.length; map.addOverlays(East_Hampton); centerByArray(East_Hampton, false, false); cntMarker += East_Hampton.length; map.addOverlays(Higganum); centerByArray(Higganum, false, false); cntMarker += Higganum.length; map.addOverlays(Killingworth); centerByArray(Killingworth, false, false); cntMarker += Killingworth.length; map.addOverlays(Middlefield); centerByArray(Middlefield, false, false); cntMarker += Middlefield.length; map.addOverlays(Middletown); centerByArray(Middletown, false, false); cntMarker += Middletown.length; map.addOverlays(Moodus); centerByArray(Moodus, false, false); cntMarker += Moodus.length; map.addOverlays(Old_Saybrook); centerByArray(Old_Saybrook, false, false); cntMarker += Old_Saybrook.length; map.addOverlays(Portland); centerByArray(Portland, false, false); cntMarker += Portland.length; map.addOverlays(Westbrook); centerByArray(Westbrook, false, false); cntMarker += Westbrook.length; centerByArray(Clinton,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'); } }