function addMarkers() { mySelect = document.getElementById('selection'); Ashford = [];Brooklyn = [];Canterbury = [];Chaplin = [];Plainfield = [];Columbia = [];Hampton = [];Eastford = [];Rogers = [];Danielson = [];North_Grosvenordale = [];Dayville = [];North_Grosveno = [];Moosup = [];Willimantic = [];North_Windham = [];Central_Villag = [];Pomfret_Center = [];Putnam = [];Scotland = [];Oneco = [];Windham = [];Woodstock = [];mySelect.options[mySelect.options.length] = new Option("Ashford schools",'all=Ashford'); mySelect.options[mySelect.options.length] = new Option("Brooklyn schools",'all=Brooklyn'); mySelect.options[mySelect.options.length] = new Option("Canterbury schools",'all=Canterbury'); mySelect.options[mySelect.options.length] = new Option("Central Villag schools",'all=Central_Villag'); mySelect.options[mySelect.options.length] = new Option("Chaplin schools",'all=Chaplin'); mySelect.options[mySelect.options.length] = new Option("Columbia schools",'all=Columbia'); mySelect.options[mySelect.options.length] = new Option("Danielson schools",'all=Danielson'); mySelect.options[mySelect.options.length] = new Option("Dayville schools",'all=Dayville'); mySelect.options[mySelect.options.length] = new Option("Eastford schools",'all=Eastford'); mySelect.options[mySelect.options.length] = new Option("Hampton schools",'all=Hampton'); mySelect.options[mySelect.options.length] = new Option("Moosup schools",'all=Moosup'); mySelect.options[mySelect.options.length] = new Option("North Grosveno schools",'all=North_Grosveno'); mySelect.options[mySelect.options.length] = new Option("North Grosvenordale schools",'all=North_Grosvenordale'); mySelect.options[mySelect.options.length] = new Option("North Windham schools",'all=North_Windham'); mySelect.options[mySelect.options.length] = new Option("Oneco schools",'all=Oneco'); mySelect.options[mySelect.options.length] = new Option("Plainfield schools",'all=Plainfield'); mySelect.options[mySelect.options.length] = new Option("Pomfret Center schools",'all=Pomfret_Center'); mySelect.options[mySelect.options.length] = new Option("Putnam schools",'all=Putnam'); mySelect.options[mySelect.options.length] = new Option("Rogers schools",'all=Rogers'); mySelect.options[mySelect.options.length] = new Option("Scotland schools",'all=Scotland'); mySelect.options[mySelect.options.length] = new Option("Willimantic schools",'all=Willimantic'); mySelect.options[mySelect.options.length] = new Option("Windham schools",'all=Windham'); mySelect.options[mySelect.options.length] = new Option("Woodstock schools",'all=Woodstock'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Ashford[Ashford.length] = createMarker(new GPoint(-72.17440033,41.89739990),"
Ashford School
440 Westford Rd.
Ashford, CT 06278

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ashford School",'Ashford=' + Ashford.length); Brooklyn[Brooklyn.length] = createMarker(new GPoint(-71.95079803,41.78799820),"
Brooklyn Community Correctional Center
P.o. Box 297
Brooklyn, CT 06234

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Brooklyn Community Correctional Center",'Brooklyn=' + Brooklyn.length); Brooklyn[Brooklyn.length] = createMarker(new GPoint(-71.93577576,41.78227615),"
Brooklyn Elementary School
119 Gorman Rd.
Brooklyn, CT 06234

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Brooklyn Elementary School",'Brooklyn=' + Brooklyn.length); Brooklyn[Brooklyn.length] = createMarker(new GPoint(-71.93577576,41.78227615),"
Brooklyn Middle School
119 Gorman Rd.
Brooklyn, CT 06234

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Brooklyn Middle School",'Brooklyn=' + Brooklyn.length); Canterbury[Canterbury.length] = createMarker(new GPoint(-71.98671722,41.70201111),"
Canterbury Elementary School
67 Kitt Rd.
Canterbury, CT 06331

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Canterbury Elementary School",'Canterbury=' + Canterbury.length); Chaplin[Chaplin.length] = createMarker(new GPoint(-72.14620209,41.78802872),"
Chaplin Elementary School
240 Palmer Rd.
Chaplin, CT 06235

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Chaplin Elementary School",'Chaplin=' + Chaplin.length); Canterbury[Canterbury.length] = createMarker(new GPoint(-71.97872925,41.69738388),"
Dr. Helen Baldwin Middle School
45 Westminster Rd.
Canterbury, CT 06331

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Dr. Helen Baldwin Middle School",'Canterbury=' + Canterbury.length); Plainfield[Plainfield.length] = createMarker(new GPoint(-71.91555023,41.67583847),"
Early Childhood Center
651 Norwich Rd.
Plainfield, CT 06374

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Early Childhood Center",'Plainfield=' + Plainfield.length); Columbia[Columbia.length] = createMarker(new GPoint(-72.28093719,41.71836090),"
Eastconn Alternative Design Academy
14 Route 66
Columbia, CT 06237

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Eastconn Alternative Design Academy",'Columbia=' + Columbia.length); Hampton[Hampton.length] = createMarker(new GPoint(-72.08339691,41.77213287),"
Eastconn Special Education
376 Hartford Turnpike
Hampton, CT 06247

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Eastconn Special Education",'Hampton=' + Hampton.length); Eastford[Eastford.length] = createMarker(new GPoint(-72.09349823,41.89879990),"
Eastford Elementary School
P.o. Box 158
Eastford, CT 06242

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Eastford Elementary School",'Eastford=' + Eastford.length); Rogers[Rogers.length] = createMarker(new GPoint(-71.90660095,41.84019852),"
Goodyear Early Childhood Center
22 Williamsville Rd.
Rogers, CT 06263

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Goodyear Early Childhood Center",'Rogers=' + Rogers.length); Danielson[Danielson.length] = createMarker(new GPoint(-71.89277649,41.81919479),"
H. H. Ellis Vocational School
613 Upper Maple St.
Danielson, CT 06239

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("H. H. Ellis Vocational School",'Danielson=' + Danielson.length); Hampton[Hampton.length] = createMarker(new GPoint(-72.05670929,41.78886032),"
Hampton Elementary School
380 Main St.
Hampton, CT 06247

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hampton Elementary School",'Hampton=' + Hampton.length); North_Grosvenordale[North_Grosvenordale.length] = createMarker(new GPoint(-71.89489746,41.98550034),"
Homebound
785 Riverside Drive
North Grosvenordale, CT 06255

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Homebound",'North_Grosvenordale=' + North_Grosvenordale.length); Brooklyn[Brooklyn.length] = createMarker(new GPoint(-71.93486786,41.78528976),"
Homebound Elementary School
119 Gorman Road
Brooklyn, CT 06234

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Homebound Elementary School",'Brooklyn=' + Brooklyn.length); Dayville[Dayville.length] = createMarker(new GPoint(-71.88605499,41.84907150),"
Killingly Central School
60 Soap St.
Dayville, CT 06241

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Killingly Central School",'Dayville=' + Dayville.length); Danielson[Danielson.length] = createMarker(new GPoint(-71.88103485,41.81330490),"
Killingly High School
79 Westfield Ave.
Danielson, CT 06239

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Killingly High School",'Danielson=' + Danielson.length); Dayville[Dayville.length] = createMarker(new GPoint(-71.89454651,41.85429001),"
Killingly Intermediate School
1599 Upper Maple St.
Dayville, CT 06241

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Killingly Intermediate School",'Dayville=' + Dayville.length); Danielson[Danielson.length] = createMarker(new GPoint(-71.87873077,41.80986404),"
Killingly Memorial School
339 Main St.
Danielson, CT 06239

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Killingly Memorial School",'Danielson=' + Danielson.length); North_Grosveno[North_Grosveno.length] = createMarker(new GPoint(-71.89990234,41.97708893),"
Mary R. Fisher Elementary School
785 Riverside Dr.
North Grosveno, CT 06255

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mary R. Fisher Elementary School",'North_Grosveno=' + North_Grosveno.length); Moosup[Moosup.length] = createMarker(new GPoint(-71.88002777,41.71726990),"
Moosup Elementary School
35 Church St.
Moosup, CT 06354

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Moosup Elementary School",'Moosup=' + Moosup.length); Willimantic[Willimantic.length] = createMarker(new GPoint(-72.20624542,41.71450043),"
Natchaug School
123 Jackson St.
Willimantic, CT 06226

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Natchaug School",'Willimantic=' + Willimantic.length); North_Windham[North_Windham.length] = createMarker(new GPoint(-72.15876770,41.73841095),"
North Windham School
112 Jordan Ln.
North Windham, CT 06256

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("North Windham School",'North_Windham=' + North_Windham.length); Chaplin[Chaplin.length] = createMarker(new GPoint(-72.12680054,41.78770065),"
Parish Hill High School
P.o. Box 275
Chaplin, CT 06235

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Parish Hill High School",'Chaplin=' + Chaplin.length); Plainfield[Plainfield.length] = createMarker(new GPoint(-71.92933655,41.68334579),"
Plainfield Central Middle School
75 Canterbury Rd.
Plainfield, CT 06374

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Plainfield Central Middle School",'Plainfield=' + Plainfield.length); Central_Villag[Central_Villag.length] = createMarker(new GPoint(-71.90720367,41.72269821),"
Plainfield High School
P.o. Box 218 87 Putna
Central Villag, CT 06332

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Plainfield High School",'Central_Villag=' + Central_Villag.length); Plainfield[Plainfield.length] = createMarker(new GPoint(-71.93060303,41.68421173),"
Plainfield Memorial School
95 Canterbury Rd.
Plainfield, CT 06374

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Plainfield Memorial School",'Plainfield=' + Plainfield.length); Pomfret_Center[Pomfret_Center.length] = createMarker(new GPoint(-71.95928192,41.85794449),"
Pomfret Community School
20 Pomfret St.
Pomfret Center, CT 06259

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pomfret Community School",'Pomfret_Center=' + Pomfret_Center.length); Putnam[Putnam.length] = createMarker(new GPoint(-71.91980743,41.92193222),"
Putnam Elementary School
33 Wicker St.
Putnam, CT 06260

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Putnam Elementary School",'Putnam=' + Putnam.length); Putnam[Putnam.length] = createMarker(new GPoint(-71.91666412,41.92375946),"
Putnam High School
152 Woodstock Ave.
Putnam, CT 06260

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Putnam High School",'Putnam=' + Putnam.length); Putnam[Putnam.length] = createMarker(new GPoint(-71.91991425,41.92184067),"
Putnam Middle School
35 Wicker St.
Putnam, CT 06260

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Putnam Middle School",'Putnam=' + Putnam.length); Scotland[Scotland.length] = createMarker(new GPoint(-72.08184814,41.70174408),"
Scotland Elementary School
68 Brook Rd.
Scotland, CT 06264

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Scotland Elementary School",'Scotland=' + Scotland.length); Plainfield[Plainfield.length] = createMarker(new GPoint(-71.90705109,41.73730469),"
Shepard Hill Elementary School
234 Shepard Hill Rd.
Plainfield, CT 06374

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Shepard Hill Elementary School",'Plainfield=' + Plainfield.length); Willimantic[Willimantic.length] = createMarker(new GPoint(-72.21130371,41.70746231),"
South Park Street Early Childhood Program Elementary School
90 South Park Street
Willimantic, CT 06226

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("South Park Street Early Childhood Program Elementary School",'Willimantic=' + Willimantic.length); Oneco[Oneco.length] = createMarker(new GPoint(-71.80190277,41.69189835),"
Sterling Memorial School
P.o. Box 159
Oneco, CT 06373

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sterling Memorial School",'Oneco=' + Oneco.length); North_Grosveno[North_Grosveno.length] = createMarker(new GPoint(-71.89990234,41.97708893),"
Thompson Middle School
785 Riverside Dr.
North Grosveno, CT 06255

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Thompson Middle School",'North_Grosveno=' + North_Grosveno.length); North_Grosveno[North_Grosveno.length] = createMarker(new GPoint(-71.89990234,41.97708893),"
Tourtellotte Memorial High School
785 Riverside Dr.
North Grosveno, CT 06255

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Tourtellotte Memorial High School",'North_Grosveno=' + North_Grosveno.length); Willimantic[Willimantic.length] = createMarker(new GPoint(-72.22591400,41.71583176),"
Valley Street Early Childhood Program Elementary School
478 Valley Street
Willimantic, CT 06226

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Valley Street Early Childhood Program Elementary School",'Willimantic=' + Willimantic.length); Willimantic[Willimantic.length] = createMarker(new GPoint(-72.22826385,41.72542572),"
W. B. Sweeney School
60 Oak Hill Dr.
Willimantic, CT 06226

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("W. B. Sweeney School",'Willimantic=' + Willimantic.length); Windham[Windham.length] = createMarker(new GPoint(-72.15239716,41.69729996),"
Windham Center School
45 North Rd.
Windham, CT 06280

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Windham Center School",'Windham=' + Windham.length); Willimantic[Willimantic.length] = createMarker(new GPoint(-72.21209717,41.71419907),"
Windham Early Childhood Prospect Street Elementary School
322 Prospect St.
Willimantic, CT 06226

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Windham Early Childhood Prospect Street Elementary School",'Willimantic=' + Willimantic.length); Willimantic[Willimantic.length] = createMarker(new GPoint(-72.21583557,41.72307968),"
Windham High School
355 High St.
Willimantic, CT 06226

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Windham High School",'Willimantic=' + Willimantic.length); Willimantic[Willimantic.length] = createMarker(new GPoint(-72.22942352,41.72285461),"
Windham Middle School
123 Quarry St.
Willimantic, CT 06226

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Windham Middle School",'Willimantic=' + Willimantic.length); Willimantic[Willimantic.length] = createMarker(new GPoint(-72.22061157,41.71839142),"
Windham Vocational School
210 Birch St.
Willimantic, CT 06226

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Windham Vocational School",'Willimantic=' + Willimantic.length); Woodstock[Woodstock.length] = createMarker(new GPoint(-71.97560120,41.95059204),"
Woodstock Academy
57 Academy Rd.
Woodstock, CT 06281

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Woodstock Academy",'Woodstock=' + Woodstock.length); Woodstock[Woodstock.length] = createMarker(new GPoint(-71.96295166,41.94324112),"
Woodstock Elementary School
24 Frog Pond Rd.
Woodstock, CT 06281

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Woodstock Elementary School",'Woodstock=' + Woodstock.length); Woodstock[Woodstock.length] = createMarker(new GPoint(-71.95661163,41.92807388),"
Woodstock Middle School
147 Route 169
Woodstock, CT 06281

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Woodstock Middle School",'Woodstock=' + Woodstock.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(Ashford); map.removeOverlays(Brooklyn); map.removeOverlays(Canterbury); map.removeOverlays(Central_Villag); map.removeOverlays(Chaplin); map.removeOverlays(Columbia); map.removeOverlays(Danielson); map.removeOverlays(Dayville); map.removeOverlays(Eastford); map.removeOverlays(Hampton); map.removeOverlays(Moosup); map.removeOverlays(North_Grosveno); map.removeOverlays(North_Grosvenordale); map.removeOverlays(North_Windham); map.removeOverlays(Oneco); map.removeOverlays(Plainfield); map.removeOverlays(Pomfret_Center); map.removeOverlays(Putnam); map.removeOverlays(Rogers); map.removeOverlays(Scotland); map.removeOverlays(Willimantic); map.removeOverlays(Windham); map.removeOverlays(Woodstock); 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(Ashford);map.removeOverlays(Ashford); map.removeOverlays(Brooklyn); map.removeOverlays(Canterbury); map.removeOverlays(Central_Villag); map.removeOverlays(Chaplin); map.removeOverlays(Columbia); map.removeOverlays(Danielson); map.removeOverlays(Dayville); map.removeOverlays(Eastford); map.removeOverlays(Hampton); map.removeOverlays(Moosup); map.removeOverlays(North_Grosveno); map.removeOverlays(North_Grosvenordale); map.removeOverlays(North_Windham); map.removeOverlays(Oneco); map.removeOverlays(Plainfield); map.removeOverlays(Pomfret_Center); map.removeOverlays(Putnam); map.removeOverlays(Rogers); map.removeOverlays(Scotland); map.removeOverlays(Willimantic); map.removeOverlays(Windham); map.removeOverlays(Woodstock); map.addOverlays(Ashford); centerByArray(Ashford, false, false); cntMarker += Ashford.length; map.addOverlays(Brooklyn); centerByArray(Brooklyn, false, false); cntMarker += Brooklyn.length; map.addOverlays(Canterbury); centerByArray(Canterbury, false, false); cntMarker += Canterbury.length; map.addOverlays(Central_Villag); centerByArray(Central_Villag, false, false); cntMarker += Central_Villag.length; map.addOverlays(Chaplin); centerByArray(Chaplin, false, false); cntMarker += Chaplin.length; map.addOverlays(Columbia); centerByArray(Columbia, false, false); cntMarker += Columbia.length; map.addOverlays(Danielson); centerByArray(Danielson, false, false); cntMarker += Danielson.length; map.addOverlays(Dayville); centerByArray(Dayville, false, false); cntMarker += Dayville.length; map.addOverlays(Eastford); centerByArray(Eastford, false, false); cntMarker += Eastford.length; map.addOverlays(Hampton); centerByArray(Hampton, false, false); cntMarker += Hampton.length; map.addOverlays(Moosup); centerByArray(Moosup, false, false); cntMarker += Moosup.length; map.addOverlays(North_Grosveno); centerByArray(North_Grosveno, false, false); cntMarker += North_Grosveno.length; map.addOverlays(North_Grosvenordale); centerByArray(North_Grosvenordale, false, false); cntMarker += North_Grosvenordale.length; map.addOverlays(North_Windham); centerByArray(North_Windham, false, false); cntMarker += North_Windham.length; map.addOverlays(Oneco); centerByArray(Oneco, false, false); cntMarker += Oneco.length; map.addOverlays(Plainfield); centerByArray(Plainfield, false, false); cntMarker += Plainfield.length; map.addOverlays(Pomfret_Center); centerByArray(Pomfret_Center, false, false); cntMarker += Pomfret_Center.length; map.addOverlays(Putnam); centerByArray(Putnam, false, false); cntMarker += Putnam.length; map.addOverlays(Rogers); centerByArray(Rogers, false, false); cntMarker += Rogers.length; map.addOverlays(Scotland); centerByArray(Scotland, false, false); cntMarker += Scotland.length; map.addOverlays(Willimantic); centerByArray(Willimantic, false, false); cntMarker += Willimantic.length; map.addOverlays(Windham); centerByArray(Windham, false, false); cntMarker += Windham.length; map.addOverlays(Woodstock); centerByArray(Woodstock, false, false); cntMarker += Woodstock.length; centerByArray(Ashford,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'); } }