function addMarkers() { mySelect = document.getElementById('selection'); Vineland = [];Millville = [];Bridgeton = [];Seabrook = [];Rosenhayn = [];Newport = [];Port_Norris = [];Port_Elizabeth = [];Greenwich = [];Cedarville = [];Shiloh = [];mySelect.options[mySelect.options.length] = new Option("Bridgeton schools",'all=Bridgeton'); mySelect.options[mySelect.options.length] = new Option("Cedarville schools",'all=Cedarville'); mySelect.options[mySelect.options.length] = new Option("Greenwich schools",'all=Greenwich'); mySelect.options[mySelect.options.length] = new Option("Millville schools",'all=Millville'); mySelect.options[mySelect.options.length] = new Option("Newport schools",'all=Newport'); mySelect.options[mySelect.options.length] = new Option("Port Elizabeth schools",'all=Port_Elizabeth'); mySelect.options[mySelect.options.length] = new Option("Port Norris schools",'all=Port_Norris'); mySelect.options[mySelect.options.length] = new Option("Rosenhayn schools",'all=Rosenhayn'); mySelect.options[mySelect.options.length] = new Option("Seabrook schools",'all=Seabrook'); mySelect.options[mySelect.options.length] = new Option("Shiloh schools",'all=Shiloh'); mySelect.options[mySelect.options.length] = new Option("Vineland schools",'all=Vineland'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Vineland[Vineland.length] = createMarker(new GPoint(-74.98135376,39.44786072),"
Anthony Rossi Inter. School
2572 Palermo Ave
Vineland, NJ 08360

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Anthony Rossi Inter. School",'Vineland=' + Vineland.length); Millville[Millville.length] = createMarker(new GPoint(-75.03299713,39.36220169),"
Bacon Elementary School
501 South Third Street
Millville, NJ 08332

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bacon Elementary School",'Millville=' + Millville.length); Bridgeton[Bridgeton.length] = createMarker(new GPoint(-75.24623108,39.43795395),"
Bridgeton High School
111 N.west Avenue
Bridgeton, NJ 08302

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bridgeton High School",'Bridgeton=' + Bridgeton.length); Bridgeton[Bridgeton.length] = createMarker(new GPoint(-75.24542236,39.42969513),"
Bridgeton Middle School
550 Buckshutem Rd
Bridgeton, NJ 08302

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bridgeton Middle School",'Bridgeton=' + Bridgeton.length); Bridgeton[Bridgeton.length] = createMarker(new GPoint(-75.23406400,39.42947500),"
Broad Street Elementary School
251 West Broad Street
Bridgeton, NJ 08302

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Broad Street Elementary School",'Bridgeton=' + Bridgeton.length); Bridgeton[Bridgeton.length] = createMarker(new GPoint(-75.21455383,39.42436600),"
Buckshutem Road Elementary School
550 Buckshutem Road
Bridgeton, NJ 08302

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Buckshutem Road Elementary School",'Bridgeton=' + Bridgeton.length); Vineland[Vineland.length] = createMarker(new GPoint(-75.02764893,39.43962479),"
Butler Ave Elementary School
1045 E Butler Ave
Vineland, NJ 08360

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Butler Ave Elementary School",'Vineland=' + Vineland.length); Seabrook[Seabrook.length] = createMarker(new GPoint(-75.24019623,39.44580078),"
Charles F Seabrook School
1373 Highway 77
Seabrook, NJ 08302

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Charles F Seabrook School",'Seabrook=' + Seabrook.length); Bridgeton[Bridgeton.length] = createMarker(new GPoint(-75.22352600,39.41935349),"
Cherry Street Elementary School
11 Cherry Street
Bridgeton, NJ 08302

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cherry Street Elementary School",'Bridgeton=' + Bridgeton.length); Millville[Millville.length] = createMarker(new GPoint(-74.99531000,39.38812400),"
Child Family Center
2509 East Main Street
Millville, NJ 08332

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Child Family Center",'Millville=' + Millville.length); Bridgeton[Bridgeton.length] = createMarker(new GPoint(-75.15757751,39.46087265),"
Cumberland Co Technical Ed Ct High School
601 Bridgeton Avenue
Bridgeton, NJ 08302

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cumberland Co Technical Ed Ct High School",'Bridgeton=' + Bridgeton.length); Seabrook[Seabrook.length] = createMarker(new GPoint(-75.23459625,39.44419861),"
Cumberland Regional High School
P O Box 5115
Seabrook, NJ 08302

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cumberland Regional High School",'Seabrook=' + Seabrook.length); Vineland[Vineland.length] = createMarker(new GPoint(-75.01671600,39.48255920),"
Cunningham Elementary School
315 S East Ave
Vineland, NJ 08360

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cunningham Elementary School",'Vineland=' + Vineland.length); Vineland[Vineland.length] = createMarker(new GPoint(-75.02610900,39.48619500),"
D'ippolito Intermediate
41578 North Valley Ave.
Vineland, NJ 08360

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("D'ippolito Intermediate",'Vineland=' + Vineland.length); Vineland[Vineland.length] = createMarker(new GPoint(-75.05258942,39.48392868),"
Dane Barse Elementary School
240 S Orchard Rd
Vineland, NJ 08360

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Dane Barse Elementary School",'Vineland=' + Vineland.length); Rosenhayn[Rosenhayn.length] = createMarker(new GPoint(-75.13159943,39.47800064),"
Deerfield Elementary School
Box 375 Morton Ave
Rosenhayn, NJ 08352

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Deerfield Elementary School",'Rosenhayn=' + Rosenhayn.length); Newport[Newport.length] = createMarker(new GPoint(-75.16469574,39.29682922),"
Downe Township Elementary School
220 Main St.
Newport, NJ 08345

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Downe Township Elementary School",'Newport=' + Newport.length); Vineland[Vineland.length] = createMarker(new GPoint(-75.02204132,39.45213318),"
Dr. William Mennies Elementary School
361 East Grant Avenue
Vineland, NJ 08360

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Dr. William Mennies Elementary School",'Vineland=' + Vineland.length); Vineland[Vineland.length] = createMarker(new GPoint(-74.94649506,39.45458984),"
East Vineland High School
1898 Panther Rd
Vineland, NJ 08360

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("East Vineland High School",'Vineland=' + Vineland.length); Seabrook[Seabrook.length] = createMarker(new GPoint(-75.24019623,39.44580078),"
Elizabeth F Moore School
1373 Highway 77
Seabrook, NJ 08302

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Elizabeth F Moore School",'Seabrook=' + Seabrook.length); Bridgeton[Bridgeton.length] = createMarker(new GPoint(-75.24019623,39.44580078),"
Fairfield T Middle Gouldt
1112 Bridgeton-millville Pike
Bridgeton, NJ 08302

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Fairfield T Middle Gouldt",'Bridgeton=' + Bridgeton.length); Bridgeton[Bridgeton.length] = createMarker(new GPoint(-75.21952820,39.38091278),"
Fairfield T Prim Fairton Elementary School
13 Ramah Road
Bridgeton, NJ 08302

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fairfield T Prim Fairton Elementary School",'Bridgeton=' + Bridgeton.length); Port_Norris[Port_Norris.length] = createMarker(new GPoint(-75.05609894,39.26089859),"
Haleyville-mauricetown Elementary School
P. O. Box 650
Port Norris, NJ 08349

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Haleyville-mauricetown Elementary School",'Port_Norris=' + Port_Norris.length); Millville[Millville.length] = createMarker(new GPoint(-74.99313354,39.38733673),"
Holly Heights Elementary School
2509 E Main St
Millville, NJ 08332

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Holly Heights Elementary School",'Millville=' + Millville.length); Bridgeton[Bridgeton.length] = createMarker(new GPoint(-75.26148224,39.45535660),"
Hopewell Crest Elementary School
122 Sewall Road
Bridgeton, NJ 08302

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hopewell Crest Elementary School",'Bridgeton=' + Bridgeton.length); Bridgeton[Bridgeton.length] = createMarker(new GPoint(-75.21842194,39.43963623),"
Indian Ave Elementary School
399 Indian Avenue
Bridgeton, NJ 08302

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Indian Ave Elementary School",'Bridgeton=' + Bridgeton.length); Vineland[Vineland.length] = createMarker(new GPoint(-75.02010345,39.48949814),"
John H Winslow Elementary School
1335 Magnolia Rd
Vineland, NJ 08360

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("John H Winslow Elementary School",'Vineland=' + Vineland.length); Vineland[Vineland.length] = createMarker(new GPoint(-75.02010345,39.48949814),"
Johnstone Elementary School
165 S. Brewster Rd.
Vineland, NJ 08360

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Johnstone Elementary School",'Vineland=' + Vineland.length); Millville[Millville.length] = createMarker(new GPoint(-75.05692291,39.39751434),"
Lakeside Middle School
2 N. Sharp St.
Millville, NJ 08332

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Lakeside Middle School",'Millville=' + Millville.length); Vineland[Vineland.length] = createMarker(new GPoint(-75.03828430,39.48665237),"
Landis Intermediate School
61 W Landis Ave
Vineland, NJ 08360

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Landis Intermediate School",'Vineland=' + Vineland.length); Vineland[Vineland.length] = createMarker(new GPoint(-95.94256592,41.25243759),"
Liberty Elementary School
315 S East Ave
Vineland, NJ 08360

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Liberty Elementary School",'Vineland=' + Vineland.length); Vineland[Vineland.length] = createMarker(new GPoint(-75.02971649,39.52651596),"
Marie Durand Elementary School
371 W Forest Grove Rd
Vineland, NJ 08360

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Marie Durand Elementary School",'Vineland=' + Vineland.length); Vineland[Vineland.length] = createMarker(new GPoint(-75.02095795,39.48461151),"
Maurice Fels Middle School
121 S Seventh St
Vineland, NJ 08360

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Maurice Fels Middle School",'Vineland=' + Vineland.length); Port_Elizabeth[Port_Elizabeth.length] = createMarker(new GPoint(-74.88950348,39.39319992),"
Maurice River Township Elementary School
Drawer D S Delsea Dr
Port Elizabeth, NJ 08348

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Maurice River Township Elementary School",'Port_Elizabeth=' + Port_Elizabeth.length); Vineland[Vineland.length] = createMarker(new GPoint(-75.03470612,39.49456024),"
Max Leuchter Elementary School
519 N West Ave
Vineland, NJ 08360

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Max Leuchter Elementary School",'Vineland=' + Vineland.length); Millville[Millville.length] = createMarker(new GPoint(-75.03286743,39.40201950),"
Memorial High School
504 East Broad Street
Millville, NJ 08332

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Memorial High School",'Millville=' + Millville.length); Millville[Millville.length] = createMarker(new GPoint(-75.01853180,39.39184952),"
Millville Senior High School
200 Wade Blvd
Millville, NJ 08332

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Millville Senior High School",'Millville=' + Millville.length); Greenwich[Greenwich.length] = createMarker(new GPoint(-75.34255219,39.40021515),"
Morris Goodwin Elementary School
839 Ye Greate Street
Greenwich, NJ 08323

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Morris Goodwin Elementary School",'Greenwich=' + Greenwich.length); Millville[Millville.length] = createMarker(new GPoint(-75.06227875,39.39934540),"
Mount Pleasant Elementary School
100 Carmel Rd
Millville, NJ 08332

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mount Pleasant Elementary School",'Millville=' + Millville.length); Cedarville[Cedarville.length] = createMarker(new GPoint(-75.20372772,39.33899689),"
Myron L Powell Elementary School
225 Main Street
Cedarville, NJ 08311

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Myron L Powell Elementary School",'Cedarville=' + Cedarville.length); Vineland[Vineland.length] = createMarker(new GPoint(-74.99725342,39.48472977),"
Nash Education Center
1669 East Landis Avenue
Vineland, NJ 08361

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Nash Education Center",'Vineland=' + Vineland.length); Vineland[Vineland.length] = createMarker(new GPoint(-74.99547577,39.49940109),"
Oak And Main Elementary School
1564 E Oak Rd
Vineland, NJ 08360

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Oak And Main Elementary School",'Vineland=' + Vineland.length); Port_Norris[Port_Norris.length] = createMarker(new GPoint(-75.05609894,39.26089859),"
Port Norris Middle School
P. O. Box 670
Port Norris, NJ 08349

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Port Norris Middle School",'Port_Norris=' + Port_Norris.length); Bridgeton[Bridgeton.length] = createMarker(new GPoint(-75.24830627,39.42028427),"
Quarter Mile Lane Elementary School
300 Quarter Mile Lane
Bridgeton, NJ 08302

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Quarter Mile Lane Elementary School",'Bridgeton=' + Bridgeton.length); Millville[Millville.length] = createMarker(new GPoint(-75.04202271,39.40321350),"
R D Wood Elementary School
700 Archer St
Millville, NJ 08332

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("R D Wood Elementary School",'Millville=' + Millville.length); Millville[Millville.length] = createMarker(new GPoint(-75.07536316,39.39016342),"
Rieck Ave Elementary School
339 Rieck Avenue
Millville, NJ 08332

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Rieck Ave Elementary School",'Millville=' + Millville.length); Newport[Newport.length] = createMarker(new GPoint(-75.17240143,39.27299881),"
School On Wheels High School
220 Main St.
Newport, NJ 08345

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("School On Wheels High School",'Newport=' + Newport.length); Shiloh[Shiloh.length] = createMarker(new GPoint(-75.29979706,39.45890045),"
Shiloh Elementary School
Main St Po Box 189
Shiloh, NJ 08353

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Shiloh Elementary School",'Shiloh=' + Shiloh.length); Millville[Millville.length] = createMarker(new GPoint(-75.04339600,39.38642120),"
Silver Run School
301 Silver Run Road
Millville, NJ 08332

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Silver Run School",'Millville=' + Millville.length); Vineland[Vineland.length] = createMarker(new GPoint(-75.02456665,39.54662704),"
South Vineland Elementary School
2831 S E Boulevard
Vineland, NJ 08360

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("South Vineland Elementary School",'Vineland=' + Vineland.length); Bridgeton[Bridgeton.length] = createMarker(new GPoint(-75.34358978,39.45254898),"
Stow Creek Township Elementary School
11 Gum Tree Corner Road
Bridgeton, NJ 08302

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Stow Creek Township Elementary School",'Bridgeton=' + Bridgeton.length); Vineland[Vineland.length] = createMarker(new GPoint(-75.00099945,39.47885132),"
Veterans Memorial Intermediate School
424 S Main Rd
Vineland, NJ 08360

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Veterans Memorial Intermediate School",'Vineland=' + Vineland.length); Vineland[Vineland.length] = createMarker(new GPoint(-75.00752258,39.47801590),"
Vineland Senior High-north
3010 E Chestnut Ave
Vineland, NJ 08360

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Vineland Senior High-north",'Vineland=' + Vineland.length); Vineland[Vineland.length] = createMarker(new GPoint(-75.00752258,39.47801590),"
Vineland Senior High-south High School
2880 E Chestnut Ave
Vineland, NJ 08360

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Vineland Senior High-south High School",'Vineland=' + Vineland.length); Bridgeton[Bridgeton.length] = createMarker(new GPoint(-75.24642181,39.43467712),"
West Ave Elementary School
51 North West Avenue
Bridgeton, NJ 08302

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("West Ave Elementary School",'Bridgeton=' + Bridgeton.length); Seabrook[Seabrook.length] = createMarker(new GPoint(-75.24019623,39.44580078),"
Woodruff School
1373 Highway 77
Seabrook, NJ 08302

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Woodruff School",'Seabrook=' + Seabrook.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(Bridgeton); map.removeOverlays(Cedarville); map.removeOverlays(Greenwich); map.removeOverlays(Millville); map.removeOverlays(Newport); map.removeOverlays(Port_Elizabeth); map.removeOverlays(Port_Norris); map.removeOverlays(Rosenhayn); map.removeOverlays(Seabrook); map.removeOverlays(Shiloh); map.removeOverlays(Vineland); 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(Vineland);map.removeOverlays(Bridgeton); map.removeOverlays(Cedarville); map.removeOverlays(Greenwich); map.removeOverlays(Millville); map.removeOverlays(Newport); map.removeOverlays(Port_Elizabeth); map.removeOverlays(Port_Norris); map.removeOverlays(Rosenhayn); map.removeOverlays(Seabrook); map.removeOverlays(Shiloh); map.removeOverlays(Vineland); map.addOverlays(Bridgeton); centerByArray(Bridgeton, false, false); cntMarker += Bridgeton.length; map.addOverlays(Cedarville); centerByArray(Cedarville, false, false); cntMarker += Cedarville.length; map.addOverlays(Greenwich); centerByArray(Greenwich, false, false); cntMarker += Greenwich.length; map.addOverlays(Millville); centerByArray(Millville, false, false); cntMarker += Millville.length; map.addOverlays(Newport); centerByArray(Newport, false, false); cntMarker += Newport.length; map.addOverlays(Port_Elizabeth); centerByArray(Port_Elizabeth, false, false); cntMarker += Port_Elizabeth.length; map.addOverlays(Port_Norris); centerByArray(Port_Norris, false, false); cntMarker += Port_Norris.length; map.addOverlays(Rosenhayn); centerByArray(Rosenhayn, false, false); cntMarker += Rosenhayn.length; map.addOverlays(Seabrook); centerByArray(Seabrook, false, false); cntMarker += Seabrook.length; map.addOverlays(Shiloh); centerByArray(Shiloh, false, false); cntMarker += Shiloh.length; map.addOverlays(Vineland); centerByArray(Vineland, false, false); cntMarker += Vineland.length; centerByArray(Vineland,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'); } }