function addMarkers(){ mySelect = document.getElementById('selection'); Nashville = [];Morristown = [];Johnson_City = [];Franklin = [];Chattanooga = [];Memphis = [];Eads = [];Knoxville = [];Clarksville = [];Summertown = [];Cordova = [];Grand_Junction = [];Germantown = [];Mc_Ewen = [];Bristol = [];Jackson = [];mySelect.options[mySelect.options.length] = new Option("Bristol schools",'all=Bristol'); mySelect.options[mySelect.options.length] = new Option("Chattanooga schools",'all=Chattanooga'); mySelect.options[mySelect.options.length] = new Option("Clarksville schools",'all=Clarksville'); mySelect.options[mySelect.options.length] = new Option("Cordova schools",'all=Cordova'); mySelect.options[mySelect.options.length] = new Option("Eads schools",'all=Eads'); mySelect.options[mySelect.options.length] = new Option("Franklin schools",'all=Franklin'); mySelect.options[mySelect.options.length] = new Option("Germantown schools",'all=Germantown'); mySelect.options[mySelect.options.length] = new Option("Grand Junction schools",'all=Grand_Junction'); mySelect.options[mySelect.options.length] = new Option("Jackson schools",'all=Jackson'); mySelect.options[mySelect.options.length] = new Option("Johnson City schools",'all=Johnson_City'); mySelect.options[mySelect.options.length] = new Option("Knoxville schools",'all=Knoxville'); mySelect.options[mySelect.options.length] = new Option("Mc Ewen schools",'all=Mc_Ewen'); mySelect.options[mySelect.options.length] = new Option("Memphis schools",'all=Memphis'); mySelect.options[mySelect.options.length] = new Option("Morristown schools",'all=Morristown'); mySelect.options[mySelect.options.length] = new Option("Nashville schools",'all=Nashville'); mySelect.options[mySelect.options.length] = new Option("Summertown schools",'all=Summertown'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Nashville[Nashville.length] = createMarker(new GPoint(-86.89276900,36.08426200),"
Akiva School
809 Percy Warner Blvd
Nashville, TN 37205
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Akiva School",'Nashville=' + Nashville.length); Morristown[Morristown.length] = createMarker(new GPoint(-83.33733500,36.18186300),"
All Saint's Episcopal School
3275 Maple Valley Road
Morristown, TN 37813
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("All Saint's Episcopal School",'Morristown=' + Morristown.length); Johnson_City[Johnson_City.length] = createMarker(new GPoint(-82.38195000,36.32369900),"
Ashley Academy
1502 Knob Creek Road
Johnson City, TN 37604
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ashley Academy",'Johnson_City=' + Johnson_City.length); Franklin[Franklin.length] = createMarker(new GPoint(-86.86168900,35.94858300),"
Battle Ground Academy
336 Ernest Rice Lane
Franklin, TN 37069
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Battle Ground Academy",'Franklin=' + Franklin.length); Chattanooga[Chattanooga.length] = createMarker(new GPoint(-85.30810000,35.04550000),"
Baylor School
171 Baylor School Road
Chattanooga, TN 37405
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Baylor School",'Chattanooga=' + Chattanooga.length); Memphis[Memphis.length] = createMarker(new GPoint(-89.84142500,35.11943000),"
Bornblum Solomon Schechter School
6641 Humphreys Blvd
Memphis, TN 38120
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bornblum Solomon Schechter School",'Memphis=' + Memphis.length); Eads[Eads.length] = createMarker(new GPoint(-89.72804900,35.12950000),"
Briarcrest Christian High School
76 S. Houston Levee Road
Eads, TN 38028
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Briarcrest Christian High School",'Eads=' + Eads.length); Eads[Eads.length] = createMarker(new GPoint(-89.72305900,35.11709000),"
Briarcrest Christian School
76 S. Houston Levee Road
Eads, TN 38028
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Briarcrest Christian School",'Eads=' + Eads.length); Memphis[Memphis.length] = createMarker(new GPoint(-89.86173300,35.10669500),"
Briarcrest Christian School - East Memphis Campus
6000 Briarcrest Avenue
Memphis, TN 38120
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Briarcrest Christian School - East Memphis Campus",'Memphis=' + Memphis.length); Chattanooga[Chattanooga.length] = createMarker(new GPoint(-85.23443200,35.00789200),"
Calvary Christian School
4601 North Terrace
Chattanooga, TN 37411
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Calvary Christian School",'Chattanooga=' + Chattanooga.length); Nashville[Nashville.length] = createMarker(new GPoint(-86.79684800,36.11815900),"
Christ The King School
3105 Belmont Blvd
Nashville, TN 37212
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christ The King School",'Nashville=' + Nashville.length); Memphis[Memphis.length] = createMarker(new GPoint(-89.91204100,35.12010000),"
Christ Methodist Day School
411 S Grove Park Road
Memphis, TN 38117
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christ Methodist Day School",'Memphis=' + Memphis.length); Knoxville[Knoxville.length] = createMarker(new GPoint(-84.10218300,35.92590900),"
Christian Academy of Knoxville
529 Academy Way
Knoxville, TN 37923
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christian Academy of Knoxville",'Knoxville=' + Knoxville.length); Clarksville[Clarksville.length] = createMarker(new GPoint(-87.36204300,36.53657700),"
Clarksville Academy
710 N 2nd Street
Clarksville, TN 37040
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Clarksville Academy",'Clarksville=' + Clarksville.length); Nashville[Nashville.length] = createMarker(new GPoint(-86.77533400,36.27941200),"
Davidson Academy
1414 Old Hickory Blvd
Nashville, TN 37207
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Davidson Academy",'Nashville=' + Nashville.length); Nashville[Nashville.length] = createMarker(new GPoint(-86.83993800,36.12439700),"
The Ensworth School
211 Ensworth Place
Nashville, TN 37205
Co-ed school, K-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Ensworth School",'Nashville=' + Nashville.length); Summertown[Summertown.length] = createMarker(new GPoint(-87.32880100,35.47871900),"
The Farm School
151 Schoolhouse Road
Summertown, TN 38483
Co-ed school, K-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Farm School",'Summertown=' + Summertown.length); Nashville[Nashville.length] = createMarker(new GPoint(-86.76836900,36.09923600),"
Father Ryan High School
700 Norwood Drive
Nashville, TN 37204
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Father Ryan High School",'Nashville=' + Nashville.length); Chattanooga[Chattanooga.length] = createMarker(new GPoint(-85.13587600,35.03521800),"
Grace Baptist Academy
7815 Shallowford Road
Chattanooga, TN 37421
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Grace Baptist Academy",'Chattanooga=' + Chattanooga.length); Nashville[Nashville.length] = createMarker(new GPoint(-86.86672100,36.10197700),"
Harding Academy
170 Windsor Drive
Nashville, TN 37205
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Harding Academy",'Nashville=' + Nashville.length); Cordova[Cordova.length] = createMarker(new GPoint(-89.78403300,35.15617700),"
Harding Academy Cordova Kindergarten
8350 Macon Road
Cordova, TN 38018
Co-ed school, NS-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Harding Academy Cordova Kindergarten",'Cordova=' + Cordova.length); Memphis[Memphis.length] = createMarker(new GPoint(-89.92938900,35.17819500),"
Heritage Baptist Academy
Po Box 280709
Memphis, TN 38168
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Heritage Baptist Academy",'Memphis=' + Memphis.length); Memphis[Memphis.length] = createMarker(new GPoint(-89.85850400,35.09172900),"
Hutchison School
1740 Ridgeway Road
Memphis, TN 38119
All-girls school, PK-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hutchison School",'Memphis=' + Memphis.length); Cordova[Cordova.length] = createMarker(new GPoint(-89.77647000,35.15475500),"
Lamplighter School
8563 Fay Road
Cordova, TN 38018
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lamplighter School",'Cordova=' + Cordova.length); Memphis[Memphis.length] = createMarker(new GPoint(-89.85625600,35.09959300),"
Memphis University School
6191 Park Avenue
Memphis, TN 38119
All-boys school, 7-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Memphis University School",'Memphis=' + Memphis.length); Nashville[Nashville.length] = createMarker(new GPoint(-86.83785200,36.13020800),"
Montgomery Bell Academy
4001 Harding Road
Nashville, TN 37205
All-boys school, 7-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Montgomery Bell Academy",'Nashville=' + Nashville.length); Grand_Junction[Grand_Junction.length] = createMarker(new GPoint(-89.02470000,35.10540000),"
New Life Christian Academy
4275 Highway 57 E
Grand Junction, TN 38039
Co-ed school, 1-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Life Christian Academy",'Grand_Junction=' + Grand_Junction.length); Nashville[Nashville.length] = createMarker(new GPoint(-86.77273700,36.08133900),"
The Oak Hill School
4815 Franklin Pike
Nashville, TN 37220
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Oak Hill School",'Nashville=' + Nashville.length); Memphis[Memphis.length] = createMarker(new GPoint(-89.92795500,35.12401600),"
Presbyterian Day School
4025 Poplar Avenue
Memphis, TN 38111
All-boys school, PK-6
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Presbyterian Day School",'Memphis=' + Memphis.length); Nashville[Nashville.length] = createMarker(new GPoint(-86.74089100,36.10280300),"
Radnor Baptist Academy
3112 Nolensville Road
Nashville, TN 37211
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Radnor Baptist Academy",'Nashville=' + Nashville.length); Nashville[Nashville.length] = createMarker(new GPoint(-86.80562000,36.13261600),"
St. Bernard Academy
2020 24th Avenue South
Nashville, TN 37212
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Bernard Academy",'Nashville=' + Nashville.length); Nashville[Nashville.length] = createMarker(new GPoint(-86.88650700,36.09188200),"
Saint Henry Catholic School
6401 Harding Pike
Nashville, TN 37205
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Saint Henry Catholic School",'Nashville=' + Nashville.length); Chattanooga[Chattanooga.length] = createMarker(new GPoint(-85.14195200,35.04352200),"
St. Nicholas School
7525 Min Tom Drive
Chattanooga, TN 37421
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Nicholas School",'Chattanooga=' + Chattanooga.length); Chattanooga[Chattanooga.length] = createMarker(new GPoint(-85.31957300,35.11531100),"
Scenic Land School
1200 Mountain Creek Rd, Suite 300
Chattanooga, TN 37405
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Scenic Land School",'Chattanooga=' + Chattanooga.length); Nashville[Nashville.length] = createMarker(new GPoint(-86.84872100,36.15181300),"
St Ann School
5105 Charlotte Pike
Nashville, TN 37209
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Ann School",'Nashville=' + Nashville.length); Nashville[Nashville.length] = createMarker(new GPoint(-86.73959700,36.11064700),"
St Edward Elementary School
190 Thompson Lane
Nashville, TN 37211
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Edward Elementary School",'Nashville=' + Nashville.length); Germantown[Germantown.length] = createMarker(new GPoint(-89.78758900,35.08243200),"
St George's Independent School
8250 Poplar Avenue
Germantown, TN 38138
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St George's Independent School",'Germantown=' + Germantown.length); Memphis[Memphis.length] = createMarker(new GPoint(-90.05027900,35.16940500),"
St George's Independent School, Memphis
999 River Isle Cv
Memphis, TN 38103
Co-ed school, PK-2
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St George's Independent School, Memphis",'Memphis=' + Memphis.length); Memphis[Memphis.length] = createMarker(new GPoint(-89.90855700,35.12956500),"
St Mary's Episcopal School
60 Perkins Extended
Memphis, TN 38117
All-girls school, PK-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("St Mary's Episcopal School",'Memphis=' + Memphis.length); Mc_Ewen[Mc_Ewen.length] = createMarker(new GPoint(-87.63749800,36.11001100),"
St Patrick Catholic School
175 Saint Patrick Street
Mc Ewen, TN 37101
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Patrick Catholic School",'Mc_Ewen=' + Mc_Ewen.length); Bristol[Bristol.length] = createMarker(new GPoint(-82.17465500,36.58604800),"
Tennessee Avenue Christian Academy
806 Tennessee Avenue
Bristol, TN 37620
Co-ed school, K-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Tennessee Avenue Christian Academy",'Bristol=' + Bristol.length); Knoxville[Knoxville.length] = createMarker(new GPoint(-83.93682000,35.95393200),"
Thackston School
2023 Lake Avenue
Knoxville, TN 37916
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Thackston School",'Knoxville=' + Knoxville.length); Jackson[Jackson.length] = createMarker(new GPoint(-88.88723200,35.70301600),"
University School of Jackson
232 McClellan Rd.
Jackson, TN 38305
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("University School of Jackson",'Jackson=' + Jackson.length); map.removeOverlays(Bristol); map.removeOverlays(Chattanooga); map.removeOverlays(Clarksville); map.removeOverlays(Cordova); map.removeOverlays(Eads); map.removeOverlays(Franklin); map.removeOverlays(Germantown); map.removeOverlays(Grand_Junction); map.removeOverlays(Jackson); map.removeOverlays(Johnson_City); map.removeOverlays(Knoxville); map.removeOverlays(Mc_Ewen); map.removeOverlays(Memphis); map.removeOverlays(Morristown); map.removeOverlays(Nashville); map.removeOverlays(Summertown); setTimeout(function(){map.addOverlays(Bristol)},1000); setTimeout(function(){map.addOverlays(Chattanooga)},1000); setTimeout(function(){map.addOverlays(Clarksville)},1000); setTimeout(function(){map.addOverlays(Cordova)},1000); setTimeout(function(){map.addOverlays(Eads)},1000); setTimeout(function(){map.addOverlays(Franklin)},1000); setTimeout(function(){map.addOverlays(Germantown)},1000); setTimeout(function(){map.addOverlays(Grand_Junction)},1000); setTimeout(function(){map.addOverlays(Jackson)},1000); setTimeout(function(){map.addOverlays(Johnson_City)},1000); setTimeout(function(){map.addOverlays(Knoxville)},1000); setTimeout(function(){map.addOverlays(Mc_Ewen)},1000); setTimeout(function(){map.addOverlays(Memphis)},1000); setTimeout(function(){map.addOverlays(Morristown)},1000); setTimeout(function(){map.addOverlays(Nashville)},1000); setTimeout(function(){map.addOverlays(Summertown)},1000); maxLng = -82.17465500; maxLat = 36.58604800; minLng = -90.05027900; minLat = 35.00789200; reCenterMap(); } // 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//////' + showArray); map.removeOverlays(Bristol); map.removeOverlays(Chattanooga); map.removeOverlays(Clarksville); map.removeOverlays(Cordova); map.removeOverlays(Eads); map.removeOverlays(Franklin); map.removeOverlays(Germantown); map.removeOverlays(Grand_Junction); map.removeOverlays(Jackson); map.removeOverlays(Johnson_City); map.removeOverlays(Knoxville); map.removeOverlays(Mc_Ewen); map.removeOverlays(Memphis); map.removeOverlays(Morristown); map.removeOverlays(Nashville); map.removeOverlays(Summertown); 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(Nashville);map.removeOverlays(Bristol); map.removeOverlays(Chattanooga); map.removeOverlays(Clarksville); map.removeOverlays(Cordova); map.removeOverlays(Eads); map.removeOverlays(Franklin); map.removeOverlays(Germantown); map.removeOverlays(Grand_Junction); map.removeOverlays(Jackson); map.removeOverlays(Johnson_City); map.removeOverlays(Knoxville); map.removeOverlays(Mc_Ewen); map.removeOverlays(Memphis); map.removeOverlays(Morristown); map.removeOverlays(Nashville); map.removeOverlays(Summertown); map.addOverlays(Bristol); centerByArray(Bristol, false, false); cntMarker += Bristol.length; map.addOverlays(Chattanooga); centerByArray(Chattanooga, false, false); cntMarker += Chattanooga.length; map.addOverlays(Clarksville); centerByArray(Clarksville, false, false); cntMarker += Clarksville.length; map.addOverlays(Cordova); centerByArray(Cordova, false, false); cntMarker += Cordova.length; map.addOverlays(Eads); centerByArray(Eads, false, false); cntMarker += Eads.length; map.addOverlays(Franklin); centerByArray(Franklin, false, false); cntMarker += Franklin.length; map.addOverlays(Germantown); centerByArray(Germantown, false, false); cntMarker += Germantown.length; map.addOverlays(Grand_Junction); centerByArray(Grand_Junction, false, false); cntMarker += Grand_Junction.length; map.addOverlays(Jackson); centerByArray(Jackson, false, false); cntMarker += Jackson.length; map.addOverlays(Johnson_City); centerByArray(Johnson_City, false, false); cntMarker += Johnson_City.length; map.addOverlays(Knoxville); centerByArray(Knoxville, false, false); cntMarker += Knoxville.length; map.addOverlays(Mc_Ewen); centerByArray(Mc_Ewen, false, false); cntMarker += Mc_Ewen.length; map.addOverlays(Memphis); centerByArray(Memphis, false, false); cntMarker += Memphis.length; map.addOverlays(Morristown); centerByArray(Morristown, false, false); cntMarker += Morristown.length; map.addOverlays(Nashville); centerByArray(Nashville, false, false); cntMarker += Nashville.length; map.addOverlays(Summertown); centerByArray(Summertown, false, false); cntMarker += Summertown.length; centerByArray(Nashville,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///26328,25928,25959,26069,26266,25998,34474,25949,25927,30520,25986,26344,26121,26185,26303,26016,26334,26047,26201,26252,26335,26328,25928,25959,26069,26307,26266,25998,26088,26152,25949,25927,35718,26222,30520,25921,25986,26331,26316,25943,36083,25980,26344,26121,26249,35717,26303,25915,25913,25982,26016,26334,26087,26228,26252,26291,26287,26294,26296,26335,/all'); //window.open('/map.php?type=2&schools=26328,25928,25959,26069,26266,25998,34474,25949,25927,30520,25986,26344,26121,26185,26303,26016,26334,26047,26201,26252,26335,26328,25928,25959,26069,26307,26266,25998,26088,26152,25949,25927,35718,26222,30520,25921,25986,26331,26316,25943,36083,25980,26344,26121,26249,35717,26303,25915,25913,25982,26016,26334,26087,26228,26252,26291,26287,26294,26296,26335,&school_level=&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; }