function addMarkers() { mySelect = document.getElementById('selection'); Clarks_Summit = [];Moscow = [];Carbondale = [];Scranton = [];Dunmore = [];Simpson = [];Lake_Ariel = [];Jermyn = [];Mayfield = [];Throop = [];Eynon = [];Old_Forge = [];Moosic = [];Taylor = [];Chinchilla = [];Peckville = [];Archbald = [];Waverly = [];mySelect.options[mySelect.options.length] = new Option("Archbald schools",'all=Archbald'); mySelect.options[mySelect.options.length] = new Option("Carbondale schools",'all=Carbondale'); mySelect.options[mySelect.options.length] = new Option("Chinchilla schools",'all=Chinchilla'); mySelect.options[mySelect.options.length] = new Option("Clarks Summit schools",'all=Clarks_Summit'); mySelect.options[mySelect.options.length] = new Option("Dunmore schools",'all=Dunmore'); mySelect.options[mySelect.options.length] = new Option("Eynon schools",'all=Eynon'); mySelect.options[mySelect.options.length] = new Option("Jermyn schools",'all=Jermyn'); mySelect.options[mySelect.options.length] = new Option("Lake Ariel schools",'all=Lake_Ariel'); mySelect.options[mySelect.options.length] = new Option("Mayfield schools",'all=Mayfield'); mySelect.options[mySelect.options.length] = new Option("Moosic schools",'all=Moosic'); mySelect.options[mySelect.options.length] = new Option("Moscow schools",'all=Moscow'); mySelect.options[mySelect.options.length] = new Option("Old Forge schools",'all=Old_Forge'); mySelect.options[mySelect.options.length] = new Option("Peckville schools",'all=Peckville'); mySelect.options[mySelect.options.length] = new Option("Scranton schools",'all=Scranton'); mySelect.options[mySelect.options.length] = new Option("Simpson schools",'all=Simpson'); mySelect.options[mySelect.options.length] = new Option("Taylor schools",'all=Taylor'); mySelect.options[mySelect.options.length] = new Option("Throop schools",'all=Throop'); mySelect.options[mySelect.options.length] = new Option("Waverly schools",'all=Waverly'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Clarks_Summit[Clarks_Summit.length] = createMarker(new GPoint(-75.72132111,41.49383926),"
Abington Heights High School
Noble Road
Clarks Summit, PA 18411

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Abington Heights High School",'Clarks_Summit=' + Clarks_Summit.length); Clarks_Summit[Clarks_Summit.length] = createMarker(new GPoint(-75.71012878,41.48976898),"
Abington Heights Middle School
Rd 4
Clarks Summit, PA 18411

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Abington Heights Middle School",'Clarks_Summit=' + Clarks_Summit.length); Moscow[Moscow.length] = createMarker(new GPoint(-75.52124023,41.33887863),"
Academy Street School
Academy Street
Moscow, PA 18444

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Academy Street School",'Moscow=' + Moscow.length); Carbondale[Carbondale.length] = createMarker(new GPoint(-75.50267029,41.57394028),"
Carbondale Area Junior Senior High School
101 Brooklyn Street
Carbondale, PA 18407

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Carbondale Area Junior Senior High School",'Carbondale=' + Carbondale.length); Carbondale[Carbondale.length] = createMarker(new GPoint(-75.51200867,41.56731033),"
Carbondale Elementary School
103 Brooklyn St
Carbondale, PA 18407

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Carbondale Elementary School",'Carbondale=' + Carbondale.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.67225647,41.42713928),"
Charles Sumner #18 Elementary School
North Sumner Avenue Swetland
Scranton, PA 18504

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Charles Sumner #18 Elementary School",'Scranton=' + Scranton.length); Clarks_Summit[Clarks_Summit.length] = createMarker(new GPoint(-75.70301056,41.49009323),"
Clarks Summit Elementary School
401 W Grove St
Clarks Summit, PA 18411

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Clarks Summit Elementary School",'Clarks_Summit=' + Clarks_Summit.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.66309357,41.40956879),"
Ctc Of Lackawanna County
3201 Rockwell Ave
Scranton, PA 18508

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ctc Of Lackawanna County",'Scranton=' + Scranton.length); Dunmore[Dunmore.length] = createMarker(new GPoint(-75.62931824,41.42559433),"
Dunmore El Center
300 W Warren St
Dunmore, PA 18512

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Dunmore El Center",'Dunmore=' + Dunmore.length); Dunmore[Dunmore.length] = createMarker(new GPoint(-75.62931824,41.42559433),"
Dunmore High School
300 W Warren St
Dunmore, PA 18512

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Dunmore High School",'Dunmore=' + Dunmore.length); Dunmore[Dunmore.length] = createMarker(new GPoint(-75.62931824,41.42559433),"
Dunmore Middle School
300 West Warren Street
Dunmore, PA 18512

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Dunmore Middle School",'Dunmore=' + Dunmore.length); Simpson[Simpson.length] = createMarker(new GPoint(-75.48428345,41.59832382),"
Fell Charter School
777 Main Street
Simpson, PA 18407

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fell Charter School",'Simpson=' + Simpson.length); Simpson[Simpson.length] = createMarker(new GPoint(-75.50108337,41.57445908),"
Fell Elementary School
John Street
Simpson, PA 18407

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fell Elementary School",'Simpson=' + Simpson.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.68595123,41.40559387),"
Frances Willard #32 Elementary School
1100 Eynon St
Scranton, PA 18504

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Frances Willard #32 Elementary School",'Scranton=' + Scranton.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.66307068,41.42356491),"
George Bancroft #34 Elementary School
1002 Albright Ave
Scranton, PA 18508

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("George Bancroft #34 Elementary School",'Scranton=' + Scranton.length); Lake_Ariel[Lake_Ariel.length] = createMarker(new GPoint(-75.50148773,41.41473770),"
Jefferson Elementary School
825 Lions Rd
Lake Ariel, PA 18436

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Jefferson Elementary School",'Lake_Ariel=' + Lake_Ariel.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.65781403,41.41896439),"
John Adams #4 Elementary School
927 Capouse Ave
Scranton, PA 18509

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("John Adams #4 Elementary School",'Scranton=' + Scranton.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.67098236,41.39122009),"
John F. Kennedy #7 Elementary School
Prospect Avenue Saginaw St
Scranton, PA 18505

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("John F. Kennedy #7 Elementary School",'Scranton=' + Scranton.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.65866852,41.39930725),"
John G Whittier #2 Elementary School
700 Orchard St
Scranton, PA 18505

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("John G Whittier #2 Elementary School",'Scranton=' + Scranton.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.64614105,41.40109253),"
John J. Audubon #42 Elementary School
1801 Mulberry St
Scranton, PA 18510

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("John J. Audubon #42 Elementary School",'Scranton=' + Scranton.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.68441772,41.41479874),"
John Marshall #41 Elementary School
North Lincoln Avenue Oram St
Scranton, PA 18504

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("John Marshall #41 Elementary School",'Scranton=' + Scranton.length); Jermyn[Jermyn.length] = createMarker(new GPoint(-75.60575867,41.55587387),"
Lakeland Elementary School
1569 Lakeland Dr
Jermyn, PA 18433

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lakeland Elementary School",'Jermyn=' + Jermyn.length); Jermyn[Jermyn.length] = createMarker(new GPoint(-75.60227203,41.55955505),"
Lakeland Junior Senior High School
1593 Lakeland Dr
Jermyn, PA 18433

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lakeland Junior Senior High School",'Jermyn=' + Jermyn.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.68759918,41.41239929),"
Lincoln-jackson #14 Elementary School
Academy Street Hyde Park Ave
Scranton, PA 18505

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lincoln-jackson #14 Elementary School",'Scranton=' + Scranton.length); Mayfield[Mayfield.length] = createMarker(new GPoint(-75.53356171,41.54279709),"
Mayfield Elementary School
501 Linden St
Mayfield, PA 18433

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mayfield Elementary School",'Mayfield=' + Mayfield.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.66479492,41.39107513),"
Mcnichols Plaza Elementary School
1111 S Irving Ave
Scranton, PA 18505

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mcnichols Plaza Elementary School",'Scranton=' + Scranton.length); Throop[Throop.length] = createMarker(new GPoint(-75.60213470,41.44728088),"
Mid Valley El Center
50 Underwood Rd
Throop, PA 18512

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mid Valley El Center",'Throop=' + Throop.length); Throop[Throop.length] = createMarker(new GPoint(-75.60181427,41.44743347),"
Mid Valley Sec Center
52 Underwood Rd
Throop, PA 18512

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mid Valley Sec Center",'Throop=' + Throop.length); Moscow[Moscow.length] = createMarker(new GPoint(-75.53359222,41.33874893),"
Moscow El Center
851 Church St
Moscow, PA 18444

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Moscow El Center",'Moscow=' + Moscow.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.68441772,41.41479874),"
Neil Armstrong #40 Elementary School
North Lincoln Ave Clearview
Scranton, PA 18508

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Neil Armstrong #40 Elementary School",'Scranton=' + Scranton.length); Clarks_Summit[Clarks_Summit.length] = createMarker(new GPoint(-75.71012878,41.48976898),"
Newton-ransom School
Rd 3
Clarks Summit, PA 18411

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Newton-ransom School",'Clarks_Summit=' + Clarks_Summit.length); Moscow[Moscow.length] = createMarker(new GPoint(-75.52886963,41.33755875),"
North Pocono High School
701 Church St
Moscow, PA 18444

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("North Pocono High School",'Moscow=' + Moscow.length); Moscow[Moscow.length] = createMarker(new GPoint(-75.52886963,41.33755875),"
North Pocono Middle School
701 Church St
Moscow, PA 18444

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("North Pocono Middle School",'Moscow=' + Moscow.length); Eynon[Eynon.length] = createMarker(new GPoint(-75.57489014,41.49646378),"
Northeast Charter School
110 Betty Street
Eynon, PA 18403

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Northeast Charter School",'Eynon=' + Eynon.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.64626312,41.42166138),"
Northeast Intrmd School
Adams Ave Gibson St
Scranton, PA 18510

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Northeast Intrmd School",'Scranton=' + Scranton.length); Old_Forge[Old_Forge.length] = createMarker(new GPoint(-75.74356079,41.37221146),"
Old Forge Elementary School
401 Melmore St
Old Forge, PA 18518

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Old Forge Elementary School",'Old_Forge=' + Old_Forge.length); Old_Forge[Old_Forge.length] = createMarker(new GPoint(-75.73954773,41.37194061),"
Old Forge Junior Senior High School
300 Marion St
Old Forge, PA 18518

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Old Forge Junior Senior High School",'Old_Forge=' + Old_Forge.length); Moosic[Moosic.length] = createMarker(new GPoint(-75.73822784,41.35287094),"
Riverside El School East
Krieg School Streets
Moosic, PA 18507

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Riverside El School East",'Moosic=' + Moosic.length); Taylor[Taylor.length] = createMarker(new GPoint(-75.71715546,41.38051987),"
Riverside El School West
300 Davis St
Taylor, PA 18517

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Riverside El School West",'Taylor=' + Taylor.length); Taylor[Taylor.length] = createMarker(new GPoint(-75.71718597,41.38053131),"
Riverside Junior Senior High School
310 Davis St
Taylor, PA 18517

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Riverside Junior Senior High School",'Taylor=' + Taylor.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.64739990,41.43251038),"
Robert Morris #27 Elementary School
1824 Boulevard Ave
Scranton, PA 18509

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Robert Morris #27 Elementary School",'Scranton=' + Scranton.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.66309357,41.40956879),"
Scranton High School
63 Munchak Way
Scranton, PA 18508

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Scranton High School",'Scranton=' + Scranton.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.64174652,41.42953873),"
Scranton State School For Deaf
1800 N Washington Ave
Scranton, PA 18509

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Scranton State School For Deaf",'Scranton=' + Scranton.length); Chinchilla[Chinchilla.length] = createMarker(new GPoint(-75.66914368,41.46681976),"
South Abington School
Northern Boulevard Box 163
Chinchilla, PA 18410

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("South Abington School",'Chinchilla=' + Chinchilla.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.67037201,41.39706421),"
South Scranton Intrmd School
355 Maple St
Scranton, PA 18505

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("South Scranton Intrmd School",'Scranton=' + Scranton.length); Peckville[Peckville.length] = createMarker(new GPoint(-75.58602142,41.47941971),"
Valley View El Center
Main Street
Peckville, PA 18452

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Valley View El Center",'Peckville=' + Peckville.length); Archbald[Archbald.length] = createMarker(new GPoint(-75.56348900,41.50699100),"
Valley View High School
1 Columbus Dr
Archbald, PA 18403

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Valley View High School",'Archbald=' + Archbald.length); Archbald[Archbald.length] = createMarker(new GPoint(-75.55503845,41.49827576),"
Valley View Intrmd School
3 Columbus Dr
Archbald, PA 18403

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Valley View Intrmd School",'Archbald=' + Archbald.length); Archbald[Archbald.length] = createMarker(new GPoint(-75.55484772,41.49804688),"
Valley View Middle School
1 Columbus Dr
Archbald, PA 18403

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Valley View Middle School",'Archbald=' + Archbald.length); Waverly[Waverly.length] = createMarker(new GPoint(-75.70580292,41.52629852),"
Waverly School
Po Box J
Waverly, PA 18471

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Waverly School",'Waverly=' + Waverly.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.68726349,41.40956879),"
West Scranton High School
1201 Luzerne St
Scranton, PA 18504

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("West Scranton High School",'Scranton=' + Scranton.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.69338226,41.41065979),"
West Scranton Intrmd School
Fellows Street Parrot Avenue
Scranton, PA 18504

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("West Scranton Intrmd School",'Scranton=' + Scranton.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.63938141,41.41334152),"
William Prescott #38 Elementary School
Prescott Avenue Myrtle St
Scranton, PA 18510

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("William Prescott #38 Elementary School",'Scranton=' + Scranton.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(Archbald); map.removeOverlays(Carbondale); map.removeOverlays(Chinchilla); map.removeOverlays(Clarks_Summit); map.removeOverlays(Dunmore); map.removeOverlays(Eynon); map.removeOverlays(Jermyn); map.removeOverlays(Lake_Ariel); map.removeOverlays(Mayfield); map.removeOverlays(Moosic); map.removeOverlays(Moscow); map.removeOverlays(Old_Forge); map.removeOverlays(Peckville); map.removeOverlays(Scranton); map.removeOverlays(Simpson); map.removeOverlays(Taylor); map.removeOverlays(Throop); map.removeOverlays(Waverly); 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(Clarks_Summit);map.removeOverlays(Archbald); map.removeOverlays(Carbondale); map.removeOverlays(Chinchilla); map.removeOverlays(Clarks_Summit); map.removeOverlays(Dunmore); map.removeOverlays(Eynon); map.removeOverlays(Jermyn); map.removeOverlays(Lake_Ariel); map.removeOverlays(Mayfield); map.removeOverlays(Moosic); map.removeOverlays(Moscow); map.removeOverlays(Old_Forge); map.removeOverlays(Peckville); map.removeOverlays(Scranton); map.removeOverlays(Simpson); map.removeOverlays(Taylor); map.removeOverlays(Throop); map.removeOverlays(Waverly); map.addOverlays(Archbald); centerByArray(Archbald, false, false); cntMarker += Archbald.length; map.addOverlays(Carbondale); centerByArray(Carbondale, false, false); cntMarker += Carbondale.length; map.addOverlays(Chinchilla); centerByArray(Chinchilla, false, false); cntMarker += Chinchilla.length; map.addOverlays(Clarks_Summit); centerByArray(Clarks_Summit, false, false); cntMarker += Clarks_Summit.length; map.addOverlays(Dunmore); centerByArray(Dunmore, false, false); cntMarker += Dunmore.length; map.addOverlays(Eynon); centerByArray(Eynon, false, false); cntMarker += Eynon.length; map.addOverlays(Jermyn); centerByArray(Jermyn, false, false); cntMarker += Jermyn.length; map.addOverlays(Lake_Ariel); centerByArray(Lake_Ariel, false, false); cntMarker += Lake_Ariel.length; map.addOverlays(Mayfield); centerByArray(Mayfield, false, false); cntMarker += Mayfield.length; map.addOverlays(Moosic); centerByArray(Moosic, false, false); cntMarker += Moosic.length; map.addOverlays(Moscow); centerByArray(Moscow, false, false); cntMarker += Moscow.length; map.addOverlays(Old_Forge); centerByArray(Old_Forge, false, false); cntMarker += Old_Forge.length; map.addOverlays(Peckville); centerByArray(Peckville, false, false); cntMarker += Peckville.length; map.addOverlays(Scranton); centerByArray(Scranton, false, false); cntMarker += Scranton.length; map.addOverlays(Simpson); centerByArray(Simpson, false, false); cntMarker += Simpson.length; map.addOverlays(Taylor); centerByArray(Taylor, false, false); cntMarker += Taylor.length; map.addOverlays(Throop); centerByArray(Throop, false, false); cntMarker += Throop.length; map.addOverlays(Waverly); centerByArray(Waverly, false, false); cntMarker += Waverly.length; centerByArray(Clarks_Summit,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'); } }