function addMarkers(){ mySelect = document.getElementById('selection'); Pittsburgh = [];Gibsonia = [];Homestead = [];Allison_Park = [];Cheswick = [];Turtle_Creek = [];East_Pittsburgh = [];Monroeville = [];Mckeesport = [];Munhall = [];Bethel_Park = [];White_Oak = [];Coraopolis = [];Mc_Kees_Rocks = [];Wexford = [];Sewickley = [];Natrona_Heights = [];Clairton = [];West_Mifflin = [];mySelect.options[mySelect.options.length] = new Option("Allison Park schools",'all=Allison_Park'); mySelect.options[mySelect.options.length] = new Option("Bethel Park schools",'all=Bethel_Park'); mySelect.options[mySelect.options.length] = new Option("Cheswick schools",'all=Cheswick'); mySelect.options[mySelect.options.length] = new Option("Clairton schools",'all=Clairton'); mySelect.options[mySelect.options.length] = new Option("Coraopolis schools",'all=Coraopolis'); mySelect.options[mySelect.options.length] = new Option("East Pittsburgh schools",'all=East_Pittsburgh'); mySelect.options[mySelect.options.length] = new Option("Gibsonia schools",'all=Gibsonia'); mySelect.options[mySelect.options.length] = new Option("Homestead schools",'all=Homestead'); mySelect.options[mySelect.options.length] = new Option("Mc Kees Rocks schools",'all=Mc_Kees_Rocks'); mySelect.options[mySelect.options.length] = new Option("Mckeesport schools",'all=Mckeesport'); mySelect.options[mySelect.options.length] = new Option("Monroeville schools",'all=Monroeville'); mySelect.options[mySelect.options.length] = new Option("Munhall schools",'all=Munhall'); mySelect.options[mySelect.options.length] = new Option("Natrona Heights schools",'all=Natrona_Heights'); mySelect.options[mySelect.options.length] = new Option("Pittsburgh schools",'all=Pittsburgh'); mySelect.options[mySelect.options.length] = new Option("Sewickley schools",'all=Sewickley'); mySelect.options[mySelect.options.length] = new Option("Turtle Creek schools",'all=Turtle_Creek'); mySelect.options[mySelect.options.length] = new Option("West Mifflin schools",'all=West_Mifflin'); mySelect.options[mySelect.options.length] = new Option("Wexford schools",'all=Wexford'); mySelect.options[mySelect.options.length] = new Option("White Oak schools",'all=White_Oak'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Pittsburgh[Pittsburgh.length] = createMarker(new GPoint(-79.97147600,40.36080100),"
A C L D/tillotson School
4900 Girard Road
Pittsburgh, PA 15227
Co-ed school, 2-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("A C L D/tillotson School",'Pittsburgh=' + Pittsburgh.length); Gibsonia[Gibsonia.length] = createMarker(new GPoint(-79.96825200,40.59850900),"
Aquinas Academy
2308 West Hardies Road
Gibsonia, PA 15044
Co-ed school, NS-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Aquinas Academy",'Gibsonia=' + Gibsonia.length); Homestead[Homestead.length] = createMarker(new GPoint(-79.91094300,40.40558100),"
The Auberle Education Center
120 East 9th Avenue
Homestead, PA 15120
Co-ed school, 4-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Auberle Education Center",'Homestead=' + Homestead.length); Pittsburgh[Pittsburgh.length] = createMarker(new GPoint(-80.03268400,40.46479500),"
Bethel Christian Academy
2438 California Avenue
Pittsburgh, PA 15212
Co-ed school, KG-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bethel Christian Academy",'Pittsburgh=' + Pittsburgh.length); Pittsburgh[Pittsburgh.length] = createMarker(new GPoint(-80.07049000,40.42358400),"
Bishop Canevin High School
2700 Morange Road
Pittsburgh, PA 15205
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bishop Canevin High School",'Pittsburgh=' + Pittsburgh.length); Pittsburgh[Pittsburgh.length] = createMarker(new GPoint(-80.15637900,40.44196300),"
Bradley School
5180 Campbells Run Road
Pittsburgh, PA 15205
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bradley School",'Pittsburgh=' + Pittsburgh.length); Pittsburgh[Pittsburgh.length] = createMarker(new GPoint(-79.88273400,40.58214300),"
Bradley School- Robinson
5180 Campbells Run Road
Pittsburgh, PA 15205
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bradley School- Robinson",'Pittsburgh=' + Pittsburgh.length); Allison_Park[Allison_Park.length] = createMarker(new GPoint(-79.95024300,40.59611000),"
Calvary Christian Academy
4765 S Pioneer Rd
Allison Park, PA 15101
Co-ed school, KG-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Calvary Christian Academy",'Allison_Park=' + Allison_Park.length); Pittsburgh[Pittsburgh.length] = createMarker(new GPoint(-79.94693500,40.44696300),"
Central Catholic High School
4720 5th Avenue
Pittsburgh, PA 15213
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Central Catholic High School",'Pittsburgh=' + Pittsburgh.length); Cheswick[Cheswick.length] = createMarker(new GPoint(-79.80046600,40.54143600),"
Cheswick Christian Academy
1407 Pittsburgh Street
Cheswick, PA 15024
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cheswick Christian Academy",'Cheswick=' + Cheswick.length); Pittsburgh[Pittsburgh.length] = createMarker(new GPoint(-80.00334900,40.53040600),"
Eden Christian Academy
206 Siebert Road
Pittsburgh, PA 15237
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Eden Christian Academy",'Pittsburgh=' + Pittsburgh.length); Pittsburgh[Pittsburgh.length] = createMarker(new GPoint(-79.91853200,40.45332500),"
The Ellis School
6425 Fifth Avenue
Pittsburgh, PA 15206
All-girls school, PK-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("The Ellis School",'Pittsburgh=' + Pittsburgh.length); Turtle_Creek[Turtle_Creek.length] = createMarker(new GPoint(-79.82586200,40.41659700),"
Faith Christian School
801 Thompson Street
Turtle Creek, PA 15145
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Faith Christian School",'Turtle_Creek=' + Turtle_Creek.length); East_Pittsburgh[East_Pittsburgh.length] = createMarker(new GPoint(-79.89721600,40.45833500),"
Grace Non-traditional Christian Academy
Po Box 54
East Pittsburgh, PA 15112
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Grace Non-traditional Christian Academy",'East_Pittsburgh=' + East_Pittsburgh.length); Monroeville[Monroeville.length] = createMarker(new GPoint(-79.73830900,40.44807700),"
Greater Works Christian School
301 College Park Drive
Monroeville, PA 15146
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Greater Works Christian School",'Monroeville=' + Monroeville.length); Pittsburgh[Pittsburgh.length] = createMarker(new GPoint(-79.78168000,40.49540600),"
Heritage Christian School
200 Elicker Road
Pittsburgh, PA 15239
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Heritage Christian School",'Pittsburgh=' + Pittsburgh.length); Pittsburgh[Pittsburgh.length] = createMarker(new GPoint(-79.92509400,40.43459700),"
Hillel Academy Pittsburgh
5685 Beacon Street
Pittsburgh, PA 15217
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hillel Academy Pittsburgh",'Pittsburgh=' + Pittsburgh.length); Mckeesport[Mckeesport.length] = createMarker(new GPoint(-79.84820900,40.34556300),"
Holy Family Inst Day School East
2412 Versailles Avenue
Mckeesport, PA 15132
Co-ed school, 3-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holy Family Inst Day School East",'Mckeesport=' + Mckeesport.length); Pittsburgh[Pittsburgh.length] = createMarker(new GPoint(-80.09971500,40.51092500),"
Holy Family Institute
8235 Ohio River Blvd
Pittsburgh, PA 15202
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holy Family Institute",'Pittsburgh=' + Pittsburgh.length); Munhall[Munhall.length] = createMarker(new GPoint(-79.90216800,40.40758600),"
Holy Family Institute
605 E 10th Avenue
Munhall, PA 15120
Co-ed school, 5-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holy Family Institute",'Munhall=' + Munhall.length); Pittsburgh[Pittsburgh.length] = createMarker(new GPoint(-80.09728000,40.51077400),"
Holy Family Learning Alt Education
125 North Avenue
Pittsburgh, PA 15202
Co-ed school, 5-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holy Family Learning Alt Education",'Pittsburgh=' + Pittsburgh.length); Pittsburgh[Pittsburgh.length] = createMarker(new GPoint(-79.89841400,40.45567800),"
Holy Rosary School
7120 Kelly Street
Pittsburgh, PA 15208
Co-ed school, PK-7
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holy Rosary School",'Pittsburgh=' + Pittsburgh.length); Pittsburgh[Pittsburgh.length] = createMarker(new GPoint(-79.86976300,40.45905600),"
Imani Christian Academy
235 Eastgate Drive
Pittsburgh, PA 15235
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Imani Christian Academy",'Pittsburgh=' + Pittsburgh.length); Bethel_Park[Bethel_Park.length] = createMarker(new GPoint(-80.05135100,40.29791200),"
Jesus Fellowship Academy
6151 Brushrun Road
Bethel Park, PA 15102
Co-ed school, 3-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Jesus Fellowship Academy",'Bethel_Park=' + Bethel_Park.length); White_Oak[White_Oak.length] = createMarker(new GPoint(-79.82189700,40.34920600),"
Mesivta Of Allegheny County
1400 Summitt Street
White Oak, PA 15131
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Mesivta Of Allegheny County",'White_Oak=' + White_Oak.length); Pittsburgh[Pittsburgh.length] = createMarker(new GPoint(-79.93960300,40.46469600),"
The Neighborhood Academy
5231 Penn Avenue Suite 200
Pittsburgh, PA 15224
Co-ed school, 8-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Neighborhood Academy",'Pittsburgh=' + Pittsburgh.length); Pittsburgh[Pittsburgh.length] = createMarker(new GPoint(-79.98594400,40.45949800),"
North Catholic
1400 Troy Hill Rd
Pittsburgh, PA 15212
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("North Catholic",'Pittsburgh=' + Pittsburgh.length); Pittsburgh[Pittsburgh.length] = createMarker(new GPoint(-79.94995500,40.44860400),"
Oakland Catholic High School
144 North Craig Street
Pittsburgh, PA 15213
All-girls school, 9-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Oakland Catholic High School",'Pittsburgh=' + Pittsburgh.length); Pittsburgh[Pittsburgh.length] = createMarker(new GPoint(-79.95646500,40.43721600),"
Oakland School
362 Mckee Place
Pittsburgh, PA 15213
Co-ed school, 8-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Oakland School",'Pittsburgh=' + Pittsburgh.length); Coraopolis[Coraopolis.length] = createMarker(new GPoint(-80.15763200,40.50312500),"
Our Lady of the Sacred Heart High School350/4
1504 Woodcrest Avenue
Coraopolis, PA 15108
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Our Lady of the Sacred Heart High School350/4",'Coraopolis=' + Coraopolis.length); Pittsburgh[Pittsburgh.length] = createMarker(new GPoint(-80.01745400,40.47076600),"
Pressley Ridge
530 Marshall Avenue
Pittsburgh, PA 15214
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pressley Ridge",'Pittsburgh=' + Pittsburgh.length); Mc_Kees_Rocks[Mc_Kees_Rocks.length] = createMarker(new GPoint(-80.14535100,40.46925300),"
Robinson Twp Christian School
77 Phillips Lane
Mc Kees Rocks, PA 15136
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Robinson Twp Christian School",'Mc_Kees_Rocks=' + Mc_Kees_Rocks.length); Wexford[Wexford.length] = createMarker(new GPoint(-80.05622400,40.62639700),"
St. Alphonsus School
201 Church Road
Wexford, PA 15090
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Alphonsus School",'Wexford=' + Wexford.length); Mckeesport[Mckeesport.length] = createMarker(new GPoint(-79.82847900,40.32794100),"
Serra Catholic High School
200 Hershey Drive
Mckeesport, PA 15132
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Serra Catholic High School",'Mckeesport=' + Mckeesport.length); Sewickley[Sewickley.length] = createMarker(new GPoint(-80.18959800,40.54389500),"
Sewickley Academy
315 Academy Avenue
Sewickley, PA 15143
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sewickley Academy",'Sewickley=' + Sewickley.length); Pittsburgh[Pittsburgh.length] = createMarker(new GPoint(-79.87956900,40.52197100),"
Shady Side Academy Senior School
423 Fox Chapel Road
Pittsburgh, PA 15238
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Shady Side Academy Senior School",'Pittsburgh=' + Pittsburgh.length); Pittsburgh[Pittsburgh.length] = createMarker(new GPoint(-79.96758200,40.39921600),"
Sleepy Hollow
900 Agnew Road
Pittsburgh, PA 15227
All-girls school, 7-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sleepy Hollow",'Pittsburgh=' + Pittsburgh.length); Wexford[Wexford.length] = createMarker(new GPoint(-80.08936600,40.60994400),"
St Anthony School Programs
2000 Corporate Drive, Suite 580
Wexford, PA 15090
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Anthony School Programs",'Wexford=' + Wexford.length); Natrona_Heights[Natrona_Heights.length] = createMarker(new GPoint(-79.72664300,40.61975300),"
St Joseph High School
800 Montana Avenue
Natrona Heights, PA 15065
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Joseph High School",'Natrona_Heights=' + Natrona_Heights.length); Pittsburgh[Pittsburgh.length] = createMarker(new GPoint(-79.85455300,40.42733100),"
Trinity Christian School
299 Ridge Avenue
Pittsburgh, PA 15221
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity Christian School",'Pittsburgh=' + Pittsburgh.length); Pittsburgh[Pittsburgh.length] = createMarker(new GPoint(-79.93026900,40.45144700),"
The University School
5711 Howe Street
Pittsburgh, PA 15232
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The University School",'Pittsburgh=' + Pittsburgh.length); Pittsburgh[Pittsburgh.length] = createMarker(new GPoint(-80.02130000,40.55440000),"
Vincentian Academy/duquesne Univ
Peebles Mcknight Roads
Pittsburgh, PA 15237
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Vincentian Academy/duquesne Univ",'Pittsburgh=' + Pittsburgh.length); Pittsburgh[Pittsburgh.length] = createMarker(new GPoint(-80.07970000,40.31845500),"
Wesley Academy
243 Johnston Road
Pittsburgh, PA 15241
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wesley Academy",'Pittsburgh=' + Pittsburgh.length); Pittsburgh[Pittsburgh.length] = createMarker(new GPoint(-80.00464000,40.36550300),"
Wesley Highland School
5250 Caste Dr
Pittsburgh, PA 15236
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wesley Highland School",'Pittsburgh=' + Pittsburgh.length); Clairton[Clairton.length] = createMarker(new GPoint(-79.93998100,40.32403000),"
Wesley Spectrum Institute School (step)
555 N Lewis Run Road
Clairton, PA 15025
Co-ed school, 3-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wesley Spectrum Institute School (step)",'Clairton=' + Clairton.length); Pittsburgh[Pittsburgh.length] = createMarker(new GPoint(-79.88264400,40.43480500),"
Western Pennsylvania School For The Deaf
300 East Swissvale Avenue
Pittsburgh, PA 15218
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Western Pennsylvania School For The Deaf",'Pittsburgh=' + Pittsburgh.length); West_Mifflin[West_Mifflin.length] = createMarker(new GPoint(-79.93520100,40.33421800),"
Wilson Christian Academy
1900 Clairton Road
West Mifflin, PA 15122
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wilson Christian Academy",'West_Mifflin=' + West_Mifflin.length); Allison_Park[Allison_Park.length] = createMarker(new GPoint(-79.95491800,40.44308100),"
Winchester Thurston School
555 Morewood Avenue and 4225 Middle Road
Allison Park, PA 15213
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Winchester Thurston School",'Allison_Park=' + Allison_Park.length); Pittsburgh[Pittsburgh.length] = createMarker(new GPoint(-79.92430000,40.43160000),"
Yeshiva Schools Boys
Po Box 81868 2100 Wightman Street
Pittsburgh, PA 15217
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Yeshiva Schools Boys",'Pittsburgh=' + Pittsburgh.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,11); /* 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/////2/' + showArray); map.removeOverlays(Allison_Park); map.removeOverlays(Bethel_Park); map.removeOverlays(Cheswick); map.removeOverlays(Clairton); map.removeOverlays(Coraopolis); map.removeOverlays(East_Pittsburgh); map.removeOverlays(Gibsonia); map.removeOverlays(Homestead); map.removeOverlays(Mc_Kees_Rocks); map.removeOverlays(Mckeesport); map.removeOverlays(Monroeville); map.removeOverlays(Munhall); map.removeOverlays(Natrona_Heights); map.removeOverlays(Pittsburgh); map.removeOverlays(Sewickley); map.removeOverlays(Turtle_Creek); map.removeOverlays(West_Mifflin); map.removeOverlays(Wexford); map.removeOverlays(White_Oak); 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(Pittsburgh);map.removeOverlays(Allison_Park); map.removeOverlays(Bethel_Park); map.removeOverlays(Cheswick); map.removeOverlays(Clairton); map.removeOverlays(Coraopolis); map.removeOverlays(East_Pittsburgh); map.removeOverlays(Gibsonia); map.removeOverlays(Homestead); map.removeOverlays(Mc_Kees_Rocks); map.removeOverlays(Mckeesport); map.removeOverlays(Monroeville); map.removeOverlays(Munhall); map.removeOverlays(Natrona_Heights); map.removeOverlays(Pittsburgh); map.removeOverlays(Sewickley); map.removeOverlays(Turtle_Creek); map.removeOverlays(West_Mifflin); map.removeOverlays(Wexford); map.removeOverlays(White_Oak); map.addOverlays(Allison_Park); centerByArray(Allison_Park, false, false); cntMarker += Allison_Park.length; map.addOverlays(Bethel_Park); centerByArray(Bethel_Park, false, false); cntMarker += Bethel_Park.length; map.addOverlays(Cheswick); centerByArray(Cheswick, false, false); cntMarker += Cheswick.length; map.addOverlays(Clairton); centerByArray(Clairton, false, false); cntMarker += Clairton.length; map.addOverlays(Coraopolis); centerByArray(Coraopolis, false, false); cntMarker += Coraopolis.length; map.addOverlays(East_Pittsburgh); centerByArray(East_Pittsburgh, false, false); cntMarker += East_Pittsburgh.length; map.addOverlays(Gibsonia); centerByArray(Gibsonia, false, false); cntMarker += Gibsonia.length; map.addOverlays(Homestead); centerByArray(Homestead, false, false); cntMarker += Homestead.length; map.addOverlays(Mc_Kees_Rocks); centerByArray(Mc_Kees_Rocks, false, false); cntMarker += Mc_Kees_Rocks.length; map.addOverlays(Mckeesport); centerByArray(Mckeesport, false, false); cntMarker += Mckeesport.length; map.addOverlays(Monroeville); centerByArray(Monroeville, false, false); cntMarker += Monroeville.length; map.addOverlays(Munhall); centerByArray(Munhall, false, false); cntMarker += Munhall.length; map.addOverlays(Natrona_Heights); centerByArray(Natrona_Heights, false, false); cntMarker += Natrona_Heights.length; map.addOverlays(Pittsburgh); centerByArray(Pittsburgh, false, false); cntMarker += Pittsburgh.length; map.addOverlays(Sewickley); centerByArray(Sewickley, false, false); cntMarker += Sewickley.length; map.addOverlays(Turtle_Creek); centerByArray(Turtle_Creek, false, false); cntMarker += Turtle_Creek.length; map.addOverlays(West_Mifflin); centerByArray(West_Mifflin, false, false); cntMarker += West_Mifflin.length; map.addOverlays(Wexford); centerByArray(Wexford, false, false); cntMarker += Wexford.length; map.addOverlays(White_Oak); centerByArray(White_Oak, false, false); cntMarker += White_Oak.length; centerByArray(Pittsburgh,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'); //window.open('/map.php?type=1&schools=&school_level=2&radius=&zipcode=&school_type_search=&school_type_code='); } } function createMarker(point, label, icon) { var marker = new GMarker(point, icon); var html = label; GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); }); return marker; }