function addMarkers() { mySelect = document.getElementById('selection'); Bridgewater = [];Manville = [];Belle_Mead = [];Warren = [];Somerville = [];Watchung = [];Bedminster = [];Bernardsville = [];Bound_Brook = [];Basking_Ridge = [];Somerset = [];Kingston = [];N_Plainfield = [];Franklin_Park = [];Green_Brook = [];Hillsborough = [];Raritan = [];Liberty_Corner = [];Skillman = [];Branchburg = [];S_Bound_Brook = [];Skillman_Nj = [];Neshanic_Station = [];mySelect.options[mySelect.options.length] = new Option("Basking Ridge schools",'all=Basking_Ridge'); mySelect.options[mySelect.options.length] = new Option("Bedminster schools",'all=Bedminster'); mySelect.options[mySelect.options.length] = new Option("Belle Mead schools",'all=Belle_Mead'); mySelect.options[mySelect.options.length] = new Option("Bernardsville schools",'all=Bernardsville'); mySelect.options[mySelect.options.length] = new Option("Bound Brook schools",'all=Bound_Brook'); mySelect.options[mySelect.options.length] = new Option("Branchburg schools",'all=Branchburg'); mySelect.options[mySelect.options.length] = new Option("Bridgewater schools",'all=Bridgewater'); mySelect.options[mySelect.options.length] = new Option("Franklin Park schools",'all=Franklin_Park'); mySelect.options[mySelect.options.length] = new Option("Green Brook schools",'all=Green_Brook'); mySelect.options[mySelect.options.length] = new Option("Hillsborough schools",'all=Hillsborough'); mySelect.options[mySelect.options.length] = new Option("Kingston schools",'all=Kingston'); mySelect.options[mySelect.options.length] = new Option("Liberty Corner schools",'all=Liberty_Corner'); mySelect.options[mySelect.options.length] = new Option("Manville schools",'all=Manville'); mySelect.options[mySelect.options.length] = new Option("N Plainfield schools",'all=N_Plainfield'); mySelect.options[mySelect.options.length] = new Option("Neshanic Station schools",'all=Neshanic_Station'); mySelect.options[mySelect.options.length] = new Option("Raritan schools",'all=Raritan'); mySelect.options[mySelect.options.length] = new Option("S Bound Brook schools",'all=S_Bound_Brook'); mySelect.options[mySelect.options.length] = new Option("Skillman schools",'all=Skillman'); mySelect.options[mySelect.options.length] = new Option("Skillman Nj schools",'all=Skillman_Nj'); mySelect.options[mySelect.options.length] = new Option("Somerset schools",'all=Somerset'); mySelect.options[mySelect.options.length] = new Option("Somerville schools",'all=Somerville'); mySelect.options[mySelect.options.length] = new Option("Warren schools",'all=Warren'); mySelect.options[mySelect.options.length] = new Option("Watchung schools",'all=Watchung'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Bridgewater[Bridgewater.length] = createMarker(new GPoint(-74.58130646,40.56988144),"
Adamsville Elementary School
400 Union Ave
Bridgewater, NJ 08807

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Adamsville Elementary School",'Bridgewater=' + Bridgewater.length); Manville[Manville.length] = createMarker(new GPoint(-74.59919739,40.54340363),"
Alexander Batcho Inter Middle School
100 North 13th Ave
Manville, NJ 08835

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Alexander Batcho Inter Middle School",'Manville=' + Manville.length); Belle_Mead[Belle_Mead.length] = createMarker(new GPoint(-74.64859772,40.44869995),"
Amsterdam School
301 Amsterdam Drive
Belle Mead, NJ 08844

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Amsterdam School",'Belle_Mead=' + Belle_Mead.length); Warren[Warren.length] = createMarker(new GPoint(-74.52465820,40.60414124),"
Angelo Tomaso School
46 Washington Valley Rd
Warren, NJ 07059

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Angelo Tomaso School",'Warren=' + Warren.length); Somerville[Somerville.length] = createMarker(new GPoint(-74.59030151,40.56450272),"
Auten Road School
281 Auten Road
Somerville, NJ 08844

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Auten Road School",'Somerville=' + Somerville.length); Watchung[Watchung.length] = createMarker(new GPoint(-74.43900299,40.64319992),"
Bayberry Elementary School
Bayberry Lane
Watchung, NJ 07069

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bayberry Elementary School",'Watchung=' + Watchung.length); Bedminster[Bedminster.length] = createMarker(new GPoint(-74.64541626,40.67930222),"
Bedminster Township Elementary School
234 Somerville Road
Bedminster, NJ 07921

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bedminster Township Elementary School",'Bedminster=' + Bedminster.length); Bernardsville[Bernardsville.length] = createMarker(new GPoint(-74.56950378,40.72874069),"
Bedwell Elementary School
Seney Drive
Bernardsville, NJ 07924

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bedwell Elementary School",'Bernardsville=' + Bernardsville.length); Bernardsville[Bernardsville.length] = createMarker(new GPoint(-74.56735992,40.72150803),"
Bernards High School
25 Olcott Avenue
Bernardsville, NJ 07924

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bernards High School",'Bernardsville=' + Bernardsville.length); Bernardsville[Bernardsville.length] = createMarker(new GPoint(-74.56950378,40.72874069),"
Bernardsville Middle School
Seney Drive
Bernardsville, NJ 07924

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Bernardsville Middle School",'Bernardsville=' + Bernardsville.length); Bound_Brook[Bound_Brook.length] = createMarker(new GPoint(-74.54364014,40.56769943),"
Bound Brook High School
West Union Ave.
Bound Brook, NJ 08805

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bound Brook High School",'Bound_Brook=' + Bound_Brook.length); Bridgewater[Bridgewater.length] = createMarker(new GPoint(-74.65820312,40.56248093),"
Bradley Gardens Elementary School
148 Pine Street
Bridgewater, NJ 08807

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bradley Gardens Elementary School",'Bridgewater=' + Bridgewater.length); Bridgewater[Bridgewater.length] = createMarker(new GPoint(-74.62689972,40.59040070),"
Brdgwtr-raritn High School
P.o. Box 6569
Bridgewater, NJ 08807

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Brdgwtr-raritn High School",'Bridgewater=' + Bridgewater.length); Bridgewater[Bridgewater.length] = createMarker(new GPoint(-74.62689972,40.59040070),"
Brdgwtr-raritn Middle School
P O Box 6933
Bridgewater, NJ 08807

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Brdgwtr-raritn Middle School",'Bridgewater=' + Bridgewater.length); Basking_Ridge[Basking_Ridge.length] = createMarker(new GPoint(-74.54449463,40.69163132),"
Cedar Hill School
100 Peachtree Road
Basking Ridge, NJ 07920

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cedar Hill School",'Basking_Ridge=' + Basking_Ridge.length); Warren[Warren.length] = createMarker(new GPoint(-74.42359924,40.61759949),"
Central Elementary School
109 Mt Bethel Rd
Warren, NJ 07059

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Central Elementary School",'Warren=' + Warren.length); Somerville[Somerville.length] = createMarker(new GPoint(-74.67179871,40.58060074),"
Central Middle School
220 Baird Road
Somerville, NJ 08876

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Central Middle School",'Somerville=' + Somerville.length); Somerset[Somerset.length] = createMarker(new GPoint(-74.49426270,40.50571442),"
Conerly Road Elementary School
35 Conerly Road
Somerset, NJ 08873

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Conerly Road Elementary School",'Somerset=' + Somerset.length); Bridgewater[Bridgewater.length] = createMarker(new GPoint(-74.59124756,40.61116028),"
Crim Elementary School
1300 Crim Rd
Bridgewater, NJ 08807

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Crim Elementary School",'Bridgewater=' + Bridgewater.length); Kingston[Kingston.length] = createMarker(new GPoint(-74.61479950,40.37710571),"
E S C Kingston School
25 Laurel Ave.
Kingston, NJ 08528

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("E S C Kingston School",'Kingston=' + Kingston.length); N_Plainfield[N_Plainfield.length] = createMarker(new GPoint(-74.42124939,40.62945175),"
East End Elementary School
170 Oneida Ave
N Plainfield, NJ 07060

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("East End Elementary School",'N_Plainfield=' + N_Plainfield.length); Bridgewater[Bridgewater.length] = createMarker(new GPoint(-74.64697266,40.61432266),"
Eisenhower Middle School
791 Eisenhower Ave
Bridgewater, NJ 08807

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Eisenhower Middle School",'Bridgewater=' + Bridgewater.length); Somerset[Somerset.length] = createMarker(new GPoint(-74.53260040,40.54980469),"
Elizabeth Ave Elementary School
363 Elizabeth Avenue
Somerset, NJ 08873

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Elizabeth Ave Elementary School",'Somerset=' + Somerset.length); Somerset[Somerset.length] = createMarker(new GPoint(-74.51535034,40.53418732),"
Franklin Charter School
49 Napolean Court
Somerset, NJ 08873

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Franklin Charter School",'Somerset=' + Somerset.length); Somerset[Somerset.length] = createMarker(new GPoint(-74.48526000,40.49093500),"
Franklin Middle School
415 Francis Street
Somerset, NJ 08873

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Franklin Middle School",'Somerset=' + Somerset.length); Franklin_Park[Franklin_Park.length] = createMarker(new GPoint(-74.53870392,40.44221878),"
Franklin Park Elementary School
30 Eden Street
Franklin Park, NJ 08823

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Franklin Park Elementary School",'Franklin_Park=' + Franklin_Park.length); Somerset[Somerset.length] = createMarker(new GPoint(-74.48699951,40.48800278),"
Franklin Township High School
500 Elizabeth Avenue
Somerset, NJ 08873

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Franklin Township High School",'Somerset=' + Somerset.length); Green_Brook[Green_Brook.length] = createMarker(new GPoint(-74.46080017,40.59680176),"
Green Brook Middle School
132 Jefferson Ave
Green Brook, NJ 08812

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Green Brook Middle School",'Green_Brook=' + Green_Brook.length); Bridgewater[Bridgewater.length] = createMarker(new GPoint(-74.62689972,40.59040070),"
Hamilton School
Po Box 6030
Bridgewater, NJ 08807

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hamilton School",'Bridgewater=' + Bridgewater.length); Somerset[Somerset.length] = createMarker(new GPoint(-74.48140717,40.49262619),"
Hillcrest Elementary School
500 Franklin Blvd
Somerset, NJ 08873

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hillcrest Elementary School",'Somerset=' + Somerset.length); Hillsborough[Hillsborough.length] = createMarker(new GPoint(-74.64859772,40.44869995),"
Hillsborough Elementary School
435 Route 206
Hillsborough, NJ 08844

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hillsborough Elementary School",'Hillsborough=' + Hillsborough.length); Hillsborough[Hillsborough.length] = createMarker(new GPoint(-74.65311400,40.48255000),"
Hillsborough High School
466 Raider Boulevard
Hillsborough, NJ 08844

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hillsborough High School",'Hillsborough=' + Hillsborough.length); Hillsborough[Hillsborough.length] = createMarker(new GPoint(-74.64425659,40.51844788),"
Hillsborough Middle School
260 Triangle Road
Hillsborough, NJ 08844

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Hillsborough Middle School",'Hillsborough=' + Hillsborough.length); Bridgewater[Bridgewater.length] = createMarker(new GPoint(-74.62945557,40.62926483),"
Hillside Middle School
844 Brown Road
Bridgewater, NJ 08807

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Hillside Middle School",'Bridgewater=' + Bridgewater.length); Green_Brook[Green_Brook.length] = createMarker(new GPoint(-74.47673798,40.59994125),"
Irene E Feldkirchner Elementary School
105 Andrew St
Green Brook, NJ 08812

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Irene E Feldkirchner Elementary School",'Green_Brook=' + Green_Brook.length); Raritan[Raritan.length] = createMarker(new GPoint(-74.64797974,40.56766891),"
John F Kennedy Elementary School
255 Woodmere St
Raritan, NJ 08869

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("John F Kennedy Elementary School",'Raritan=' + Raritan.length); Bound_Brook[Bound_Brook.length] = createMarker(new GPoint(-74.53563690,40.56431961),"
Lafayette Elementary School
50 West High Street
Bound Brook, NJ 08805

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lafayette Elementary School",'Bound_Brook=' + Bound_Brook.length); Liberty_Corner[Liberty_Corner.length] = createMarker(new GPoint(-74.58023834,40.66564941),"
Liberty Corner Elementary School
61 Church Street
Liberty Corner, NJ 07938

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Liberty Corner Elementary School",'Liberty_Corner=' + Liberty_Corner.length); Somerset[Somerset.length] = createMarker(new GPoint(-74.50980377,40.50490189),"
Macafee Elementary School
53 Macafee Road
Somerset, NJ 08873

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Macafee Elementary School",'Somerset=' + Somerset.length); Manville[Manville.length] = createMarker(new GPoint(-74.59750366,40.54370117),"
Manville High School
1100 Brooks Boulevard
Manville, NJ 08835

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Manville High School",'Manville=' + Manville.length); Warren[Warren.length] = createMarker(new GPoint(-74.48844910,40.63975143),"
Middle Middle School
100 Old Stirling Rd
Warren, NJ 07060

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Middle Middle School",'Warren=' + Warren.length); Bridgewater[Bridgewater.length] = createMarker(new GPoint(-74.67274100,40.59706700),"
Milltown School
611 Milltown Road
Bridgewater, NJ 08807

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Milltown School",'Bridgewater=' + Bridgewater.length); Skillman[Skillman.length] = createMarker(new GPoint(-74.67439270,40.42853546),"
Montgomery High School
1016 Route 601
Skillman, NJ 08558

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montgomery High School",'Skillman=' + Skillman.length); Skillman[Skillman.length] = createMarker(new GPoint(-74.66794300,40.42451000),"
Montgomery Lower Mid School
373 Burt Hill Road
Skillman, NJ 08558

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montgomery Lower Mid School",'Skillman=' + Skillman.length); Skillman[Skillman.length] = createMarker(new GPoint(-74.67439270,40.42853546),"
Montgomery Middle School
N75 Burnt Hill Road
Skillman, NJ 08558

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Montgomery Middle School",'Skillman=' + Skillman.length); Basking_Ridge[Basking_Ridge.length] = createMarker(new GPoint(-74.62354279,40.65682983),"
Mount Prospect Elementary School
111 Hansom Rd
Basking Ridge, NJ 07920

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mount Prospect Elementary School",'Basking_Ridge=' + Basking_Ridge.length); Warren[Warren.length] = createMarker(new GPoint(-74.51139832,40.63309860),"
Mt. Horeb Elementary School
80 Mt Horeb Rd
Warren, NJ 07059

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mt. Horeb Elementary School",'Warren=' + Warren.length); N_Plainfield[N_Plainfield.length] = createMarker(new GPoint(-74.44071960,40.62253571),"
North Plainfield High School
34 Wilson Ave
N Plainfield, NJ 07060

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("North Plainfield High School",'N_Plainfield=' + N_Plainfield.length); Basking_Ridge[Basking_Ridge.length] = createMarker(new GPoint(-74.55242920,40.70622253),"
Oak St Elementary School
70 W Oak St
Basking Ridge, NJ 07920

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Oak St Elementary School",'Basking_Ridge=' + Basking_Ridge.length); Branchburg[Branchburg.length] = createMarker(new GPoint(-74.69751740,40.55997849),"
Old York Elementary School
580 Old York Rd
Branchburg, NJ 08876

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Old York Elementary School",'Branchburg=' + Branchburg.length); Skillman[Skillman.length] = createMarker(new GPoint(-74.67214966,40.41932678),"
Orchard Hill Elementary School
244 Orchard Road
Skillman, NJ 08558

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Orchard Hill Elementary School",'Skillman=' + Skillman.length); Somerset[Somerset.length] = createMarker(new GPoint(-74.47139740,40.49865341),"
Pine Grove Manor Elementary School
130 Highland Avenue
Somerset, NJ 08873

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pine Grove Manor Elementary School",'Somerset=' + Somerset.length); Basking_Ridge[Basking_Ridge.length] = createMarker(new GPoint(-74.54887390,40.69515991),"
Ridge High School
268 So. Finley Ave
Basking Ridge, NJ 07920

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ridge High School",'Basking_Ridge=' + Basking_Ridge.length); S_Bound_Brook[S_Bound_Brook.length] = createMarker(new GPoint(-74.53170013,40.55430222),"
Robert Morris Public School
122 Elizabeth Street
S Bound Brook, NJ 08880

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Robert Morris Public School",'S_Bound_Brook=' + S_Bound_Brook.length); Manville[Manville.length] = createMarker(new GPoint(-74.59149933,40.54478455),"
Roosevelt School
410 Brooks Blvd.
Manville, NJ 08835

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Roosevelt School",'Manville=' + Manville.length); Somerset[Somerset.length] = createMarker(new GPoint(-74.52157593,40.49344635),"
Sampson G Smith Middle School
1649 Amwell Road
Somerset, NJ 08873

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Sampson G Smith Middle School",'Somerset=' + Somerset.length); Bound_Brook[Bound_Brook.length] = createMarker(new GPoint(-74.54171753,40.57093811),"
Smalley Elementary School
Cherry Ave
Bound Brook, NJ 08805

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Smalley Elementary School",'Bound_Brook=' + Bound_Brook.length); N_Plainfield[N_Plainfield.length] = createMarker(new GPoint(-74.42946900,40.62182000),"
Somerset
303 Somerset Street
N Plainfield, NJ 07060

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Somerset",'N_Plainfield=' + N_Plainfield.length); Bridgewater[Bridgewater.length] = createMarker(new GPoint(-74.62310028,40.58980179),"
Somerset Co Vocational Technical High School
P.o. Box 6350
Bridgewater, NJ 08807

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Somerset Co Vocational Technical High School",'Bridgewater=' + Bridgewater.length); Bridgewater[Bridgewater.length] = createMarker(new GPoint(-74.63173676,40.56813431),"
Somerset Elementary Academy
7 Finderne Ave.
Bridgewater, NJ 08807

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Somerset Elementary Academy",'Bridgewater=' + Bridgewater.length); Bridgewater[Bridgewater.length] = createMarker(new GPoint(-74.58154297,40.55813217),"
Somerset Secondary Academy
7 Finderne Ave
Bridgewater, NJ 08807

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Somerset Secondary Academy",'Bridgewater=' + Bridgewater.length); Somerville[Somerville.length] = createMarker(new GPoint(-74.61330414,40.57750320),"
Somerville High School
222 Davenport St
Somerville, NJ 08876

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Somerville High School",'Somerville=' + Somerville.length); Somerville[Somerville.length] = createMarker(new GPoint(-74.61308289,40.57210922),"
Somerville Middle School
51 West Cliff Street
Somerville, NJ 08876

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Somerville Middle School",'Somerville=' + Somerville.length); N_Plainfield[N_Plainfield.length] = createMarker(new GPoint(-74.44719696,40.61670303),"
Stony Brook Elementary School
269 Grove St
N Plainfield, NJ 07060

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Stony Brook Elementary School",'N_Plainfield=' + N_Plainfield.length); Somerville[Somerville.length] = createMarker(new GPoint(-74.69896698,40.57654572),"
Stony Brook Elementary School
136 Cedar Grove Rd
Somerville, NJ 08876

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Stony Brook Elementary School",'Somerville=' + Somerville.length); Hillsborough[Hillsborough.length] = createMarker(new GPoint(-74.67179871,40.58110046),"
Sunnymead Elementary School
55 Sunnymead Rd
Hillsborough, NJ 08844

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sunnymead Elementary School",'Hillsborough=' + Hillsborough.length); Hillsborough[Hillsborough.length] = createMarker(new GPoint(-74.67179871,40.58110046),"
Triangle Elementary School
156 So. Triangle Rd
Hillsborough, NJ 08844

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Triangle Elementary School",'Hillsborough=' + Hillsborough.length); Watchung[Watchung.length] = createMarker(new GPoint(-74.43900299,40.64319992),"
Valley View Middle School
50 Valley View Road
Watchung, NJ 07069

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Valley View Middle School",'Watchung=' + Watchung.length); Somerville[Somerville.length] = createMarker(new GPoint(-74.67179871,40.58110046),"
Van Derveer Elementary School
Union Avenue
Somerville, NJ 08876

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Van Derveer Elementary School",'Somerville=' + Somerville.length); Bridgewater[Bridgewater.length] = createMarker(new GPoint(-74.65583801,40.60340118),"
Van Holten Elementary School
Van Holten Rd
Bridgewater, NJ 08807

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Van Holten Elementary School",'Bridgewater=' + Bridgewater.length); Skillman_Nj[Skillman_Nj.length] = createMarker(new GPoint(-74.69909668,40.40999985),"
Village Elementary School
100 Main Boulevard
Skillman Nj, NJ 08558

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Village Elementary School",'Skillman_Nj=' + Skillman_Nj.length); Warren[Warren.length] = createMarker(new GPoint(-74.47807312,40.65140152),"
Watchung Hills Regional High School
108 Stirling Rd
Warren, NJ 07059

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Watchung Hills Regional High School",'Warren=' + Warren.length); N_Plainfield[N_Plainfield.length] = createMarker(new GPoint(-74.44910700,40.61293400),"
West End
447 Greenbrook Rd
N Plainfield, NJ 07060

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("West End",'N_Plainfield=' + N_Plainfield.length); Manville[Manville.length] = createMarker(new GPoint(-74.59220123,40.53929901),"
Weston Elementary School
Newark Ave
Manville, NJ 08835

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Weston Elementary School",'Manville=' + Manville.length); Neshanic_Station[Neshanic_Station.length] = createMarker(new GPoint(-74.72122955,40.54669952),"
Whiton Elementary School
470 Whiton Road
Neshanic Station, NJ 08853

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Whiton Elementary School",'Neshanic_Station=' + Neshanic_Station.length); Basking_Ridge[Basking_Ridge.length] = createMarker(new GPoint(-74.56349945,40.68275833),"
William Annin Middle School
70 Quincy Road
Basking Ridge, NJ 07920

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("William Annin Middle School",'Basking_Ridge=' + Basking_Ridge.length); Hillsborough[Hillsborough.length] = createMarker(new GPoint(-74.76370239,40.50510406),"
Woodfern Elementary School
425 Woodfern Rd
Hillsborough, NJ 08844

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Woodfern Elementary School",'Hillsborough=' + Hillsborough.length); Warren[Warren.length] = createMarker(new GPoint(-74.47821045,40.65259933),"
Woodland School
114 Stirling Rd
Warren, NJ 07059

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Woodland School",'Warren=' + Warren.length); Hillsborough[Hillsborough.length] = createMarker(new GPoint(-74.61019897,40.45970535),"
Woods Road Elementary School
120 South Woods Rd
Hillsborough, NJ 08844

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Woods Road Elementary School",'Hillsborough=' + Hillsborough.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(Basking_Ridge); map.removeOverlays(Bedminster); map.removeOverlays(Belle_Mead); map.removeOverlays(Bernardsville); map.removeOverlays(Bound_Brook); map.removeOverlays(Branchburg); map.removeOverlays(Bridgewater); map.removeOverlays(Franklin_Park); map.removeOverlays(Green_Brook); map.removeOverlays(Hillsborough); map.removeOverlays(Kingston); map.removeOverlays(Liberty_Corner); map.removeOverlays(Manville); map.removeOverlays(N_Plainfield); map.removeOverlays(Neshanic_Station); map.removeOverlays(Raritan); map.removeOverlays(S_Bound_Brook); map.removeOverlays(Skillman); map.removeOverlays(Skillman_Nj); map.removeOverlays(Somerset); map.removeOverlays(Somerville); map.removeOverlays(Warren); map.removeOverlays(Watchung); 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(Bridgewater);map.removeOverlays(Basking_Ridge); map.removeOverlays(Bedminster); map.removeOverlays(Belle_Mead); map.removeOverlays(Bernardsville); map.removeOverlays(Bound_Brook); map.removeOverlays(Branchburg); map.removeOverlays(Bridgewater); map.removeOverlays(Franklin_Park); map.removeOverlays(Green_Brook); map.removeOverlays(Hillsborough); map.removeOverlays(Kingston); map.removeOverlays(Liberty_Corner); map.removeOverlays(Manville); map.removeOverlays(N_Plainfield); map.removeOverlays(Neshanic_Station); map.removeOverlays(Raritan); map.removeOverlays(S_Bound_Brook); map.removeOverlays(Skillman); map.removeOverlays(Skillman_Nj); map.removeOverlays(Somerset); map.removeOverlays(Somerville); map.removeOverlays(Warren); map.removeOverlays(Watchung); map.addOverlays(Basking_Ridge); centerByArray(Basking_Ridge, false, false); cntMarker += Basking_Ridge.length; map.addOverlays(Bedminster); centerByArray(Bedminster, false, false); cntMarker += Bedminster.length; map.addOverlays(Belle_Mead); centerByArray(Belle_Mead, false, false); cntMarker += Belle_Mead.length; map.addOverlays(Bernardsville); centerByArray(Bernardsville, false, false); cntMarker += Bernardsville.length; map.addOverlays(Bound_Brook); centerByArray(Bound_Brook, false, false); cntMarker += Bound_Brook.length; map.addOverlays(Branchburg); centerByArray(Branchburg, false, false); cntMarker += Branchburg.length; map.addOverlays(Bridgewater); centerByArray(Bridgewater, false, false); cntMarker += Bridgewater.length; map.addOverlays(Franklin_Park); centerByArray(Franklin_Park, false, false); cntMarker += Franklin_Park.length; map.addOverlays(Green_Brook); centerByArray(Green_Brook, false, false); cntMarker += Green_Brook.length; map.addOverlays(Hillsborough); centerByArray(Hillsborough, false, false); cntMarker += Hillsborough.length; map.addOverlays(Kingston); centerByArray(Kingston, false, false); cntMarker += Kingston.length; map.addOverlays(Liberty_Corner); centerByArray(Liberty_Corner, false, false); cntMarker += Liberty_Corner.length; map.addOverlays(Manville); centerByArray(Manville, false, false); cntMarker += Manville.length; map.addOverlays(N_Plainfield); centerByArray(N_Plainfield, false, false); cntMarker += N_Plainfield.length; map.addOverlays(Neshanic_Station); centerByArray(Neshanic_Station, false, false); cntMarker += Neshanic_Station.length; map.addOverlays(Raritan); centerByArray(Raritan, false, false); cntMarker += Raritan.length; map.addOverlays(S_Bound_Brook); centerByArray(S_Bound_Brook, false, false); cntMarker += S_Bound_Brook.length; map.addOverlays(Skillman); centerByArray(Skillman, false, false); cntMarker += Skillman.length; map.addOverlays(Skillman_Nj); centerByArray(Skillman_Nj, false, false); cntMarker += Skillman_Nj.length; map.addOverlays(Somerset); centerByArray(Somerset, false, false); cntMarker += Somerset.length; map.addOverlays(Somerville); centerByArray(Somerville, false, false); cntMarker += Somerville.length; map.addOverlays(Warren); centerByArray(Warren, false, false); cntMarker += Warren.length; map.addOverlays(Watchung); centerByArray(Watchung, false, false); cntMarker += Watchung.length; centerByArray(Bridgewater,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'); } }