function addMarkers()
{
mySelect = document.getElementById('selection');
Kempton = [];Reading = [];Douglassville = [];Blandon = [];Oley = [];Leesport = [];Bethel = [];Birdsboro = [];Boyertown = [];Topton = [];Mohnton = [];Wernersville = [];Robesonia = [];Womelsdorf = [];Sinking_Spring = [];Shillington = [];Fleetwood = [];Lenhartsville = [];Hamburg = [];Hereford = [];Kutztown = [];West_Lawn = [];Mertztown = [];Mount_Penn = [];Laureldale = [];Bernville = [];Shoemakersville = [];Wyomissing = [];Strausstown = [];Elverson = [];Shartlesville = [];Barto = [];West_Reading = [];mySelect.options[mySelect.options.length] = new Option("Barto schools",'all=Barto');
mySelect.options[mySelect.options.length] = new Option("Bernville schools",'all=Bernville');
mySelect.options[mySelect.options.length] = new Option("Bethel schools",'all=Bethel');
mySelect.options[mySelect.options.length] = new Option("Birdsboro schools",'all=Birdsboro');
mySelect.options[mySelect.options.length] = new Option("Blandon schools",'all=Blandon');
mySelect.options[mySelect.options.length] = new Option("Boyertown schools",'all=Boyertown');
mySelect.options[mySelect.options.length] = new Option("Douglassville schools",'all=Douglassville');
mySelect.options[mySelect.options.length] = new Option("Elverson schools",'all=Elverson');
mySelect.options[mySelect.options.length] = new Option("Fleetwood schools",'all=Fleetwood');
mySelect.options[mySelect.options.length] = new Option("Hamburg schools",'all=Hamburg');
mySelect.options[mySelect.options.length] = new Option("Hereford schools",'all=Hereford');
mySelect.options[mySelect.options.length] = new Option("Kempton schools",'all=Kempton');
mySelect.options[mySelect.options.length] = new Option("Kutztown schools",'all=Kutztown');
mySelect.options[mySelect.options.length] = new Option("Laureldale schools",'all=Laureldale');
mySelect.options[mySelect.options.length] = new Option("Leesport schools",'all=Leesport');
mySelect.options[mySelect.options.length] = new Option("Lenhartsville schools",'all=Lenhartsville');
mySelect.options[mySelect.options.length] = new Option("Mertztown schools",'all=Mertztown');
mySelect.options[mySelect.options.length] = new Option("Mohnton schools",'all=Mohnton');
mySelect.options[mySelect.options.length] = new Option("Mount Penn schools",'all=Mount_Penn');
mySelect.options[mySelect.options.length] = new Option("Oley schools",'all=Oley');
mySelect.options[mySelect.options.length] = new Option("Reading schools",'all=Reading');
mySelect.options[mySelect.options.length] = new Option("Robesonia schools",'all=Robesonia');
mySelect.options[mySelect.options.length] = new Option("Shartlesville schools",'all=Shartlesville');
mySelect.options[mySelect.options.length] = new Option("Shillington schools",'all=Shillington');
mySelect.options[mySelect.options.length] = new Option("Shoemakersville schools",'all=Shoemakersville');
mySelect.options[mySelect.options.length] = new Option("Sinking Spring schools",'all=Sinking_Spring');
mySelect.options[mySelect.options.length] = new Option("Strausstown schools",'all=Strausstown');
mySelect.options[mySelect.options.length] = new Option("Topton schools",'all=Topton');
mySelect.options[mySelect.options.length] = new Option("Wernersville schools",'all=Wernersville');
mySelect.options[mySelect.options.length] = new Option("West Lawn schools",'all=West_Lawn');
mySelect.options[mySelect.options.length] = new Option("West Reading schools",'all=West_Reading');
mySelect.options[mySelect.options.length] = new Option("Womelsdorf schools",'all=Womelsdorf');
mySelect.options[mySelect.options.length] = new Option("Wyomissing schools",'all=Wyomissing');
mySelect.options[mySelect.options.length] = new Option("---------------------------",'');
Kempton[Kempton.length] = createMarker(new GPoint(-75.85823822,40.62392426),"
",iconRd);
mySelect.options[mySelect.options.length] = new Option("Albany Elementary School",'Kempton=' + Kempton.length);
Reading[Reading.length] = createMarker(new GPoint(-75.91812134,40.33031082),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Amanda E Stout Elementary School",'Reading=' + Reading.length);
Douglassville[Douglassville.length] = createMarker(new GPoint(-75.73712158,40.29277039),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Amity Intrmd Center",'Douglassville=' + Douglassville.length);
Douglassville[Douglassville.length] = createMarker(new GPoint(-75.73529053,40.29829788),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Amity Primary Center",'Douglassville=' + Douglassville.length);
Blandon[Blandon.length] = createMarker(new GPoint(-75.88520050,40.44063568),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Andrew Maier Elementary School",'Blandon=' + Blandon.length);
Reading[Reading.length] = createMarker(new GPoint(-75.87051392,40.35245514),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Antietam Middle School High School",'Reading=' + Reading.length);
Oley[Oley.length] = createMarker(new GPoint(-75.79718018,40.38379288),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Berks Ctc-east Campus",'Oley=' + Oley.length);
Leesport[Leesport.length] = createMarker(new GPoint(-76.01715088,40.38109970),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Berks Ctc-west Campus",'Leesport=' + Leesport.length);
Bethel[Bethel.length] = createMarker(new GPoint(-76.28990936,40.46857452),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Bethel Elementary School",'Bethel=' + Bethel.length);
Birdsboro[Birdsboro.length] = createMarker(new GPoint(-75.81393433,40.26353073),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Birdsboro El Center",'Birdsboro=' + Birdsboro.length);
Boyertown[Boyertown.length] = createMarker(new GPoint(-75.63307190,40.32485580),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Boyertown Area Junior High School - West",'Boyertown=' + Boyertown.length);
Boyertown[Boyertown.length] = createMarker(new GPoint(-75.63037109,40.33109283),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Boyertown Area Senior High School",'Boyertown=' + Boyertown.length);
Boyertown[Boyertown.length] = createMarker(new GPoint(-75.63106537,40.32530975),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Boyertown Elementary School",'Boyertown=' + Boyertown.length);
Topton[Topton.length] = createMarker(new GPoint(-75.70320129,40.49936676),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Brandywine Heights High School",'Topton=' + Topton.length);
Topton[Topton.length] = createMarker(new GPoint(-75.70320129,40.49936676),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Brandywine Heights Middle School",'Topton=' + Topton.length);
Mohnton[Mohnton.length] = createMarker(new GPoint(-75.98410034,40.28479004),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Brecknock Elementary School",'Mohnton=' + Mohnton.length);
Boyertown[Boyertown.length] = createMarker(new GPoint(-75.62764740,40.34019089),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Colebrookdale Elementary School",'Boyertown=' + Boyertown.length);
Wernersville[Wernersville.length] = createMarker(new GPoint(-76.07875061,40.32540894),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Conrad Weiser East Elementary School",'Wernersville=' + Wernersville.length);
Robesonia[Robesonia.length] = createMarker(new GPoint(-76.11814117,40.34718704),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Conrad Weiser High School",'Robesonia=' + Robesonia.length);
Robesonia[Robesonia.length] = createMarker(new GPoint(-76.12629700,40.34912491),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Conrad Weiser Middle School",'Robesonia=' + Robesonia.length);
Womelsdorf[Womelsdorf.length] = createMarker(new GPoint(-76.18960571,40.36326981),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Conrad Weiser West Elementary School",'Womelsdorf=' + Womelsdorf.length);
Sinking_Spring[Sinking_Spring.length] = createMarker(new GPoint(-76.01195526,40.31953812),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Cornwall Terrace Elementary School",'Sinking_Spring=' + Sinking_Spring.length);
Shillington[Shillington.length] = createMarker(new GPoint(-75.95511627,40.29827881),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Cumru Elementary School",'Shillington=' + Shillington.length);
Birdsboro[Birdsboro.length] = createMarker(new GPoint(-75.82800293,40.26610184),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Daniel Boone Area High School",'Birdsboro=' + Birdsboro.length);
Douglassville[Douglassville.length] = createMarker(new GPoint(-75.82800293,40.26610184),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Daniel Boone Area Middle School",'Douglassville=' + Douglassville.length);
Topton[Topton.length] = createMarker(new GPoint(-75.70394135,40.50173950),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("District-topton Elementary School",'Topton=' + Topton.length);
Boyertown[Boyertown.length] = createMarker(new GPoint(-75.70613098,40.36839676),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Earl Elementary School",'Boyertown=' + Boyertown.length);
Reading[Reading.length] = createMarker(new GPoint(-75.86803436,40.31738663),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Exeter Township Junior High School",'Reading=' + Reading.length);
Reading[Reading.length] = createMarker(new GPoint(-75.87023926,40.32043076),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Exeter Township Senior High School",'Reading=' + Reading.length);
Fleetwood[Fleetwood.length] = createMarker(new GPoint(-75.82176208,40.45748138),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Fleetwood Elementary School",'Fleetwood=' + Fleetwood.length);
Fleetwood[Fleetwood.length] = createMarker(new GPoint(-75.82300568,40.45693588),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Fleetwood Middle School",'Fleetwood=' + Fleetwood.length);
Fleetwood[Fleetwood.length] = createMarker(new GPoint(-75.83068085,40.45961380),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Fleetwood Senior High School",'Fleetwood=' + Fleetwood.length);
Reading[Reading.length] = createMarker(new GPoint(-75.94974518,40.35736847),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Glenside Elementary School",'Reading=' + Reading.length);
Shillington[Shillington.length] = createMarker(new GPoint(-75.96517181,40.30454636),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Governor Mifflin Middle School",'Shillington=' + Shillington.length);
Shillington[Shillington.length] = createMarker(new GPoint(-75.96191406,40.30181122),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Governor Mifflin Senior High School",'Shillington=' + Shillington.length);
Lenhartsville[Lenhartsville.length] = createMarker(new GPoint(-75.80245209,40.57514191),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Greenwich-lenhartsville Elementary School",'Lenhartsville=' + Lenhartsville.length);
Hamburg[Hamburg.length] = createMarker(new GPoint(-75.97936249,40.54972076),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Hamburg Area High School",'Hamburg=' + Hamburg.length);
Hamburg[Hamburg.length] = createMarker(new GPoint(-75.97936249,40.54972076),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Hamburg Area Middle School",'Hamburg=' + Hamburg.length);
Hamburg[Hamburg.length] = createMarker(new GPoint(-75.97793579,40.55716705),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hamburg Elementary School",'Hamburg=' + Hamburg.length);
Hereford[Hereford.length] = createMarker(new GPoint(-75.54807281,40.44128036),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hereford Elementary School",'Hereford=' + Hereford.length);
Shillington[Shillington.length] = createMarker(new GPoint(-75.95468140,40.30220032),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Intermediate School",'Shillington=' + Shillington.length);
Reading[Reading.length] = createMarker(new GPoint(-75.84571838,40.32513428),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Jacksonwald Elementary School",'Reading=' + Reading.length);
Kutztown[Kutztown.length] = createMarker(new GPoint(-75.76969147,40.51170731),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Kutztown Area Middle School",'Kutztown=' + Kutztown.length);
Kutztown[Kutztown.length] = createMarker(new GPoint(-75.77832031,40.50997925),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Kutztown Area Senior High School",'Kutztown=' + Kutztown.length);
Kutztown[Kutztown.length] = createMarker(new GPoint(-75.77072906,40.51553726),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Kutztown Elementary School",'Kutztown=' + Kutztown.length);
Reading[Reading.length] = createMarker(new GPoint(-75.93341827,40.33932114),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lauers Park Elementary School",'Reading=' + Reading.length);
West_Lawn[West_Lawn.length] = createMarker(new GPoint(-75.98725128,40.31402969),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lincoln Park Elementary School",'West_Lawn=' + West_Lawn.length);
Mertztown[Mertztown.length] = createMarker(new GPoint(-75.66078186,40.50276947),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Longswamp Elementary School",'Mertztown=' + Mertztown.length);
Reading[Reading.length] = createMarker(new GPoint(-75.85378265,40.29180145),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lorane Elementary School",'Reading=' + Reading.length);
Sinking_Spring[Sinking_Spring.length] = createMarker(new GPoint(-76.05805206,40.36121750),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lower Heidelberg Elementary School",'Sinking_Spring=' + Sinking_Spring.length);
Reading[Reading.length] = createMarker(new GPoint(-75.86042786,40.32251358),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Martin Luther Lausch El Center",'Reading=' + Reading.length);
Kutztown[Kutztown.length] = createMarker(new GPoint(-75.73171234,40.53425980),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Maxatawny Elementary School",'Kutztown=' + Kutztown.length);
Reading[Reading.length] = createMarker(new GPoint(-75.93046570,40.31860733),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Millmont Elementary School",'Reading=' + Reading.length);
Douglassville[Douglassville.length] = createMarker(new GPoint(-75.73870087,40.27740097),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Monocacy Kdg Center",'Douglassville=' + Douglassville.length);
Mount_Penn[Mount_Penn.length] = createMarker(new GPoint(-75.89066315,40.32906342),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mt Penn Elementary School",'Mount_Penn=' + Mount_Penn.length);
Reading[Reading.length] = createMarker(new GPoint(-75.88749800,40.33018200),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mt Penn Primary Center",'Reading=' + Reading.length);
Laureldale[Laureldale.length] = createMarker(new GPoint(-75.91867065,40.38800812),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Muhlenberg El Center",'Laureldale=' + Laureldale.length);
Laureldale[Laureldale.length] = createMarker(new GPoint(-75.91867065,40.38800812),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Muhlenberg High School",'Laureldale=' + Laureldale.length);
Laureldale[Laureldale.length] = createMarker(new GPoint(-75.92214203,40.38853455),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Muhlenberg Middle School",'Laureldale=' + Laureldale.length);
Reading[Reading.length] = createMarker(new GPoint(-75.91195679,40.35344315),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Northeast Middle School",'Reading=' + Reading.length);
Reading[Reading.length] = createMarker(new GPoint(-75.94548798,40.34734726),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Northwest Elementary School",'Reading=' + Reading.length);
Reading[Reading.length] = createMarker(new GPoint(-75.93537903,40.35073853),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Northwest Middle School",'Reading=' + Reading.length);
Oley[Oley.length] = createMarker(new GPoint(-75.79964447,40.38205719),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Oley Valley Elementary School",'Oley=' + Oley.length);
Oley[Oley.length] = createMarker(new GPoint(-75.80001068,40.38164139),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Oley Valley Middle School",'Oley=' + Oley.length);
Oley[Oley.length] = createMarker(new GPoint(-75.78490448,40.38616562),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Oley Valley Senior High School",'Oley=' + Oley.length);
Bernville[Bernville.length] = createMarker(new GPoint(-76.11745453,40.43952942),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Penn Bernville Elementary School",'Bernville=' + Bernville.length);
Shoemakersville[Shoemakersville.length] = createMarker(new GPoint(-75.96681976,40.49914932),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Perry Elementary School",'Shoemakersville=' + Shoemakersville.length);
Boyertown[Boyertown.length] = createMarker(new GPoint(-75.69361115,40.28200150),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Pine Forge Elementary School",'Boyertown=' + Boyertown.length);
Reading[Reading.length] = createMarker(new GPoint(-75.91172028,40.34735489),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Reading Senior High School",'Reading=' + Reading.length);
Reading[Reading.length] = createMarker(new GPoint(-75.91159821,40.36830139),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Reading-muhlenberg Avts",'Reading=' + Reading.length);
Reading[Reading.length] = createMarker(new GPoint(-75.85827637,40.31251907),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Reiffton School",'Reading=' + Reading.length);
Fleetwood[Fleetwood.length] = createMarker(new GPoint(-75.84053802,40.48479843),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Richmond Elementary School",'Fleetwood=' + Fleetwood.length);
Reading[Reading.length] = createMarker(new GPoint(-75.93329620,40.35850525),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Riverside Elementary School",'Reading=' + Reading.length);
Birdsboro[Birdsboro.length] = createMarker(new GPoint(-75.87038422,40.24523926),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Robeson El Center",'Birdsboro=' + Birdsboro.length);
Fleetwood[Fleetwood.length] = createMarker(new GPoint(-75.74820709,40.45781326),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Rockland Center Elementary School",'Fleetwood=' + Fleetwood.length);
Leesport[Leesport.length] = createMarker(new GPoint(-75.94779205,40.44749069),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Schuylkill Valley Elementary School",'Leesport=' + Leesport.length);
Leesport[Leesport.length] = createMarker(new GPoint(-75.94136810,40.44188309),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Schuylkill Valley High School",'Leesport=' + Leesport.length);
Leesport[Leesport.length] = createMarker(new GPoint(-75.94232941,40.44657898),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Schuylkill Valley Middle School",'Leesport=' + Leesport.length);
Sinking_Spring[Sinking_Spring.length] = createMarker(new GPoint(-76.02702332,40.28541946),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Shiloh Hills Elementary School",'Sinking_Spring=' + Sinking_Spring.length);
Reading[Reading.length] = createMarker(new GPoint(-75.90608215,40.33062363),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Sixteenth & Haak Elementary School",'Reading=' + Reading.length);
Reading[Reading.length] = createMarker(new GPoint(-75.91890717,40.33213806),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Southern Middle School",'Reading=' + Reading.length);
Reading[Reading.length] = createMarker(new GPoint(-75.94451904,40.33300400),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Southwest Middle School",'Reading=' + Reading.length);
Wyomissing[Wyomissing.length] = createMarker(new GPoint(-75.99088287,40.34338760),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Spring Ridge Elementary School",'Wyomissing=' + Wyomissing.length);
Strausstown[Strausstown.length] = createMarker(new GPoint(-76.18001556,40.49396133),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Strausstown Elementary School",'Strausstown=' + Strausstown.length);
Reading[Reading.length] = createMarker(new GPoint(-75.91807556,40.34154129),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Tenth & Green Elementary School",'Reading=' + Reading.length);
Reading[Reading.length] = createMarker(new GPoint(-75.91906738,40.33533859),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Tenth & Penn Elementary School",'Reading=' + Reading.length);
Reading[Reading.length] = createMarker(new GPoint(-75.91190338,40.34294510),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Thirteenth & Green Elementary School",'Reading=' + Reading.length);
Reading[Reading.length] = createMarker(new GPoint(-75.91178131,40.35924149),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Thirteenth & Union Elementary School",'Reading=' + Reading.length);
Reading[Reading.length] = createMarker(new GPoint(-75.95159912,40.32276535),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Thomas H Ford Elementary School",'Reading=' + Reading.length);
Hamburg[Hamburg.length] = createMarker(new GPoint(-75.99987030,40.54981232),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Tilden Elementary School",'Hamburg=' + Hamburg.length);
Bernville[Bernville.length] = createMarker(new GPoint(-76.17720795,40.45276260),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Tulpehocken Junior Senior High School",'Bernville=' + Bernville.length);
Reading[Reading.length] = createMarker(new GPoint(-75.91387939,40.35333633),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Twelfth & Marion Elementary School",'Reading=' + Reading.length);
Elverson[Elverson.length] = createMarker(new GPoint(-75.85570526,40.16042709),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Twin Valley High School",'Elverson=' + Elverson.length);
Elverson[Elverson.length] = createMarker(new GPoint(-75.85754395,40.16469193),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Twin Valley Middle School",'Elverson=' + Elverson.length);
Reading[Reading.length] = createMarker(new GPoint(-75.92791748,40.33043289),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Tyson-schoener Elementary School",'Reading=' + Reading.length);
Shartlesville[Shartlesville.length] = createMarker(new GPoint(-76.10659790,40.51409912),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Upper Bern Elementary School",'Shartlesville=' + Shartlesville.length);
Barto[Barto.length] = createMarker(new GPoint(-75.59858704,40.38825607),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Washington Elementary School",'Barto=' + Barto.length);
West_Reading[West_Reading.length] = createMarker(new GPoint(-75.94639587,40.33364105),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("West Reading El Center",'West_Reading=' + West_Reading.length);
West_Lawn[West_Lawn.length] = createMarker(new GPoint(-75.98952484,40.32456589),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("West Wyomissing Elementary School",'West_Lawn=' + West_Lawn.length);
West_Lawn[West_Lawn.length] = createMarker(new GPoint(-76.00611877,40.33364105),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Whitfield Elementary School",'West_Lawn=' + West_Lawn.length);
West_Lawn[West_Lawn.length] = createMarker(new GPoint(-76.00080109,40.33055496),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Wilson Central Junior High School",'West_Lawn=' + West_Lawn.length);
West_Lawn[West_Lawn.length] = createMarker(new GPoint(-76.00080109,40.33055496),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Wilson High School",'West_Lawn=' + West_Lawn.length);
Sinking_Spring[Sinking_Spring.length] = createMarker(new GPoint(-76.01195526,40.31953812),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Wilson Southern Junior High School",'Sinking_Spring=' + Sinking_Spring.length);
Wyomissing[Wyomissing.length] = createMarker(new GPoint(-75.97010803,40.32473755),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Wyomissing Area Junior Senior High School",'Wyomissing=' + Wyomissing.length);
Wyomissing[Wyomissing.length] = createMarker(new GPoint(-75.97926331,40.33308411),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Wyomissing Hills El Center",'Wyomissing=' + Wyomissing.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(Barto);
map.removeOverlays(Bernville);
map.removeOverlays(Bethel);
map.removeOverlays(Birdsboro);
map.removeOverlays(Blandon);
map.removeOverlays(Boyertown);
map.removeOverlays(Douglassville);
map.removeOverlays(Elverson);
map.removeOverlays(Fleetwood);
map.removeOverlays(Hamburg);
map.removeOverlays(Hereford);
map.removeOverlays(Kempton);
map.removeOverlays(Kutztown);
map.removeOverlays(Laureldale);
map.removeOverlays(Leesport);
map.removeOverlays(Lenhartsville);
map.removeOverlays(Mertztown);
map.removeOverlays(Mohnton);
map.removeOverlays(Mount_Penn);
map.removeOverlays(Oley);
map.removeOverlays(Reading);
map.removeOverlays(Robesonia);
map.removeOverlays(Shartlesville);
map.removeOverlays(Shillington);
map.removeOverlays(Shoemakersville);
map.removeOverlays(Sinking_Spring);
map.removeOverlays(Strausstown);
map.removeOverlays(Topton);
map.removeOverlays(Wernersville);
map.removeOverlays(West_Lawn);
map.removeOverlays(West_Reading);
map.removeOverlays(Womelsdorf);
map.removeOverlays(Wyomissing);
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(Kempton);map.removeOverlays(Barto);
map.removeOverlays(Bernville);
map.removeOverlays(Bethel);
map.removeOverlays(Birdsboro);
map.removeOverlays(Blandon);
map.removeOverlays(Boyertown);
map.removeOverlays(Douglassville);
map.removeOverlays(Elverson);
map.removeOverlays(Fleetwood);
map.removeOverlays(Hamburg);
map.removeOverlays(Hereford);
map.removeOverlays(Kempton);
map.removeOverlays(Kutztown);
map.removeOverlays(Laureldale);
map.removeOverlays(Leesport);
map.removeOverlays(Lenhartsville);
map.removeOverlays(Mertztown);
map.removeOverlays(Mohnton);
map.removeOverlays(Mount_Penn);
map.removeOverlays(Oley);
map.removeOverlays(Reading);
map.removeOverlays(Robesonia);
map.removeOverlays(Shartlesville);
map.removeOverlays(Shillington);
map.removeOverlays(Shoemakersville);
map.removeOverlays(Sinking_Spring);
map.removeOverlays(Strausstown);
map.removeOverlays(Topton);
map.removeOverlays(Wernersville);
map.removeOverlays(West_Lawn);
map.removeOverlays(West_Reading);
map.removeOverlays(Womelsdorf);
map.removeOverlays(Wyomissing);
map.addOverlays(Barto);
centerByArray(Barto, false, false);
cntMarker += Barto.length;
map.addOverlays(Bernville);
centerByArray(Bernville, false, false);
cntMarker += Bernville.length;
map.addOverlays(Bethel);
centerByArray(Bethel, false, false);
cntMarker += Bethel.length;
map.addOverlays(Birdsboro);
centerByArray(Birdsboro, false, false);
cntMarker += Birdsboro.length;
map.addOverlays(Blandon);
centerByArray(Blandon, false, false);
cntMarker += Blandon.length;
map.addOverlays(Boyertown);
centerByArray(Boyertown, false, false);
cntMarker += Boyertown.length;
map.addOverlays(Douglassville);
centerByArray(Douglassville, false, false);
cntMarker += Douglassville.length;
map.addOverlays(Elverson);
centerByArray(Elverson, false, false);
cntMarker += Elverson.length;
map.addOverlays(Fleetwood);
centerByArray(Fleetwood, false, false);
cntMarker += Fleetwood.length;
map.addOverlays(Hamburg);
centerByArray(Hamburg, false, false);
cntMarker += Hamburg.length;
map.addOverlays(Hereford);
centerByArray(Hereford, false, false);
cntMarker += Hereford.length;
map.addOverlays(Kempton);
centerByArray(Kempton, false, false);
cntMarker += Kempton.length;
map.addOverlays(Kutztown);
centerByArray(Kutztown, false, false);
cntMarker += Kutztown.length;
map.addOverlays(Laureldale);
centerByArray(Laureldale, false, false);
cntMarker += Laureldale.length;
map.addOverlays(Leesport);
centerByArray(Leesport, false, false);
cntMarker += Leesport.length;
map.addOverlays(Lenhartsville);
centerByArray(Lenhartsville, false, false);
cntMarker += Lenhartsville.length;
map.addOverlays(Mertztown);
centerByArray(Mertztown, false, false);
cntMarker += Mertztown.length;
map.addOverlays(Mohnton);
centerByArray(Mohnton, false, false);
cntMarker += Mohnton.length;
map.addOverlays(Mount_Penn);
centerByArray(Mount_Penn, false, false);
cntMarker += Mount_Penn.length;
map.addOverlays(Oley);
centerByArray(Oley, false, false);
cntMarker += Oley.length;
map.addOverlays(Reading);
centerByArray(Reading, false, false);
cntMarker += Reading.length;
map.addOverlays(Robesonia);
centerByArray(Robesonia, false, false);
cntMarker += Robesonia.length;
map.addOverlays(Shartlesville);
centerByArray(Shartlesville, false, false);
cntMarker += Shartlesville.length;
map.addOverlays(Shillington);
centerByArray(Shillington, false, false);
cntMarker += Shillington.length;
map.addOverlays(Shoemakersville);
centerByArray(Shoemakersville, false, false);
cntMarker += Shoemakersville.length;
map.addOverlays(Sinking_Spring);
centerByArray(Sinking_Spring, false, false);
cntMarker += Sinking_Spring.length;
map.addOverlays(Strausstown);
centerByArray(Strausstown, false, false);
cntMarker += Strausstown.length;
map.addOverlays(Topton);
centerByArray(Topton, false, false);
cntMarker += Topton.length;
map.addOverlays(Wernersville);
centerByArray(Wernersville, false, false);
cntMarker += Wernersville.length;
map.addOverlays(West_Lawn);
centerByArray(West_Lawn, false, false);
cntMarker += West_Lawn.length;
map.addOverlays(West_Reading);
centerByArray(West_Reading, false, false);
cntMarker += West_Reading.length;
map.addOverlays(Womelsdorf);
centerByArray(Womelsdorf, false, false);
cntMarker += Womelsdorf.length;
map.addOverlays(Wyomissing);
centerByArray(Wyomissing, false, false);
cntMarker += Wyomissing.length;
centerByArray(Kempton,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');
}
}