function addMarkers(){
mySelect = document.getElementById('selection');
Charlotte = [];Havelock = [];Asheville = [];Kernersville = [];Burlington = [];Raleigh = [];Hendersonville = [];Durham = [];High_Point = [];Jacksonville = [];Greensboro = [];Winston_Salem = [];Rocky_Mount = [];Southern_Pines = [];Salisbury = [];Wake_Forest = [];Morehead_City = [];Hillsborough = [];Wilmington = [];Goldsboro = [];Cary = [];Gastonia = [];Fayetteville = [];Wilson = [];Chapel_Hill = [];Maggie_Valley = [];Huntersville = [];Apex = [];New_Bern = [];Greenville = [];mySelect.options[mySelect.options.length] = new Option("Apex schools",'all=Apex');
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("Huntersville schools",'all=Huntersville');
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("Maggie Valley schools",'all=Maggie_Valley');
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("Wilson schools",'all=Wilson');
mySelect.options[mySelect.options.length] = new Option("Winston Salem schools",'all=Winston_Salem');
mySelect.options[mySelect.options.length] = new Option("---------------------------",'');
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.83626500,35.06790900),"
",iconGr);
mySelect.options[mySelect.options.length] = new Option("All Saints Catholic School",'Charlotte=' + Charlotte.length);
Havelock[Havelock.length] = createMarker(new GPoint(-76.90527000,34.87890100),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Annunciation Catholic School",'Havelock=' + Havelock.length);
Asheville[Asheville.length] = createMarker(new GPoint(-82.55113500,35.63092100),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Asheville Catholic School",'Asheville=' + Asheville.length);
Kernersville[Kernersville.length] = createMarker(new GPoint(-80.06258700,36.07803000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Bishop Mc Guinness High School",'Kernersville=' + Kernersville.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.82574600,35.21849400),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Blessed Sacrament Academy",'Charlotte=' + Charlotte.length);
Burlington[Burlington.length] = createMarker(new GPoint(-79.44583100,36.09410900),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Blessed Sacrament School",'Burlington=' + Burlington.length);
Raleigh[Raleigh.length] = createMarker(new GPoint(-78.72636800,35.80458300),"",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),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Cathedral School",'Raleigh=' + Raleigh.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.84838800,35.08783700),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Charlotte Catholic High School",'Charlotte=' + Charlotte.length);
Raleigh[Raleigh.length] = createMarker(new GPoint(-78.69430000,35.87280000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("The Franciscan School",'Raleigh=' + Raleigh.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.85325400,35.18865600),"",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),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Immaculata Catholic School",'Hendersonville=' + Hendersonville.length);
Durham[Durham.length] = createMarker(new GPoint(-78.91348400,35.99801100),"",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),"",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),"",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),"",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),"",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),"",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),"",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),"",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),"",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),"",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),"",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),"",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),"",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),"",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),"",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),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Mary School",'Goldsboro=' + Goldsboro.length);
Cary[Cary.length] = createMarker(new GPoint(-78.82222300,35.78604000),"",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),"",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),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Patrick School",'Fayetteville=' + Fayetteville.length);
Raleigh[Raleigh.length] = createMarker(new GPoint(-78.61922900,35.86106400),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Raphael Catholic School",'Raleigh=' + Raleigh.length);
Wilson[Wilson.length] = createMarker(new GPoint(-77.91716000,35.73369500),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Therese Catholic School",'Wilson=' + Wilson.length);
Chapel_Hill[Chapel_Hill.length] = createMarker(new GPoint(-79.02929500,35.90615000),"",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),"",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),"",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),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St Gabriel Catholic School",'Charlotte=' + Charlotte.length);
Maggie_Valley[Maggie_Valley.length] = createMarker(new GPoint(-83.09515000,35.52136500),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St Joseph Academy",'Maggie_Valley=' + Maggie_Valley.length);
Huntersville[Huntersville.length] = createMarker(new GPoint(-80.86636900,35.42067400),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St Mark Catholic School",'Huntersville=' + Huntersville.length);
Wilmington[Wilmington.length] = createMarker(new GPoint(-77.84895700,34.23778800),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St Mark Catholic School",'Wilmington=' + Wilmington.length);
Apex[Apex.length] = createMarker(new GPoint(-78.87549300,35.72411900),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St Mary Magdalene Catholic School",'Apex=' + Apex.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.81547400,35.05602500),"",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),"",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),"",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),"",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),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St Pius X Catholic School",'Greensboro=' + Greensboro.length);
Raleigh[Raleigh.length] = createMarker(new GPoint(-78.58903100,35.85527000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St Thomas More Academy",'Raleigh=' + Raleigh.length);
map.removeOverlays(Apex);
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(Huntersville);
map.removeOverlays(Jacksonville);
map.removeOverlays(Kernersville);
map.removeOverlays(Maggie_Valley);
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(Wilson);
map.removeOverlays(Winston_Salem);
setTimeout(function(){map.addOverlays(Apex)},1000);
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(Huntersville)},1000);
setTimeout(function(){map.addOverlays(Jacksonville)},1000);
setTimeout(function(){map.addOverlays(Kernersville)},1000);
setTimeout(function(){map.addOverlays(Maggie_Valley)},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(Wilson)},1000);
setTimeout(function(){map.addOverlays(Winston_Salem)},1000);
maxLng = -76.72583400;
maxLat = 36.11693400;
minLng = -83.09515000;
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(Apex);
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(Huntersville);
map.removeOverlays(Jacksonville);
map.removeOverlays(Kernersville);
map.removeOverlays(Maggie_Valley);
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(Wilson);
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(Charlotte);map.removeOverlays(Apex);
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(Huntersville);
map.removeOverlays(Jacksonville);
map.removeOverlays(Kernersville);
map.removeOverlays(Maggie_Valley);
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(Wilson);
map.removeOverlays(Winston_Salem);
map.addOverlays(Apex);
centerByArray(Apex, false, false);
cntMarker += Apex.length;
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(Huntersville);
centerByArray(Huntersville, false, false);
cntMarker += Huntersville.length;
map.addOverlays(Jacksonville);
centerByArray(Jacksonville, false, false);
cntMarker += Jacksonville.length;
map.addOverlays(Kernersville);
centerByArray(Kernersville, false, false);
cntMarker += Kernersville.length;
map.addOverlays(Maggie_Valley);
centerByArray(Maggie_Valley, false, false);
cntMarker += Maggie_Valley.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(Wilson);
centerByArray(Wilson, false, false);
cntMarker += Wilson.length;
map.addOverlays(Winston_Salem);
centerByArray(Winston_Salem, false, false);
cntMarker += Winston_Salem.length;
centerByArray(Charlotte,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///20826,21172,20772,20808,34429,34428,20747,35191,21170,21178,20736,20773,20967,21078,21158,21163,34099,21171,20973,21172,21159,21182,21125,21079,21174,21127,20743,21292,20974,21214,31641,21181,21166,21162,21183,20821,21211,21080,21184,21082,21123,34100,21161,21169,34101,21304,21081,21167,/all');
//window.open('/map.php?type=2&schools=20826,21172,20772,20808,34429,34428,20747,35191,21170,21178,20736,20773,20967,21078,21158,21163,34099,21171,20973,21172,21159,21182,21125,21079,21174,21127,20743,21292,20974,21214,31641,21181,21166,21162,21183,20821,21211,21080,21184,21082,21123,34100,21161,21169,34101,21304,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;
}