function addMarkers()
{
mySelect = document.getElementById('selection');
Absecon = [];Galloway = [];Atlantic_City = [];Mays_Landing = [];Linwood = [];Brigantine = [];Buena = [];Egg_Harbor_City = [];Somers_Point = [];Egg_Harbor_Township = [];Minotola = [];Williamstown = [];Cologne = [];Egg_Harbor_Twp = [];Estell_Manor = [];Margate = [];Folsom = [];Elwood = [];Egg_Harbor = [];Hammonton = [];Corbin_City = [];Pleasantville = [];Northfield = [];Oceanville = [];Port_Republic = [];South_Egg_Harbor = [];Ventnor = [];Dorothy = [];Landisville = [];mySelect.options[mySelect.options.length] = new Option("Absecon schools",'all=Absecon');
mySelect.options[mySelect.options.length] = new Option("Atlantic City schools",'all=Atlantic_City');
mySelect.options[mySelect.options.length] = new Option("Brigantine schools",'all=Brigantine');
mySelect.options[mySelect.options.length] = new Option("Buena schools",'all=Buena');
mySelect.options[mySelect.options.length] = new Option("Cologne schools",'all=Cologne');
mySelect.options[mySelect.options.length] = new Option("Corbin City schools",'all=Corbin_City');
mySelect.options[mySelect.options.length] = new Option("Dorothy schools",'all=Dorothy');
mySelect.options[mySelect.options.length] = new Option("Egg Harbor schools",'all=Egg_Harbor');
mySelect.options[mySelect.options.length] = new Option("Egg Harbor City schools",'all=Egg_Harbor_City');
mySelect.options[mySelect.options.length] = new Option("Egg Harbor Township schools",'all=Egg_Harbor_Township');
mySelect.options[mySelect.options.length] = new Option("Egg Harbor Twp schools",'all=Egg_Harbor_Twp');
mySelect.options[mySelect.options.length] = new Option("Elwood schools",'all=Elwood');
mySelect.options[mySelect.options.length] = new Option("Estell Manor schools",'all=Estell_Manor');
mySelect.options[mySelect.options.length] = new Option("Folsom schools",'all=Folsom');
mySelect.options[mySelect.options.length] = new Option("Galloway schools",'all=Galloway');
mySelect.options[mySelect.options.length] = new Option("Hammonton schools",'all=Hammonton');
mySelect.options[mySelect.options.length] = new Option("Landisville schools",'all=Landisville');
mySelect.options[mySelect.options.length] = new Option("Linwood schools",'all=Linwood');
mySelect.options[mySelect.options.length] = new Option("Margate schools",'all=Margate');
mySelect.options[mySelect.options.length] = new Option("Mays Landing schools",'all=Mays_Landing');
mySelect.options[mySelect.options.length] = new Option("Minotola schools",'all=Minotola');
mySelect.options[mySelect.options.length] = new Option("Northfield schools",'all=Northfield');
mySelect.options[mySelect.options.length] = new Option("Oceanville schools",'all=Oceanville');
mySelect.options[mySelect.options.length] = new Option("Pleasantville schools",'all=Pleasantville');
mySelect.options[mySelect.options.length] = new Option("Port Republic schools",'all=Port_Republic');
mySelect.options[mySelect.options.length] = new Option("Somers Point schools",'all=Somers_Point');
mySelect.options[mySelect.options.length] = new Option("South Egg Harbor schools",'all=South_Egg_Harbor');
mySelect.options[mySelect.options.length] = new Option("Ventnor schools",'all=Ventnor');
mySelect.options[mySelect.options.length] = new Option("Williamstown schools",'all=Williamstown');
mySelect.options[mySelect.options.length] = new Option("---------------------------",'');
Absecon[Absecon.length] = createMarker(new GPoint(-74.50743866,39.43132019),"
",iconGr);
mySelect.options[mySelect.options.length] = new Option("Absecon Campus",'Absecon=' + Absecon.length);
Galloway[Galloway.length] = createMarker(new GPoint(-74.51287842,39.47670364),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Absegami High School",'Galloway=' + Galloway.length);
Galloway[Galloway.length] = createMarker(new GPoint(-74.50199890,39.47309875),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Arthur Rann Elementary School",'Galloway=' + Galloway.length);
Atlantic_City[Atlantic_City.length] = createMarker(new GPoint(-74.47564697,39.36930847),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Atlantic City High School",'Atlantic_City=' + Atlantic_City.length);
Mays_Landing[Mays_Landing.length] = createMarker(new GPoint(-74.69079590,39.44176865),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Atlantic City Vocational High School",'Mays_Landing=' + Mays_Landing.length);
Mays_Landing[Mays_Landing.length] = createMarker(new GPoint(-74.73760223,39.46749878),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Atlantic Co Elem/middle",'Mays_Landing=' + Mays_Landing.length);
Mays_Landing[Mays_Landing.length] = createMarker(new GPoint(-74.69869232,39.44147491),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Atlantic Co High School",'Mays_Landing=' + Mays_Landing.length);
Linwood[Linwood.length] = createMarker(new GPoint(-74.57440186,39.34659958),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Belhaven Middle School",'Linwood=' + Linwood.length);
Brigantine[Brigantine.length] = createMarker(new GPoint(-74.36405182,39.41075897),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Brigantine Elementary School",'Brigantine=' + Brigantine.length);
Brigantine[Brigantine.length] = createMarker(new GPoint(-74.36405182,39.41075897),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Brigantine North School",'Brigantine=' + Brigantine.length);
Atlantic_City[Atlantic_City.length] = createMarker(new GPoint(-74.44911957,39.35763931),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Brighton Ave Elementary School",'Atlantic_City=' + Atlantic_City.length);
Atlantic_City[Atlantic_City.length] = createMarker(new GPoint(-74.44788100,39.35578600),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Brighton Avenue School",'Atlantic_City=' + Atlantic_City.length);
Buena[Buena.length] = createMarker(new GPoint(-74.94535828,39.53271866),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Buena Regional High School",'Buena=' + Buena.length);
Egg_Harbor_City[Egg_Harbor_City.length] = createMarker(new GPoint(-74.63774872,39.53392410),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Charles L. Spragg Elementary School",'Egg_Harbor_City=' + Egg_Harbor_City.length);
Somers_Point[Somers_Point.length] = createMarker(new GPoint(-74.59942000,39.32710600),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Charter Technical High School",'Somers_Point=' + Somers_Point.length);
Atlantic_City[Atlantic_City.length] = createMarker(new GPoint(-74.46383667,39.35545731),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Chelsea Heights Elementary School",'Atlantic_City=' + Atlantic_City.length);
Egg_Harbor_Township[Egg_Harbor_Township.length] = createMarker(new GPoint(-74.57862854,39.42511749),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Clayton J. Davenport Elementary School",'Egg_Harbor_Township=' + Egg_Harbor_Township.length);
Minotola[Minotola.length] = createMarker(new GPoint(-74.94853973,39.51458740),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Cleary Middle School",'Minotola=' + Minotola.length);
Williamstown[Williamstown.length] = createMarker(new GPoint(-74.88295746,39.58640289),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Collings Lake Elementary School",'Williamstown=' + Williamstown.length);
Cologne[Cologne.length] = createMarker(new GPoint(-74.61360168,39.50469971),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Cologne Elementary School",'Cologne=' + Cologne.length);
Somers_Point[Somers_Point.length] = createMarker(new GPoint(-74.60119629,39.31869888),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Dawes Ave Elementary School",'Somers_Point=' + Somers_Point.length);
Atlantic_City[Atlantic_City.length] = createMarker(new GPoint(-74.42407227,39.36568832),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Dr M L King Junior School Comp",'Atlantic_City=' + Atlantic_City.length);
Egg_Harbor_Twp[Egg_Harbor_Twp.length] = createMarker(new GPoint(-74.59709930,39.39759827),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Dr. Joy Miller Elementary School",'Egg_Harbor_Twp=' + Egg_Harbor_Twp.length);
Egg_Harbor_Township[Egg_Harbor_Township.length] = createMarker(new GPoint(-74.62764740,39.37149429),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("E H Slaybaugh Elementary School",'Egg_Harbor_Township=' + Egg_Harbor_Township.length);
Egg_Harbor_Township[Egg_Harbor_Township.length] = createMarker(new GPoint(-74.62345123,39.39379501),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Egg Harbor Township High School",'Egg_Harbor_Township=' + Egg_Harbor_Township.length);
Egg_Harbor_Township[Egg_Harbor_Township.length] = createMarker(new GPoint(-74.64715576,39.41265106),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Egg Harbor Township Inter. Middle School",'Egg_Harbor_Township=' + Egg_Harbor_Township.length);
Egg_Harbor_Township[Egg_Harbor_Township.length] = createMarker(new GPoint(-74.60217285,39.40745163),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Egg Harbor Township Middle School",'Egg_Harbor_Township=' + Egg_Harbor_Township.length);
Absecon[Absecon.length] = createMarker(new GPoint(-74.49521637,39.43519974),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Emma C Attales Middle School",'Absecon=' + Absecon.length);
Estell_Manor[Estell_Manor.length] = createMarker(new GPoint(-74.82508850,39.37881470),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Estell Manor Elementary School",'Estell_Manor=' + Estell_Manor.length);
Margate[Margate.length] = createMarker(new GPoint(-74.50135040,39.33483505),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Eugene A Tighe Mid School",'Margate=' + Margate.length);
Egg_Harbor_City[Egg_Harbor_City.length] = createMarker(new GPoint(-74.64098358,39.53447342),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Fanny D. Rittenberg Middle School",'Egg_Harbor_City=' + Egg_Harbor_City.length);
Folsom[Folsom.length] = createMarker(new GPoint(-74.86420441,39.63278961),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Folsom Elementary School",'Folsom=' + Folsom.length);
Galloway[Galloway.length] = createMarker(new GPoint(-74.45951843,39.47924042),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Galloway Community Charter School",'Galloway=' + Galloway.length);
Galloway[Galloway.length] = createMarker(new GPoint(-74.51490021,39.48611832),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Galloway Township Middle School",'Galloway=' + Galloway.length);
Mays_Landing[Mays_Landing.length] = createMarker(new GPoint(-74.70161438,39.43163300),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("George L Hess Educ Comp Elementary School",'Mays_Landing=' + Mays_Landing.length);
Elwood[Elwood.length] = createMarker(new GPoint(-74.71720123,39.57630157),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Gertrude S. Lauer Elementary School",'Elwood=' + Elwood.length);
Egg_Harbor[Egg_Harbor.length] = createMarker(new GPoint(-74.60049900,39.49949500),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Green Bank Elementary School",'Egg_Harbor=' + Egg_Harbor.length);
Absecon[Absecon.length] = createMarker(new GPoint(-74.50738200,39.43271400),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("H Ashton Marsh",'Absecon=' + Absecon.length);
Absecon[Absecon.length] = createMarker(new GPoint(-74.49503326,39.43515015),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("H Ashton Marsh Elementary School",'Absecon=' + Absecon.length);
Egg_Harbor_Township[Egg_Harbor_Township.length] = createMarker(new GPoint(-74.62625122,39.37155151),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("H. Russell Swift Elementary School",'Egg_Harbor_Township=' + Egg_Harbor_Township.length);
Hammonton[Hammonton.length] = createMarker(new GPoint(-74.78109741,39.62450027),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hammonton Ecdc Elementary School",'Hammonton=' + Hammonton.length);
Hammonton[Hammonton.length] = createMarker(new GPoint(-74.78079987,39.62549973),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Hammonton High School",'Hammonton=' + Hammonton.length);
Hammonton[Hammonton.length] = createMarker(new GPoint(-74.78079987,39.62549973),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Hammonton Middle School",'Hammonton=' + Hammonton.length);
Elwood[Elwood.length] = createMarker(new GPoint(-74.71720123,39.57630157),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hilda E. Frame Pre School",'Elwood=' + Elwood.length);
Corbin_City[Corbin_City.length] = createMarker(new GPoint(-74.76893616,39.31054306),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Hostler Hall",'Corbin_City=' + Corbin_City.length);
Atlantic_City[Atlantic_City.length] = createMarker(new GPoint(-74.43411255,39.36191940),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Indiana Ave Elementary School",'Atlantic_City=' + Atlantic_City.length);
Buena[Buena.length] = createMarker(new GPoint(-74.91032410,39.50732422),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("John C. Milanesi Elementary School",'Buena=' + Buena.length);
Somers_Point[Somers_Point.length] = createMarker(new GPoint(-74.60119629,39.31869888),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Jordan Rd Elementary School",'Somers_Point=' + Somers_Point.length);
Mays_Landing[Mays_Landing.length] = createMarker(new GPoint(-74.73840332,39.46810150),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Joseph C Shaner Memorial Elementary School",'Mays_Landing=' + Mays_Landing.length);
Atlantic_City[Atlantic_City.length] = createMarker(new GPoint(-74.41436768,39.36751556),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Learning Center Charter School",'Atlantic_City=' + Atlantic_City.length);
Pleasantville[Pleasantville.length] = createMarker(new GPoint(-74.50987244,39.40848160),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Leeds Ave Elementary School",'Pleasantville=' + Pleasantville.length);
Linwood[Linwood.length] = createMarker(new GPoint(-74.57440186,39.34659958),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Mainland Regional High School",'Linwood=' + Linwood.length);
Elwood[Elwood.length] = createMarker(new GPoint(-74.71720123,39.57630157),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Mullica Township Middle School",'Elwood=' + Elwood.length);
Elwood[Elwood.length] = createMarker(new GPoint(-74.71720123,39.57630157),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mullica Township Primary",'Elwood=' + Elwood.length);
Corbin_City[Corbin_City.length] = createMarker(new GPoint(-74.76952362,39.30995560),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("N J Reg Day-corbin",'Corbin_City=' + Corbin_City.length);
Atlantic_City[Atlantic_City.length] = createMarker(new GPoint(-74.41950989,39.36632156),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("New Jersey Ave Elementary School",'Atlantic_City=' + Atlantic_City.length);
Somers_Point[Somers_Point.length] = createMarker(new GPoint(-74.59647000,39.31596000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("New York Avenue School",'Somers_Point=' + Somers_Point.length);
Pleasantville[Pleasantville.length] = createMarker(new GPoint(-74.51873016,39.39599609),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("North Main St Elementary School",'Pleasantville=' + Pleasantville.length);
Northfield[Northfield.length] = createMarker(new GPoint(-74.56072998,39.36822128),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Northfield Community Elementary School",'Northfield=' + Northfield.length);
Northfield[Northfield.length] = createMarker(new GPoint(-74.56072998,39.36822128),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Northfield Community Middle School",'Northfield=' + Northfield.length);
Mays_Landing[Mays_Landing.length] = createMarker(new GPoint(-74.73840332,39.46810150),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Oakcrest High School",'Mays_Landing=' + Mays_Landing.length);
Atlantic_City[Atlantic_City.length] = createMarker(new GPoint(-74.43475342,39.36357117),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Oceanside Charter School",'Atlantic_City=' + Atlantic_City.length);
Oceanville[Oceanville.length] = createMarker(new GPoint(-74.46080017,39.47109985),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Oceanville School",'Oceanville=' + Oceanville.length);
Atlantic_City[Atlantic_City.length] = createMarker(new GPoint(-74.43449402,39.36014938),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Ohio Ave Middle School",'Atlantic_City=' + Atlantic_City.length);
Pleasantville[Pleasantville.length] = createMarker(new GPoint(-74.52740479,39.39533997),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Pleasantech Academy Charter School",'Pleasantville=' + Pleasantville.length);
Pleasantville[Pleasantville.length] = createMarker(new GPoint(-74.53340912,39.39194107),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Pleasantville Charter School For Acad. Excellence",'Pleasantville=' + Pleasantville.length);
Pleasantville[Pleasantville.length] = createMarker(new GPoint(-74.52618408,39.40610886),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Pleasantville High School",'Pleasantville=' + Pleasantville.length);
Pleasantville[Pleasantville.length] = createMarker(new GPoint(-74.52601624,39.40724182),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Pleasantville Middle School",'Pleasantville=' + Pleasantville.length);
Egg_Harbor[Egg_Harbor.length] = createMarker(new GPoint(-74.57550049,39.47829819),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Pomona Elementary School",'Egg_Harbor=' + Egg_Harbor.length);
Port_Republic[Port_Republic.length] = createMarker(new GPoint(-74.48880005,39.52840042),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Port Republic Elementary School",'Port_Republic=' + Port_Republic.length);
Galloway[Galloway.length] = createMarker(new GPoint(-74.51490021,39.48611832),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Reeds Road Elementary School",'Galloway=' + Galloway.length);
Atlantic_City[Atlantic_City.length] = createMarker(new GPoint(-74.45893860,39.34730148),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Richmond Ave Elementary School",'Atlantic_City=' + Atlantic_City.length);
Galloway[Galloway.length] = createMarker(new GPoint(-74.51474762,39.48595810),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Roland Rogers Elementary School",'Galloway=' + Galloway.length);
Linwood[Linwood.length] = createMarker(new GPoint(-74.57440186,39.34659958),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Seaview Elementary School",'Linwood=' + Linwood.length);
Galloway[Galloway.length] = createMarker(new GPoint(-74.46080017,39.47109985),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Smithville Elementary School",'Galloway=' + Galloway.length);
South_Egg_Harbor[South_Egg_Harbor.length] = createMarker(new GPoint(-74.61940002,39.54869843),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("South Egg Harbor Elementary School",'South_Egg_Harbor=' + South_Egg_Harbor.length);
Pleasantville[Pleasantville.length] = createMarker(new GPoint(-74.52875519,39.38473892),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("South Main St Elementary School",'Pleasantville=' + Pleasantville.length);
Atlantic_City[Atlantic_City.length] = createMarker(new GPoint(-74.44113922,39.35298157),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Texas Avenue Elementary School",'Atlantic_City=' + Atlantic_City.length);
Margate[Margate.length] = createMarker(new GPoint(-74.51216125,39.32519913),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Union Ave Elementary School",'Margate=' + Margate.length);
Atlantic_City[Atlantic_City.length] = createMarker(new GPoint(-74.41662598,39.37056351),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Uptown Sch00l Complex Elementary School",'Atlantic_City=' + Atlantic_City.length);
Atlantic_City[Atlantic_City.length] = createMarker(new GPoint(-74.44724274,39.37523270),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Venice Park",'Atlantic_City=' + Atlantic_City.length);
Ventnor[Ventnor.length] = createMarker(new GPoint(-74.49525452,39.34087753),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Ventnor Elementary School",'Ventnor=' + Ventnor.length);
Ventnor[Ventnor.length] = createMarker(new GPoint(-74.48190308,39.34199905),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Ventnor Middle School",'Ventnor=' + Ventnor.length);
Hammonton[Hammonton.length] = createMarker(new GPoint(-74.80464172,39.64778900),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Warren E Sooy Jr-elem School",'Hammonton=' + Hammonton.length);
Pleasantville[Pleasantville.length] = createMarker(new GPoint(-74.52586365,39.39315414),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Washington Avenue Elementary School",'Pleasantville=' + Pleasantville.length);
Dorothy[Dorothy.length] = createMarker(new GPoint(-74.82849884,39.40299988),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Weymouth Township Elementary School",'Dorothy=' + Dorothy.length);
Mays_Landing[Mays_Landing.length] = createMarker(new GPoint(-74.73840332,39.46810150),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("William Davies Middle School",'Mays_Landing=' + Mays_Landing.length);
Margate[Margate.length] = createMarker(new GPoint(-74.51444900,39.33767000),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("William H Ross Iii Intermediate School",'Margate=' + Margate.length);
Landisville[Landisville.length] = createMarker(new GPoint(-74.94239807,39.52616119),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Wm B. Donini Elementary School",'Landisville=' + Landisville.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(Absecon);
map.removeOverlays(Atlantic_City);
map.removeOverlays(Brigantine);
map.removeOverlays(Buena);
map.removeOverlays(Cologne);
map.removeOverlays(Corbin_City);
map.removeOverlays(Dorothy);
map.removeOverlays(Egg_Harbor);
map.removeOverlays(Egg_Harbor_City);
map.removeOverlays(Egg_Harbor_Township);
map.removeOverlays(Egg_Harbor_Twp);
map.removeOverlays(Elwood);
map.removeOverlays(Estell_Manor);
map.removeOverlays(Folsom);
map.removeOverlays(Galloway);
map.removeOverlays(Hammonton);
map.removeOverlays(Landisville);
map.removeOverlays(Linwood);
map.removeOverlays(Margate);
map.removeOverlays(Mays_Landing);
map.removeOverlays(Minotola);
map.removeOverlays(Northfield);
map.removeOverlays(Oceanville);
map.removeOverlays(Pleasantville);
map.removeOverlays(Port_Republic);
map.removeOverlays(Somers_Point);
map.removeOverlays(South_Egg_Harbor);
map.removeOverlays(Ventnor);
map.removeOverlays(Williamstown);
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(Absecon);map.removeOverlays(Absecon);
map.removeOverlays(Atlantic_City);
map.removeOverlays(Brigantine);
map.removeOverlays(Buena);
map.removeOverlays(Cologne);
map.removeOverlays(Corbin_City);
map.removeOverlays(Dorothy);
map.removeOverlays(Egg_Harbor);
map.removeOverlays(Egg_Harbor_City);
map.removeOverlays(Egg_Harbor_Township);
map.removeOverlays(Egg_Harbor_Twp);
map.removeOverlays(Elwood);
map.removeOverlays(Estell_Manor);
map.removeOverlays(Folsom);
map.removeOverlays(Galloway);
map.removeOverlays(Hammonton);
map.removeOverlays(Landisville);
map.removeOverlays(Linwood);
map.removeOverlays(Margate);
map.removeOverlays(Mays_Landing);
map.removeOverlays(Minotola);
map.removeOverlays(Northfield);
map.removeOverlays(Oceanville);
map.removeOverlays(Pleasantville);
map.removeOverlays(Port_Republic);
map.removeOverlays(Somers_Point);
map.removeOverlays(South_Egg_Harbor);
map.removeOverlays(Ventnor);
map.removeOverlays(Williamstown);
map.addOverlays(Absecon);
centerByArray(Absecon, false, false);
cntMarker += Absecon.length;
map.addOverlays(Atlantic_City);
centerByArray(Atlantic_City, false, false);
cntMarker += Atlantic_City.length;
map.addOverlays(Brigantine);
centerByArray(Brigantine, false, false);
cntMarker += Brigantine.length;
map.addOverlays(Buena);
centerByArray(Buena, false, false);
cntMarker += Buena.length;
map.addOverlays(Cologne);
centerByArray(Cologne, false, false);
cntMarker += Cologne.length;
map.addOverlays(Corbin_City);
centerByArray(Corbin_City, false, false);
cntMarker += Corbin_City.length;
map.addOverlays(Dorothy);
centerByArray(Dorothy, false, false);
cntMarker += Dorothy.length;
map.addOverlays(Egg_Harbor);
centerByArray(Egg_Harbor, false, false);
cntMarker += Egg_Harbor.length;
map.addOverlays(Egg_Harbor_City);
centerByArray(Egg_Harbor_City, false, false);
cntMarker += Egg_Harbor_City.length;
map.addOverlays(Egg_Harbor_Township);
centerByArray(Egg_Harbor_Township, false, false);
cntMarker += Egg_Harbor_Township.length;
map.addOverlays(Egg_Harbor_Twp);
centerByArray(Egg_Harbor_Twp, false, false);
cntMarker += Egg_Harbor_Twp.length;
map.addOverlays(Elwood);
centerByArray(Elwood, false, false);
cntMarker += Elwood.length;
map.addOverlays(Estell_Manor);
centerByArray(Estell_Manor, false, false);
cntMarker += Estell_Manor.length;
map.addOverlays(Folsom);
centerByArray(Folsom, false, false);
cntMarker += Folsom.length;
map.addOverlays(Galloway);
centerByArray(Galloway, false, false);
cntMarker += Galloway.length;
map.addOverlays(Hammonton);
centerByArray(Hammonton, false, false);
cntMarker += Hammonton.length;
map.addOverlays(Landisville);
centerByArray(Landisville, false, false);
cntMarker += Landisville.length;
map.addOverlays(Linwood);
centerByArray(Linwood, false, false);
cntMarker += Linwood.length;
map.addOverlays(Margate);
centerByArray(Margate, false, false);
cntMarker += Margate.length;
map.addOverlays(Mays_Landing);
centerByArray(Mays_Landing, false, false);
cntMarker += Mays_Landing.length;
map.addOverlays(Minotola);
centerByArray(Minotola, false, false);
cntMarker += Minotola.length;
map.addOverlays(Northfield);
centerByArray(Northfield, false, false);
cntMarker += Northfield.length;
map.addOverlays(Oceanville);
centerByArray(Oceanville, false, false);
cntMarker += Oceanville.length;
map.addOverlays(Pleasantville);
centerByArray(Pleasantville, false, false);
cntMarker += Pleasantville.length;
map.addOverlays(Port_Republic);
centerByArray(Port_Republic, false, false);
cntMarker += Port_Republic.length;
map.addOverlays(Somers_Point);
centerByArray(Somers_Point, false, false);
cntMarker += Somers_Point.length;
map.addOverlays(South_Egg_Harbor);
centerByArray(South_Egg_Harbor, false, false);
cntMarker += South_Egg_Harbor.length;
map.addOverlays(Ventnor);
centerByArray(Ventnor, false, false);
cntMarker += Ventnor.length;
map.addOverlays(Williamstown);
centerByArray(Williamstown, false, false);
cntMarker += Williamstown.length;
centerByArray(Absecon,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');
}
}