function addMarkers() { mySelect = document.getElementById('selection'); Pittstown = [];Flemington = [];Bloomsbury = [];Califon = [];Clinton = [];Ringoes = [];Sergeantsville = [];Frenchtown = [];Lambertville = [];Lebanon = [];Asbury = [];Quakertown = [];Hampton = [];High_Bridge = [];Whitehouse_Station = [];Milford = [];Annandale = [];Stockton = [];Three_Bridges = [];Glen_Gardner = [];mySelect.options[mySelect.options.length] = new Option("Annandale schools",'all=Annandale'); mySelect.options[mySelect.options.length] = new Option("Asbury schools",'all=Asbury'); mySelect.options[mySelect.options.length] = new Option("Bloomsbury schools",'all=Bloomsbury'); mySelect.options[mySelect.options.length] = new Option("Califon schools",'all=Califon'); mySelect.options[mySelect.options.length] = new Option("Clinton schools",'all=Clinton'); mySelect.options[mySelect.options.length] = new Option("Flemington schools",'all=Flemington'); mySelect.options[mySelect.options.length] = new Option("Frenchtown schools",'all=Frenchtown'); mySelect.options[mySelect.options.length] = new Option("Glen Gardner schools",'all=Glen_Gardner'); mySelect.options[mySelect.options.length] = new Option("Hampton schools",'all=Hampton'); mySelect.options[mySelect.options.length] = new Option("High Bridge schools",'all=High_Bridge'); mySelect.options[mySelect.options.length] = new Option("Lambertville schools",'all=Lambertville'); mySelect.options[mySelect.options.length] = new Option("Lebanon schools",'all=Lebanon'); mySelect.options[mySelect.options.length] = new Option("Milford schools",'all=Milford'); mySelect.options[mySelect.options.length] = new Option("Pittstown schools",'all=Pittstown'); mySelect.options[mySelect.options.length] = new Option("Quakertown schools",'all=Quakertown'); mySelect.options[mySelect.options.length] = new Option("Ringoes schools",'all=Ringoes'); mySelect.options[mySelect.options.length] = new Option("Sergeantsville schools",'all=Sergeantsville'); mySelect.options[mySelect.options.length] = new Option("Stockton schools",'all=Stockton'); mySelect.options[mySelect.options.length] = new Option("Three Bridges schools",'all=Three_Bridges'); mySelect.options[mySelect.options.length] = new Option("Whitehouse Station schools",'all=Whitehouse_Station'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Pittstown[Pittstown.length] = createMarker(new GPoint(-75.01696014,40.56974030),"
Alexandria School
557 County Road 513
Pittstown, NJ 08867

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Alexandria School",'Pittstown=' + Pittstown.length); Flemington[Flemington.length] = createMarker(new GPoint(-74.82430267,40.49413300),"
Barley Sheaf Elementary School
80 Barley Sheaf Road
Flemington, NJ 08822

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Barley Sheaf Elementary School",'Flemington=' + Flemington.length); Flemington[Flemington.length] = createMarker(new GPoint(-74.85441900,40.53574100),"
Bartels Corner
8 Bartles Corner Road
Flemington, NJ 08822

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bartels Corner",'Flemington=' + Flemington.length); Bloomsbury[Bloomsbury.length] = createMarker(new GPoint(-75.08570862,40.65467072),"
Bloomsbury Borough Elementary School
20 Main St., Po Box 375
Bloomsbury, NJ 08804

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bloomsbury Borough Elementary School",'Bloomsbury=' + Bloomsbury.length); Califon[Califon.length] = createMarker(new GPoint(-74.84007263,40.72442627),"
Califon Borough Elementary School
6 School Street
Califon, NJ 07830

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Califon Borough Elementary School",'Califon=' + Califon.length); Flemington[Flemington.length] = createMarker(new GPoint(-74.86380300,40.48146800),"
Central
84 Route 31
Flemington, NJ 08822

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Central",'Flemington=' + Flemington.length); Clinton[Clinton.length] = createMarker(new GPoint(-74.90764618,40.63514709),"
Clinton Town Elementary School
10 School Street
Clinton, NJ 08809

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Clinton Town Elementary School",'Clinton=' + Clinton.length); Ringoes[Ringoes.length] = createMarker(new GPoint(-74.84950256,40.44729996),"
Copper Hill School
100 Everitts Rd.
Ringoes, NJ 08551

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Copper Hill School",'Ringoes=' + Ringoes.length); Sergeantsville[Sergeantsville.length] = createMarker(new GPoint(-74.93666077,40.44653702),"
Delaware Township No 1 Elementary School
501 Rosemont-ringoes Road
Sergeantsville, NJ 08557

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Delaware Township No 1 Elementary School",'Sergeantsville=' + Sergeantsville.length); Frenchtown[Frenchtown.length] = createMarker(new GPoint(-75.01096344,40.56160736),"
Delaware Valley Regional High School
19 Senator Stout Rd.
Frenchtown, NJ 08825

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Delaware Valley Regional High School",'Frenchtown=' + Frenchtown.length); Lambertville[Lambertville.length] = createMarker(new GPoint(-74.92420197,40.37340164),"
E S C School
1422 State Hwy. 179
Lambertville, NJ 08530

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("E S C School",'Lambertville=' + Lambertville.length); Lebanon[Lebanon.length] = createMarker(new GPoint(-74.78184400,40.70379500),"
E S C Tewksbury
51 Sawmill Road
Lebanon, NJ 08833

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("E S C Tewksbury",'Lebanon=' + Lebanon.length); Ringoes[Ringoes.length] = createMarker(new GPoint(-74.85874176,40.42838287),"
East Amwell Township Elementary School
43 Wertsville Rd.
Ringoes, NJ 08551

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("East Amwell Township Elementary School",'Ringoes=' + Ringoes.length); Frenchtown[Frenchtown.length] = createMarker(new GPoint(-75.06272888,40.53404236),"
Edith Ort Thomas Elementary School
902 Harrison St.
Frenchtown, NJ 08825

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Edith Ort Thomas Elementary School",'Frenchtown=' + Frenchtown.length); Asbury[Asbury.length] = createMarker(new GPoint(-75.03255463,40.66645432),"
Ethel Hoppock Elementary School
280 Asburywest Portal Rd.
Asbury, NJ 08802

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Ethel Hoppock Elementary School",'Asbury=' + Asbury.length); Flemington[Flemington.length] = createMarker(new GPoint(-74.86381531,40.54049683),"
F A Desmares Elementary School
16 Old Clinton Road
Flemington, NJ 08822

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("F A Desmares Elementary School",'Flemington=' + Flemington.length); Quakertown[Quakertown.length] = createMarker(new GPoint(-74.94190216,40.56549835),"
Franklin Township Elementary School
226 Quakertown Road
Quakertown, NJ 08868

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Franklin Township Elementary School",'Quakertown=' + Quakertown.length); Hampton[Hampton.length] = createMarker(new GPoint(-74.95568848,40.70599365),"
Hampton Boro Elementary School
32-41 South Street
Hampton, NJ 08827

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hampton Boro Elementary School",'Hampton=' + Hampton.length); High_Bridge[High_Bridge.length] = createMarker(new GPoint(-74.89161682,40.66878891),"
High Bridge Elementary School
50 Thomas Street
High Bridge, NJ 08829

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("High Bridge Elementary School",'High_Bridge=' + High_Bridge.length); High_Bridge[High_Bridge.length] = createMarker(new GPoint(-74.89161682,40.66878891),"
High Bridge Middle School
50 Thomas St.
High Bridge, NJ 08829

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("High Bridge Middle School",'High_Bridge=' + High_Bridge.length); Whitehouse_Station[Whitehouse_Station.length] = createMarker(new GPoint(-74.76000977,40.58851624),"
Holland Brook School
52 Readington Road
Whitehouse Station, NJ 08889

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Holland Brook School",'Whitehouse_Station=' + Whitehouse_Station.length); Milford[Milford.length] = createMarker(new GPoint(-75.10030365,40.59069824),"
Holland Township Elementary School
714 Milford-warren Glen Road
Milford, NJ 08848

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Holland Township Elementary School",'Milford=' + Milford.length); Milford[Milford.length] = createMarker(new GPoint(-75.10030365,40.59069824),"
Holland Township Middle School
710 Milford-warren Glen Road
Milford, NJ 08848

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Holland Township Middle School",'Milford=' + Milford.length); Milford[Milford.length] = createMarker(new GPoint(-75.09479400,40.56932000),"
Holland Twp Elementary School
714 Milford-warren Glen Road
Milford, NJ 08848

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Holland Twp Elementary School",'Milford=' + Milford.length); Flemington[Flemington.length] = createMarker(new GPoint(-74.85119629,40.51530075),"
Hunterdon Central High School
84 Route 31
Flemington, NJ 08822

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hunterdon Central High School",'Flemington=' + Flemington.length); Flemington[Flemington.length] = createMarker(new GPoint(-74.83219600,40.50114400),"
J.p. Case Middle School
301 Case Boulevard
Flemington, NJ 08822

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("J.p. Case Middle School",'Flemington=' + Flemington.length); Frenchtown[Frenchtown.length] = createMarker(new GPoint(-75.01276398,40.50675201),"
Kingwood Township Elementary School
880 County Road 519
Frenchtown, NJ 08825

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Kingwood Township Elementary School",'Frenchtown=' + Frenchtown.length); Lambertville[Lambertville.length] = createMarker(new GPoint(-74.94492340,40.37317657),"
Lambertville Elementary School
200 North Main Street
Lambertville, NJ 08530

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lambertville Elementary School",'Lambertville=' + Lambertville.length); Lebanon[Lebanon.length] = createMarker(new GPoint(-74.83625031,40.63991547),"
Lebanon Borough Elementary School
6 Maple St.
Lebanon, NJ 08833

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lebanon Borough Elementary School",'Lebanon=' + Lebanon.length); Pittstown[Pittstown.length] = createMarker(new GPoint(-75.01696014,40.56974030),"
Lester D Wilson Elementary School
557 County Road 513
Pittstown, NJ 08867

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lester D Wilson Elementary School",'Pittstown=' + Pittstown.length); Milford[Milford.length] = createMarker(new GPoint(-75.09294891,40.56889343),"
Milford Boro Elementary School
7 Hillside Avenue
Milford, NJ 08848

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Milford Boro Elementary School",'Milford=' + Milford.length); Annandale[Annandale.length] = createMarker(new GPoint(-74.89218200,40.63948600),"
North Hunterdon
1445 Route 31
Annandale, NJ 08801

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("North Hunterdon",'Annandale=' + Annandale.length); Annandale[Annandale.length] = createMarker(new GPoint(-74.88327789,40.63065720),"
North Hunterdon Regional High School
1445 State Route 31
Annandale, NJ 08801

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("North Hunterdon Regional High School",'Annandale=' + Annandale.length); Califon[Califon.length] = createMarker(new GPoint(-74.77389526,40.70489883),"
Old Turnpike School
171 Old Turnpike Road
Califon, NJ 07830

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Old Turnpike School",'Califon=' + Califon.length); Lebanon[Lebanon.length] = createMarker(new GPoint(-74.87408447,40.61135483),"
Patrick Mcgaheran Elementary School
63 Allerton Road
Lebanon, NJ 08833

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Patrick Mcgaheran Elementary School",'Lebanon=' + Lebanon.length); Flemington[Flemington.length] = createMarker(new GPoint(-74.86353302,40.51023483),"
Reading-fleming Middle School
50 Court Street
Flemington, NJ 08822

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Reading-fleming Middle School",'Flemington=' + Flemington.length); Whitehouse_Station[Whitehouse_Station.length] = createMarker(new GPoint(-74.76121521,40.58897018),"
Readington Middle School
48 Readington Rd.
Whitehouse Station, NJ 08889

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Readington Middle School",'Whitehouse_Station=' + Whitehouse_Station.length); Flemington[Flemington.length] = createMarker(new GPoint(-74.87412262,40.50483322),"
Robert Hunter Elementary School
8 Dayton Road
Flemington, NJ 08822

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Robert Hunter Elementary School",'Flemington=' + Flemington.length); Lebanon[Lebanon.length] = createMarker(new GPoint(-74.83020782,40.65372086),"
Round Valley Middle School
128 Cokesbury Rd
Lebanon, NJ 08833

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Round Valley Middle School",'Lebanon=' + Lebanon.length); Lambertville[Lambertville.length] = createMarker(new GPoint(-74.92420197,40.37340164),"
S Hunterdon Regional High School
301 Mt. Airy-harbourton Road
Lambertville, NJ 08530

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("S Hunterdon Regional High School",'Lambertville=' + Lambertville.length); Flemington[Flemington.length] = createMarker(new GPoint(-74.85119629,40.51530075),"
Sandhill School
215 Route 31
Flemington, NJ 08822

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sandhill School",'Flemington=' + Flemington.length); Lebanon[Lebanon.length] = createMarker(new GPoint(-74.78218079,40.70335007),"
Sawmill Elementary School
51 Sawmill Road
Lebanon, NJ 08833

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sawmill Elementary School",'Lebanon=' + Lebanon.length); Clinton[Clinton.length] = createMarker(new GPoint(-74.89213562,40.64087296),"
Spruce Run Elementary School
27 Belvidere Avenue
Clinton, NJ 08809

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Spruce Run Elementary School",'Clinton=' + Clinton.length); Stockton[Stockton.length] = createMarker(new GPoint(-74.97603607,40.40537643),"
Stockton Boro Elementary School
19 South Main Street
Stockton, NJ 08859

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Stockton Boro Elementary School",'Stockton=' + Stockton.length); Califon[Califon.length] = createMarker(new GPoint(-74.76092100,40.72595400),"
Tewksbury Elementary School
109 Fairmount Road East
Califon, NJ 07830

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Tewksbury Elementary School",'Califon=' + Califon.length); Asbury[Asbury.length] = createMarker(new GPoint(-74.99309540,40.68217468),"
Thomas B. Conley Elementary School
940 Iron Bridge Rd.
Asbury, NJ 08802

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Thomas B. Conley Elementary School",'Asbury=' + Asbury.length); Three_Bridges[Three_Bridges.length] = createMarker(new GPoint(-74.79656982,40.52462006),"
Three Bridges Elementary School
480 Main Street
Three Bridges, NJ 08887

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Three Bridges Elementary School",'Three_Bridges=' + Three_Bridges.length); Hampton[Hampton.length] = createMarker(new GPoint(-74.96926880,40.62993622),"
Union Township Elementary School
165 Perryville Road
Hampton, NJ 08827

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Union Township Elementary School",'Hampton=' + Hampton.length); Califon[Califon.length] = createMarker(new GPoint(-74.80419922,40.71889877),"
Valley View Elementary School
400 Route 513
Califon, NJ 07830

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Valley View Elementary School",'Califon=' + Califon.length); Glen_Gardner[Glen_Gardner.length] = createMarker(new GPoint(-74.88693900,40.69593200),"
Voorhees
256 Route 513
Glen Gardner, NJ 08826

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Voorhees",'Glen_Gardner=' + Glen_Gardner.length); Glen_Gardner[Glen_Gardner.length] = createMarker(new GPoint(-74.88695526,40.69542694),"
Voorhees High School
256 County Road 513
Glen Gardner, NJ 08826

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Voorhees High School",'Glen_Gardner=' + Glen_Gardner.length); Lambertville[Lambertville.length] = createMarker(new GPoint(-74.92420197,40.37340164),"
West Amwell Township Elementary School
1417 Route 179
Lambertville, NJ 08530

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("West Amwell Township Elementary School",'Lambertville=' + Lambertville.length); Whitehouse_Station[Whitehouse_Station.length] = createMarker(new GPoint(-74.76165009,40.61484528),"
Whitehouse Elementary School
50 Whitehouse Ave.
Whitehouse Station, NJ 08889

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Whitehouse Elementary School",'Whitehouse_Station=' + Whitehouse_Station.length); Califon[Califon.length] = createMarker(new GPoint(-74.88472748,40.71144867),"
Woodglen Middle School
70 Bunnvale Road
Califon, NJ 07830

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Woodglen Middle School",'Califon=' + Califon.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(Annandale); map.removeOverlays(Asbury); map.removeOverlays(Bloomsbury); map.removeOverlays(Califon); map.removeOverlays(Clinton); map.removeOverlays(Flemington); map.removeOverlays(Frenchtown); map.removeOverlays(Glen_Gardner); map.removeOverlays(Hampton); map.removeOverlays(High_Bridge); map.removeOverlays(Lambertville); map.removeOverlays(Lebanon); map.removeOverlays(Milford); map.removeOverlays(Pittstown); map.removeOverlays(Quakertown); map.removeOverlays(Ringoes); map.removeOverlays(Sergeantsville); map.removeOverlays(Stockton); map.removeOverlays(Three_Bridges); map.removeOverlays(Whitehouse_Station); 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(Pittstown);map.removeOverlays(Annandale); map.removeOverlays(Asbury); map.removeOverlays(Bloomsbury); map.removeOverlays(Califon); map.removeOverlays(Clinton); map.removeOverlays(Flemington); map.removeOverlays(Frenchtown); map.removeOverlays(Glen_Gardner); map.removeOverlays(Hampton); map.removeOverlays(High_Bridge); map.removeOverlays(Lambertville); map.removeOverlays(Lebanon); map.removeOverlays(Milford); map.removeOverlays(Pittstown); map.removeOverlays(Quakertown); map.removeOverlays(Ringoes); map.removeOverlays(Sergeantsville); map.removeOverlays(Stockton); map.removeOverlays(Three_Bridges); map.removeOverlays(Whitehouse_Station); map.addOverlays(Annandale); centerByArray(Annandale, false, false); cntMarker += Annandale.length; map.addOverlays(Asbury); centerByArray(Asbury, false, false); cntMarker += Asbury.length; map.addOverlays(Bloomsbury); centerByArray(Bloomsbury, false, false); cntMarker += Bloomsbury.length; map.addOverlays(Califon); centerByArray(Califon, false, false); cntMarker += Califon.length; map.addOverlays(Clinton); centerByArray(Clinton, false, false); cntMarker += Clinton.length; map.addOverlays(Flemington); centerByArray(Flemington, false, false); cntMarker += Flemington.length; map.addOverlays(Frenchtown); centerByArray(Frenchtown, false, false); cntMarker += Frenchtown.length; map.addOverlays(Glen_Gardner); centerByArray(Glen_Gardner, false, false); cntMarker += Glen_Gardner.length; map.addOverlays(Hampton); centerByArray(Hampton, false, false); cntMarker += Hampton.length; map.addOverlays(High_Bridge); centerByArray(High_Bridge, false, false); cntMarker += High_Bridge.length; map.addOverlays(Lambertville); centerByArray(Lambertville, false, false); cntMarker += Lambertville.length; map.addOverlays(Lebanon); centerByArray(Lebanon, false, false); cntMarker += Lebanon.length; map.addOverlays(Milford); centerByArray(Milford, false, false); cntMarker += Milford.length; map.addOverlays(Pittstown); centerByArray(Pittstown, false, false); cntMarker += Pittstown.length; map.addOverlays(Quakertown); centerByArray(Quakertown, false, false); cntMarker += Quakertown.length; map.addOverlays(Ringoes); centerByArray(Ringoes, false, false); cntMarker += Ringoes.length; map.addOverlays(Sergeantsville); centerByArray(Sergeantsville, false, false); cntMarker += Sergeantsville.length; map.addOverlays(Stockton); centerByArray(Stockton, false, false); cntMarker += Stockton.length; map.addOverlays(Three_Bridges); centerByArray(Three_Bridges, false, false); cntMarker += Three_Bridges.length; map.addOverlays(Whitehouse_Station); centerByArray(Whitehouse_Station, false, false); cntMarker += Whitehouse_Station.length; centerByArray(Pittstown,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'); } }