function addMarkers()
{
mySelect = document.getElementById('selection');
Sewell = [];Glassboro = [];Turnersville = [];Paulsboro = [];Franklinville = [];Logan_Twp = [];Deptford = [];Mantua = [];Clayton = [];Mullica_Hill = [];Newfield = [];Pitman = [];Woodbury = [];Woodbury_Hts = [];Woolwich_Twp = [];Gibbstown = [];Williamstown = [];Mickleton = [];Swedesboro = [];National_Park = [];Wenonah = [];Westville = [];Thorofare = [];Harrisonville = [];West_Deptford = [];mySelect.options[mySelect.options.length] = new Option("Clayton schools",'all=Clayton');
mySelect.options[mySelect.options.length] = new Option("Deptford schools",'all=Deptford');
mySelect.options[mySelect.options.length] = new Option("Franklinville schools",'all=Franklinville');
mySelect.options[mySelect.options.length] = new Option("Gibbstown schools",'all=Gibbstown');
mySelect.options[mySelect.options.length] = new Option("Glassboro schools",'all=Glassboro');
mySelect.options[mySelect.options.length] = new Option("Harrisonville schools",'all=Harrisonville');
mySelect.options[mySelect.options.length] = new Option("Logan Twp schools",'all=Logan_Twp');
mySelect.options[mySelect.options.length] = new Option("Mantua schools",'all=Mantua');
mySelect.options[mySelect.options.length] = new Option("Mickleton schools",'all=Mickleton');
mySelect.options[mySelect.options.length] = new Option("Mullica Hill schools",'all=Mullica_Hill');
mySelect.options[mySelect.options.length] = new Option("National Park schools",'all=National_Park');
mySelect.options[mySelect.options.length] = new Option("Newfield schools",'all=Newfield');
mySelect.options[mySelect.options.length] = new Option("Paulsboro schools",'all=Paulsboro');
mySelect.options[mySelect.options.length] = new Option("Pitman schools",'all=Pitman');
mySelect.options[mySelect.options.length] = new Option("Sewell schools",'all=Sewell');
mySelect.options[mySelect.options.length] = new Option("Swedesboro schools",'all=Swedesboro');
mySelect.options[mySelect.options.length] = new Option("Thorofare schools",'all=Thorofare');
mySelect.options[mySelect.options.length] = new Option("Turnersville schools",'all=Turnersville');
mySelect.options[mySelect.options.length] = new Option("Wenonah schools",'all=Wenonah');
mySelect.options[mySelect.options.length] = new Option("West Deptford schools",'all=West_Deptford');
mySelect.options[mySelect.options.length] = new Option("Westville schools",'all=Westville');
mySelect.options[mySelect.options.length] = new Option("Williamstown schools",'all=Williamstown');
mySelect.options[mySelect.options.length] = new Option("Woodbury schools",'all=Woodbury');
mySelect.options[mySelect.options.length] = new Option("Woodbury Hts schools",'all=Woodbury_Hts');
mySelect.options[mySelect.options.length] = new Option("Woolwich Twp schools",'all=Woolwich_Twp');
mySelect.options[mySelect.options.length] = new Option("---------------------------",'');
Sewell[Sewell.length] = createMarker(new GPoint(-75.11669922,39.70040131),"
",iconGr);
mySelect.options[mySelect.options.length] = new Option("Alternative High School Glassboro",'Sewell=' + Sewell.length);
Glassboro[Glassboro.length] = createMarker(new GPoint(-75.17688751,39.68494797),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Aura Elementary School",'Glassboro=' + Glassboro.length);
Sewell[Sewell.length] = createMarker(new GPoint(-75.12143707,39.79283524),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Bankbridge Regional School",'Sewell=' + Sewell.length);
Turnersville[Turnersville.length] = createMarker(new GPoint(-75.07615662,39.75084686),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Bells Elementary School",'Turnersville=' + Turnersville.length);
Paulsboro[Paulsboro.length] = createMarker(new GPoint(-75.24364471,39.84300613),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Billingsport Elementary School",'Paulsboro=' + Paulsboro.length);
Turnersville[Turnersville.length] = createMarker(new GPoint(-75.05111694,39.74456787),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Birches Elementary School",'Turnersville=' + Turnersville.length);
Sewell[Sewell.length] = createMarker(new GPoint(-75.09960175,39.75159836),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Bunker Hill Middle School",'Sewell=' + Sewell.length);
Franklinville[Franklinville.length] = createMarker(new GPoint(-75.07248688,39.60877228),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Caroline L Reutter School",'Franklinville=' + Franklinville.length);
Logan_Twp[Logan_Twp.length] = createMarker(new GPoint(-75.35750580,39.75599289),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Center Square School",'Logan_Twp=' + Logan_Twp.length);
Deptford[Deptford.length] = createMarker(new GPoint(-75.12830353,39.82960129),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Central Early Childhood Elementary School",'Deptford=' + Deptford.length);
Mantua[Mantua.length] = createMarker(new GPoint(-75.18164825,39.77379608),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Centre City Elementary School",'Mantua=' + Mantua.length);
Sewell[Sewell.length] = createMarker(new GPoint(-75.09960175,39.75159836),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Chestnut Ridge Middle School",'Sewell=' + Sewell.length);
Clayton[Clayton.length] = createMarker(new GPoint(-75.08617401,39.66277695),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Clayton High School",'Clayton=' + Clayton.length);
Clayton[Clayton.length] = createMarker(new GPoint(-75.08617401,39.66277695),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Clayton Middle School",'Clayton=' + Clayton.length);
Mullica_Hill[Mullica_Hill.length] = createMarker(new GPoint(-75.20924377,39.75197601),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Clearview Regional High School",'Mullica_Hill=' + Mullica_Hill.length);
Mullica_Hill[Mullica_Hill.length] = createMarker(new GPoint(-75.20283508,39.75211334),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Clearview Regional Middle School",'Mullica_Hill=' + Mullica_Hill.length);
Franklinville[Franklinville.length] = createMarker(new GPoint(-75.05290222,39.61360168),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Delsea Regional High School",'Franklinville=' + Franklinville.length);
Franklinville[Franklinville.length] = createMarker(new GPoint(-75.05290222,39.61360168),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Delsea Regional Middle School",'Franklinville=' + Franklinville.length);
Deptford[Deptford.length] = createMarker(new GPoint(-75.12461853,39.82611847),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Deptford Central Elementary School",'Deptford=' + Deptford.length);
Deptford[Deptford.length] = createMarker(new GPoint(-75.10777283,39.81380081),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Deptford Township High School",'Deptford=' + Deptford.length);
Glassboro[Glassboro.length] = createMarker(new GPoint(-75.11579895,39.70557022),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Dorothy L Bullock School",'Glassboro=' + Glassboro.length);
Newfield[Newfield.length] = createMarker(new GPoint(-75.01917267,39.54767990),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Edgarton Memorial Elementary School",'Newfield=' + Newfield.length);
Pitman[Pitman.length] = createMarker(new GPoint(-75.12126160,39.72704315),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Elwood Kindle Elementary School",'Pitman=' + Pitman.length);
Woodbury[Woodbury.length] = createMarker(new GPoint(-75.12889862,39.82949829),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Evergreen Ave Elementary School",'Woodbury=' + Woodbury.length);
Woodbury_Hts[Woodbury_Hts.length] = createMarker(new GPoint(-75.14002228,39.81962585),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Gateway Regional High Sch00l",'Woodbury_Hts=' + Woodbury_Hts.length);
Glassboro[Glassboro.length] = createMarker(new GPoint(-75.11669922,39.70040131),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Glassboro High School",'Glassboro=' + Glassboro.length);
Glassboro[Glassboro.length] = createMarker(new GPoint(-75.11669922,39.70040131),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Glassboro Intermediate",'Glassboro=' + Glassboro.length);
Sewell[Sewell.length] = createMarker(new GPoint(-75.09960175,39.75159836),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Gloucester City Institutional Of Te High School",'Sewell=' + Sewell.length);
Deptford[Deptford.length] = createMarker(new GPoint(-75.10974121,39.81696320),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Good Intent Elementary School",'Deptford=' + Deptford.length);
Woolwich_Twp[Woolwich_Twp.length] = createMarker(new GPoint(-10.00000000,10.00000000),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Gov. Charles C. Stratton",'Woolwich_Twp=' + Woolwich_Twp.length);
Woodbury[Woodbury.length] = createMarker(new GPoint(-75.16957092,39.81523514),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Green Fields Elementary School",'Woodbury=' + Woodbury.length);
Gibbstown[Gibbstown.length] = createMarker(new GPoint(-75.28393555,39.82556915),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Greenwich Township Elementary School",'Gibbstown=' + Gibbstown.length);
Sewell[Sewell.length] = createMarker(new GPoint(-75.09960175,39.75159836),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Grenloch Terr Early Child Elementary School",'Sewell=' + Sewell.length);
Mullica_Hill[Mullica_Hill.length] = createMarker(new GPoint(-75.22475433,39.74275589),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Harrison Township Elementary School",'Mullica_Hill=' + Mullica_Hill.length);
Clayton[Clayton.length] = createMarker(new GPoint(-75.09754944,39.65179062),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Herma S. Simmons Elementary School",'Clayton=' + Clayton.length);
Williamstown[Williamstown.length] = createMarker(new GPoint(-75.00517273,39.69391251),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Holly Glen Elementary School",'Williamstown=' + Williamstown.length);
Sewell[Sewell.length] = createMarker(new GPoint(-75.09960175,39.75159836),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hurffville Elementary School",'Sewell=' + Sewell.length);
Glassboro[Glassboro.length] = createMarker(new GPoint(-75.12796021,39.70584869),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("J Harvey Rodgers School",'Glassboro=' + Glassboro.length);
Mantua[Mantua.length] = createMarker(new GPoint(-75.16950226,39.78400040),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("J Mason Tomlin Elementary School",'Mantua=' + Mantua.length);
Mickleton[Mickleton.length] = createMarker(new GPoint(-75.24208832,39.78887177),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Jeffrey Clark School",'Mickleton=' + Mickleton.length);
Woolwich_Twp[Woolwich_Twp.length] = createMarker(new GPoint(-75.30767822,39.74972916),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Kingsway Regional High School",'Woolwich_Twp=' + Woolwich_Twp.length);
Woolwich_Twp[Woolwich_Twp.length] = createMarker(new GPoint(-75.30776215,39.74967194),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Kingsway Regional Middle School",'Woolwich_Twp=' + Woolwich_Twp.length);
Deptford[Deptford.length] = createMarker(new GPoint(-75.14369965,39.82307816),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lake Tract Elementary School",'Deptford=' + Deptford.length);
Logan_Twp[Logan_Twp.length] = createMarker(new GPoint(-75.35380554,39.75125504),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Logan Elementary School",'Logan_Twp=' + Logan_Twp.length);
Paulsboro[Paulsboro.length] = createMarker(new GPoint(-75.23953247,39.82511139),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Loudenslager Elementary School",'Paulsboro=' + Paulsboro.length);
Newfield[Newfield.length] = createMarker(new GPoint(-74.99948120,39.55762863),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Main Road School",'Newfield=' + Newfield.length);
Swedesboro[Swedesboro.length] = createMarker(new GPoint(-75.31313324,39.74597931),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Margaret C Clifford School",'Swedesboro=' + Swedesboro.length);
Franklinville[Franklinville.length] = createMarker(new GPoint(-75.02366638,39.61867142),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mary F. Janvier School",'Franklinville=' + Franklinville.length);
Pitman[Pitman.length] = createMarker(new GPoint(-75.13865662,39.73419952),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Memorial Elementary School",'Pitman=' + Pitman.length);
Sewell[Sewell.length] = createMarker(new GPoint(-75.12390137,39.79287338),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Monongahela Middle School",'Sewell=' + Sewell.length);
National_Park[National_Park.length] = createMarker(new GPoint(-75.18231964,39.86573410),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("National Park Elementary School",'National_Park=' + National_Park.length);
Gibbstown[Gibbstown.length] = createMarker(new GPoint(-75.26676178,39.81723785),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Nehaunsey Middle School",'Gibbstown=' + Gibbstown.length);
Deptford[Deptford.length] = createMarker(new GPoint(-75.12460327,39.80710602),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("New Sharon",'Deptford=' + Deptford.length);
Williamstown[Williamstown.length] = createMarker(new GPoint(-74.99632263,39.68225479),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Oak Knoll Elementary School",'Williamstown=' + Williamstown.length);
Wenonah[Wenonah.length] = createMarker(new GPoint(-75.16007996,39.80643463),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Oak Valley Elementary School",'Wenonah=' + Wenonah.length);
Woodbury[Woodbury.length] = createMarker(new GPoint(-75.15571594,39.85210419),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Oakview Elementary School",'Woodbury=' + Woodbury.length);
Sewell[Sewell.length] = createMarker(new GPoint(-75.09960175,39.75159836),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Orchard Valley Middle School",'Sewell=' + Sewell.length);
Westville[Westville.length] = createMarker(new GPoint(-75.13529968,39.86069870),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Parkview Elementary School",'Westville=' + Westville.length);
Paulsboro[Paulsboro.length] = createMarker(new GPoint(-75.24385071,39.83726120),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Paulsboro High School",'Paulsboro=' + Paulsboro.length);
Wenonah[Wenonah.length] = createMarker(new GPoint(-75.16241455,39.79695511),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Pine Acres Elementary School",'Wenonah=' + Wenonah.length);
Pitman[Pitman.length] = createMarker(new GPoint(-75.12756348,39.73974609),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Pitman High School",'Pitman=' + Pitman.length);
Pitman[Pitman.length] = createMarker(new GPoint(-75.12767792,39.73455048),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Pitman Middle School",'Pitman=' + Pitman.length);
Mullica_Hill[Mullica_Hill.length] = createMarker(new GPoint(-75.20850372,39.74741745),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Pleasant Valley School",'Mullica_Hill=' + Mullica_Hill.length);
Williamstown[Williamstown.length] = createMarker(new GPoint(-74.97694397,39.69281387),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Radix Elementary School",'Williamstown=' + Williamstown.length);
Thorofare[Thorofare.length] = createMarker(new GPoint(-75.16817474,39.86700058),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Red Bank Elementary School",'Thorofare=' + Thorofare.length);
Mickleton[Mickleton.length] = createMarker(new GPoint(-75.24369049,39.78677750),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Samuel Mickle School",'Mickleton=' + Mickleton.length);
Sewell[Sewell.length] = createMarker(new GPoint(-75.13655090,39.76492691),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Sewell Elementary School",'Sewell=' + Sewell.length);
Westville[Westville.length] = createMarker(new GPoint(-75.13247681,39.84963608),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Shady Lane Elementary School",'Westville=' + Westville.length);
Harrisonville[Harrisonville.length] = createMarker(new GPoint(-75.26763916,39.68473816),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("South Harrison Elementary School",'Harrisonville=' + Harrisonville.length);
Glassboro[Glassboro.length] = createMarker(new GPoint(-75.11669922,39.70040131),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Thomas E Bowe Middle School",'Glassboro=' + Glassboro.length);
Turnersville[Turnersville.length] = createMarker(new GPoint(-75.07417297,39.73057175),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Thomas Jefferson Elementary School",'Turnersville=' + Turnersville.length);
Pitman[Pitman.length] = createMarker(new GPoint(-75.13528442,39.72940445),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("W.c.k. Walls Elementary School",'Pitman=' + Pitman.length);
Woodbury[Woodbury.length] = createMarker(new GPoint(-75.12889862,39.82949829),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Walnut St Elementary School",'Woodbury=' + Woodbury.length);
Swedesboro[Swedesboro.length] = createMarker(new GPoint(-75.31988525,39.73382950),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Walter H Hill Elementary School",'Swedesboro=' + Swedesboro.length);
Sewell[Sewell.length] = createMarker(new GPoint(-75.09960175,39.75159836),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Washington Township High School",'Sewell=' + Sewell.length);
Sewell[Sewell.length] = createMarker(new GPoint(-75.07270813,39.76192093),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Wedgwood School",'Sewell=' + Sewell.length);
Wenonah[Wenonah.length] = createMarker(new GPoint(-75.14899445,39.79412842),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Wenonah Elementary School",'Wenonah=' + Wenonah.length);
Westville[Westville.length] = createMarker(new GPoint(-75.13529968,39.86069870),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("West Deptford High School",'Westville=' + Westville.length);
West_Deptford[West_Deptford.length] = createMarker(new GPoint(-75.19326782,39.82942963),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("West Deptford Middle School",'West_Deptford=' + West_Deptford.length);
Woodbury[Woodbury.length] = createMarker(new GPoint(-75.12889862,39.82949829),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("West End Memorial E.s. Elementary School",'Woodbury=' + Woodbury.length);
Williamstown[Williamstown.length] = createMarker(new GPoint(-74.94732666,39.64758301),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Whitehall Elementary School",'Williamstown=' + Williamstown.length);
Turnersville[Turnersville.length] = createMarker(new GPoint(-75.03433228,39.75058746),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Whitman Elementary School",'Turnersville=' + Turnersville.length);
Williamstown[Williamstown.length] = createMarker(new GPoint(-75.01797485,39.68481827),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Williamstown High School",'Williamstown=' + Williamstown.length);
Williamstown[Williamstown.length] = createMarker(new GPoint(-75.01844788,39.66793060),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Williamstown Middle School",'Williamstown=' + Williamstown.length);
Woodbury_Hts[Woodbury_Hts.length] = createMarker(new GPoint(-75.14994812,39.81668472),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Woodbury Heights Elementary School",'Woodbury_Hts=' + Woodbury_Hts.length);
Woodbury[Woodbury.length] = createMarker(new GPoint(-75.15269470,39.83875275),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Woodbury Jr-sr High School",'Woodbury=' + Woodbury.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(Clayton);
map.removeOverlays(Deptford);
map.removeOverlays(Franklinville);
map.removeOverlays(Gibbstown);
map.removeOverlays(Glassboro);
map.removeOverlays(Harrisonville);
map.removeOverlays(Logan_Twp);
map.removeOverlays(Mantua);
map.removeOverlays(Mickleton);
map.removeOverlays(Mullica_Hill);
map.removeOverlays(National_Park);
map.removeOverlays(Newfield);
map.removeOverlays(Paulsboro);
map.removeOverlays(Pitman);
map.removeOverlays(Sewell);
map.removeOverlays(Swedesboro);
map.removeOverlays(Thorofare);
map.removeOverlays(Turnersville);
map.removeOverlays(Wenonah);
map.removeOverlays(West_Deptford);
map.removeOverlays(Westville);
map.removeOverlays(Williamstown);
map.removeOverlays(Woodbury);
map.removeOverlays(Woodbury_Hts);
map.removeOverlays(Woolwich_Twp);
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(Sewell);map.removeOverlays(Clayton);
map.removeOverlays(Deptford);
map.removeOverlays(Franklinville);
map.removeOverlays(Gibbstown);
map.removeOverlays(Glassboro);
map.removeOverlays(Harrisonville);
map.removeOverlays(Logan_Twp);
map.removeOverlays(Mantua);
map.removeOverlays(Mickleton);
map.removeOverlays(Mullica_Hill);
map.removeOverlays(National_Park);
map.removeOverlays(Newfield);
map.removeOverlays(Paulsboro);
map.removeOverlays(Pitman);
map.removeOverlays(Sewell);
map.removeOverlays(Swedesboro);
map.removeOverlays(Thorofare);
map.removeOverlays(Turnersville);
map.removeOverlays(Wenonah);
map.removeOverlays(West_Deptford);
map.removeOverlays(Westville);
map.removeOverlays(Williamstown);
map.removeOverlays(Woodbury);
map.removeOverlays(Woodbury_Hts);
map.removeOverlays(Woolwich_Twp);
map.addOverlays(Clayton);
centerByArray(Clayton, false, false);
cntMarker += Clayton.length;
map.addOverlays(Deptford);
centerByArray(Deptford, false, false);
cntMarker += Deptford.length;
map.addOverlays(Franklinville);
centerByArray(Franklinville, false, false);
cntMarker += Franklinville.length;
map.addOverlays(Gibbstown);
centerByArray(Gibbstown, false, false);
cntMarker += Gibbstown.length;
map.addOverlays(Glassboro);
centerByArray(Glassboro, false, false);
cntMarker += Glassboro.length;
map.addOverlays(Harrisonville);
centerByArray(Harrisonville, false, false);
cntMarker += Harrisonville.length;
map.addOverlays(Logan_Twp);
centerByArray(Logan_Twp, false, false);
cntMarker += Logan_Twp.length;
map.addOverlays(Mantua);
centerByArray(Mantua, false, false);
cntMarker += Mantua.length;
map.addOverlays(Mickleton);
centerByArray(Mickleton, false, false);
cntMarker += Mickleton.length;
map.addOverlays(Mullica_Hill);
centerByArray(Mullica_Hill, false, false);
cntMarker += Mullica_Hill.length;
map.addOverlays(National_Park);
centerByArray(National_Park, false, false);
cntMarker += National_Park.length;
map.addOverlays(Newfield);
centerByArray(Newfield, false, false);
cntMarker += Newfield.length;
map.addOverlays(Paulsboro);
centerByArray(Paulsboro, false, false);
cntMarker += Paulsboro.length;
map.addOverlays(Pitman);
centerByArray(Pitman, false, false);
cntMarker += Pitman.length;
map.addOverlays(Sewell);
centerByArray(Sewell, false, false);
cntMarker += Sewell.length;
map.addOverlays(Swedesboro);
centerByArray(Swedesboro, false, false);
cntMarker += Swedesboro.length;
map.addOverlays(Thorofare);
centerByArray(Thorofare, false, false);
cntMarker += Thorofare.length;
map.addOverlays(Turnersville);
centerByArray(Turnersville, false, false);
cntMarker += Turnersville.length;
map.addOverlays(Wenonah);
centerByArray(Wenonah, false, false);
cntMarker += Wenonah.length;
map.addOverlays(West_Deptford);
centerByArray(West_Deptford, false, false);
cntMarker += West_Deptford.length;
map.addOverlays(Westville);
centerByArray(Westville, false, false);
cntMarker += Westville.length;
map.addOverlays(Williamstown);
centerByArray(Williamstown, false, false);
cntMarker += Williamstown.length;
map.addOverlays(Woodbury);
centerByArray(Woodbury, false, false);
cntMarker += Woodbury.length;
map.addOverlays(Woodbury_Hts);
centerByArray(Woodbury_Hts, false, false);
cntMarker += Woodbury_Hts.length;
map.addOverlays(Woolwich_Twp);
centerByArray(Woolwich_Twp, false, false);
cntMarker += Woolwich_Twp.length;
centerByArray(Sewell,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');
}
}