function addMarkers() { mySelect = document.getElementById('selection'); Essex_Junction = [];Huntington = [];Jericho = [];Burlington = [];Richmond = [];South_Burlingto = [];Hinesburg = [];Charlotte = [];Colchester = [];Winooski = [];Milton = [];Shelburne = [];Waterbury = [];Underhill_Ctr = [];Underhill = [];Westford = [];Williston = [];mySelect.options[mySelect.options.length] = new Option("Burlington schools",'all=Burlington'); mySelect.options[mySelect.options.length] = new Option("Charlotte schools",'all=Charlotte'); mySelect.options[mySelect.options.length] = new Option("Colchester schools",'all=Colchester'); mySelect.options[mySelect.options.length] = new Option("Essex Junction schools",'all=Essex_Junction'); mySelect.options[mySelect.options.length] = new Option("Hinesburg schools",'all=Hinesburg'); mySelect.options[mySelect.options.length] = new Option("Huntington schools",'all=Huntington'); mySelect.options[mySelect.options.length] = new Option("Jericho schools",'all=Jericho'); mySelect.options[mySelect.options.length] = new Option("Milton schools",'all=Milton'); mySelect.options[mySelect.options.length] = new Option("Richmond schools",'all=Richmond'); mySelect.options[mySelect.options.length] = new Option("Shelburne schools",'all=Shelburne'); mySelect.options[mySelect.options.length] = new Option("South Burlingto schools",'all=South_Burlingto'); mySelect.options[mySelect.options.length] = new Option("Underhill schools",'all=Underhill'); mySelect.options[mySelect.options.length] = new Option("Underhill Ctr schools",'all=Underhill_Ctr'); mySelect.options[mySelect.options.length] = new Option("Waterbury schools",'all=Waterbury'); mySelect.options[mySelect.options.length] = new Option("Westford schools",'all=Westford'); mySelect.options[mySelect.options.length] = new Option("Williston schools",'all=Williston'); mySelect.options[mySelect.options.length] = new Option("Winooski schools",'all=Winooski'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Essex_Junction[Essex_Junction.length] = createMarker(new GPoint(-73.09010315,44.50180054),"
Albert D. Lawton School
104 Maple Street Rfd 4
Essex Junction, VT 05452

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Albert D. Lawton School",'Essex_Junction=' + Essex_Junction.length); Huntington[Huntington.length] = createMarker(new GPoint(-72.96420288,44.29679489),"
Brewster Pierce School
120 School Street
Huntington, VT 05462

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Brewster Pierce School",'Huntington=' + Huntington.length); Jericho[Jericho.length] = createMarker(new GPoint(-72.94553375,44.51982117),"
Browns River Middle Usd #17
20 River Road
Jericho, VT 05465

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Browns River Middle Usd #17",'Jericho=' + Jericho.length); Burlington[Burlington.length] = createMarker(new GPoint(-73.22519684,44.48630142),"
Burlington S.d.
150 Colchester Ave
Burlington, VT 05401

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Burlington S.d.",'Burlington=' + Burlington.length); Burlington[Burlington.length] = createMarker(new GPoint(-73.23897552,44.49644089),"
Burlington Senior High School
52 Institute Road
Burlington, VT 05401

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Burlington Senior High School",'Burlington=' + Burlington.length); Burlington[Burlington.length] = createMarker(new GPoint(-73.23897552,44.49644089),"
Burlington Technical Center
52 Institute Road
Burlington, VT 05401

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Burlington Technical Center",'Burlington=' + Burlington.length); Burlington[Burlington.length] = createMarker(new GPoint(-73.24230957,44.51310730),"
C. P. Smith School
332 Ethan Allen Parkway
Burlington, VT 05401

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("C. P. Smith School",'Burlington=' + Burlington.length); Richmond[Richmond.length] = createMarker(new GPoint(-72.99296570,44.41283035),"
Camels Hump Middle Usd #17
173 School Street
Richmond, VT 05477

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Camels Hump Middle Usd #17",'Richmond=' + Richmond.length); South_Burlingto[South_Burlingto.length] = createMarker(new GPoint(-73.16464233,44.47055435),"
Chamberlin School
262 White Street
South Burlingto, VT 05403

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Chamberlin School",'South_Burlingto=' + South_Burlingto.length); Burlington[Burlington.length] = createMarker(new GPoint(-73.21411133,44.45695877),"
Champlain School
800 Pine Street
Burlington, VT 05401

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Champlain School",'Burlington=' + Burlington.length); Hinesburg[Hinesburg.length] = createMarker(new GPoint(-73.10939026,44.34310150),"
Champlain Valley Uhsd #15 High School
396 Cvu Road
Hinesburg, VT 05461

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Champlain Valley Uhsd #15 High School",'Hinesburg=' + Hinesburg.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-73.23258209,44.31529236),"
Charlotte Central School
408 Hinesburg Road
Charlotte, VT 05445

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Charlotte Central School",'Charlotte=' + Charlotte.length); Essex_Junction[Essex_Junction.length] = createMarker(new GPoint(-73.10340881,44.49789810),"
Chittenden Central S.u. Elementary School
7 Meadow Ter
Essex Junction, VT 05452

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Chittenden Central S.u. Elementary School",'Essex_Junction=' + Essex_Junction.length); Richmond[Richmond.length] = createMarker(new GPoint(-72.98970032,44.40110016),"
Chittenden East S.u. Elementary School
Po Box 282
Richmond, VT 05477

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Chittenden East S.u. Elementary School",'Richmond=' + Richmond.length); Hinesburg[Hinesburg.length] = createMarker(new GPoint(-73.11055700,44.34354700),"
Chittenden South Super Unio
363 Cvu Road
Hinesburg, VT 05461

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Chittenden South Super Unio",'Hinesburg=' + Hinesburg.length); Colchester[Colchester.length] = createMarker(new GPoint(-73.19779968,44.53929901),"
Colchester High School
Po Box 900
Colchester, VT 05446

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Colchester High School",'Colchester=' + Colchester.length); Colchester[Colchester.length] = createMarker(new GPoint(-73.19779968,44.53929901),"
Colchester Middle School
Po Box 30
Colchester, VT 05446

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Colchester Middle School",'Colchester=' + Colchester.length); Colchester[Colchester.length] = createMarker(new GPoint(-73.14824700,44.54375500),"
Colchester S.d.
Po Box 27
Colchester, VT 05446

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Colchester S.d.",'Colchester=' + Colchester.length); Burlington[Burlington.length] = createMarker(new GPoint(-73.20776367,44.47596359),"
Edmunds Elementary School
299 Main Street
Burlington, VT 05401

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Edmunds Elementary School",'Burlington=' + Burlington.length); Burlington[Burlington.length] = createMarker(new GPoint(-73.20851898,44.47596359),"
Edmunds Middle School
275 Main Street
Burlington, VT 05401

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Edmunds Middle School",'Burlington=' + Burlington.length); Burlington[Burlington.length] = createMarker(new GPoint(-73.19407654,44.48173141),"
Essential Early Education C Elementary School
150 Colchester Avenue
Burlington, VT 05401

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Essential Early Education C Elementary School",'Burlington=' + Burlington.length); Essex_Junction[Essex_Junction.length] = createMarker(new GPoint(-73.11132812,44.49773788),"
Essex Comm. Ed. Center Uhsd #
2 Educational Dr
Essex Junction, VT 05452

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Essex Comm. Ed. Center Uhsd #",'Essex_Junction=' + Essex_Junction.length); Essex_Junction[Essex_Junction.length] = createMarker(new GPoint(-73.05720520,44.51243591),"
Essex Elementary School
1 Bixby Hill Road
Essex Junction, VT 05452

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Essex Elementary School",'Essex_Junction=' + Essex_Junction.length); Essex_Junction[Essex_Junction.length] = createMarker(new GPoint(-73.11133575,44.49746323),"
Essex Jct Regional Technical Center
3 Educational Drive
Essex Junction, VT 05452

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Essex Jct Regional Technical Center",'Essex_Junction=' + Essex_Junction.length); Essex_Junction[Essex_Junction.length] = createMarker(new GPoint(-73.05500031,44.50209808),"
Essex Middle School
40 Foster Rd
Essex Junction, VT 05452

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Essex Middle School",'Essex_Junction=' + Essex_Junction.length); Essex_Junction[Essex_Junction.length] = createMarker(new GPoint(-73.04929352,44.49990845),"
Founders Memorial School
168 Sand Hill
Essex Junction, VT 05452

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Founders Memorial School",'Essex_Junction=' + Essex_Junction.length); South_Burlingto[South_Burlingto.length] = createMarker(new GPoint(-73.17883301,44.45484161),"
Frederick H. Tuttle Middle School
500 Dorset Street
South Burlingto, VT 05403

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Frederick H. Tuttle Middle School",'South_Burlingto=' + South_Burlingto.length); Essex_Junction[Essex_Junction.length] = createMarker(new GPoint(-73.12757874,44.48986435),"
Hiawatha School
34 Hiawatha Ave
Essex Junction, VT 05452

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hiawatha School",'Essex_Junction=' + Essex_Junction.length); Hinesburg[Hinesburg.length] = createMarker(new GPoint(-73.10964966,44.32646561),"
Hinesburg Elementary School
10888 Route 116
Hinesburg, VT 05461

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hinesburg Elementary School",'Hinesburg=' + Hinesburg.length); Winooski[Winooski.length] = createMarker(new GPoint(-73.18234253,44.50109100),"
J. F. Kennedy Elementary School
70 Normand Street
Winooski, VT 05404

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("J. F. Kennedy Elementary School",'Winooski=' + Winooski.length); Burlington[Burlington.length] = createMarker(new GPoint(-73.25920105,44.51728439),"
J. J. Flynn School
1645 North Avenue
Burlington, VT 05401

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("J. J. Flynn School",'Burlington=' + Burlington.length); Jericho[Jericho.length] = createMarker(new GPoint(-72.99266052,44.50619125),"
Jericho Elementary School
90 Vt Route 15
Jericho, VT 05465

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Jericho Elementary School",'Jericho=' + Jericho.length); Burlington[Burlington.length] = createMarker(new GPoint(-73.21715546,44.48446274),"
Lawrence Barnes School
123 North Street
Burlington, VT 05401

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lawrence Barnes School",'Burlington=' + Burlington.length); Burlington[Burlington.length] = createMarker(new GPoint(-73.25089264,44.51159286),"
Lyman C. Hunt Middle School
1364 North Avenue
Burlington, VT 05401

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Lyman C. Hunt Middle School",'Burlington=' + Burlington.length); Colchester[Colchester.length] = createMarker(new GPoint(-73.19779968,44.53929901),"
Malletts Bay School
Po Box 28
Colchester, VT 05446

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Malletts Bay School",'Colchester=' + Colchester.length); Milton[Milton.length] = createMarker(new GPoint(-73.11085510,44.63211060),"
Milton Elementary School
42 Herrick Avenue
Milton, VT 05468

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Milton Elementary School",'Milton=' + Milton.length); Milton[Milton.length] = createMarker(new GPoint(-73.11700439,44.62834167),"
Milton Junior High School
17 Rebecca Lander Drive
Milton, VT 05468

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Milton Junior High School",'Milton=' + Milton.length); Milton[Milton.length] = createMarker(new GPoint(-73.11700439,44.62834167),"
Milton Senior High School
17 Rebecca Lander Drive
Milton, VT 05468

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Milton Senior High School",'Milton=' + Milton.length); Jericho[Jericho.length] = createMarker(new GPoint(-72.96353912,44.48632050),"
Mt. Mansfield Usd #17 High School
211 Browns Trace
Jericho, VT 05465

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mt. Mansfield Usd #17 High School",'Jericho=' + Jericho.length); Burlington[Burlington.length] = createMarker(new GPoint(-73.20317078,44.48024750),"
Ontop
14 South Williams Street
Burlington, VT 05401

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ontop",'Burlington=' + Burlington.length); South_Burlingto[South_Burlingto.length] = createMarker(new GPoint(-73.21004486,44.43883514),"
Orchard School
2 Baldwin Avenue
South Burlingto, VT 05403

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Orchard School",'South_Burlingto=' + South_Burlingto.length); Colchester[Colchester.length] = createMarker(new GPoint(-73.19779968,44.53929901),"
Porters Point School
Po Box 32
Colchester, VT 05446

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Porters Point School",'Colchester=' + Colchester.length); Richmond[Richmond.length] = createMarker(new GPoint(-72.99263000,44.41250229),"
Richmond Elementary School
125 School Street
Richmond, VT 05477

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Richmond Elementary School",'Richmond=' + Richmond.length); Shelburne[Shelburne.length] = createMarker(new GPoint(-73.23441315,44.38193512),"
Shelburne Community School
345 Harbor Road
Shelburne, VT 05482

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Shelburne Community School",'Shelburne=' + Shelburne.length); Waterbury[Waterbury.length] = createMarker(new GPoint(-72.87898254,44.37323761),"
Smilie Memorial School(bolt Elementary School
2712 Theodore Roosevelt H
Waterbury, VT 05676

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Smilie Memorial School(bolt Elementary School",'Waterbury=' + Waterbury.length); South_Burlingto[South_Burlingto.length] = createMarker(new GPoint(-73.18053436,44.46537018),"
So. Burlington Central School
10 Market Street
South Burlingto, VT 05403

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("So. Burlington Central School",'South_Burlingto=' + South_Burlingto.length); South_Burlingto[South_Burlingto.length] = createMarker(new GPoint(-73.17873383,44.45434952),"
So. Burlington High School
550 Dorset Street
South Burlingto, VT 05403

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("So. Burlington High School",'South_Burlingto=' + South_Burlingto.length); South_Burlingto[South_Burlingto.length] = createMarker(new GPoint(-73.17873383,44.45434952),"
South Burlington S.d.
550 Dorset St
South Burlingto, VT 05403

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("South Burlington S.d.",'South_Burlingto=' + South_Burlingto.length); Essex_Junction[Essex_Junction.length] = createMarker(new GPoint(-73.11490631,44.49256134),"
Summit Street School
17 Summit St
Essex Junction, VT 05452

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Summit Street School",'Essex_Junction=' + Essex_Junction.length); Essex_Junction[Essex_Junction.length] = createMarker(new GPoint(-73.11150360,44.49372101),"
Thomas Fleming School
Prospect Street
Essex Junction, VT 05452

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Thomas Fleming School",'Essex_Junction=' + Essex_Junction.length); Underhill_Ctr[Underhill_Ctr.length] = createMarker(new GPoint(-72.90045929,44.50737000),"
Underhill Central School
Pleasant Valley Road
Underhill Ctr, VT 05490

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Underhill Central School",'Underhill_Ctr=' + Underhill_Ctr.length); Underhill[Underhill.length] = createMarker(new GPoint(-72.93967438,44.52087402),"
Underhill Graded School
10 River Road
Underhill, VT 05489

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Underhill Graded School",'Underhill=' + Underhill.length); Colchester[Colchester.length] = createMarker(new GPoint(-73.19779968,44.53929901),"
Union Memorial School
Po Box 48
Colchester, VT 05446

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Union Memorial School",'Colchester=' + Colchester.length); Westford[Westford.length] = createMarker(new GPoint(-73.01936340,44.60435486),"
Westford Elementary School
146 Brookside Road
Westford, VT 05494

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Westford Elementary School",'Westford=' + Westford.length); Burlington[Burlington.length] = createMarker(new GPoint(-73.21334076,44.48786163),"
Wheeler School
6 Archibald Street
Burlington, VT 05401

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wheeler School",'Burlington=' + Burlington.length); Williston[Williston.length] = createMarker(new GPoint(-73.07601929,44.43928909),"
Williston Schools Elementary School
195 Central School Drive
Williston, VT 05495

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Williston Schools Elementary School",'Williston=' + Williston.length); Winooski[Winooski.length] = createMarker(new GPoint(-73.18248749,44.50112915),"
Winooski High School
80 Normand Street
Winooski, VT 05404

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Winooski High School",'Winooski=' + Winooski.length); Winooski[Winooski.length] = createMarker(new GPoint(-73.18248749,44.50112915),"
Winooski Middle School
80 Normand Street
Winooski, VT 05404

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Winooski Middle School",'Winooski=' + Winooski.length); Colchester[Colchester.length] = createMarker(new GPoint(-73.23753357,44.53639603),"
Woodside Juvenile Rehab Center
26 Woodside Dr
Colchester, VT 05446

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Woodside Juvenile Rehab Center",'Colchester=' + Colchester.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(Burlington); map.removeOverlays(Charlotte); map.removeOverlays(Colchester); map.removeOverlays(Essex_Junction); map.removeOverlays(Hinesburg); map.removeOverlays(Huntington); map.removeOverlays(Jericho); map.removeOverlays(Milton); map.removeOverlays(Richmond); map.removeOverlays(Shelburne); map.removeOverlays(South_Burlingto); map.removeOverlays(Underhill); map.removeOverlays(Underhill_Ctr); map.removeOverlays(Waterbury); map.removeOverlays(Westford); map.removeOverlays(Williston); map.removeOverlays(Winooski); 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(Essex_Junction);map.removeOverlays(Burlington); map.removeOverlays(Charlotte); map.removeOverlays(Colchester); map.removeOverlays(Essex_Junction); map.removeOverlays(Hinesburg); map.removeOverlays(Huntington); map.removeOverlays(Jericho); map.removeOverlays(Milton); map.removeOverlays(Richmond); map.removeOverlays(Shelburne); map.removeOverlays(South_Burlingto); map.removeOverlays(Underhill); map.removeOverlays(Underhill_Ctr); map.removeOverlays(Waterbury); map.removeOverlays(Westford); map.removeOverlays(Williston); map.removeOverlays(Winooski); map.addOverlays(Burlington); centerByArray(Burlington, false, false); cntMarker += Burlington.length; map.addOverlays(Charlotte); centerByArray(Charlotte, false, false); cntMarker += Charlotte.length; map.addOverlays(Colchester); centerByArray(Colchester, false, false); cntMarker += Colchester.length; map.addOverlays(Essex_Junction); centerByArray(Essex_Junction, false, false); cntMarker += Essex_Junction.length; map.addOverlays(Hinesburg); centerByArray(Hinesburg, false, false); cntMarker += Hinesburg.length; map.addOverlays(Huntington); centerByArray(Huntington, false, false); cntMarker += Huntington.length; map.addOverlays(Jericho); centerByArray(Jericho, false, false); cntMarker += Jericho.length; map.addOverlays(Milton); centerByArray(Milton, false, false); cntMarker += Milton.length; map.addOverlays(Richmond); centerByArray(Richmond, false, false); cntMarker += Richmond.length; map.addOverlays(Shelburne); centerByArray(Shelburne, false, false); cntMarker += Shelburne.length; map.addOverlays(South_Burlingto); centerByArray(South_Burlingto, false, false); cntMarker += South_Burlingto.length; map.addOverlays(Underhill); centerByArray(Underhill, false, false); cntMarker += Underhill.length; map.addOverlays(Underhill_Ctr); centerByArray(Underhill_Ctr, false, false); cntMarker += Underhill_Ctr.length; map.addOverlays(Waterbury); centerByArray(Waterbury, false, false); cntMarker += Waterbury.length; map.addOverlays(Westford); centerByArray(Westford, false, false); cntMarker += Westford.length; map.addOverlays(Williston); centerByArray(Williston, false, false); cntMarker += Williston.length; map.addOverlays(Winooski); centerByArray(Winooski, false, false); cntMarker += Winooski.length; centerByArray(Essex_Junction,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'); } }