function addMarkers()
{
mySelect = document.getElementById('selection');
Scotch_Plains = [];Roselle = [];Hillside = [];New_Providence = [];Clark = [];Union = [];Westfield = [];Mountainside = [];Cranford = [];Summit = [];Plainfield = [];Berkeley_Heights = [];Kenilworth = [];Springfield = [];Elizabeth = [];Roselle_Park = [];Rahway = [];Linden = [];Garwood = [];Berkeley_Hts = [];Winfield = [];mySelect.options[mySelect.options.length] = new Option("Berkeley Heights schools",'all=Berkeley_Heights');
mySelect.options[mySelect.options.length] = new Option("Berkeley Hts schools",'all=Berkeley_Hts');
mySelect.options[mySelect.options.length] = new Option("Clark schools",'all=Clark');
mySelect.options[mySelect.options.length] = new Option("Cranford schools",'all=Cranford');
mySelect.options[mySelect.options.length] = new Option("Elizabeth schools",'all=Elizabeth');
mySelect.options[mySelect.options.length] = new Option("Garwood schools",'all=Garwood');
mySelect.options[mySelect.options.length] = new Option("Hillside schools",'all=Hillside');
mySelect.options[mySelect.options.length] = new Option("Kenilworth schools",'all=Kenilworth');
mySelect.options[mySelect.options.length] = new Option("Linden schools",'all=Linden');
mySelect.options[mySelect.options.length] = new Option("Mountainside schools",'all=Mountainside');
mySelect.options[mySelect.options.length] = new Option("New Providence schools",'all=New_Providence');
mySelect.options[mySelect.options.length] = new Option("Plainfield schools",'all=Plainfield');
mySelect.options[mySelect.options.length] = new Option("Rahway schools",'all=Rahway');
mySelect.options[mySelect.options.length] = new Option("Roselle schools",'all=Roselle');
mySelect.options[mySelect.options.length] = new Option("Roselle Park schools",'all=Roselle_Park');
mySelect.options[mySelect.options.length] = new Option("Scotch Plains schools",'all=Scotch_Plains');
mySelect.options[mySelect.options.length] = new Option("Springfield schools",'all=Springfield');
mySelect.options[mySelect.options.length] = new Option("Summit schools",'all=Summit');
mySelect.options[mySelect.options.length] = new Option("Union schools",'all=Union');
mySelect.options[mySelect.options.length] = new Option("Westfield schools",'all=Westfield');
mySelect.options[mySelect.options.length] = new Option("Winfield schools",'all=Winfield');
mySelect.options[mySelect.options.length] = new Option("---------------------------",'');
Scotch_Plains[Scotch_Plains.length] = createMarker(new GPoint(-10.00000000,10.00000000),"
",iconGr);
mySelect.options[mySelect.options.length] = new Option(" AcademyFor Allied Hlth Sci",'Scotch_Plains=' + Scotch_Plains.length);
Roselle[Roselle.length] = createMarker(new GPoint(-74.26157379,40.65406799),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Abraham Clark High School",'Roselle=' + Roselle.length);
Hillside[Hillside.length] = createMarker(new GPoint(-74.22066498,40.69089890),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Abram P Morris-saybrook Elementary School",'Hillside=' + Hillside.length);
Scotch_Plains[Scotch_Plains.length] = createMarker(new GPoint(-74.35839300,40.61737000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Academy For Info Tech",'Scotch_Plains=' + Scotch_Plains.length);
New_Providence[New_Providence.length] = createMarker(new GPoint(-74.41636658,40.69183350),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Allen W. Roberts Elementary School",'New_Providence=' + New_Providence.length);
Clark[Clark.length] = createMarker(new GPoint(-74.31198883,40.62312317),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Arthur L. Johnson High School",'Clark=' + Clark.length);
Union[Union.length] = createMarker(new GPoint(-74.29559326,40.69890213),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Battle Hill Elementary School",'Union=' + Union.length);
Westfield[Westfield.length] = createMarker(new GPoint(-74.32790375,40.62518311),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Beadleston High School",'Westfield=' + Westfield.length);
Mountainside[Mountainside.length] = createMarker(new GPoint(-74.36886500,40.67199700),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Beechwood School",'Mountainside=' + Mountainside.length);
Cranford[Cranford.length] = createMarker(new GPoint(-74.29034424,40.66499329),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Bloomingdale Ave School",'Cranford=' + Cranford.length);
Summit[Summit.length] = createMarker(new GPoint(-74.36383057,40.70981979),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Brayton Elementary School",'Summit=' + Summit.length);
Cranford[Cranford.length] = createMarker(new GPoint(-74.31934357,40.66222763),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Brookside Place Elementary School",'Cranford=' + Cranford.length);
Union[Union.length] = createMarker(new GPoint(-74.27689362,40.69770050),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Burnet Middle School",'Union=' + Union.length);
Hillside[Hillside.length] = createMarker(new GPoint(-74.24407959,40.70024490),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Calvin Coolidge Elementary School",'Hillside=' + Hillside.length);
Clark[Clark.length] = createMarker(new GPoint(-74.31535339,40.61436462),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Carl H. Kumpf Middle School",'Clark=' + Clark.length);
Plainfield[Plainfield.length] = createMarker(new GPoint(-74.41660309,40.60403061),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Cedarbrook Elementary School",'Plainfield=' + Plainfield.length);
Westfield[Westfield.length] = createMarker(new GPoint(-74.34219360,40.64140320),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Centennial High School",'Westfield=' + Westfield.length);
Union[Union.length] = createMarker(new GPoint(-74.28057861,40.71625519),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Central Five-jefferson Middle School",'Union=' + Union.length);
Plainfield[Plainfield.length] = createMarker(new GPoint(-74.42241000,40.61791300),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Central Jersey Arts Charter School",'Plainfield=' + Plainfield.length);
Plainfield[Plainfield.length] = createMarker(new GPoint(-74.42209625,40.61600113),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Charles H. Stillman Elementary School",'Plainfield=' + Plainfield.length);
Plainfield[Plainfield.length] = createMarker(new GPoint(-74.44599915,40.60459900),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Clinton Elementary School",'Plainfield=' + Plainfield.length);
Berkeley_Heights[Berkeley_Heights.length] = createMarker(new GPoint(-74.44007874,40.67723465),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Columbia Middle School",'Berkeley_Heights=' + Berkeley_Heights.length);
Union[Union.length] = createMarker(new GPoint(-74.27351379,40.69309998),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Connecticut Farms Elementary School",'Union=' + Union.length);
Cranford[Cranford.length] = createMarker(new GPoint(-74.31230927,40.66149902),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Cranford Senior High School",'Cranford=' + Cranford.length);
Westfield[Westfield.length] = createMarker(new GPoint(-74.33014679,40.68045807),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Crossroads School",'Westfield=' + Westfield.length);
Kenilworth[Kenilworth.length] = createMarker(new GPoint(-74.29100037,40.67639923),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("David Brearley High School",'Kenilworth=' + Kenilworth.length);
Mountainside[Mountainside.length] = createMarker(new GPoint(-74.35399628,40.68080139),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Deerfield Elementary School",'Mountainside=' + Mountainside.length);
Union[Union.length] = createMarker(new GPoint(-74.28433228,40.70829391),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Devel L C-hamilton Shcool",'Union=' + Union.length);
Kenilworth[Kenilworth.length] = createMarker(new GPoint(-74.29134369,40.67607117),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Devel L C-kenilworth",'Kenilworth=' + Kenilworth.length);
Mountainside[Mountainside.length] = createMarker(new GPoint(-74.37020111,40.67249298),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Devel L C-mountainside",'Mountainside=' + Mountainside.length);
New_Providence[New_Providence.length] = createMarker(new GPoint(-74.39227295,40.69953918),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Devel L C-new Providence",'New_Providence=' + New_Providence.length);
Plainfield[Plainfield.length] = createMarker(new GPoint(-74.42359924,40.61759949),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Dewitt D. Barlow Elementary School",'Plainfield=' + Plainfield.length);
Roselle[Roselle.length] = createMarker(new GPoint(-74.25338745,40.64810181),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Dr Charles C. Polk School",'Roselle=' + Roselle.length);
Berkeley_Heights[Berkeley_Heights.length] = createMarker(new GPoint(-74.43580627,40.66857529),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Early Child Cnt-hamil Ter Elementary School",'Berkeley_Heights=' + Berkeley_Heights.length);
Springfield[Springfield.length] = createMarker(new GPoint(-74.31357400,40.70850500),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Edward V. Walton",'Springfield=' + Springfield.length);
Springfield[Springfield.length] = createMarker(new GPoint(-74.32279968,40.70159912),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Edward V. Walton Elementary School",'Springfield=' + Springfield.length);
Elizabeth[Elizabeth.length] = createMarker(new GPoint(-74.21428680,40.66002274),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Elizabeth High School",'Elizabeth=' + Elizabeth.length);
Elizabeth[Elizabeth.length] = createMarker(new GPoint(-74.22544098,40.65355301),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Elmora Pre-k Center",'Elizabeth=' + Elizabeth.length);
Plainfield[Plainfield.length] = createMarker(new GPoint(-74.40695953,40.63443375),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Emerson Elementary School",'Plainfield=' + Plainfield.length);
Roselle_Park[Roselle_Park.length] = createMarker(new GPoint(-74.26728821,40.66630173),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Ernest J Finizio - Aldene Elementary School",'Roselle_Park=' + Roselle_Park.length);
Plainfield[Plainfield.length] = createMarker(new GPoint(-74.41147614,40.61196518),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Evergreen Elementary School",'Plainfield=' + Plainfield.length);
Scotch_Plains[Scotch_Plains.length] = createMarker(new GPoint(-74.37699890,40.64049911),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Evergreen Elementary School",'Scotch_Plains=' + Scotch_Plains.length);
Springfield[Springfield.length] = createMarker(new GPoint(-74.32279968,40.70159912),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Florence M. Gaudineer Middle School",'Springfield=' + Springfield.length);
Clark[Clark.length] = createMarker(new GPoint(-74.32700348,40.61391830),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Frank K. Hehnly Elementary School",'Clark=' + Clark.length);
Union[Union.length] = createMarker(new GPoint(-74.25746155,40.70601654),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Franklin Elementary School",'Union=' + Union.length);
Summit[Summit.length] = createMarker(new GPoint(-74.37532043,40.70964432),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Franklin Elementary School",'Summit=' + Summit.length);
Rahway[Rahway.length] = createMarker(new GPoint(-74.28060150,40.60720062),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Franklin Elementary School",'Rahway=' + Rahway.length);
Westfield[Westfield.length] = createMarker(new GPoint(-74.36019135,40.65680313),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Franklin Elementary School",'Westfield=' + Westfield.length);
Plainfield[Plainfield.length] = createMarker(new GPoint(-74.39706421,40.62788773),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Frederic W. Cook Elementary School",'Plainfield=' + Plainfield.length);
Hillside[Hillside.length] = createMarker(new GPoint(-74.22834778,40.70606995),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("George Washington Elementary School",'Hillside=' + Hillside.length);
Berkeley_Heights[Berkeley_Heights.length] = createMarker(new GPoint(-74.38735199,40.68671417),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Governor Livingston High School",'Berkeley_Heights=' + Berkeley_Heights.length);
Rahway[Rahway.length] = createMarker(new GPoint(-74.26792145,40.60450745),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Grover Cleveland Elementary School",'Rahway=' + Rahway.length);
Union[Union.length] = createMarker(new GPoint(-74.27884674,40.70245361),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hannah Caldwell Elementary School",'Union=' + Union.length);
Kenilworth[Kenilworth.length] = createMarker(new GPoint(-74.29560089,40.67553711),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Harding Elementary School",'Kenilworth=' + Kenilworth.length);
Roselle[Roselle.length] = createMarker(new GPoint(-74.25158691,40.65880203),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Harrison Elementary School",'Roselle=' + Roselle.length);
Scotch_Plains[Scotch_Plains.length] = createMarker(new GPoint(-74.37322998,40.65480423),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Hillcrest Academy",'Scotch_Plains=' + Scotch_Plains.length);
Westfield[Westfield.length] = createMarker(new GPoint(-74.34257600,40.63998100),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Hillcrest Academy-south",'Westfield=' + Westfield.length);
Cranford[Cranford.length] = createMarker(new GPoint(-74.29529572,40.64779663),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hillside Ave School",'Cranford=' + Cranford.length);
Hillside[Hillside.length] = createMarker(new GPoint(-74.23699188,40.69162750),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Hillside High School",'Hillside=' + Hillside.length);
Scotch_Plains[Scotch_Plains.length] = createMarker(new GPoint(-74.38197327,40.65059662),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Howard B. Brunner Elementary School",'Scotch_Plains=' + Scotch_Plains.length);
Plainfield[Plainfield.length] = createMarker(new GPoint(-74.42482758,40.60637283),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Hubbard Middle School",'Plainfield=' + Plainfield.length);
Hillside[Hillside.length] = createMarker(new GPoint(-74.23432922,40.69664001),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hurden Looker Elementary School",'Hillside=' + Hillside.length);
Scotch_Plains[Scotch_Plains.length] = createMarker(new GPoint(-74.37699890,40.64049911),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("J Ackerman Coles Elementary School",'Scotch_Plains=' + Scotch_Plains.length);
Springfield[Springfield.length] = createMarker(new GPoint(-74.31453705,40.71039200),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("James Caldwell Elementary School",'Springfield=' + Springfield.length);
Plainfield[Plainfield.length] = createMarker(new GPoint(-74.44770050,40.60460281),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Jefferson Elementary School",'Plainfield=' + Plainfield.length);
Westfield[Westfield.length] = createMarker(new GPoint(-74.32879639,40.63800049),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Jefferson Elementary School",'Westfield=' + Westfield.length);
Summit[Summit.length] = createMarker(new GPoint(-74.35198212,40.70544434),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Jefferson Elementary School",'Summit=' + Summit.length);
Springfield[Springfield.length] = createMarker(new GPoint(-74.32279968,40.70159912),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Jonathan Dayton High School",'Springfield=' + Springfield.length);
Linden[Linden.length] = createMarker(new GPoint(-74.25080109,40.63399887),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Joseph E Soehl Middle School",'Linden=' + Linden.length);
Union[Union.length] = createMarker(new GPoint(-74.26168823,40.68850327),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Kawameeh Middle School",'Union=' + Union.length);
Roselle[Roselle.length] = createMarker(new GPoint(-74.26469421,40.65100098),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Leonard V. Moore Middle School",'Roselle=' + Roselle.length);
Summit[Summit.length] = createMarker(new GPoint(-74.36019135,40.72040176),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lincoln-hubbard Elementary School",'Summit=' + Summit.length);
Garwood[Garwood.length] = createMarker(new GPoint(-74.32619476,40.65430069),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lincoln/franklin Elementary School",'Garwood=' + Garwood.length);
Linden[Linden.length] = createMarker(new GPoint(-74.25070190,40.63410187),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Linden High School",'Linden=' + Linden.length);
Cranford[Cranford.length] = createMarker(new GPoint(-74.31040192,40.64515305),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Livingston Ave School",'Cranford=' + Cranford.length);
Union[Union.length] = createMarker(new GPoint(-74.26760101,40.69609833),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Livingston Elementary School",'Union=' + Union.length);
Rahway[Rahway.length] = createMarker(new GPoint(-74.29367065,40.60919952),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Madison Elementary School",'Rahway=' + Rahway.length);
Plainfield[Plainfield.length] = createMarker(new GPoint(-74.40419769,40.62583542),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Maxson Middle School",'Plainfield=' + Plainfield.length);
Westfield[Westfield.length] = createMarker(new GPoint(-74.35299683,40.64510345),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mckinley Elementary School",'Westfield=' + Westfield.length);
Berkeley_Hts[Berkeley_Hts.length] = createMarker(new GPoint(-74.45271301,40.66851807),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mountain Park Elementary School",'Berkeley_Hts=' + Berkeley_Hts.length);
Linden[Linden.length] = createMarker(new GPoint(-74.27489471,40.63790131),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Myles J Mcmanus Middle School",'Linden=' + Linden.length);
New_Providence[New_Providence.length] = createMarker(new GPoint(-74.40260315,40.69869995),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("New Providence High School",'New_Providence=' + New_Providence.length);
New_Providence[New_Providence.length] = createMarker(new GPoint(-74.40260315,40.69869995),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("New Providence Middle School",'New_Providence=' + New_Providence.length);
Linden[Linden.length] = createMarker(new GPoint(-74.28298950,40.64130020),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("No 10 Highland Avenue Elementary School",'Linden=' + Linden.length);
Elizabeth[Elizabeth.length] = createMarker(new GPoint(-74.21010590,40.64438629),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("No 22 William F Halloran Elementary School",'Elizabeth=' + Elizabeth.length);
Elizabeth[Elizabeth.length] = createMarker(new GPoint(-74.21228900,40.67327500),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("No 51 Donald Stewart Ecc",'Elizabeth=' + Elizabeth.length);
Elizabeth[Elizabeth.length] = createMarker(new GPoint(-74.17797000,40.65504900),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("No 52 Ecc",'Elizabeth=' + Elizabeth.length);
Elizabeth[Elizabeth.length] = createMarker(new GPoint(-74.19870758,40.65291977),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("No 70 Cleveland Middle School",'Elizabeth=' + Elizabeth.length);
Elizabeth[Elizabeth.length] = createMarker(new GPoint(-74.19248962,40.64830399),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("No 71 Mabel Holmes Middle School",'Elizabeth=' + Elizabeth.length);
Elizabeth[Elizabeth.length] = createMarker(new GPoint(-74.22164154,40.66786194),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("No 72 Hamilton Middle School",'Elizabeth=' + Elizabeth.length);
Elizabeth[Elizabeth.length] = createMarker(new GPoint(-74.21549225,40.65770340),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("No 75 Battin Middle School",'Elizabeth=' + Elizabeth.length);
Elizabeth[Elizabeth.length] = createMarker(new GPoint(-74.21756744,40.65467453),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("No 76 Reilly Middle School",'Elizabeth=' + Elizabeth.length);
Elizabeth[Elizabeth.length] = createMarker(new GPoint(-74.21549225,40.65770340),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("No 77 Mcauliffe Middle School",'Elizabeth=' + Elizabeth.length);
Linden[Linden.length] = createMarker(new GPoint(-74.25080109,40.63399887),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Number 1 Elementary School",'Linden=' + Linden.length);
Elizabeth[Elizabeth.length] = createMarker(new GPoint(-74.18920898,40.65272141),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Number 1 G Washington Elementary School",'Elizabeth=' + Elizabeth.length);
Elizabeth[Elizabeth.length] = createMarker(new GPoint(-74.23346710,40.66922760),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Number 12 Elmora Elementary School",'Elizabeth=' + Elizabeth.length);
Elizabeth[Elizabeth.length] = createMarker(new GPoint(-74.18216705,40.65568161),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Number 13 B Franklin Elementary School",'Elizabeth=' + Elizabeth.length);
Elizabeth[Elizabeth.length] = createMarker(new GPoint(-74.22789001,40.66060257),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Number 14 A Lincoln Elementary School",'Elizabeth=' + Elizabeth.length);
Elizabeth[Elizabeth.length] = createMarker(new GPoint(-74.21559906,40.65169907),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Number 15 C Columbus Elementary School",'Elizabeth=' + Elizabeth.length);
Elizabeth[Elizabeth.length] = createMarker(new GPoint(-74.20265961,40.67956924),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Number 16 Madison Monroe Elementary School",'Elizabeth=' + Elizabeth.length);
Elizabeth[Elizabeth.length] = createMarker(new GPoint(-74.21544647,40.64658737),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Number 17 T Roosevelt Elementary School",'Elizabeth=' + Elizabeth.length);
Elizabeth[Elizabeth.length] = createMarker(new GPoint(-74.21080017,40.68325806),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Number 18 Robert Morris Elementary School",'Elizabeth=' + Elizabeth.length);
Elizabeth[Elizabeth.length] = createMarker(new GPoint(-74.22148895,40.65214157),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Number 19 Woodrow Wilson Elementary School",'Elizabeth=' + Elizabeth.length);
Linden[Linden.length] = createMarker(new GPoint(-74.31188965,40.65370178),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Number 2 Elementary School",'Linden=' + Linden.length);
Elizabeth[Elizabeth.length] = createMarker(new GPoint(-74.21079254,40.66514969),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Number 2 Winfield Scott Elementary School",'Elizabeth=' + Elizabeth.length);
Elizabeth[Elizabeth.length] = createMarker(new GPoint(-74.19126129,40.65826797),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Number 20 John Marshall Elementary School",'Elizabeth=' + Elizabeth.length);
Elizabeth[Elizabeth.length] = createMarker(new GPoint(-74.24748993,40.66960144),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Number 21 Victor Mravlag Elementary School",'Elizabeth=' + Elizabeth.length);
Elizabeth[Elizabeth.length] = createMarker(new GPoint(-74.21708679,40.67460251),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Number 23 N M Butler Elementary School",'Elizabeth=' + Elizabeth.length);
Elizabeth[Elizabeth.length] = createMarker(new GPoint(-74.19873047,40.64173889),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Number 25 Charles Hudson Elementary School",'Elizabeth=' + Elizabeth.length);
Elizabeth[Elizabeth.length] = createMarker(new GPoint(-74.21868896,40.68000031),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Number 26 Westminster Ave Elementary School",'Elizabeth=' + Elizabeth.length);
Elizabeth[Elizabeth.length] = createMarker(new GPoint(-74.20398712,40.65730286),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Number 3 Peterstown Elementary School",'Elizabeth=' + Elizabeth.length);
Linden[Linden.length] = createMarker(new GPoint(-74.24035645,40.64811325),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Number 4 Annex Elementary School",'Linden=' + Linden.length);
Linden[Linden.length] = createMarker(new GPoint(-74.25281525,40.64067459),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Number 5 Elementary School",'Linden=' + Linden.length);
Linden[Linden.length] = createMarker(new GPoint(-74.24893188,40.62892151),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Number 6 Elementary School",'Linden=' + Linden.length);
Elizabeth[Elizabeth.length] = createMarker(new GPoint(-74.20520782,40.67296982),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Number 6 Lafayette Elementary School",'Elizabeth=' + Elizabeth.length);
Linden[Linden.length] = createMarker(new GPoint(-74.25759125,40.62820435),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Number 8 Elementary School",'Linden=' + Linden.length);
Linden[Linden.length] = createMarker(new GPoint(-74.25080109,40.63399887),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Number 9 Deerfield Terr Elementary School",'Linden=' + Linden.length);
Cranford[Cranford.length] = createMarker(new GPoint(-74.29735565,40.66829681),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Orange Ave School",'Cranford=' + Cranford.length);
Scotch_Plains[Scotch_Plains.length] = createMarker(new GPoint(-74.39439392,40.64740372),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Park Middle School",'Scotch_Plains=' + Scotch_Plains.length);
Plainfield[Plainfield.length] = createMarker(new GPoint(-74.41219330,40.61180115),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Plainfield High School",'Plainfield=' + Plainfield.length);
Plainfield[Plainfield.length] = createMarker(new GPoint(-74.42434692,40.62116241),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Queen City Academy Charter School",'Plainfield=' + Plainfield.length);
Rahway[Rahway.length] = createMarker(new GPoint(-74.29359436,40.60956955),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Rahway High School",'Rahway=' + Rahway.length);
Rahway[Rahway.length] = createMarker(new GPoint(-74.28060150,40.60720062),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Rahway Intermediate School",'Rahway=' + Rahway.length);
Roselle_Park[Roselle_Park.length] = createMarker(new GPoint(-74.26689148,40.66379547),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Robert Gordon Elementary School",'Roselle_Park=' + Roselle_Park.length);
Rahway[Rahway.length] = createMarker(new GPoint(-74.28060150,40.60720062),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Roosevelt Elementary School",'Rahway=' + Rahway.length);
Westfield[Westfield.length] = createMarker(new GPoint(-74.35489655,40.65150070),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Roosevelt Intermediate",'Westfield=' + Westfield.length);
Roselle_Park[Roselle_Park.length] = createMarker(new GPoint(-74.26728821,40.66630173),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Roselle Park High School",'Roselle_Park=' + Roselle_Park.length);
Roselle_Park[Roselle_Park.length] = createMarker(new GPoint(-74.26684570,40.66380310),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Roselle Park Middle School",'Roselle_Park=' + Roselle_Park.length);
Roselle[Roselle.length] = createMarker(new GPoint(-74.26493600,40.65066300),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Roselle Public Sch Annex",'Roselle=' + Roselle.length);
New_Providence[New_Providence.length] = createMarker(new GPoint(-74.39085388,40.70803833),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Salt Brook Elementary School",'New_Providence=' + New_Providence.length);
Scotch_Plains[Scotch_Plains.length] = createMarker(new GPoint(-74.40639496,40.64980316),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("School 1",'Scotch_Plains=' + Scotch_Plains.length);
Scotch_Plains[Scotch_Plains.length] = createMarker(new GPoint(-74.38500977,40.65233994),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Scotch Plains Fanwood High School",'Scotch_Plains=' + Scotch_Plains.length);
Roselle_Park[Roselle_Park.length] = createMarker(new GPoint(-74.25439453,40.66614914),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Sherman Elementary School",'Roselle_Park=' + Roselle_Park.length);
Summit[Summit.length] = createMarker(new GPoint(-74.35955811,40.71438980),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Summit Middle School",'Summit=' + Summit.length);
Summit[Summit.length] = createMarker(new GPoint(-74.37094879,40.71927643),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Summit Senior High School",'Summit=' + Summit.length);
Westfield[Westfield.length] = createMarker(new GPoint(-74.33865356,40.63573837),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Tamaques Elementary School",'Westfield=' + Westfield.length);
Scotch_Plains[Scotch_Plains.length] = createMarker(new GPoint(-74.37359619,40.62360382),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Terrill Middle School",'Scotch_Plains=' + Scotch_Plains.length);
Springfield[Springfield.length] = createMarker(new GPoint(-74.32295227,40.69137955),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Thelma L. Sandmeier Elementary School",'Springfield=' + Springfield.length);
Westfield[Westfield.length] = createMarker(new GPoint(-74.34139252,40.63860321),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Thomas Edison Inter. Middle School",'Westfield=' + Westfield.length);
Berkeley_Hts[Berkeley_Hts.length] = createMarker(new GPoint(-74.43007660,40.67688751),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Thomas P. Hughes Elementary School",'Berkeley_Hts=' + Berkeley_Hts.length);
Scotch_Plains[Scotch_Plains.length] = createMarker(new GPoint(-74.35974121,40.61856461),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Union City Magnet High School",'Scotch_Plains=' + Scotch_Plains.length);
Scotch_Plains[Scotch_Plains.length] = createMarker(new GPoint(-74.35752106,40.61892700),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Union City Vocational Technical High School",'Scotch_Plains=' + Scotch_Plains.length);
Plainfield[Plainfield.length] = createMarker(new GPoint(-74.41732800,40.61496600),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Union Co Teams Charter School",'Plainfield=' + Plainfield.length);
Union[Union.length] = createMarker(new GPoint(-74.26760101,40.69609833),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Union Senior High School",'Union=' + Union.length);
Clark[Clark.length] = createMarker(new GPoint(-74.29746246,40.62546158),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Valley Road Elementary School",'Clark=' + Clark.length);
Cranford[Cranford.length] = createMarker(new GPoint(-74.30477142,40.64550400),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Walnut Ave School",'Cranford=' + Cranford.length);
Hillside[Hillside.length] = createMarker(new GPoint(-74.22338867,40.69868851),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Walter O. Krumbiegel Middle School",'Hillside=' + Hillside.length);
Plainfield[Plainfield.length] = createMarker(new GPoint(-74.43200684,40.60705566),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Washington Elementary School",'Plainfield=' + Plainfield.length);
Union[Union.length] = createMarker(new GPoint(-74.26400757,40.68178940),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Washington Elementary School",'Union=' + Union.length);
Roselle[Roselle.length] = createMarker(new GPoint(-74.26059723,40.65219879),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Washington Elementary School",'Roselle=' + Roselle.length);
Westfield[Westfield.length] = createMarker(new GPoint(-74.33319092,40.66110229),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Washington Elementary School",'Westfield=' + Westfield.length);
Summit[Summit.length] = createMarker(new GPoint(-74.37259674,40.72550201),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Washington Elementary School",'Summit=' + Summit.length);
Garwood[Garwood.length] = createMarker(new GPoint(-74.32159424,40.64890289),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Washington Elementary School",'Garwood=' + Garwood.length);
Westfield[Westfield.length] = createMarker(new GPoint(-74.34789276,40.64377975),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Westfield Senior High School",'Westfield=' + Westfield.length);
Westfield[Westfield.length] = createMarker(new GPoint(-74.32790375,40.62518311),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Westlake Sch-westfield",'Westfield=' + Westfield.length);
Roselle[Roselle.length] = createMarker(new GPoint(-74.26059723,40.65219879),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Wilday Middle School",'Roselle=' + Roselle.length);
Scotch_Plains[Scotch_Plains.length] = createMarker(new GPoint(-74.37699890,40.64049911),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("William J. Mcginn Elementary School",'Scotch_Plains=' + Scotch_Plains.length);
Berkeley_Hts[Berkeley_Hts.length] = createMarker(new GPoint(-74.43055725,40.68788147),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("William Woodruff Elementary School",'Berkeley_Hts=' + Berkeley_Hts.length);
Westfield[Westfield.length] = createMarker(new GPoint(-74.34279633,40.66210175),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Wilson Elementary School",'Westfield=' + Westfield.length);
Winfield[Winfield.length] = createMarker(new GPoint(-74.30269623,40.65510178),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Winfield Township Elementary School",'Winfield=' + Winfield.length);
Plainfield[Plainfield.length] = createMarker(new GPoint(-74.40509796,40.62380219),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Woodland Elementary School",'Plainfield=' + Plainfield.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(Berkeley_Heights);
map.removeOverlays(Berkeley_Hts);
map.removeOverlays(Clark);
map.removeOverlays(Cranford);
map.removeOverlays(Elizabeth);
map.removeOverlays(Garwood);
map.removeOverlays(Hillside);
map.removeOverlays(Kenilworth);
map.removeOverlays(Linden);
map.removeOverlays(Mountainside);
map.removeOverlays(New_Providence);
map.removeOverlays(Plainfield);
map.removeOverlays(Rahway);
map.removeOverlays(Roselle);
map.removeOverlays(Roselle_Park);
map.removeOverlays(Scotch_Plains);
map.removeOverlays(Springfield);
map.removeOverlays(Summit);
map.removeOverlays(Union);
map.removeOverlays(Westfield);
map.removeOverlays(Winfield);
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(Scotch_Plains);map.removeOverlays(Berkeley_Heights);
map.removeOverlays(Berkeley_Hts);
map.removeOverlays(Clark);
map.removeOverlays(Cranford);
map.removeOverlays(Elizabeth);
map.removeOverlays(Garwood);
map.removeOverlays(Hillside);
map.removeOverlays(Kenilworth);
map.removeOverlays(Linden);
map.removeOverlays(Mountainside);
map.removeOverlays(New_Providence);
map.removeOverlays(Plainfield);
map.removeOverlays(Rahway);
map.removeOverlays(Roselle);
map.removeOverlays(Roselle_Park);
map.removeOverlays(Scotch_Plains);
map.removeOverlays(Springfield);
map.removeOverlays(Summit);
map.removeOverlays(Union);
map.removeOverlays(Westfield);
map.removeOverlays(Winfield);
map.addOverlays(Berkeley_Heights);
centerByArray(Berkeley_Heights, false, false);
cntMarker += Berkeley_Heights.length;
map.addOverlays(Berkeley_Hts);
centerByArray(Berkeley_Hts, false, false);
cntMarker += Berkeley_Hts.length;
map.addOverlays(Clark);
centerByArray(Clark, false, false);
cntMarker += Clark.length;
map.addOverlays(Cranford);
centerByArray(Cranford, false, false);
cntMarker += Cranford.length;
map.addOverlays(Elizabeth);
centerByArray(Elizabeth, false, false);
cntMarker += Elizabeth.length;
map.addOverlays(Garwood);
centerByArray(Garwood, false, false);
cntMarker += Garwood.length;
map.addOverlays(Hillside);
centerByArray(Hillside, false, false);
cntMarker += Hillside.length;
map.addOverlays(Kenilworth);
centerByArray(Kenilworth, false, false);
cntMarker += Kenilworth.length;
map.addOverlays(Linden);
centerByArray(Linden, false, false);
cntMarker += Linden.length;
map.addOverlays(Mountainside);
centerByArray(Mountainside, false, false);
cntMarker += Mountainside.length;
map.addOverlays(New_Providence);
centerByArray(New_Providence, false, false);
cntMarker += New_Providence.length;
map.addOverlays(Plainfield);
centerByArray(Plainfield, false, false);
cntMarker += Plainfield.length;
map.addOverlays(Rahway);
centerByArray(Rahway, false, false);
cntMarker += Rahway.length;
map.addOverlays(Roselle);
centerByArray(Roselle, false, false);
cntMarker += Roselle.length;
map.addOverlays(Roselle_Park);
centerByArray(Roselle_Park, false, false);
cntMarker += Roselle_Park.length;
map.addOverlays(Scotch_Plains);
centerByArray(Scotch_Plains, false, false);
cntMarker += Scotch_Plains.length;
map.addOverlays(Springfield);
centerByArray(Springfield, false, false);
cntMarker += Springfield.length;
map.addOverlays(Summit);
centerByArray(Summit, false, false);
cntMarker += Summit.length;
map.addOverlays(Union);
centerByArray(Union, false, false);
cntMarker += Union.length;
map.addOverlays(Westfield);
centerByArray(Westfield, false, false);
cntMarker += Westfield.length;
map.addOverlays(Winfield);
centerByArray(Winfield, false, false);
cntMarker += Winfield.length;
centerByArray(Scotch_Plains,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');
}
}