function addMarkers(){ mySelect = document.getElementById('selection'); Havelock = [];Asheville = [];Kernersville = [];Burlington = [];Raleigh = [];Charlotte = [];Hendersonville = [];Durham = [];High_Point = [];Jacksonville = [];Greensboro = [];Winston_Salem = [];Rocky_Mount = [];Southern_Pines = [];Salisbury = [];Wake_Forest = [];Morehead_City = [];Hillsborough = [];Wilmington = [];Goldsboro = [];Cary = [];Gastonia = [];Fayetteville = [];Chapel_Hill = [];New_Bern = [];Greenville = [];mySelect.options[mySelect.options.length] = new Option("Asheville schools",'all=Asheville'); mySelect.options[mySelect.options.length] = new Option("Burlington schools",'all=Burlington'); mySelect.options[mySelect.options.length] = new Option("Cary schools",'all=Cary'); mySelect.options[mySelect.options.length] = new Option("Chapel Hill schools",'all=Chapel_Hill'); mySelect.options[mySelect.options.length] = new Option("Charlotte schools",'all=Charlotte'); mySelect.options[mySelect.options.length] = new Option("Durham schools",'all=Durham'); mySelect.options[mySelect.options.length] = new Option("Fayetteville schools",'all=Fayetteville'); mySelect.options[mySelect.options.length] = new Option("Gastonia schools",'all=Gastonia'); mySelect.options[mySelect.options.length] = new Option("Goldsboro schools",'all=Goldsboro'); mySelect.options[mySelect.options.length] = new Option("Greensboro schools",'all=Greensboro'); mySelect.options[mySelect.options.length] = new Option("Greenville schools",'all=Greenville'); mySelect.options[mySelect.options.length] = new Option("Havelock schools",'all=Havelock'); mySelect.options[mySelect.options.length] = new Option("Hendersonville schools",'all=Hendersonville'); mySelect.options[mySelect.options.length] = new Option("High Point schools",'all=High_Point'); mySelect.options[mySelect.options.length] = new Option("Hillsborough schools",'all=Hillsborough'); mySelect.options[mySelect.options.length] = new Option("Jacksonville schools",'all=Jacksonville'); mySelect.options[mySelect.options.length] = new Option("Kernersville schools",'all=Kernersville'); mySelect.options[mySelect.options.length] = new Option("Morehead City schools",'all=Morehead_City'); mySelect.options[mySelect.options.length] = new Option("New Bern schools",'all=New_Bern'); mySelect.options[mySelect.options.length] = new Option("Raleigh schools",'all=Raleigh'); mySelect.options[mySelect.options.length] = new Option("Rocky Mount schools",'all=Rocky_Mount'); mySelect.options[mySelect.options.length] = new Option("Salisbury schools",'all=Salisbury'); mySelect.options[mySelect.options.length] = new Option("Southern Pines schools",'all=Southern_Pines'); mySelect.options[mySelect.options.length] = new Option("Wake Forest schools",'all=Wake_Forest'); mySelect.options[mySelect.options.length] = new Option("Wilmington schools",'all=Wilmington'); mySelect.options[mySelect.options.length] = new Option("Winston Salem schools",'all=Winston_Salem'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Havelock[Havelock.length] = createMarker(new GPoint(-76.90527000,34.87890100),"
Annunciation Catholic School
246 E Main Street
Havelock, NC 28532
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Annunciation Catholic School",'Havelock=' + Havelock.length); Asheville[Asheville.length] = createMarker(new GPoint(-82.55113500,35.63092100),"
Asheville Catholic School
12 Culvern Street
Asheville, NC 28804
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Asheville Catholic School",'Asheville=' + Asheville.length); Kernersville[Kernersville.length] = createMarker(new GPoint(-80.06258700,36.07803000),"
Bishop Mc Guinness High School
1725 Nc Highway 66 S
Kernersville, NC 27284
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bishop Mc Guinness High School",'Kernersville=' + Kernersville.length); Burlington[Burlington.length] = createMarker(new GPoint(-79.44583100,36.09410900),"
Blessed Sacrament School
515 Hillcrest Avenue
Burlington, NC 27215
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Blessed Sacrament School",'Burlington=' + Burlington.length); Raleigh[Raleigh.length] = createMarker(new GPoint(-78.72636800,35.80458300),"
Cardinal Gibbons High School
1401 Edwards Mill Road
Raleigh, NC 27607
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cardinal Gibbons High School",'Raleigh=' + Raleigh.length); Raleigh[Raleigh.length] = createMarker(new GPoint(-78.64192500,35.78063700),"
Cathedral School
204 Hillsborough Street
Raleigh, NC 27603
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cathedral School",'Raleigh=' + Raleigh.length); Raleigh[Raleigh.length] = createMarker(new GPoint(-78.69430000,35.87280000),"
The Franciscan School
10000 Saint Francis Drive
Raleigh, NC 27613
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Franciscan School",'Raleigh=' + Raleigh.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.85325400,35.18865600),"
Holy Trinity Catholic Middle School
3100 Park Road
Charlotte, NC 28209
Co-ed school, 6-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holy Trinity Catholic Middle School",'Charlotte=' + Charlotte.length); Hendersonville[Hendersonville.length] = createMarker(new GPoint(-82.46386000,35.31951400),"
Immaculata Catholic School
711 Buncombe Street
Hendersonville, NC 28791
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Immaculata Catholic School",'Hendersonville=' + Hendersonville.length); Durham[Durham.length] = createMarker(new GPoint(-78.91348400,35.99801100),"
Immaculata Catholic School
721 Burch Avenue
Durham, NC 27701
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Immaculata Catholic School",'Durham=' + Durham.length); High_Point[High_Point.length] = createMarker(new GPoint(-80.00364900,35.96743700),"
Immaculate Heart Of Mary
605 Barbee Street
High Point, NC 27262
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Immaculate Heart Of Mary",'High_Point=' + High_Point.length); Jacksonville[Jacksonville.length] = createMarker(new GPoint(-77.42600200,34.75348200),"
Infant Of Prague Catholic School
501 Bordeaux St
Jacksonville, NC 28546
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Infant Of Prague Catholic School",'Jacksonville=' + Jacksonville.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.75344600,35.23096400),"
Our Lady Of The Assumption Catholic School
4225 Shamrock Dr
Charlotte, NC 28215
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Our Lady Of The Assumption Catholic School",'Charlotte=' + Charlotte.length); Greensboro[Greensboro.length] = createMarker(new GPoint(-79.82105700,36.07381200),"
Our Lady Of Grace Elementary School
2205 W Market Street
Greensboro, NC 27403
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Our Lady Of Grace Elementary School",'Greensboro=' + Greensboro.length); Raleigh[Raleigh.length] = createMarker(new GPoint(-78.63449700,35.81871800),"
Our Lady Of Lourdes Elementary School
2710 Overbrook Drive
Raleigh, NC 27608
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Our Lady Of Lourdes Elementary School",'Raleigh=' + Raleigh.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.26148800,36.07067000),"
Our Lady Of Mercy School
1730 Link Road
Winston Salem, NC 27103
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Our Lady Of Mercy School",'Winston_Salem=' + Winston_Salem.length); Rocky_Mount[Rocky_Mount.length] = createMarker(new GPoint(-77.80059300,35.93896200),"
Our Lady Of Perpetual Help Catholic School
315 Hammond Street
Rocky Mount, NC 27804
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Our Lady Of Perpetual Help Catholic School",'Rocky_Mount=' + Rocky_Mount.length); Southern_Pines[Southern_Pines.length] = createMarker(new GPoint(-79.38804400,35.17454500),"
Pope John Paul II Catholic School
320 N Ashe Street
Southern Pines, NC 28387
Co-ed school, PK-7
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pope John Paul II Catholic School",'Southern_Pines=' + Southern_Pines.length); Salisbury[Salisbury.length] = createMarker(new GPoint(-80.47366000,35.67116500),"
Sacred Heart Elementary School
123 N Ellis Street
Salisbury, NC 28144
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sacred Heart Elementary School",'Salisbury=' + Salisbury.length); Wake_Forest[Wake_Forest.length] = createMarker(new GPoint(-78.52307600,35.97343800),"
St. Catherine Of Siena Catholic
520 West Holding Ave
Wake Forest, NC 27587
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Catherine Of Siena Catholic",'Wake_Forest=' + Wake_Forest.length); Morehead_City[Morehead_City.length] = createMarker(new GPoint(-76.72583400,34.72128200),"
St. Egbert Elementary School
1705 Evans Street
Morehead City, NC 28557
Co-ed school, K-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Egbert Elementary School",'Morehead_City=' + Morehead_City.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.27360500,36.10115100),"
St. Leo Parish School
333 Springdale Avenue
Winston Salem, NC 27104
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Leo Parish School",'Winston_Salem=' + Winston_Salem.length); Hillsborough[Hillsborough.length] = createMarker(new GPoint(-79.00131500,36.11693400),"
St. Mary Catholic School
7500 Schley Rd
Hillsborough, NC 27278
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Mary Catholic School",'Hillsborough=' + Hillsborough.length); Wilmington[Wilmington.length] = createMarker(new GPoint(-77.94420200,34.23289100),"
St. Mary Catholic School
217 South 4th St.
Wilmington, NC 28401
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Mary Catholic School",'Wilmington=' + Wilmington.length); Goldsboro[Goldsboro.length] = createMarker(new GPoint(-77.96976700,35.38648200),"
St. Mary School
1601 Edgerton Street
Goldsboro, NC 27530
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Mary School",'Goldsboro=' + Goldsboro.length); Cary[Cary.length] = createMarker(new GPoint(-78.82222300,35.78604000),"
St. Michael The Archangel School
810 High House Road
Cary, NC 27513
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Michael The Archangel School",'Cary=' + Cary.length); Gastonia[Gastonia.length] = createMarker(new GPoint(-81.19711800,35.24609100),"
St. Michael's Catholic School
704 Saint Michaels Lane
Gastonia, NC 28052
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Michael's Catholic School",'Gastonia=' + Gastonia.length); Fayetteville[Fayetteville.length] = createMarker(new GPoint(-78.92234600,35.03508300),"
St. Patrick School
1620 Marlborough Rd
Fayetteville, NC 28304
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Patrick School",'Fayetteville=' + Fayetteville.length); Raleigh[Raleigh.length] = createMarker(new GPoint(-78.61922900,35.86106400),"
St. Raphael Catholic School
5815 Fall Of Neuse Rd
Raleigh, NC 27609
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Raphael Catholic School",'Raleigh=' + Raleigh.length); Chapel_Hill[Chapel_Hill.length] = createMarker(new GPoint(-79.02929500,35.90615000),"
St. Thomas More School
920 Carmichael Street
Chapel Hill, NC 27514
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Thomas More School",'Chapel_Hill=' + Chapel_Hill.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.84889900,35.17977900),"
St Ann Catholic School
600 Hillside Avenue
Charlotte, NC 28209
Co-ed school, K-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Ann Catholic School",'Charlotte=' + Charlotte.length); Fayetteville[Fayetteville.length] = createMarker(new GPoint(-78.87392000,35.05516700),"
St Ann Elementary School
365 N Cool Spring Street
Fayetteville, NC 28301
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Ann Elementary School",'Fayetteville=' + Fayetteville.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.80683800,35.16984300),"
St Gabriel Catholic School
3028 Providence Road
Charlotte, NC 28211
Co-ed school, K-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Gabriel Catholic School",'Charlotte=' + Charlotte.length); Wilmington[Wilmington.length] = createMarker(new GPoint(-77.84895700,34.23778800),"
St Mark Catholic School
1013 Eastwood Road
Wilmington, NC 28403
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Mark Catholic School",'Wilmington=' + Wilmington.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.81547400,35.05602500),"
St Matthew Catholic School
11525 Elm Lane
Charlotte, NC 28277
Co-ed school, K-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Matthew Catholic School",'Charlotte=' + Charlotte.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.84529600,35.20526200),"
St Patrick Elementary School
1125 Buchanan Street
Charlotte, NC 28203
Co-ed school, K-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Patrick Elementary School",'Charlotte=' + Charlotte.length); New_Bern[New_Bern.length] = createMarker(new GPoint(-77.06978900,35.08400900),"
St Paul Education Center
3007 Country Club Road
New Bern, NC 28562
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Paul Education Center",'New_Bern=' + New_Bern.length); Greenville[Greenville.length] = createMarker(new GPoint(-77.34275200,35.60610400),"
St Peter's School
2606 E 5th Street
Greenville, NC 27858
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Peter's School",'Greenville=' + Greenville.length); Greensboro[Greensboro.length] = createMarker(new GPoint(-79.78772900,36.10284000),"
St Pius X Catholic School
2200 N Elm Street
Greensboro, NC 27408
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Pius X Catholic School",'Greensboro=' + Greensboro.length); map.removeOverlays(Asheville); map.removeOverlays(Burlington); map.removeOverlays(Cary); map.removeOverlays(Chapel_Hill); map.removeOverlays(Charlotte); map.removeOverlays(Durham); map.removeOverlays(Fayetteville); map.removeOverlays(Gastonia); map.removeOverlays(Goldsboro); map.removeOverlays(Greensboro); map.removeOverlays(Greenville); map.removeOverlays(Havelock); map.removeOverlays(Hendersonville); map.removeOverlays(High_Point); map.removeOverlays(Hillsborough); map.removeOverlays(Jacksonville); map.removeOverlays(Kernersville); map.removeOverlays(Morehead_City); map.removeOverlays(New_Bern); map.removeOverlays(Raleigh); map.removeOverlays(Rocky_Mount); map.removeOverlays(Salisbury); map.removeOverlays(Southern_Pines); map.removeOverlays(Wake_Forest); map.removeOverlays(Wilmington); map.removeOverlays(Winston_Salem); setTimeout(function(){map.addOverlays(Asheville)},1000); setTimeout(function(){map.addOverlays(Burlington)},1000); setTimeout(function(){map.addOverlays(Cary)},1000); setTimeout(function(){map.addOverlays(Chapel_Hill)},1000); setTimeout(function(){map.addOverlays(Charlotte)},1000); setTimeout(function(){map.addOverlays(Durham)},1000); setTimeout(function(){map.addOverlays(Fayetteville)},1000); setTimeout(function(){map.addOverlays(Gastonia)},1000); setTimeout(function(){map.addOverlays(Goldsboro)},1000); setTimeout(function(){map.addOverlays(Greensboro)},1000); setTimeout(function(){map.addOverlays(Greenville)},1000); setTimeout(function(){map.addOverlays(Havelock)},1000); setTimeout(function(){map.addOverlays(Hendersonville)},1000); setTimeout(function(){map.addOverlays(High_Point)},1000); setTimeout(function(){map.addOverlays(Hillsborough)},1000); setTimeout(function(){map.addOverlays(Jacksonville)},1000); setTimeout(function(){map.addOverlays(Kernersville)},1000); setTimeout(function(){map.addOverlays(Morehead_City)},1000); setTimeout(function(){map.addOverlays(New_Bern)},1000); setTimeout(function(){map.addOverlays(Raleigh)},1000); setTimeout(function(){map.addOverlays(Rocky_Mount)},1000); setTimeout(function(){map.addOverlays(Salisbury)},1000); setTimeout(function(){map.addOverlays(Southern_Pines)},1000); setTimeout(function(){map.addOverlays(Wake_Forest)},1000); setTimeout(function(){map.addOverlays(Wilmington)},1000); setTimeout(function(){map.addOverlays(Winston_Salem)},1000); maxLng = -76.72583400; maxLat = 36.11693400; minLng = -82.55113500; minLat = 34.23289100; reCenterMap(); } // End addStateMarkers JavaScript Function // Takes an array of markers and centers/zooms map based on marker range function centerByArray(myArray, recenter, newMaxMin) { if (newMaxMin == true) reMaxMin(myArray); for (var i = 0; i < myArray.length; i++) { var markLng = myArray[i].getPoint().x; var markLat = myArray[i].getPoint().y; if (markLat > maxLat) maxLat = markLat; if (markLng > maxLng) maxLng = markLng; if (markLat < minLat) minLat = markLat; if (markLng < minLng) minLng = markLng; } if (recenter) reCenterMap(); } // Reinit max/mins function reMaxMin(myArray) { maxLng = myArray[0].getPoint().x; maxLat = myArray[0].getPoint().y; minLng = myArray[0].getPoint().x; minLat = myArray[0].getPoint().y; } // Recenter map based on global max/mins function reCenterMap() { var bounds = new GLatLngBounds(); bounds.extend(new GLatLng(minLat, minLng)); bounds.extend(new GLatLng(maxLat, maxLng)); var center_lat = (bounds.getNorthEast().lat() + bounds.getSouthWest().lat()) / 2.0; var center_lng = (bounds.getNorthEast().lng() + bounds.getSouthWest().lng()) / 2.0; var center = new GLatLng(center_lat, center_lng); var zoom = map.getBoundsZoomLevel(bounds); map.setCenter(center,zoom); //map.setCenter(center,11); /* var center = new GPoint( (maxLng + minLng)/2, (maxLat+minLat)/2 ); var delta = new GSize(maxLng - minLng, maxLat - minLat); var minZoom = map.spec.getLowestZoomLevel(center, delta, map.viewSize); if (minZoom < 4) minZoom = 4; // Lowest possible zoom is 4 map.centerAndZoom(center, minZoom); */ } // Fires when drop down list of schools changes function selectChange(selection) { var myVal = selection.options[selection.selectedIndex].value; map.closeInfoWindow(); // Add entire array based on variable type if (myVal.indexOf('all') != -1 && myVal != 'all') { var temp = myVal.split('='); var showArray = temp[1]; // If Array is > X amount of markers, then open in a new page if (eval(showArray).length > 20) // New window depends on whether or not we're on the search page if (location.href.indexOf('nearby_schools.php') == -1) window.open(location.href + '/map/' + showArray); else window.open('/search//////' + showArray); map.removeOverlays(Asheville); map.removeOverlays(Burlington); map.removeOverlays(Cary); map.removeOverlays(Chapel_Hill); map.removeOverlays(Charlotte); map.removeOverlays(Durham); map.removeOverlays(Fayetteville); map.removeOverlays(Gastonia); map.removeOverlays(Goldsboro); map.removeOverlays(Greensboro); map.removeOverlays(Greenville); map.removeOverlays(Havelock); map.removeOverlays(Hendersonville); map.removeOverlays(High_Point); map.removeOverlays(Hillsborough); map.removeOverlays(Jacksonville); map.removeOverlays(Kernersville); map.removeOverlays(Morehead_City); map.removeOverlays(New_Bern); map.removeOverlays(Raleigh); map.removeOverlays(Rocky_Mount); map.removeOverlays(Salisbury); map.removeOverlays(Southern_Pines); map.removeOverlays(Wake_Forest); map.removeOverlays(Wilmington); map.removeOverlays(Winston_Salem); 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(Havelock);map.removeOverlays(Asheville); map.removeOverlays(Burlington); map.removeOverlays(Cary); map.removeOverlays(Chapel_Hill); map.removeOverlays(Charlotte); map.removeOverlays(Durham); map.removeOverlays(Fayetteville); map.removeOverlays(Gastonia); map.removeOverlays(Goldsboro); map.removeOverlays(Greensboro); map.removeOverlays(Greenville); map.removeOverlays(Havelock); map.removeOverlays(Hendersonville); map.removeOverlays(High_Point); map.removeOverlays(Hillsborough); map.removeOverlays(Jacksonville); map.removeOverlays(Kernersville); map.removeOverlays(Morehead_City); map.removeOverlays(New_Bern); map.removeOverlays(Raleigh); map.removeOverlays(Rocky_Mount); map.removeOverlays(Salisbury); map.removeOverlays(Southern_Pines); map.removeOverlays(Wake_Forest); map.removeOverlays(Wilmington); map.removeOverlays(Winston_Salem); map.addOverlays(Asheville); centerByArray(Asheville, false, false); cntMarker += Asheville.length; map.addOverlays(Burlington); centerByArray(Burlington, false, false); cntMarker += Burlington.length; map.addOverlays(Cary); centerByArray(Cary, false, false); cntMarker += Cary.length; map.addOverlays(Chapel_Hill); centerByArray(Chapel_Hill, false, false); cntMarker += Chapel_Hill.length; map.addOverlays(Charlotte); centerByArray(Charlotte, false, false); cntMarker += Charlotte.length; map.addOverlays(Durham); centerByArray(Durham, false, false); cntMarker += Durham.length; map.addOverlays(Fayetteville); centerByArray(Fayetteville, false, false); cntMarker += Fayetteville.length; map.addOverlays(Gastonia); centerByArray(Gastonia, false, false); cntMarker += Gastonia.length; map.addOverlays(Goldsboro); centerByArray(Goldsboro, false, false); cntMarker += Goldsboro.length; map.addOverlays(Greensboro); centerByArray(Greensboro, false, false); cntMarker += Greensboro.length; map.addOverlays(Greenville); centerByArray(Greenville, false, false); cntMarker += Greenville.length; map.addOverlays(Havelock); centerByArray(Havelock, false, false); cntMarker += Havelock.length; map.addOverlays(Hendersonville); centerByArray(Hendersonville, false, false); cntMarker += Hendersonville.length; map.addOverlays(High_Point); centerByArray(High_Point, false, false); cntMarker += High_Point.length; map.addOverlays(Hillsborough); centerByArray(Hillsborough, false, false); cntMarker += Hillsborough.length; map.addOverlays(Jacksonville); centerByArray(Jacksonville, false, false); cntMarker += Jacksonville.length; map.addOverlays(Kernersville); centerByArray(Kernersville, false, false); cntMarker += Kernersville.length; map.addOverlays(Morehead_City); centerByArray(Morehead_City, false, false); cntMarker += Morehead_City.length; map.addOverlays(New_Bern); centerByArray(New_Bern, false, false); cntMarker += New_Bern.length; map.addOverlays(Raleigh); centerByArray(Raleigh, false, false); cntMarker += Raleigh.length; map.addOverlays(Rocky_Mount); centerByArray(Rocky_Mount, false, false); cntMarker += Rocky_Mount.length; map.addOverlays(Salisbury); centerByArray(Salisbury, false, false); cntMarker += Salisbury.length; map.addOverlays(Southern_Pines); centerByArray(Southern_Pines, false, false); cntMarker += Southern_Pines.length; map.addOverlays(Wake_Forest); centerByArray(Wake_Forest, false, false); cntMarker += Wake_Forest.length; map.addOverlays(Wilmington); centerByArray(Wilmington, false, false); cntMarker += Wilmington.length; map.addOverlays(Winston_Salem); centerByArray(Winston_Salem, false, false); cntMarker += Winston_Salem.length; centerByArray(Havelock,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///21172,20772,20808,20747,35191,21170,21178,20967,21078,21158,21163,34099,21171,20973,21172,21159,21182,21125,21079,21174,21127,20743,21292,20974,21214,21181,21162,21183,20821,21211,21080,21184,21082,21123,34100,21161,21169,34101,21081,21167,/all'); //window.open('/map.php?type=2&schools=21172,20772,20808,20747,35191,21170,21178,20967,21078,21158,21163,34099,21171,20973,21172,21159,21182,21125,21079,21174,21127,20743,21292,20974,21214,21181,21162,21183,20821,21211,21080,21184,21082,21123,34100,21161,21169,34101,21081,21167,&school_level=&radius=&zipcode=&school_type_search=&school_type_code='); } } function createMarker(point, label, icon) { var marker = new GMarker(point, icon); var html = label; GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); }); return marker; }