function addMarkers() { mySelect = document.getElementById('selection'); Gastonia = [];Belmont = [];Bessemer_City = [];Dallas = [];Cherryville = [];Cramerton = [];Mount_Holly = [];Lowell = [];Stanley = [];Mcadenville = [];mySelect.options[mySelect.options.length] = new Option("Belmont schools",'all=Belmont'); mySelect.options[mySelect.options.length] = new Option("Bessemer City schools",'all=Bessemer_City'); mySelect.options[mySelect.options.length] = new Option("Cherryville schools",'all=Cherryville'); mySelect.options[mySelect.options.length] = new Option("Cramerton schools",'all=Cramerton'); mySelect.options[mySelect.options.length] = new Option("Dallas schools",'all=Dallas'); mySelect.options[mySelect.options.length] = new Option("Gastonia schools",'all=Gastonia'); mySelect.options[mySelect.options.length] = new Option("Lowell schools",'all=Lowell'); mySelect.options[mySelect.options.length] = new Option("Mcadenville schools",'all=Mcadenville'); mySelect.options[mySelect.options.length] = new Option("Mount Holly schools",'all=Mount_Holly'); mySelect.options[mySelect.options.length] = new Option("Stanley schools",'all=Stanley'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Gastonia[Gastonia.length] = createMarker(new GPoint(-81.21225739,35.26499939),"
Arlington Elementary School
1621 N Webb Street
Gastonia, NC 28052

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Arlington Elementary School",'Gastonia=' + Gastonia.length); Gastonia[Gastonia.length] = createMarker(new GPoint(-81.12811279,35.24248123),"
Ashbrook High School
2222 S New Hope Road
Gastonia, NC 28054

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ashbrook High School",'Gastonia=' + Gastonia.length); Belmont[Belmont.length] = createMarker(new GPoint(-81.04885864,35.23939514),"
Belmont Central Elementary School
310 Eagle Road
Belmont, NC 28012

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Belmont Central Elementary School",'Belmont=' + Belmont.length); Belmont[Belmont.length] = createMarker(new GPoint(-81.04200745,35.24150848),"
Belmont Middle School
110 N Central Avenue
Belmont, NC 28012

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Belmont Middle School",'Belmont=' + Belmont.length); Bessemer_City[Bessemer_City.length] = createMarker(new GPoint(-81.28500900,35.28496000),"
Bessemer City Central Elementary School
Po Box 794
Bessemer City, NC 28016

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bessemer City Central Elementary School",'Bessemer_City=' + Bessemer_City.length); Bessemer_City[Bessemer_City.length] = createMarker(new GPoint(-81.28033447,35.29838943),"
Bessemer City High School
119 Yellow Jacket Lane
Bessemer City, NC 28016

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bessemer City High School",'Bessemer_City=' + Bessemer_City.length); Bessemer_City[Bessemer_City.length] = createMarker(new GPoint(-81.28140259,35.30360031),"
Bessemer City Middle School
525 Ed Wilson Road
Bessemer City, NC 28016

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Bessemer City Middle School",'Bessemer_City=' + Bessemer_City.length); Bessemer_City[Bessemer_City.length] = createMarker(new GPoint(-81.27871704,35.29866028),"
Bessemer City Primary
1302 North 12th Street
Bessemer City, NC 28016

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bessemer City Primary",'Bessemer_City=' + Bessemer_City.length); Gastonia[Gastonia.length] = createMarker(new GPoint(-81.15364838,35.29298782),"
Brookside Elementary School
1950 Rhyne Carter Road
Gastonia, NC 28054

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Brookside Elementary School",'Gastonia=' + Gastonia.length); Dallas[Dallas.length] = createMarker(new GPoint(-81.18215179,35.31336212),"
Carr Elementary School
601 W Carpenter Street
Dallas, NC 28034

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Carr Elementary School",'Dallas=' + Dallas.length); Belmont[Belmont.length] = createMarker(new GPoint(-81.03579712,35.27349472),"
Catawba Heights Elementary School
101 Ivey Street
Belmont, NC 28012

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Catawba Heights Elementary School",'Belmont=' + Belmont.length); Gastonia[Gastonia.length] = createMarker(new GPoint(-81.24978638,35.20695114),"
Chapel Grove Elementary School
5201 Lewis Road
Gastonia, NC 28052

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Chapel Grove Elementary School",'Gastonia=' + Gastonia.length); Cherryville[Cherryville.length] = createMarker(new GPoint(-81.37158203,35.37912369),"
Cherryville Elementary School
700 East Academy Street
Cherryville, NC 28021

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cherryville Elementary School",'Cherryville=' + Cherryville.length); Cherryville[Cherryville.length] = createMarker(new GPoint(-81.37956238,35.37895966),"
Cherryville Senior High School
Po Box 779
Cherryville, NC 28021

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cherryville Senior High School",'Cherryville=' + Cherryville.length); Dallas[Dallas.length] = createMarker(new GPoint(-81.18150330,35.33589935),"
Costner Elementary School
Po Box 980
Dallas, NC 28034

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Costner Elementary School",'Dallas=' + Dallas.length); Cramerton[Cramerton.length] = createMarker(new GPoint(-73.83959198,40.67771530),"
Cramerton Middle School
601 Cramer Mountain Road
Cramerton, NC 28032

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Cramerton Middle School",'Cramerton=' + Cramerton.length); Mount_Holly[Mount_Holly.length] = createMarker(new GPoint(-81.01600647,35.29853821),"
East Gaston High School
1744 Lane Road
Mount Holly, NC 28120

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("East Gaston High School",'Mount_Holly=' + Mount_Holly.length); Gastonia[Gastonia.length] = createMarker(new GPoint(-81.25972100,35.25668400),"
Edward D Sadler, Jr Elementary School
3950 West Franklin Boulevard
Gastonia, NC 28052

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Edward D Sadler, Jr Elementary School",'Gastonia=' + Gastonia.length); Gastonia[Gastonia.length] = createMarker(new GPoint(-81.18782043,35.26213074),"
Forest Heights Elementary School
1 Learning Place
Gastonia, NC 28052

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Forest Heights Elementary School",'Gastonia=' + Gastonia.length); Gastonia[Gastonia.length] = createMarker(new GPoint(-81.13629150,35.18282700),"
Forestview High School
5545 Union Road
Gastonia, NC 28056

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Forestview High School",'Gastonia=' + Gastonia.length); Gastonia[Gastonia.length] = createMarker(new GPoint(-81.13461304,35.25460815),"
Gardner Park Elementary School
738 Armstrong Park Road
Gastonia, NC 28054

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Gardner Park Elementary School",'Gastonia=' + Gastonia.length); Gastonia[Gastonia.length] = createMarker(new GPoint(-81.20217896,35.22243500),"
Hershal H Beam Elementary School
200 Davis Park Road
Gastonia, NC 28052

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hershal H Beam Elementary School",'Gastonia=' + Gastonia.length); Gastonia[Gastonia.length] = createMarker(new GPoint(-81.18609619,35.26330185),"
Highland Charter
Po Box 1653
Gastonia, NC 28053

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Highland Charter",'Gastonia=' + Gastonia.length); Gastonia[Gastonia.length] = createMarker(new GPoint(-81.18986511,35.27964020),"
Highland School Of Technology
1600 N Morris Street
Gastonia, NC 28052

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Highland School Of Technology",'Gastonia=' + Gastonia.length); Lowell[Lowell.length] = createMarker(new GPoint(-81.10157400,35.26698500),"
Holbrook Middle School
418 S Church Street
Lowell, NC 28098

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Holbrook Middle School",'Lowell=' + Lowell.length); Gastonia[Gastonia.length] = createMarker(new GPoint(-81.20658112,35.24126816),"
Hunter Huss High School
1518 Edgefield Avenue
Gastonia, NC 28052

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hunter Huss High School",'Gastonia=' + Gastonia.length); Mount_Holly[Mount_Holly.length] = createMarker(new GPoint(-81.02970123,35.31430054),"
Ida Rankin Elementary School
Po Box 805
Mount Holly, NC 28120

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ida Rankin Elementary School",'Mount_Holly=' + Mount_Holly.length); Belmont[Belmont.length] = createMarker(new GPoint(-81.03295898,35.23545074),"
J B Page Elementary School
215 Ewing Drive
Belmont, NC 28012

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("J B Page Elementary School",'Belmont=' + Belmont.length); Cherryville[Cherryville.length] = createMarker(new GPoint(-81.39559937,35.37990189),"
John Chavis Middle School
Po Box 337
Cherryville, NC 28021

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("John Chavis Middle School",'Cherryville=' + Cherryville.length); Stanley[Stanley.length] = createMarker(new GPoint(-81.09220123,35.36143875),"
Kiser Elementary School
311 E College Street
Stanley, NC 28164

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Kiser Elementary School",'Stanley=' + Stanley.length); Gastonia[Gastonia.length] = createMarker(new GPoint(-81.19133759,35.24092865),"
Lingerfeldt Elementary School
1601 Madison Street
Gastonia, NC 28052

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lingerfeldt Elementary School",'Gastonia=' + Gastonia.length); Lowell[Lowell.length] = createMarker(new GPoint(-81.09227753,35.27808762),"
Lowell Elementary School
1500 Power Drive
Lowell, NC 28098

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lowell Elementary School",'Lowell=' + Lowell.length); Mcadenville[Mcadenville.length] = createMarker(new GPoint(-81.07289886,35.25360107),"
Mcadenville Elementary School
Po Box 129
Mcadenville, NC 28101

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mcadenville Elementary School",'Mcadenville=' + Mcadenville.length); Mount_Holly[Mount_Holly.length] = createMarker(new GPoint(-81.02261353,35.29823303),"
Mount Holly Middle School
124 S Hawthorne Street
Mount Holly, NC 28120

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Mount Holly Middle School",'Mount_Holly=' + Mount_Holly.length); Gastonia[Gastonia.length] = createMarker(new GPoint(-81.08328247,35.21129990),"
New Hope Elementary School
137 Stowe Road
Gastonia, NC 28056

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("New Hope Elementary School",'Gastonia=' + Gastonia.length); Belmont[Belmont.length] = createMarker(new GPoint(-81.04921722,35.27291489),"
North Belmont Elementary School
210 School Street
Belmont, NC 28012

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("North Belmont Elementary School",'Belmont=' + Belmont.length); Dallas[Dallas.length] = createMarker(new GPoint(-81.17749786,35.33549118),"
North Gaston High School
1133 Ratchford Road
Dallas, NC 28034

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("North Gaston High School",'Dallas=' + Dallas.length); Gastonia[Gastonia.length] = createMarker(new GPoint(-81.15299988,35.26020050),"
Piedmont Community Charter
Po Box 3706
Gastonia, NC 28054

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Piedmont Community Charter",'Gastonia=' + Gastonia.length); Mount_Holly[Mount_Holly.length] = createMarker(new GPoint(-80.99851990,35.32839584),"
Pinewood Elementary School
1925 N Main Street
Mount Holly, NC 28120

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pinewood Elementary School",'Mount_Holly=' + Mount_Holly.length); Gastonia[Gastonia.length] = createMarker(new GPoint(-81.20403290,35.24923325),"
Pleasant Ridge Elementary School
937 S Miller Street
Gastonia, NC 28052

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pleasant Ridge Elementary School",'Gastonia=' + Gastonia.length); Gastonia[Gastonia.length] = createMarker(new GPoint(-81.20730591,35.27878189),"
Rhyne Elementary School
1900 W Davidson Avenue
Gastonia, NC 28052

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Rhyne Elementary School",'Gastonia=' + Gastonia.length); Gastonia[Gastonia.length] = createMarker(new GPoint(-81.16570282,35.21337128),"
Robinson Elementary School
3122 S Union Road
Gastonia, NC 28056

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Robinson Elementary School",'Gastonia=' + Gastonia.length); Gastonia[Gastonia.length] = createMarker(new GPoint(-81.15388489,35.24919510),"
Sherwood Elementary School
1744 Dixon Road
Gastonia, NC 28054

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sherwood Elementary School",'Gastonia=' + Gastonia.length); Belmont[Belmont.length] = createMarker(new GPoint(-81.03792572,35.22425461),"
South Point High School
906 S Point Road
Belmont, NC 28012

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("South Point High School",'Belmont=' + Belmont.length); Gastonia[Gastonia.length] = createMarker(new GPoint(-81.20614624,35.23055267),"
Southwest Middle School
1 Roadrunner Drive
Gastonia, NC 28052

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Southwest Middle School",'Gastonia=' + Gastonia.length); Stanley[Stanley.length] = createMarker(new GPoint(-81.09530640,35.34792328),"
Springfield Primary
900 S Main Street
Stanley, NC 28164

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Springfield Primary",'Stanley=' + Stanley.length); Stanley[Stanley.length] = createMarker(new GPoint(-81.10368347,35.36727905),"
Stanley Middle School
317 Hovis Road
Stanley, NC 28164

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Stanley Middle School",'Stanley=' + Stanley.length); Bessemer_City[Bessemer_City.length] = createMarker(new GPoint(-81.32293701,35.34050751),"
Tryon Elementary School
2620 Tryon Courthouse Road
Bessemer City, NC 28016

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Tryon Elementary School",'Bessemer_City=' + Bessemer_City.length); Gastonia[Gastonia.length] = createMarker(new GPoint(-81.13380432,35.18978119),"
W A Bess Elementary School
4340 Beaty Road
Gastonia, NC 28056

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("W A Bess Elementary School",'Gastonia=' + Gastonia.length); Gastonia[Gastonia.length] = createMarker(new GPoint(-81.15547943,35.25296021),"
W P Grier Middle School
1622 E Garrison Boulevard
Gastonia, NC 28054

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("W P Grier Middle School",'Gastonia=' + Gastonia.length); Gastonia[Gastonia.length] = createMarker(new GPoint(-81.13360596,35.28110123),"
Warlick School
1316 Spencer Mountain Road
Gastonia, NC 28054

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Warlick School",'Gastonia=' + Gastonia.length); Gastonia[Gastonia.length] = createMarker(new GPoint(-81.21226501,35.26499939),"
Webb St Special Education
1623 N Webb Street
Gastonia, NC 28052

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Webb St Special Education",'Gastonia=' + Gastonia.length); Cherryville[Cherryville.length] = createMarker(new GPoint(-81.37648300,35.38111000),"
William B Beam Intermediate
401east First Street
Cherryville, NC 28021

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("William B Beam Intermediate",'Cherryville=' + Cherryville.length); Dallas[Dallas.length] = createMarker(new GPoint(-81.18326569,35.33535767),"
William C Friday Middle School
1221 Ratchford Drive
Dallas, NC 28034

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("William C Friday Middle School",'Dallas=' + Dallas.length); Gastonia[Gastonia.length] = createMarker(new GPoint(-81.17908478,35.27816772),"
Woodhill Elementary School
1027 Woodhill Drive
Gastonia, NC 28052

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Woodhill Elementary School",'Gastonia=' + Gastonia.length); Gastonia[Gastonia.length] = createMarker(new GPoint(-81.18638400,35.26217000),"
York Chester Middle School
601 S Clay Street
Gastonia, NC 28052

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("York Chester Middle School",'Gastonia=' + Gastonia.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(Belmont); map.removeOverlays(Bessemer_City); map.removeOverlays(Cherryville); map.removeOverlays(Cramerton); map.removeOverlays(Dallas); map.removeOverlays(Gastonia); map.removeOverlays(Lowell); map.removeOverlays(Mcadenville); map.removeOverlays(Mount_Holly); map.removeOverlays(Stanley); 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(Gastonia);map.removeOverlays(Belmont); map.removeOverlays(Bessemer_City); map.removeOverlays(Cherryville); map.removeOverlays(Cramerton); map.removeOverlays(Dallas); map.removeOverlays(Gastonia); map.removeOverlays(Lowell); map.removeOverlays(Mcadenville); map.removeOverlays(Mount_Holly); map.removeOverlays(Stanley); map.addOverlays(Belmont); centerByArray(Belmont, false, false); cntMarker += Belmont.length; map.addOverlays(Bessemer_City); centerByArray(Bessemer_City, false, false); cntMarker += Bessemer_City.length; map.addOverlays(Cherryville); centerByArray(Cherryville, false, false); cntMarker += Cherryville.length; map.addOverlays(Cramerton); centerByArray(Cramerton, false, false); cntMarker += Cramerton.length; map.addOverlays(Dallas); centerByArray(Dallas, false, false); cntMarker += Dallas.length; map.addOverlays(Gastonia); centerByArray(Gastonia, false, false); cntMarker += Gastonia.length; map.addOverlays(Lowell); centerByArray(Lowell, false, false); cntMarker += Lowell.length; map.addOverlays(Mcadenville); centerByArray(Mcadenville, false, false); cntMarker += Mcadenville.length; map.addOverlays(Mount_Holly); centerByArray(Mount_Holly, false, false); cntMarker += Mount_Holly.length; map.addOverlays(Stanley); centerByArray(Stanley, false, false); cntMarker += Stanley.length; centerByArray(Gastonia,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'); } }