function addMarkers(){ mySelect = document.getElementById('selection'); Triadelphia = [];Ballard = [];Omar = [];Boomer = [];Hurricane = [];Lewisburg = [];Fairmont = [];Clay = [];Elkview = [];Clarksburg = [];Charleston = [];Prosperity = [];Ravenswood = [];Belva = [];Parkersburg = [];Romney = [];Martinsburg = [];Princeton = [];Lenore = [];Morgantown = [];Moundsville = [];Beckley = [];West_Union = [];Pipestem = [];Rainelle = [];Ronceverte = [];Sophia = [];Birch_River = [];Oceana = [];Buckhannon = [];Beaver = [];mySelect.options[mySelect.options.length] = new Option("Ballard schools",'all=Ballard'); mySelect.options[mySelect.options.length] = new Option("Beaver schools",'all=Beaver'); mySelect.options[mySelect.options.length] = new Option("Beckley schools",'all=Beckley'); mySelect.options[mySelect.options.length] = new Option("Belva schools",'all=Belva'); mySelect.options[mySelect.options.length] = new Option("Birch River schools",'all=Birch_River'); mySelect.options[mySelect.options.length] = new Option("Boomer schools",'all=Boomer'); mySelect.options[mySelect.options.length] = new Option("Buckhannon schools",'all=Buckhannon'); mySelect.options[mySelect.options.length] = new Option("Charleston schools",'all=Charleston'); mySelect.options[mySelect.options.length] = new Option("Clarksburg schools",'all=Clarksburg'); mySelect.options[mySelect.options.length] = new Option("Clay schools",'all=Clay'); mySelect.options[mySelect.options.length] = new Option("Elkview schools",'all=Elkview'); mySelect.options[mySelect.options.length] = new Option("Fairmont schools",'all=Fairmont'); mySelect.options[mySelect.options.length] = new Option("Hurricane schools",'all=Hurricane'); mySelect.options[mySelect.options.length] = new Option("Lenore schools",'all=Lenore'); mySelect.options[mySelect.options.length] = new Option("Lewisburg schools",'all=Lewisburg'); mySelect.options[mySelect.options.length] = new Option("Martinsburg schools",'all=Martinsburg'); mySelect.options[mySelect.options.length] = new Option("Morgantown schools",'all=Morgantown'); mySelect.options[mySelect.options.length] = new Option("Moundsville schools",'all=Moundsville'); mySelect.options[mySelect.options.length] = new Option("Oceana schools",'all=Oceana'); mySelect.options[mySelect.options.length] = new Option("Omar schools",'all=Omar'); mySelect.options[mySelect.options.length] = new Option("Parkersburg schools",'all=Parkersburg'); mySelect.options[mySelect.options.length] = new Option("Pipestem schools",'all=Pipestem'); mySelect.options[mySelect.options.length] = new Option("Princeton schools",'all=Princeton'); mySelect.options[mySelect.options.length] = new Option("Prosperity schools",'all=Prosperity'); mySelect.options[mySelect.options.length] = new Option("Rainelle schools",'all=Rainelle'); mySelect.options[mySelect.options.length] = new Option("Ravenswood schools",'all=Ravenswood'); mySelect.options[mySelect.options.length] = new Option("Romney schools",'all=Romney'); mySelect.options[mySelect.options.length] = new Option("Ronceverte schools",'all=Ronceverte'); mySelect.options[mySelect.options.length] = new Option("Sophia schools",'all=Sophia'); mySelect.options[mySelect.options.length] = new Option("Triadelphia schools",'all=Triadelphia'); mySelect.options[mySelect.options.length] = new Option("West Union schools",'all=West_Union'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Triadelphia[Triadelphia.length] = createMarker(new GPoint(-80.60060000,40.07220000),"
Abundant Life Christian School
Rr 2 Box 445a
Triadelphia, WV 26059
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Abundant Life Christian School",'Triadelphia=' + Triadelphia.length); Ballard[Ballard.length] = createMarker(new GPoint(-80.76330000,37.50220000),"
Ballard Christian School
Hc 77 Box 106
Ballard, WV 24918
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ballard Christian School",'Ballard=' + Ballard.length); Omar[Omar.length] = createMarker(new GPoint(-82.03510000,37.67490000),"
Beth Haven Christian School
Rt 44 Box 620
Omar, WV 25638
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Beth Haven Christian School",'Omar=' + Omar.length); Boomer[Boomer.length] = createMarker(new GPoint(-81.28670000,38.15240000),"
Boomer Christian Academy
Po Box 446
Boomer, WV 25031
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Boomer Christian Academy",'Boomer=' + Boomer.length); Hurricane[Hurricane.length] = createMarker(new GPoint(-81.97920600,38.44383300),"
Calvary Baptist Academy
3655 Teays Valley Road
Hurricane, WV 25526
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Calvary Baptist Academy",'Hurricane=' + Hurricane.length); Lewisburg[Lewisburg.length] = createMarker(new GPoint(-80.44622900,37.80163000),"
Calvary Baptist School
Po Box 53 113 Montvue Drive
Lewisburg, WV 24901
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Calvary Baptist School",'Lewisburg=' + Lewisburg.length); Fairmont[Fairmont.length] = createMarker(new GPoint(-80.10630000,39.51750000),"
Calvary Christian School
28 Fellowship Drive
Fairmont, WV 26554
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Calvary Christian School",'Fairmont=' + Fairmont.length); Clay[Clay.length] = createMarker(new GPoint(-81.04780000,38.46700000),"
Clay Christian Academy
Po Box 849
Clay, WV 25043
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Clay Christian Academy",'Clay=' + Clay.length); Elkview[Elkview.length] = createMarker(new GPoint(-81.47393200,38.44402900),"
Elk Valley Christian School
5110 Elk River Road North
Elkview, WV 25071
Co-ed school, NS-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Elk Valley Christian School",'Elkview=' + Elkview.length); Clarksburg[Clarksburg.length] = createMarker(new GPoint(-80.34649600,39.29242800),"
Emmanuel Christian School
1318 N 16th Street
Clarksburg, WV 26301
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Emmanuel Christian School",'Clarksburg=' + Clarksburg.length); Charleston[Charleston.length] = createMarker(new GPoint(-81.50791100,38.32334600),"
Fairhaven Christian School
689 Fairhavenuen Dr
Charleston, WV 25306
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Fairhaven Christian School",'Charleston=' + Charleston.length); Prosperity[Prosperity.length] = createMarker(new GPoint(-81.19260900,37.83835000),"
Greater Beckley Christian School
Po Box 670
Prosperity, WV 25909
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Greater Beckley Christian School",'Prosperity=' + Prosperity.length); Ravenswood[Ravenswood.length] = createMarker(new GPoint(-81.74120000,38.96710000),"
Heritage Christian Academy
Po Box 427
Ravenswood, WV 26164
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Heritage Christian Academy",'Ravenswood=' + Ravenswood.length); Belva[Belva.length] = createMarker(new GPoint(-81.17080000,38.25380000),"
Joshua Scott Boarding School
Po Box 67
Belva, WV 26656
All-boys school, K-10
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Joshua Scott Boarding School",'Belva=' + Belva.length); Parkersburg[Parkersburg.length] = createMarker(new GPoint(-81.52471700,39.34535800),"
Lighthouse Baptist Christian A
7200 Grand Central Ave
Parkersburg, WV 26105
Co-ed school, 11-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lighthouse Baptist Christian A",'Parkersburg=' + Parkersburg.length); Hurricane[Hurricane.length] = createMarker(new GPoint(-82.02497100,38.41867500),"
Lighthouse Christian Academy
2440 Us Route 60
Hurricane, WV 25526
Co-ed school, PK-4
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lighthouse Christian Academy",'Hurricane=' + Hurricane.length); Romney[Romney.length] = createMarker(new GPoint(-78.73800000,39.34870000),"
Maranatha Christian Academy
Hc 65 Box 300
Romney, WV 26757
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Maranatha Christian Academy",'Romney=' + Romney.length); Martinsburg[Martinsburg.length] = createMarker(new GPoint(-77.93917700,39.50084900),"
Martinsburg Christian Academy
2247 Williamsport Pike
Martinsburg, WV 25401
school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Martinsburg Christian Academy",'Martinsburg=' + Martinsburg.length); Princeton[Princeton.length] = createMarker(new GPoint(-81.06900600,37.36506000),"
Mercer Christian Academy
314 A Oakvale Road
Princeton, WV 24740
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mercer Christian Academy",'Princeton=' + Princeton.length); Lenore[Lenore.length] = createMarker(new GPoint(-82.25750000,37.79220000),"
Mingo Christian School
Po Box 364
Lenore, WV 25676
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mingo Christian School",'Lenore=' + Lenore.length); Morgantown[Morgantown.length] = createMarker(new GPoint(-79.93645100,39.61112900),"
Morgantown Christian Academy
809 Greenbag Road
Morgantown, WV 26508
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Morgantown Christian Academy",'Morgantown=' + Morgantown.length); Moundsville[Moundsville.length] = createMarker(new GPoint(-80.73157800,39.92026700),"
Moundsville Christian School
410 Annadale Avenue
Moundsville, WV 26041
Co-ed school, K-3
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Moundsville Christian School",'Moundsville=' + Moundsville.length); Beckley[Beckley.length] = createMarker(new GPoint(-81.23154300,37.79451300),"
Mount Tabor Christian School
262 Mt Tabor Road
Beckley, WV 25802
Co-ed school, 2-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mount Tabor Christian School",'Beckley=' + Beckley.length); West_Union[West_Union.length] = createMarker(new GPoint(-80.78120000,39.27810000),"
Mt Salem Baptist School
Po Box 215
West Union, WV 26456
Co-ed school, 2-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mt Salem Baptist School",'West_Union=' + West_Union.length); Parkersburg[Parkersburg.length] = createMarker(new GPoint(-81.53831300,39.28595600),"
North Christian School
3109 Emerson Avenue
Parkersburg, WV 26104
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("North Christian School",'Parkersburg=' + Parkersburg.length); Pipestem[Pipestem.length] = createMarker(new GPoint(-80.94260000,37.52330000),"
Pipestem Christian Academy
Po Box 49
Pipestem, WV 25979
Co-ed school, PK-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pipestem Christian Academy",'Pipestem=' + Pipestem.length); Rainelle[Rainelle.length] = createMarker(new GPoint(-80.76660000,37.96740000),"
Rainelle Christian Academy
Po Box 784
Rainelle, WV 25962
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rainelle Christian Academy",'Rainelle=' + Rainelle.length); Ronceverte[Ronceverte.length] = createMarker(new GPoint(-80.45344900,37.75266000),"
Seneca Trail Christian Academy
Rr 2 Box 269
Ronceverte, WV 24970
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Seneca Trail Christian Academy",'Ronceverte=' + Ronceverte.length); Sophia[Sophia.length] = createMarker(new GPoint(-81.25402900,37.70950000),"
Sophia Christian Academy
Po Box 1285
Sophia, WV 25921
Co-ed school, PK-1
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sophia Christian Academy",'Sophia=' + Sophia.length); Birch_River[Birch_River.length] = createMarker(new GPoint(-80.75666700,38.48264200),"
Trinity Baptist Academy
Po Box 436
Birch River, WV 26610
Co-ed school, 4-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity Baptist Academy",'Birch_River=' + Birch_River.length); Oceana[Oceana.length] = createMarker(new GPoint(-81.62102900,37.69664500),"
Turkey Ridge Independent Baptist Church
Po Box 1030
Oceana, WV 24870
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Turkey Ridge Independent Baptist Church",'Oceana=' + Oceana.length); Buckhannon[Buckhannon.length] = createMarker(new GPoint(-80.22386200,38.98172500),"
Upshur County Christian Academy
176 S Kanawha Street
Buckhannon, WV 26201
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Upshur County Christian Academy",'Buckhannon=' + Buckhannon.length); Beaver[Beaver.length] = createMarker(new GPoint(-81.08070000,37.76700000),"
Victory Baptist Academy
Po Box 549
Beaver, WV 25813
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Victory Baptist Academy",'Beaver=' + Beaver.length); map.removeOverlays(Ballard); map.removeOverlays(Beaver); map.removeOverlays(Beckley); map.removeOverlays(Belva); map.removeOverlays(Birch_River); map.removeOverlays(Boomer); map.removeOverlays(Buckhannon); map.removeOverlays(Charleston); map.removeOverlays(Clarksburg); map.removeOverlays(Clay); map.removeOverlays(Elkview); map.removeOverlays(Fairmont); map.removeOverlays(Hurricane); map.removeOverlays(Lenore); map.removeOverlays(Lewisburg); map.removeOverlays(Martinsburg); map.removeOverlays(Morgantown); map.removeOverlays(Moundsville); map.removeOverlays(Oceana); map.removeOverlays(Omar); map.removeOverlays(Parkersburg); map.removeOverlays(Pipestem); map.removeOverlays(Princeton); map.removeOverlays(Prosperity); map.removeOverlays(Rainelle); map.removeOverlays(Ravenswood); map.removeOverlays(Romney); map.removeOverlays(Ronceverte); map.removeOverlays(Sophia); map.removeOverlays(Triadelphia); map.removeOverlays(West_Union); setTimeout(function(){map.addOverlays(Ballard)},1000); setTimeout(function(){map.addOverlays(Beaver)},1000); setTimeout(function(){map.addOverlays(Beckley)},1000); setTimeout(function(){map.addOverlays(Belva)},1000); setTimeout(function(){map.addOverlays(Birch_River)},1000); setTimeout(function(){map.addOverlays(Boomer)},1000); setTimeout(function(){map.addOverlays(Buckhannon)},1000); setTimeout(function(){map.addOverlays(Charleston)},1000); setTimeout(function(){map.addOverlays(Clarksburg)},1000); setTimeout(function(){map.addOverlays(Clay)},1000); setTimeout(function(){map.addOverlays(Elkview)},1000); setTimeout(function(){map.addOverlays(Fairmont)},1000); setTimeout(function(){map.addOverlays(Hurricane)},1000); setTimeout(function(){map.addOverlays(Lenore)},1000); setTimeout(function(){map.addOverlays(Lewisburg)},1000); setTimeout(function(){map.addOverlays(Martinsburg)},1000); setTimeout(function(){map.addOverlays(Morgantown)},1000); setTimeout(function(){map.addOverlays(Moundsville)},1000); setTimeout(function(){map.addOverlays(Oceana)},1000); setTimeout(function(){map.addOverlays(Omar)},1000); setTimeout(function(){map.addOverlays(Parkersburg)},1000); setTimeout(function(){map.addOverlays(Pipestem)},1000); setTimeout(function(){map.addOverlays(Princeton)},1000); setTimeout(function(){map.addOverlays(Prosperity)},1000); setTimeout(function(){map.addOverlays(Rainelle)},1000); setTimeout(function(){map.addOverlays(Ravenswood)},1000); setTimeout(function(){map.addOverlays(Romney)},1000); setTimeout(function(){map.addOverlays(Ronceverte)},1000); setTimeout(function(){map.addOverlays(Sophia)},1000); setTimeout(function(){map.addOverlays(Triadelphia)},1000); setTimeout(function(){map.addOverlays(West_Union)},1000); maxLng = -77.93917700; maxLat = 40.07220000; minLng = -82.25750000; minLat = 37.36506000; 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(Ballard); map.removeOverlays(Beaver); map.removeOverlays(Beckley); map.removeOverlays(Belva); map.removeOverlays(Birch_River); map.removeOverlays(Boomer); map.removeOverlays(Buckhannon); map.removeOverlays(Charleston); map.removeOverlays(Clarksburg); map.removeOverlays(Clay); map.removeOverlays(Elkview); map.removeOverlays(Fairmont); map.removeOverlays(Hurricane); map.removeOverlays(Lenore); map.removeOverlays(Lewisburg); map.removeOverlays(Martinsburg); map.removeOverlays(Morgantown); map.removeOverlays(Moundsville); map.removeOverlays(Oceana); map.removeOverlays(Omar); map.removeOverlays(Parkersburg); map.removeOverlays(Pipestem); map.removeOverlays(Princeton); map.removeOverlays(Prosperity); map.removeOverlays(Rainelle); map.removeOverlays(Ravenswood); map.removeOverlays(Romney); map.removeOverlays(Ronceverte); map.removeOverlays(Sophia); map.removeOverlays(Triadelphia); map.removeOverlays(West_Union); 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(Triadelphia);map.removeOverlays(Ballard); map.removeOverlays(Beaver); map.removeOverlays(Beckley); map.removeOverlays(Belva); map.removeOverlays(Birch_River); map.removeOverlays(Boomer); map.removeOverlays(Buckhannon); map.removeOverlays(Charleston); map.removeOverlays(Clarksburg); map.removeOverlays(Clay); map.removeOverlays(Elkview); map.removeOverlays(Fairmont); map.removeOverlays(Hurricane); map.removeOverlays(Lenore); map.removeOverlays(Lewisburg); map.removeOverlays(Martinsburg); map.removeOverlays(Morgantown); map.removeOverlays(Moundsville); map.removeOverlays(Oceana); map.removeOverlays(Omar); map.removeOverlays(Parkersburg); map.removeOverlays(Pipestem); map.removeOverlays(Princeton); map.removeOverlays(Prosperity); map.removeOverlays(Rainelle); map.removeOverlays(Ravenswood); map.removeOverlays(Romney); map.removeOverlays(Ronceverte); map.removeOverlays(Sophia); map.removeOverlays(Triadelphia); map.removeOverlays(West_Union); map.addOverlays(Ballard); centerByArray(Ballard, false, false); cntMarker += Ballard.length; map.addOverlays(Beaver); centerByArray(Beaver, false, false); cntMarker += Beaver.length; map.addOverlays(Beckley); centerByArray(Beckley, false, false); cntMarker += Beckley.length; map.addOverlays(Belva); centerByArray(Belva, false, false); cntMarker += Belva.length; map.addOverlays(Birch_River); centerByArray(Birch_River, false, false); cntMarker += Birch_River.length; map.addOverlays(Boomer); centerByArray(Boomer, false, false); cntMarker += Boomer.length; map.addOverlays(Buckhannon); centerByArray(Buckhannon, false, false); cntMarker += Buckhannon.length; map.addOverlays(Charleston); centerByArray(Charleston, false, false); cntMarker += Charleston.length; map.addOverlays(Clarksburg); centerByArray(Clarksburg, false, false); cntMarker += Clarksburg.length; map.addOverlays(Clay); centerByArray(Clay, false, false); cntMarker += Clay.length; map.addOverlays(Elkview); centerByArray(Elkview, false, false); cntMarker += Elkview.length; map.addOverlays(Fairmont); centerByArray(Fairmont, false, false); cntMarker += Fairmont.length; map.addOverlays(Hurricane); centerByArray(Hurricane, false, false); cntMarker += Hurricane.length; map.addOverlays(Lenore); centerByArray(Lenore, false, false); cntMarker += Lenore.length; map.addOverlays(Lewisburg); centerByArray(Lewisburg, false, false); cntMarker += Lewisburg.length; map.addOverlays(Martinsburg); centerByArray(Martinsburg, false, false); cntMarker += Martinsburg.length; map.addOverlays(Morgantown); centerByArray(Morgantown, false, false); cntMarker += Morgantown.length; map.addOverlays(Moundsville); centerByArray(Moundsville, false, false); cntMarker += Moundsville.length; map.addOverlays(Oceana); centerByArray(Oceana, false, false); cntMarker += Oceana.length; map.addOverlays(Omar); centerByArray(Omar, false, false); cntMarker += Omar.length; map.addOverlays(Parkersburg); centerByArray(Parkersburg, false, false); cntMarker += Parkersburg.length; map.addOverlays(Pipestem); centerByArray(Pipestem, false, false); cntMarker += Pipestem.length; map.addOverlays(Princeton); centerByArray(Princeton, false, false); cntMarker += Princeton.length; map.addOverlays(Prosperity); centerByArray(Prosperity, false, false); cntMarker += Prosperity.length; map.addOverlays(Rainelle); centerByArray(Rainelle, false, false); cntMarker += Rainelle.length; map.addOverlays(Ravenswood); centerByArray(Ravenswood, false, false); cntMarker += Ravenswood.length; map.addOverlays(Romney); centerByArray(Romney, false, false); cntMarker += Romney.length; map.addOverlays(Ronceverte); centerByArray(Ronceverte, false, false); cntMarker += Ronceverte.length; map.addOverlays(Sophia); centerByArray(Sophia, false, false); cntMarker += Sophia.length; map.addOverlays(Triadelphia); centerByArray(Triadelphia, false, false); cntMarker += Triadelphia.length; map.addOverlays(West_Union); centerByArray(West_Union, false, false); cntMarker += West_Union.length; centerByArray(Triadelphia,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///29239,29368,29309,29282,34513,29245,29366,29269,29268,29259,29267,29250,29249,29292,31987,29241,29246,29325,29293,29276,29326,29277,29291,29333,29308,29239,29368,29309,29282,34513,29245,29366,29269,29268,29259,29267,29250,29249,29287,29296,31985,29292,29299,29303,31987,29241,29314,29325,29293,29276,29326,29277,29291,29333,33780,29231,29308,/all'); //window.open('/map.php?type=2&schools=29239,29368,29309,29282,34513,29245,29366,29269,29268,29259,29267,29250,29249,29292,31987,29241,29246,29325,29293,29276,29326,29277,29291,29333,29308,29239,29368,29309,29282,34513,29245,29366,29269,29268,29259,29267,29250,29249,29287,29296,31985,29292,29299,29303,31987,29241,29314,29325,29293,29276,29326,29277,29291,29333,33780,29231,29308,&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; }