function addMarkers(){
mySelect = document.getElementById('selection');
Augusta = [];Savannah = [];Roswell = [];Atlanta = [];Alpharetta = [];Athens = [];Macon = [];Columbus = [];Fairburn = [];Tyrone = [];Cumming = [];Warner_Robins = [];Kennesaw = [];Hapeville = [];Lilburn = [];Marietta = [];Rome = [];Albany = [];Decatur = [];Brunswick = [];Valdosta = [];Tybee_Island = [];mySelect.options[mySelect.options.length] = new Option("Albany schools",'all=Albany');
mySelect.options[mySelect.options.length] = new Option("Alpharetta schools",'all=Alpharetta');
mySelect.options[mySelect.options.length] = new Option("Athens schools",'all=Athens');
mySelect.options[mySelect.options.length] = new Option("Atlanta schools",'all=Atlanta');
mySelect.options[mySelect.options.length] = new Option("Augusta schools",'all=Augusta');
mySelect.options[mySelect.options.length] = new Option("Brunswick schools",'all=Brunswick');
mySelect.options[mySelect.options.length] = new Option("Columbus schools",'all=Columbus');
mySelect.options[mySelect.options.length] = new Option("Cumming schools",'all=Cumming');
mySelect.options[mySelect.options.length] = new Option("Decatur schools",'all=Decatur');
mySelect.options[mySelect.options.length] = new Option("Fairburn schools",'all=Fairburn');
mySelect.options[mySelect.options.length] = new Option("Hapeville schools",'all=Hapeville');
mySelect.options[mySelect.options.length] = new Option("Kennesaw schools",'all=Kennesaw');
mySelect.options[mySelect.options.length] = new Option("Lilburn schools",'all=Lilburn');
mySelect.options[mySelect.options.length] = new Option("Macon schools",'all=Macon');
mySelect.options[mySelect.options.length] = new Option("Marietta schools",'all=Marietta');
mySelect.options[mySelect.options.length] = new Option("Rome schools",'all=Rome');
mySelect.options[mySelect.options.length] = new Option("Roswell schools",'all=Roswell');
mySelect.options[mySelect.options.length] = new Option("Savannah schools",'all=Savannah');
mySelect.options[mySelect.options.length] = new Option("Tybee Island schools",'all=Tybee_Island');
mySelect.options[mySelect.options.length] = new Option("Tyrone schools",'all=Tyrone');
mySelect.options[mySelect.options.length] = new Option("Valdosta schools",'all=Valdosta');
mySelect.options[mySelect.options.length] = new Option("Warner Robins schools",'all=Warner_Robins');
mySelect.options[mySelect.options.length] = new Option("---------------------------",'');
Augusta[Augusta.length] = createMarker(new GPoint(-82.03856700,33.46230700),"
",iconGr);
mySelect.options[mySelect.options.length] = new Option("Aquinas High School",'Augusta=' + Augusta.length);
Savannah[Savannah.length] = createMarker(new GPoint(-81.09570000,32.00500000),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Benedictine Military School",'Savannah=' + Savannah.length);
Savannah[Savannah.length] = createMarker(new GPoint(-81.08638900,32.04831600),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Blessed Sacrament School",'Savannah=' + Savannah.length);
Roswell[Roswell.length] = createMarker(new GPoint(-84.38354700,34.05633500),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Blessed Trinity Catholic High School",'Roswell=' + Roswell.length);
Atlanta[Atlanta.length] = createMarker(new GPoint(-84.38632100,33.82781600),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Christ The King School",'Atlanta=' + Atlanta.length);
Alpharetta[Alpharetta.length] = createMarker(new GPoint(-84.26232800,34.02289600),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Holy Redeemer Catholic School",'Alpharetta=' + Alpharetta.length);
Atlanta[Atlanta.length] = createMarker(new GPoint(-84.41081300,33.87601000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Holy Spirit Preparatory School",'Atlanta=' + Atlanta.length);
Augusta[Augusta.length] = createMarker(new GPoint(-81.97634500,33.46437700),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Immaculate Conception School",'Augusta=' + Augusta.length);
Atlanta[Atlanta.length] = createMarker(new GPoint(-84.32021000,33.83374200),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Immaculate Heart Of Mary School",'Atlanta=' + Atlanta.length);
Atlanta[Atlanta.length] = createMarker(new GPoint(-84.33130100,33.90289200),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Marist School",'Atlanta=' + Atlanta.length);
Athens[Athens.length] = createMarker(new GPoint(-83.45104700,33.98980100),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Monsignor Donovan Catholic High School",'Athens=' + Athens.length);
Macon[Macon.length] = createMarker(new GPoint(-83.63935600,32.83433100),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Mount de Sales Academy",'Macon=' + Macon.length);
Savannah[Savannah.length] = createMarker(new GPoint(-81.09922300,32.06027700),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Notre Dame Academy",'Savannah=' + Savannah.length);
Atlanta[Atlanta.length] = createMarker(new GPoint(-84.32981600,33.88578900),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Our Lady Of The Assumption School",'Atlanta=' + Atlanta.length);
Columbus[Columbus.length] = createMarker(new GPoint(-84.94824200,32.41655900),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Our Lady Of Lourdes Catholic School",'Columbus=' + Columbus.length);
Fairburn[Fairburn.length] = createMarker(new GPoint(-84.46384100,33.54781600),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Our Lady Of Mercy Catholic High School",'Fairburn=' + Fairburn.length);
Tyrone[Tyrone.length] = createMarker(new GPoint(-84.58197400,33.51461800),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Our Lady Of Victory Catholic School",'Tyrone=' + Tyrone.length);
Columbus[Columbus.length] = createMarker(new GPoint(-84.93449200,32.48376200),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Pacelli High School",'Columbus=' + Columbus.length);
Cumming[Cumming.length] = createMarker(new GPoint(-84.17320100,34.13773100),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Pinecrest Academy",'Cumming=' + Cumming.length);
Roswell[Roswell.length] = createMarker(new GPoint(-84.38356500,34.05657000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Queen Of Angels Catholic School",'Roswell=' + Roswell.length);
Warner_Robins[Warner_Robins.length] = createMarker(new GPoint(-83.61321200,32.61685100),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Sacred Heart",'Warner_Robins=' + Warner_Robins.length);
Kennesaw[Kennesaw.length] = createMarker(new GPoint(-84.59783000,34.02850800),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Catherine of Siena Catholic School",'Kennesaw=' + Kennesaw.length);
Savannah[Savannah.length] = createMarker(new GPoint(-81.10099100,31.99188500),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. James Catholic School",'Savannah=' + Savannah.length);
Hapeville[Hapeville.length] = createMarker(new GPoint(-84.39774500,33.65605000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. John The Evangelist School",'Hapeville=' + Hapeville.length);
Lilburn[Lilburn.length] = createMarker(new GPoint(-84.09172200,33.87965000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. John Neumann Regional Catholic School",'Lilburn=' + Lilburn.length);
Marietta[Marietta.length] = createMarker(new GPoint(-84.55447000,33.96631800),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Joseph Catholic School",'Marietta=' + Marietta.length);
Athens[Athens.length] = createMarker(new GPoint(-83.38120100,33.96027900),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Joseph Catholic School",'Athens=' + Athens.length);
Macon[Macon.length] = createMarker(new GPoint(-83.63579900,32.83726100),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Josephs Catholic School",'Macon=' + Macon.length);
Atlanta[Atlanta.length] = createMarker(new GPoint(-84.36363500,33.94998200),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Jude The Apostle Catholic School",'Atlanta=' + Atlanta.length);
Augusta[Augusta.length] = createMarker(new GPoint(-82.02752800,33.47571200),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Mary On The Hill Catholic School",'Augusta=' + Augusta.length);
Rome[Rome.length] = createMarker(new GPoint(-85.15945500,34.24507900),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Mary School",'Rome=' + Rome.length);
Savannah[Savannah.length] = createMarker(new GPoint(-80.98690000,32.02060000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Peter The Apostle School",'Savannah=' + Savannah.length);
Macon[Macon.length] = createMarker(new GPoint(-83.64963500,32.84377600),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Peter Claver School",'Macon=' + Macon.length);
Atlanta[Atlanta.length] = createMarker(new GPoint(-84.29032000,33.86509500),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Pius X Catholic High School",'Atlanta=' + Atlanta.length);
Albany[Albany.length] = createMarker(new GPoint(-84.18922600,31.58267600),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Teresa's School",'Albany=' + Albany.length);
Decatur[Decatur.length] = createMarker(new GPoint(-84.30566700,33.77367600),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Thomas More School",'Decatur=' + Decatur.length);
Decatur[Decatur.length] = createMarker(new GPoint(-84.29112500,33.72765300),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Ss Peter Claver Regional Catholic School",'Decatur=' + Decatur.length);
Columbus[Columbus.length] = createMarker(new GPoint(-84.93483800,32.48222900),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St Anne School",'Columbus=' + Columbus.length);
Savannah[Savannah.length] = createMarker(new GPoint(-81.15696200,31.98952000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St Frances Cabrini Catholic School",'Savannah=' + Savannah.length);
Brunswick[Brunswick.length] = createMarker(new GPoint(-81.49171000,31.14450000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St Francis Xavier School",'Brunswick=' + Brunswick.length);
Valdosta[Valdosta.length] = createMarker(new GPoint(-83.30188300,30.85983700),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St John Catholic School",'Valdosta=' + Valdosta.length);
Tybee_Island[Tybee_Island.length] = createMarker(new GPoint(-80.84880000,32.00740000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St Michael's Catholic School",'Tybee_Island=' + Tybee_Island.length);
Savannah[Savannah.length] = createMarker(new GPoint(-81.09114400,32.07391300),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("St Vincents Academy",'Savannah=' + Savannah.length);
map.removeOverlays(Albany);
map.removeOverlays(Alpharetta);
map.removeOverlays(Athens);
map.removeOverlays(Atlanta);
map.removeOverlays(Augusta);
map.removeOverlays(Brunswick);
map.removeOverlays(Columbus);
map.removeOverlays(Cumming);
map.removeOverlays(Decatur);
map.removeOverlays(Fairburn);
map.removeOverlays(Hapeville);
map.removeOverlays(Kennesaw);
map.removeOverlays(Lilburn);
map.removeOverlays(Macon);
map.removeOverlays(Marietta);
map.removeOverlays(Rome);
map.removeOverlays(Roswell);
map.removeOverlays(Savannah);
map.removeOverlays(Tybee_Island);
map.removeOverlays(Tyrone);
map.removeOverlays(Valdosta);
map.removeOverlays(Warner_Robins);
setTimeout(function(){map.addOverlays(Albany)},1000);
setTimeout(function(){map.addOverlays(Alpharetta)},1000);
setTimeout(function(){map.addOverlays(Athens)},1000);
setTimeout(function(){map.addOverlays(Atlanta)},1000);
setTimeout(function(){map.addOverlays(Augusta)},1000);
setTimeout(function(){map.addOverlays(Brunswick)},1000);
setTimeout(function(){map.addOverlays(Columbus)},1000);
setTimeout(function(){map.addOverlays(Cumming)},1000);
setTimeout(function(){map.addOverlays(Decatur)},1000);
setTimeout(function(){map.addOverlays(Fairburn)},1000);
setTimeout(function(){map.addOverlays(Hapeville)},1000);
setTimeout(function(){map.addOverlays(Kennesaw)},1000);
setTimeout(function(){map.addOverlays(Lilburn)},1000);
setTimeout(function(){map.addOverlays(Macon)},1000);
setTimeout(function(){map.addOverlays(Marietta)},1000);
setTimeout(function(){map.addOverlays(Rome)},1000);
setTimeout(function(){map.addOverlays(Roswell)},1000);
setTimeout(function(){map.addOverlays(Savannah)},1000);
setTimeout(function(){map.addOverlays(Tybee_Island)},1000);
setTimeout(function(){map.addOverlays(Tyrone)},1000);
setTimeout(function(){map.addOverlays(Valdosta)},1000);
setTimeout(function(){map.addOverlays(Warner_Robins)},1000);
maxLng = -80.84880000;
maxLat = 34.24507900;
minLng = -85.15945500;
minLat = 30.85983700;
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(Albany);
map.removeOverlays(Alpharetta);
map.removeOverlays(Athens);
map.removeOverlays(Atlanta);
map.removeOverlays(Augusta);
map.removeOverlays(Brunswick);
map.removeOverlays(Columbus);
map.removeOverlays(Cumming);
map.removeOverlays(Decatur);
map.removeOverlays(Fairburn);
map.removeOverlays(Hapeville);
map.removeOverlays(Kennesaw);
map.removeOverlays(Lilburn);
map.removeOverlays(Macon);
map.removeOverlays(Marietta);
map.removeOverlays(Rome);
map.removeOverlays(Roswell);
map.removeOverlays(Savannah);
map.removeOverlays(Tybee_Island);
map.removeOverlays(Tyrone);
map.removeOverlays(Valdosta);
map.removeOverlays(Warner_Robins);
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(Augusta);map.removeOverlays(Albany);
map.removeOverlays(Alpharetta);
map.removeOverlays(Athens);
map.removeOverlays(Atlanta);
map.removeOverlays(Augusta);
map.removeOverlays(Brunswick);
map.removeOverlays(Columbus);
map.removeOverlays(Cumming);
map.removeOverlays(Decatur);
map.removeOverlays(Fairburn);
map.removeOverlays(Hapeville);
map.removeOverlays(Kennesaw);
map.removeOverlays(Lilburn);
map.removeOverlays(Macon);
map.removeOverlays(Marietta);
map.removeOverlays(Rome);
map.removeOverlays(Roswell);
map.removeOverlays(Savannah);
map.removeOverlays(Tybee_Island);
map.removeOverlays(Tyrone);
map.removeOverlays(Valdosta);
map.removeOverlays(Warner_Robins);
map.addOverlays(Albany);
centerByArray(Albany, false, false);
cntMarker += Albany.length;
map.addOverlays(Alpharetta);
centerByArray(Alpharetta, false, false);
cntMarker += Alpharetta.length;
map.addOverlays(Athens);
centerByArray(Athens, false, false);
cntMarker += Athens.length;
map.addOverlays(Atlanta);
centerByArray(Atlanta, false, false);
cntMarker += Atlanta.length;
map.addOverlays(Augusta);
centerByArray(Augusta, false, false);
cntMarker += Augusta.length;
map.addOverlays(Brunswick);
centerByArray(Brunswick, false, false);
cntMarker += Brunswick.length;
map.addOverlays(Columbus);
centerByArray(Columbus, false, false);
cntMarker += Columbus.length;
map.addOverlays(Cumming);
centerByArray(Cumming, false, false);
cntMarker += Cumming.length;
map.addOverlays(Decatur);
centerByArray(Decatur, false, false);
cntMarker += Decatur.length;
map.addOverlays(Fairburn);
centerByArray(Fairburn, false, false);
cntMarker += Fairburn.length;
map.addOverlays(Hapeville);
centerByArray(Hapeville, false, false);
cntMarker += Hapeville.length;
map.addOverlays(Kennesaw);
centerByArray(Kennesaw, false, false);
cntMarker += Kennesaw.length;
map.addOverlays(Lilburn);
centerByArray(Lilburn, false, false);
cntMarker += Lilburn.length;
map.addOverlays(Macon);
centerByArray(Macon, false, false);
cntMarker += Macon.length;
map.addOverlays(Marietta);
centerByArray(Marietta, false, false);
cntMarker += Marietta.length;
map.addOverlays(Rome);
centerByArray(Rome, false, false);
cntMarker += Rome.length;
map.addOverlays(Roswell);
centerByArray(Roswell, false, false);
cntMarker += Roswell.length;
map.addOverlays(Savannah);
centerByArray(Savannah, false, false);
cntMarker += Savannah.length;
map.addOverlays(Tybee_Island);
centerByArray(Tybee_Island, false, false);
cntMarker += Tybee_Island.length;
map.addOverlays(Tyrone);
centerByArray(Tyrone, false, false);
cntMarker += Tyrone.length;
map.addOverlays(Valdosta);
centerByArray(Valdosta, false, false);
cntMarker += Valdosta.length;
map.addOverlays(Warner_Robins);
centerByArray(Warner_Robins, false, false);
cntMarker += Warner_Robins.length;
centerByArray(Augusta,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///34037,7534,7534,7812,7812,7973,7973,7877,7894,31158,7840,7568,7556,7977,7924,7750,7964,7605,7605,7534,7534,7758,7758,7873,7873,7965,7965,7532,7757,7967,7956,7872,7953,7894,7975,7950,7960,36272,7961,7963,7972,7962,7968,7905,7567,7859,7958,7923,7955,7970,7874,7959,7922,/all');
//window.open('/map.php?type=2&schools=34037,7534,7534,7812,7812,7973,7973,7877,7894,31158,7840,7568,7556,7977,7924,7750,7964,7605,7605,7534,7534,7758,7758,7873,7873,7965,7965,7532,7757,7967,7956,7872,7953,7894,7975,7950,7960,36272,7961,7963,7972,7962,7968,7905,7567,7859,7958,7923,7955,7970,7874,7959,7922,&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;
}