function addMarkers()
{
mySelect = document.getElementById('selection');
Downingtown = [];West_Grove = [];Phoenixville = [];Devon = [];Thorndale = [];Coatesville = [];Chadds_Ford = [];Kennett_Square = [];Malvern = [];West_Chester = [];Berwyn = [];Exton = [];Pottstown = [];Oxford = [];Lincoln_University = [];Honey_Brook = [];Kemblesville = [];Landenberg = [];Wayne = [];Toughkenamon = [];Atglen = [];Chester_Springs = [];East_Fallowfield_Township = [];Spring_City = [];Elverson = [];mySelect.options[mySelect.options.length] = new Option("Atglen schools",'all=Atglen');
mySelect.options[mySelect.options.length] = new Option("Berwyn schools",'all=Berwyn');
mySelect.options[mySelect.options.length] = new Option("Chadds Ford schools",'all=Chadds_Ford');
mySelect.options[mySelect.options.length] = new Option("Chester Springs schools",'all=Chester_Springs');
mySelect.options[mySelect.options.length] = new Option("Coatesville schools",'all=Coatesville');
mySelect.options[mySelect.options.length] = new Option("Devon schools",'all=Devon');
mySelect.options[mySelect.options.length] = new Option("Downingtown schools",'all=Downingtown');
mySelect.options[mySelect.options.length] = new Option("East Fallowfield Township schools",'all=East_Fallowfield_Township');
mySelect.options[mySelect.options.length] = new Option("Elverson schools",'all=Elverson');
mySelect.options[mySelect.options.length] = new Option("Exton schools",'all=Exton');
mySelect.options[mySelect.options.length] = new Option("Honey Brook schools",'all=Honey_Brook');
mySelect.options[mySelect.options.length] = new Option("Kemblesville schools",'all=Kemblesville');
mySelect.options[mySelect.options.length] = new Option("Kennett Square schools",'all=Kennett_Square');
mySelect.options[mySelect.options.length] = new Option("Landenberg schools",'all=Landenberg');
mySelect.options[mySelect.options.length] = new Option("Lincoln University schools",'all=Lincoln_University');
mySelect.options[mySelect.options.length] = new Option("Malvern schools",'all=Malvern');
mySelect.options[mySelect.options.length] = new Option("Oxford schools",'all=Oxford');
mySelect.options[mySelect.options.length] = new Option("Phoenixville schools",'all=Phoenixville');
mySelect.options[mySelect.options.length] = new Option("Pottstown schools",'all=Pottstown');
mySelect.options[mySelect.options.length] = new Option("Spring City schools",'all=Spring_City');
mySelect.options[mySelect.options.length] = new Option("Thorndale schools",'all=Thorndale');
mySelect.options[mySelect.options.length] = new Option("Toughkenamon schools",'all=Toughkenamon');
mySelect.options[mySelect.options.length] = new Option("Wayne schools",'all=Wayne');
mySelect.options[mySelect.options.length] = new Option("West Chester schools",'all=West_Chester');
mySelect.options[mySelect.options.length] = new Option("West Grove schools",'all=West_Grove');
mySelect.options[mySelect.options.length] = new Option("---------------------------",'');
Downingtown[Downingtown.length] = createMarker(new GPoint(-75.67266083,40.05377960),"
",iconGr);
mySelect.options[mySelect.options.length] = new Option("21st Century Cyber Charter School",'Downingtown=' + Downingtown.length);
West_Grove[West_Grove.length] = createMarker(new GPoint(-75.82440186,39.74879837),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Avon Grove Charter School",'West_Grove=' + West_Grove.length);
West_Grove[West_Grove.length] = createMarker(new GPoint(-75.81411743,39.81891251),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Avon Grove High School",'West_Grove=' + West_Grove.length);
West_Grove[West_Grove.length] = createMarker(new GPoint(-75.88642120,39.79679871),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Avon Grove Intrmd School",'West_Grove=' + West_Grove.length);
Phoenixville[Phoenixville.length] = createMarker(new GPoint(-75.51837158,40.12766266),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Barkley Elementary School",'Phoenixville=' + Phoenixville.length);
Devon[Devon.length] = createMarker(new GPoint(-75.42820740,40.02308655),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Beaumont Elementary School",'Devon=' + Devon.length);
Downingtown[Downingtown.length] = createMarker(new GPoint(-75.72085571,40.00174332),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Beaver Creek Elementary School",'Downingtown=' + Downingtown.length);
Downingtown[Downingtown.length] = createMarker(new GPoint(-75.71199036,39.98862457),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Bradford Hgts Elementary School",'Downingtown=' + Downingtown.length);
Downingtown[Downingtown.length] = createMarker(new GPoint(-75.75668335,40.03954315),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Brandywine-wallace Elementary School",'Downingtown=' + Downingtown.length);
Thorndale[Thorndale.length] = createMarker(new GPoint(-75.74945831,39.99570847),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Caln Elementary School",'Thorndale=' + Thorndale.length);
Coatesville[Coatesville.length] = createMarker(new GPoint(-75.81468201,39.98459244),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Carl O Benner Elementary School",'Coatesville=' + Coatesville.length);
Coatesville[Coatesville.length] = createMarker(new GPoint(-75.79402161,39.98833847),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Center For Arts & Technology-b",'Coatesville=' + Coatesville.length);
Phoenixville[Phoenixville.length] = createMarker(new GPoint(-75.54450989,40.11656189),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Center For Arts & Technology-p",'Phoenixville=' + Phoenixville.length);
Chadds_Ford[Chadds_Ford.length] = createMarker(new GPoint(-75.60466766,39.87156677),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Chadds Ford Elementary School",'Chadds_Ford=' + Chadds_Ford.length);
Kennett_Square[Kennett_Square.length] = createMarker(new GPoint(-75.71962738,39.88017654),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Charles F Patton Middle School",'Kennett_Square=' + Kennett_Square.length);
Malvern[Malvern.length] = createMarker(new GPoint(-75.54370880,40.07928467),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Charlestown Elementary School",'Malvern=' + Malvern.length);
West_Chester[West_Chester.length] = createMarker(new GPoint(-75.60020447,39.96299362),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Chester Co Family Academy Charter School",'West_Chester=' + West_Chester.length);
Coatesville[Coatesville.length] = createMarker(new GPoint(-75.79770660,39.98768616),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Coatesville Area Senior High School",'Coatesville=' + Coatesville.length);
Coatesville[Coatesville.length] = createMarker(new GPoint(-75.79812622,39.98760986),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Coatesville Ihs",'Coatesville=' + Coatesville.length);
West_Chester[West_Chester.length] = createMarker(new GPoint(-75.61443329,39.95670700),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Collegium Charter School",'West_Chester=' + West_Chester.length);
Berwyn[Berwyn.length] = createMarker(new GPoint(-75.45543671,40.04919052),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Conestoga Senior High School",'Berwyn=' + Berwyn.length);
Devon[Devon.length] = createMarker(new GPoint(-75.42372894,40.03730774),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Devon Elementary School",'Devon=' + Devon.length);
Downingtown[Downingtown.length] = createMarker(new GPoint(-75.72048187,40.01412582),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Downington Middle School",'Downingtown=' + Downingtown.length);
Exton[Exton.length] = createMarker(new GPoint(-75.65483093,40.04327011),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Downingtown High School East Campus",'Exton=' + Exton.length);
Downingtown[Downingtown.length] = createMarker(new GPoint(-75.71423340,40.00866699),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Downingtown High School Ninth Gr Center",'Downingtown=' + Downingtown.length);
Downingtown[Downingtown.length] = createMarker(new GPoint(-75.71851349,40.01029968),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Downingtown High School West Campus",'Downingtown=' + Downingtown.length);
West_Chester[West_Chester.length] = createMarker(new GPoint(-75.62094116,39.99775314),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("E N Peirce Middle School",'West_Chester=' + West_Chester.length);
West_Chester[West_Chester.length] = createMarker(new GPoint(-75.64245605,39.96995926),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("East Bradford Elementary School",'West_Chester=' + West_Chester.length);
Pottstown[Pottstown.length] = createMarker(new GPoint(-75.60494995,40.20872116),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("East Coventry Elementary School",'Pottstown=' + Pottstown.length);
Coatesville[Coatesville.length] = createMarker(new GPoint(-75.81182098,39.95017242),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("East Fallowfield Elementary School",'Coatesville=' + Coatesville.length);
West_Chester[West_Chester.length] = createMarker(new GPoint(-75.54353333,39.99233627),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("East Goshen Elementary School",'West_Chester=' + West_Chester.length);
Phoenixville[Phoenixville.length] = createMarker(new GPoint(-75.58021545,40.12521744),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("East Pikeland Elementary School",'Phoenixville=' + Phoenixville.length);
Downingtown[Downingtown.length] = createMarker(new GPoint(-75.69593048,40.00965500),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("East Ward Elementary School",'Downingtown=' + Downingtown.length);
Oxford[Oxford.length] = createMarker(new GPoint(-75.96485138,39.77412033),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Elk Ridge School",'Oxford=' + Oxford.length);
Lincoln_University[Lincoln_University.length] = createMarker(new GPoint(-75.89499664,39.78350067),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Erin Dudley Forbes Charter School",'Lincoln_University=' + Lincoln_University.length);
Exton[Exton.length] = createMarker(new GPoint(-75.62255859,40.02383804),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Exton Elementary School",'Exton=' + Exton.length);
West_Chester[West_Chester.length] = createMarker(new GPoint(-75.58711243,39.97499847),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Fern Hill Elementary School",'West_Chester=' + West_Chester.length);
West_Grove[West_Grove.length] = createMarker(new GPoint(-75.81709290,39.81509018),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Fred S Engle Middle School",'West_Grove=' + West_Grove.length);
Pottstown[Pottstown.length] = createMarker(new GPoint(-75.68984985,40.16660309),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("French Creek Elementary School",'Pottstown=' + Pottstown.length);
Coatesville[Coatesville.length] = createMarker(new GPoint(-75.79103851,40.01425552),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Friendship Elementary School",'Coatesville=' + Coatesville.length);
Malvern[Malvern.length] = createMarker(new GPoint(-75.48246002,40.03453827),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("General Wayne Elementary School",'Malvern=' + Malvern.length);
West_Chester[West_Chester.length] = createMarker(new GPoint(-75.56468964,39.96876144),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Glen Acres Elementary School",'West_Chester=' + West_Chester.length);
Coatesville[Coatesville.length] = createMarker(new GPoint(-75.81855011,39.98234177),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Gordon Elementary School",'Coatesville=' + Coatesville.length);
Coatesville[Coatesville.length] = createMarker(new GPoint(-75.78411865,39.96784592),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Graystone Academy Charter School",'Coatesville=' + Coatesville.length);
Malvern[Malvern.length] = createMarker(new GPoint(-75.56884766,40.05681610),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Great Valley High School",'Malvern=' + Malvern.length);
Malvern[Malvern.length] = createMarker(new GPoint(-75.56658936,40.06034851),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Great Valley Middle School",'Malvern=' + Malvern.length);
Kennett_Square[Kennett_Square.length] = createMarker(new GPoint(-75.66857147,39.86527634),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Greenwood Elementary School",'Kennett_Square=' + Kennett_Square.length);
Chadds_Ford[Chadds_Ford.length] = createMarker(new GPoint(-75.63773346,39.86149979),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hillendale Elementary School",'Chadds_Ford=' + Chadds_Ford.length);
West_Chester[West_Chester.length] = createMarker(new GPoint(-75.61631012,39.95451355),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hillsdale Elementary School",'West_Chester=' + West_Chester.length);
Berwyn[Berwyn.length] = createMarker(new GPoint(-75.45571899,40.05598831),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hillside Elementary School",'Berwyn=' + Berwyn.length);
Honey_Brook[Honey_Brook.length] = createMarker(new GPoint(-75.91876221,40.09034729),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Honey Brook El Center",'Honey_Brook=' + Honey_Brook.length);
West_Chester[West_Chester.length] = createMarker(new GPoint(-75.56416321,39.98014450),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("J R Fugett Middle School",'West_Chester=' + West_Chester.length);
Oxford[Oxford.length] = createMarker(new GPoint(-75.97369385,39.78126144),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Jordan Bank School",'Oxford=' + Oxford.length);
Malvern[Malvern.length] = createMarker(new GPoint(-75.55750275,40.04467773),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Kathryn D. Markley Elementary School",'Malvern=' + Malvern.length);
Kemblesville[Kemblesville.length] = createMarker(new GPoint(-75.82440186,39.74879837),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Kemblesville Elementary School",'Kemblesville=' + Kemblesville.length);
Kennett_Square[Kennett_Square.length] = createMarker(new GPoint(-75.70978546,39.83999634),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Kennett High School",'Kennett_Square=' + Kennett_Square.length);
Landenberg[Landenberg.length] = createMarker(new GPoint(-75.74355316,39.79601288),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Kennett Middle School",'Landenberg=' + Landenberg.length);
Coatesville[Coatesville.length] = createMarker(new GPoint(-75.88162994,40.01127625),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Kings Highway Elementary School",'Coatesville=' + Coatesville.length);
Downingtown[Downingtown.length] = createMarker(new GPoint(-75.66377258,40.04299927),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lionville Elementary School",'Downingtown=' + Downingtown.length);
Exton[Exton.length] = createMarker(new GPoint(-75.66167450,40.04862976),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Lionville Middle School",'Exton=' + Exton.length);
West_Chester[West_Chester.length] = createMarker(new GPoint(-75.64326477,40.00233459),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mary C Howse Elementary School",'West_Chester=' + West_Chester.length);
Kennett_Square[Kennett_Square.length] = createMarker(new GPoint(-75.71266937,39.84301758),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mary D Language Elementary School",'Kennett_Square=' + Kennett_Square.length);
Wayne[Wayne.length] = createMarker(new GPoint(-75.41534424,40.06740189),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("New Eagle Elementary School",'Wayne=' + Wayne.length);
Toughkenamon[Toughkenamon.length] = createMarker(new GPoint(-75.74702454,39.81052780),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("New Garden Elementary School",'Toughkenamon=' + Toughkenamon.length);
Coatesville[Coatesville.length] = createMarker(new GPoint(-75.79081726,40.01275253),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("North Brandywine Middle School",'Coatesville=' + Coatesville.length);
Pottstown[Pottstown.length] = createMarker(new GPoint(-75.65258026,40.21871948),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("North Coventry Elementary School",'Pottstown=' + Pottstown.length);
Oxford[Oxford.length] = createMarker(new GPoint(-75.96926880,39.78023529),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Nottingham School",'Oxford=' + Oxford.length);
Atglen[Atglen.length] = createMarker(new GPoint(-75.97219849,39.94079971),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Octorara Area High School",'Atglen=' + Atglen.length);
Atglen[Atglen.length] = createMarker(new GPoint(-75.97219849,39.94079971),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Octorara Elementary School",'Atglen=' + Atglen.length);
Atglen[Atglen.length] = createMarker(new GPoint(-75.97219849,39.94079971),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Octorara Middle School",'Atglen=' + Atglen.length);
Atglen[Atglen.length] = createMarker(new GPoint(-75.97219849,39.94079971),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Octorara Primary Learning Center",'Atglen=' + Atglen.length);
Pottstown[Pottstown.length] = createMarker(new GPoint(-75.66133118,40.17509460),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Owen J Roberts High School",'Pottstown=' + Pottstown.length);
Pottstown[Pottstown.length] = createMarker(new GPoint(-75.65456390,40.17553711),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Owen J Roberts Middle School",'Pottstown=' + Pottstown.length);
Oxford[Oxford.length] = createMarker(new GPoint(-75.97357178,39.77960205),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Oxford Area High School",'Oxford=' + Oxford.length);
West_Grove[West_Grove.length] = createMarker(new GPoint(-75.88619995,39.79766464),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Penn London Elementary School",'West_Grove=' + West_Grove.length);
West_Chester[West_Chester.length] = createMarker(new GPoint(-75.52754974,39.95463943),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Penn Wood Elementary School",'West_Chester=' + West_Chester.length);
Oxford[Oxford.length] = createMarker(new GPoint(-75.97100830,39.77887726),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Penn's Grove School",'Oxford=' + Oxford.length);
West_Chester[West_Chester.length] = createMarker(new GPoint(-75.55554800,39.98930100),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Pennsylvania Leadership Charter School",'West_Chester=' + West_Chester.length);
Phoenixville[Phoenixville.length] = createMarker(new GPoint(-75.51987457,40.11941147),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Phoenixville Area High School",'Phoenixville=' + Phoenixville.length);
Phoenixville[Phoenixville.length] = createMarker(new GPoint(-75.50678253,40.13014984),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Phoenixville Area Kdg Center",'Phoenixville=' + Phoenixville.length);
Phoenixville[Phoenixville.length] = createMarker(new GPoint(-75.51809692,40.11822891),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Phoenixville Area Middle School",'Phoenixville=' + Phoenixville.length);
Chester_Springs[Chester_Springs.length] = createMarker(new GPoint(-75.68605804,40.07764816),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Pickering Valley Elementary School",'Chester_Springs=' + Chester_Springs.length);
West_Chester[West_Chester.length] = createMarker(new GPoint(-75.62667084,39.90159225),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Pocopson Elementary School",'West_Chester=' + West_Chester.length);
Coatesville[Coatesville.length] = createMarker(new GPoint(-75.85312653,39.98547363),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Rainbow Elementary School",'Coatesville=' + Coatesville.length);
Coatesville[Coatesville.length] = createMarker(new GPoint(-75.79078674,40.01246262),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Reeceville Elementary School",'Coatesville=' + Coatesville.length);
Phoenixville[Phoenixville.length] = createMarker(new GPoint(-75.54180145,40.10990143),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Renaissance Academy-edison Charter School",'Phoenixville=' + Phoenixville.length);
West_Chester[West_Chester.length] = createMarker(new GPoint(-75.61231400,39.95706500),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Sankofa Academy Charter School",'West_Chester=' + West_Chester.length);
West_Chester[West_Chester.length] = createMarker(new GPoint(-75.58690643,39.93161011),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Sarah W Starkweather Elementary School",'West_Chester=' + West_Chester.length);
Phoenixville[Phoenixville.length] = createMarker(new GPoint(-75.51044464,40.11285782),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Schuylkill Elementary School",'Phoenixville=' + Phoenixville.length);
Coatesville[Coatesville.length] = createMarker(new GPoint(-75.85092163,39.95365906),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Scott Middle School",'Coatesville=' + Coatesville.length);
Phoenixville[Phoenixville.length] = createMarker(new GPoint(-75.50678253,40.13014984),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Second Avenue Elementary School",'Phoenixville=' + Phoenixville.length);
Downingtown[Downingtown.length] = createMarker(new GPoint(-75.70238495,40.05869293),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Shamona Creek Elementary School",'Downingtown=' + Downingtown.length);
East_Fallowfield_Township[East_Fallowfield_Township.length] = createMarker(new GPoint(-75.84207153,39.95466232),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("South Brandywine Middle School",'East_Fallowfield_Township=' + East_Fallowfield_Township.length);
Coatesville[Coatesville.length] = createMarker(new GPoint(-75.80982208,39.89369965),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Southeast Secure Treatment Uni",'Coatesville=' + Coatesville.length);
West_Chester[West_Chester.length] = createMarker(new GPoint(-75.60405731,39.96102905),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Southeast Secure Treatment Unt High School",'West_Chester=' + West_Chester.length);
Spring_City[Spring_City.length] = createMarker(new GPoint(-75.54959869,40.17220688),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Spring City Elementary School",'Spring_City=' + Spring_City.length);
West_Chester[West_Chester.length] = createMarker(new GPoint(-75.58642578,39.93096161),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Stetson Middle School",'West_Chester=' + West_Chester.length);
Berwyn[Berwyn.length] = createMarker(new GPoint(-75.44817352,40.04831314),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Tredyffrin-easttown Middle School",'Berwyn=' + Berwyn.length);
Elverson[Elverson.length] = createMarker(new GPoint(-75.85816956,40.16476440),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Twin Valley El Center",'Elverson=' + Elverson.length);
Kennett_Square[Kennett_Square.length] = createMarker(new GPoint(-75.72624969,39.89319229),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Unionville Elementary School",'Kennett_Square=' + Kennett_Square.length);
Kennett_Square[Kennett_Square.length] = createMarker(new GPoint(-75.71901703,39.87932968),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Unionville High School",'Kennett_Square=' + Kennett_Square.length);
Downingtown[Downingtown.length] = createMarker(new GPoint(-75.67857361,40.03353882),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Uwchlan Hills Elementary School",'Downingtown=' + Downingtown.length);
Wayne[Wayne.length] = createMarker(new GPoint(-75.43717957,40.07631683),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Valley Forge Elementary School",'Wayne=' + Wayne.length);
Wayne[Wayne.length] = createMarker(new GPoint(-75.44130707,40.07431412),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Valley Forge Middle School",'Wayne=' + Wayne.length);
Spring_City[Spring_City.length] = createMarker(new GPoint(-75.60104370,40.16663742),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Vincent Elementary School",'Spring_City=' + Spring_City.length);
Elverson[Elverson.length] = createMarker(new GPoint(-75.72782898,40.17264938),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Warwick Elementary School",'Elverson=' + Elverson.length);
Downingtown[Downingtown.length] = createMarker(new GPoint(-75.74352264,39.97276306),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("West Bradford Elementary School",'Downingtown=' + Downingtown.length);
West_Chester[West_Chester.length] = createMarker(new GPoint(-75.56325531,39.97894669),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("West Chester East High School",'West_Chester=' + West_Chester.length);
West_Chester[West_Chester.length] = createMarker(new GPoint(-75.59824371,39.96775818),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("West Chester Henderson High School",'West_Chester=' + West_Chester.length);
West_Chester[West_Chester.length] = createMarker(new GPoint(-75.55914307,39.93450546),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Westtown-thornbury Elementary School",'West_Chester=' + West_Chester.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(Atglen);
map.removeOverlays(Berwyn);
map.removeOverlays(Chadds_Ford);
map.removeOverlays(Chester_Springs);
map.removeOverlays(Coatesville);
map.removeOverlays(Devon);
map.removeOverlays(Downingtown);
map.removeOverlays(East_Fallowfield_Township);
map.removeOverlays(Elverson);
map.removeOverlays(Exton);
map.removeOverlays(Honey_Brook);
map.removeOverlays(Kemblesville);
map.removeOverlays(Kennett_Square);
map.removeOverlays(Landenberg);
map.removeOverlays(Lincoln_University);
map.removeOverlays(Malvern);
map.removeOverlays(Oxford);
map.removeOverlays(Phoenixville);
map.removeOverlays(Pottstown);
map.removeOverlays(Spring_City);
map.removeOverlays(Thorndale);
map.removeOverlays(Toughkenamon);
map.removeOverlays(Wayne);
map.removeOverlays(West_Chester);
map.removeOverlays(West_Grove);
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(Downingtown);map.removeOverlays(Atglen);
map.removeOverlays(Berwyn);
map.removeOverlays(Chadds_Ford);
map.removeOverlays(Chester_Springs);
map.removeOverlays(Coatesville);
map.removeOverlays(Devon);
map.removeOverlays(Downingtown);
map.removeOverlays(East_Fallowfield_Township);
map.removeOverlays(Elverson);
map.removeOverlays(Exton);
map.removeOverlays(Honey_Brook);
map.removeOverlays(Kemblesville);
map.removeOverlays(Kennett_Square);
map.removeOverlays(Landenberg);
map.removeOverlays(Lincoln_University);
map.removeOverlays(Malvern);
map.removeOverlays(Oxford);
map.removeOverlays(Phoenixville);
map.removeOverlays(Pottstown);
map.removeOverlays(Spring_City);
map.removeOverlays(Thorndale);
map.removeOverlays(Toughkenamon);
map.removeOverlays(Wayne);
map.removeOverlays(West_Chester);
map.removeOverlays(West_Grove);
map.addOverlays(Atglen);
centerByArray(Atglen, false, false);
cntMarker += Atglen.length;
map.addOverlays(Berwyn);
centerByArray(Berwyn, false, false);
cntMarker += Berwyn.length;
map.addOverlays(Chadds_Ford);
centerByArray(Chadds_Ford, false, false);
cntMarker += Chadds_Ford.length;
map.addOverlays(Chester_Springs);
centerByArray(Chester_Springs, false, false);
cntMarker += Chester_Springs.length;
map.addOverlays(Coatesville);
centerByArray(Coatesville, false, false);
cntMarker += Coatesville.length;
map.addOverlays(Devon);
centerByArray(Devon, false, false);
cntMarker += Devon.length;
map.addOverlays(Downingtown);
centerByArray(Downingtown, false, false);
cntMarker += Downingtown.length;
map.addOverlays(East_Fallowfield_Township);
centerByArray(East_Fallowfield_Township, false, false);
cntMarker += East_Fallowfield_Township.length;
map.addOverlays(Elverson);
centerByArray(Elverson, false, false);
cntMarker += Elverson.length;
map.addOverlays(Exton);
centerByArray(Exton, false, false);
cntMarker += Exton.length;
map.addOverlays(Honey_Brook);
centerByArray(Honey_Brook, false, false);
cntMarker += Honey_Brook.length;
map.addOverlays(Kemblesville);
centerByArray(Kemblesville, false, false);
cntMarker += Kemblesville.length;
map.addOverlays(Kennett_Square);
centerByArray(Kennett_Square, false, false);
cntMarker += Kennett_Square.length;
map.addOverlays(Landenberg);
centerByArray(Landenberg, false, false);
cntMarker += Landenberg.length;
map.addOverlays(Lincoln_University);
centerByArray(Lincoln_University, false, false);
cntMarker += Lincoln_University.length;
map.addOverlays(Malvern);
centerByArray(Malvern, false, false);
cntMarker += Malvern.length;
map.addOverlays(Oxford);
centerByArray(Oxford, false, false);
cntMarker += Oxford.length;
map.addOverlays(Phoenixville);
centerByArray(Phoenixville, false, false);
cntMarker += Phoenixville.length;
map.addOverlays(Pottstown);
centerByArray(Pottstown, false, false);
cntMarker += Pottstown.length;
map.addOverlays(Spring_City);
centerByArray(Spring_City, false, false);
cntMarker += Spring_City.length;
map.addOverlays(Thorndale);
centerByArray(Thorndale, false, false);
cntMarker += Thorndale.length;
map.addOverlays(Toughkenamon);
centerByArray(Toughkenamon, false, false);
cntMarker += Toughkenamon.length;
map.addOverlays(Wayne);
centerByArray(Wayne, false, false);
cntMarker += Wayne.length;
map.addOverlays(West_Chester);
centerByArray(West_Chester, false, false);
cntMarker += West_Chester.length;
map.addOverlays(West_Grove);
centerByArray(West_Grove, false, false);
cntMarker += West_Grove.length;
centerByArray(Downingtown,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');
}
}