function addMarkers(){ mySelect = document.getElementById('selection'); Weyers_Cave = [];Richmond = [];Virginia_Beach = [];Lynchburg = [];Clifton_Forge = [];Danville = [];Melfa = [];Roanoke = [];Locust_Grove = [];Norfolk = [];Chester = [];Middletown = [];Big_Stone_Gap = [];Salem = [];Dublin = [];Annandale = [];Martinsville = [];Franklin = [];Charlottesville = [];Glenns = [];Petersburg = [];Alberta = [];Richlands = [];Hampton = [];Abingdon = [];Wytheville = [];mySelect.options[mySelect.options.length] = new Option("Abingdon Schools",'all=Abingdon'); mySelect.options[mySelect.options.length] = new Option("Alberta Schools",'all=Alberta'); mySelect.options[mySelect.options.length] = new Option("Annandale Schools",'all=Annandale'); mySelect.options[mySelect.options.length] = new Option("Big Stone Gap Schools",'all=Big_Stone_Gap'); mySelect.options[mySelect.options.length] = new Option("Charlottesville Schools",'all=Charlottesville'); mySelect.options[mySelect.options.length] = new Option("Chester Schools",'all=Chester'); mySelect.options[mySelect.options.length] = new Option("Clifton Forge Schools",'all=Clifton_Forge'); mySelect.options[mySelect.options.length] = new Option("Danville Schools",'all=Danville'); mySelect.options[mySelect.options.length] = new Option("Dublin Schools",'all=Dublin'); mySelect.options[mySelect.options.length] = new Option("Franklin Schools",'all=Franklin'); mySelect.options[mySelect.options.length] = new Option("Glenns Schools",'all=Glenns'); mySelect.options[mySelect.options.length] = new Option("Hampton Schools",'all=Hampton'); mySelect.options[mySelect.options.length] = new Option("Locust Grove Schools",'all=Locust_Grove'); mySelect.options[mySelect.options.length] = new Option("Lynchburg Schools",'all=Lynchburg'); mySelect.options[mySelect.options.length] = new Option("Martinsville Schools",'all=Martinsville'); mySelect.options[mySelect.options.length] = new Option("Melfa Schools",'all=Melfa'); mySelect.options[mySelect.options.length] = new Option("Middletown Schools",'all=Middletown'); mySelect.options[mySelect.options.length] = new Option("Norfolk Schools",'all=Norfolk'); mySelect.options[mySelect.options.length] = new Option("Petersburg Schools",'all=Petersburg'); mySelect.options[mySelect.options.length] = new Option("Richlands Schools",'all=Richlands'); mySelect.options[mySelect.options.length] = new Option("Richmond Schools",'all=Richmond'); mySelect.options[mySelect.options.length] = new Option("Roanoke Schools",'all=Roanoke'); mySelect.options[mySelect.options.length] = new Option("Salem Schools",'all=Salem'); mySelect.options[mySelect.options.length] = new Option("Virginia Beach Schools",'all=Virginia_Beach'); mySelect.options[mySelect.options.length] = new Option("Weyers Cave Schools",'all=Weyers_Cave'); mySelect.options[mySelect.options.length] = new Option("Wytheville Schools",'all=Wytheville'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); var tmpLatLng=0; var tmpLen=0; tmpLatLng=new GLatLng(38.28165700000000271,-78.9416580000000038); tmpLen=Weyers_Cave.length; Weyers_Cave[tmpLen] = createMarker(tmpLatLng,"
Blue Ridge Community College
1 College Lane
Weyers Cave, VA 24486

[ View School Profile ]
",iconGr); Weyers_Cave[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Blue Ridge Community College",'Weyers_Cave=' + Weyers_Cave.length); tmpLatLng=new GLatLng(37.46155699999999910,-77.5433170000000018); tmpLen=Richmond.length; Richmond[tmpLen] = createMarker(tmpLatLng,"
Bryant And Stratton College-richmond
8141 Hull St Rd
Richmond, VA 23235

[ View School Profile ]
",iconRd); Richmond[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Bryant And Stratton College-richmond",'Richmond=' + Richmond.length); tmpLatLng=new GLatLng(36.82872400000000112,-76.1390970000000066); tmpLen=Virginia_Beach.length; Virginia_Beach[tmpLen] = createMarker(tmpLatLng,"
Bryant And Stratton College-virginia Beach
301 Centre Pointe Dr
Virginia Beach, VA 23462

[ View School Profile ]
",iconRd); Virginia_Beach[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Bryant And Stratton College-virginia Beach",'Virginia_Beach=' + Virginia_Beach.length); tmpLatLng=new GLatLng(37.35729800000000011,-79.1810700000000053); tmpLen=Lynchburg.length; Lynchburg[tmpLen] = createMarker(tmpLatLng,"
Central Virginia Community College
3506 Wards Rd
Lynchburg, VA 24502

[ View School Profile ]
",iconGr); Lynchburg[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Central Virginia Community College",'Lynchburg=' + Lynchburg.length); tmpLatLng=new GLatLng(37.81616999999999961,-79.8251879999999971); tmpLen=Clifton_Forge.length; Clifton_Forge[tmpLen] = createMarker(tmpLatLng,"
Dabney S Lancaster Community College
1000 Dabney Drive
Clifton Forge, VA 24422

[ View School Profile ]
",iconGr); Clifton_Forge[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Dabney S Lancaster Community College",'Clifton_Forge=' + Clifton_Forge.length); tmpLatLng=new GLatLng(36.56678800000000251,-79.4050620000000009); tmpLen=Danville.length; Danville[tmpLen] = createMarker(tmpLatLng,"
Danville Community College
1008 S Main St
Danville, VA 24541

[ View School Profile ]
",iconGr); Danville[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Danville Community College",'Danville=' + Danville.length); tmpLatLng=new GLatLng(37.62575600000000264,-75.7585219999999992); tmpLen=Melfa.length; Melfa[tmpLen] = createMarker(tmpLatLng,"
Eastern Shore Community College
29300 Lankford Hwy
Melfa, VA 23410

[ View School Profile ]
",iconGr); Melfa[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Eastern Shore Community College",'Melfa=' + Melfa.length); tmpLatLng=new GLatLng(36.84403700000000014,-76.1787219999999933); tmpLen=Virginia_Beach.length; Virginia_Beach[tmpLen] = createMarker(tmpLatLng,"
Ecpi College Of Technology
5555 Greenwich Rd Ste 300
Virginia Beach, VA 23462

[ View School Profile ]
",iconRd); Virginia_Beach[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Ecpi College Of Technology",'Virginia_Beach=' + Virginia_Beach.length); tmpLatLng=new GLatLng(37.50106799999999651,-77.582421999999994); tmpLen=Richmond.length; Richmond[tmpLen] = createMarker(tmpLatLng,"
Ecpi Technical College
800 Moorefield Pk Dr
Richmond, VA 23236

[ View School Profile ]
",iconRd); Richmond[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Ecpi Technical College",'Richmond=' + Richmond.length); tmpLatLng=new GLatLng(37.32013899999999750,-79.9590129999999987); tmpLen=Roanoke.length; Roanoke[tmpLen] = createMarker(tmpLatLng,"
Ecpi Technical College
5234 Airport Rd
Roanoke, VA 24012

[ View School Profile ]
",iconRd); Roanoke[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Ecpi Technical College",'Roanoke=' + Roanoke.length); tmpLatLng=new GLatLng(38.37658199999999908,-77.7789690000000035); tmpLen=Locust_Grove.length; Locust_Grove[tmpLen] = createMarker(tmpLatLng,"
Germanna Community College
2130 Germanna Hwy
Locust Grove, VA 22508

[ View School Profile ]
",iconGr); Locust_Grove[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Germanna Community College",'Locust_Grove=' + Locust_Grove.length); tmpLatLng=new GLatLng(36.85384299999999768,-76.2018989999999973); tmpLen=Norfolk.length; Norfolk[tmpLen] = createMarker(tmpLatLng,"
Itt Technical Institute-norfolk
863 Glenrock Rd, Ste 100
Norfolk, VA 23502

[ View School Profile ]
",iconRd); Norfolk[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Itt Technical Institute-norfolk",'Norfolk=' + Norfolk.length); tmpLatLng=new GLatLng(37.63813600000000292,-77.4752280000000013); tmpLen=Richmond.length; Richmond[tmpLen] = createMarker(tmpLatLng,"
J Sargeant Reynolds Community College
1651 E Parham Road
Richmond, VA 23228

[ View School Profile ]
",iconGr); Richmond[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("J Sargeant Reynolds Community College",'Richmond=' + Richmond.length); tmpLatLng=new GLatLng(37.34745699999999857,-77.4105940000000032); tmpLen=Chester.length; Chester[tmpLen] = createMarker(tmpLatLng,"
John Tyler Community College
13101 Jefferson Davis Hwy
Chester, VA 23831

[ View School Profile ]
",iconGr); Chester[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("John Tyler Community College",'Chester=' + Chester.length); tmpLatLng=new GLatLng(36.87917600000000106,-76.2158029999999939); tmpLen=Norfolk.length; Norfolk[tmpLen] = createMarker(tmpLatLng,"
Johnson & Wales University-norfolk
2428 Almeda Ave Ste 316
Norfolk, VA 23513

[ View School Profile ]
",iconRd); Norfolk[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Johnson & Wales University-norfolk",'Norfolk=' + Norfolk.length); tmpLatLng=new GLatLng(39.03474700000000297,-78.2693419999999946); tmpLen=Middletown.length; Middletown[tmpLen] = createMarker(tmpLatLng,"
Lord Fairfax Community College
173 Skirmisher Lane
Middletown, VA 22645

[ View School Profile ]
",iconGr); Middletown[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Lord Fairfax Community College",'Middletown=' + Middletown.length); tmpLatLng=new GLatLng(36.85430699999999859,-82.7577359999999941); tmpLen=Big_Stone_Gap.length; Big_Stone_Gap[tmpLen] = createMarker(tmpLatLng,"
Mountain Empire Community College
3441 Mountain Empire Road
Big Stone Gap, VA 24219

[ View School Profile ]
",iconGr); Big_Stone_Gap[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Mountain Empire Community College",'Big_Stone_Gap=' + Big_Stone_Gap.length); tmpLatLng=new GLatLng(37.29907699999999692,-80.0236400000000003); tmpLen=Salem.length; Salem[tmpLen] = createMarker(tmpLatLng,"
National College-salem
1813 E Main St
Salem, VA 24153

[ View School Profile ]
",iconRd); Salem[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("National College-salem",'Salem=' + Salem.length); tmpLatLng=new GLatLng(37.10617799999999988,-80.6842730000000045); tmpLen=Dublin.length; Dublin[tmpLen] = createMarker(tmpLatLng,"
New River Community College
5251 College Drive
Dublin, VA 24084

[ View School Profile ]
",iconGr); Dublin[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("New River Community College",'Dublin=' + Dublin.length); tmpLatLng=new GLatLng(38.83674500000000051,-77.2390860000000003); tmpLen=Annandale.length; Annandale[tmpLen] = createMarker(tmpLatLng,"
Northern Virginia Community College
4001 Wakefield Chapel Rd
Annandale, VA 22003

[ View School Profile ]
",iconGr); Annandale[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Northern Virginia Community College",'Annandale=' + Annandale.length); tmpLatLng=new GLatLng(36.73875300000000265,-79.8712320000000062); tmpLen=Martinsville.length; Martinsville[tmpLen] = createMarker(tmpLatLng,"
Patrick Henry Community College
645 Patriot Avenue
Martinsville, VA 24112

[ View School Profile ]
",iconGr); Martinsville[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Patrick Henry Community College",'Martinsville=' + Martinsville.length); tmpLatLng=new GLatLng(36.67262800000000311,-76.9386030000000005); tmpLen=Franklin.length; Franklin[tmpLen] = createMarker(tmpLatLng,"
Paul D Camp Community College
100 N College Dr
Franklin, VA 23851

[ View School Profile ]
",iconGr); Franklin[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Paul D Camp Community College",'Franklin=' + Franklin.length); tmpLatLng=new GLatLng(38.00605999999999795,-78.4833890000000025); tmpLen=Charlottesville.length; Charlottesville[tmpLen] = createMarker(tmpLatLng,"
Piedmont Virginia Community College
501 College Drive
Charlottesville, VA 22902

[ View School Profile ]
",iconGr); Charlottesville[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Piedmont Virginia Community College",'Charlottesville=' + Charlottesville.length); tmpLatLng=new GLatLng(37.56305299999999647,-76.6256350000000026); tmpLen=Glenns.length; Glenns[tmpLen] = createMarker(tmpLatLng,"
Rappahannock Community College
12745 College Drive
Glenns, VA 23149

[ View School Profile ]
",iconGr); Glenns[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Rappahannock Community College",'Glenns=' + Glenns.length); tmpLatLng=new GLatLng(37.17165599999999869,-77.4007299999999958); tmpLen=Petersburg.length; Petersburg[tmpLen] = createMarker(tmpLatLng,"
Richard Bland College Of College Of William An
11301 Johnson Rd
Petersburg, VA 23805

[ View School Profile ]
",iconGr); Petersburg[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Richard Bland College Of College Of William An",'Petersburg=' + Petersburg.length); tmpLatLng=new GLatLng(36.84027700000000038,-77.9168119999999930); tmpLen=Alberta.length; Alberta[tmpLen] = createMarker(tmpLatLng,"
Southside Virginia Community College
109 Campus Dr
Alberta, VA 23821

[ View School Profile ]
",iconGr); Alberta[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Southside Virginia Community College",'Alberta=' + Alberta.length); tmpLatLng=new GLatLng(37.09299099999999782,-81.7935259999999999); tmpLen=Richlands.length; Richlands[tmpLen] = createMarker(tmpLatLng,"
Southwest Virginia Community College
369 College Road Us Rt. 19, 6 Miles S. Claypool Hill
Richlands, VA 24641

[ View School Profile ]
",iconGr); Richlands[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Southwest Virginia Community College",'Richlands=' + Richlands.length); tmpLatLng=new GLatLng(37.06405699999999825,-76.4230969999999985); tmpLen=Hampton.length; Hampton[tmpLen] = createMarker(tmpLatLng,"
Thomas Nelson Community College
99 Thomas Nelson Drive
Hampton, VA 23666

[ View School Profile ]
",iconGr); Hampton[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Thomas Nelson Community College",'Hampton=' + Hampton.length); tmpLatLng=new GLatLng(36.85052900000000164,-76.2908479999999968); tmpLen=Norfolk.length; Norfolk[tmpLen] = createMarker(tmpLatLng,"
Tidewater Community College
500 East Main Street
Norfolk, VA 23514

[ View School Profile ]
",iconGr); Norfolk[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Tidewater Community College",'Norfolk=' + Norfolk.length); tmpLatLng=new GLatLng(36.71072000000000201,-81.9776920000000046); tmpLen=Abingdon.length; Abingdon[tmpLen] = createMarker(tmpLatLng,"
Virginia Highlands Community College
100 Vhcc Drive
Abingdon, VA 24212

[ View School Profile ]
",iconGr); Abingdon[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Virginia Highlands Community College",'Abingdon=' + Abingdon.length); tmpLatLng=new GLatLng(37.24122899999999702,-79.9810460000000063); tmpLen=Roanoke.length; Roanoke[tmpLen] = createMarker(tmpLatLng,"
Virginia Western Community College
3095 Colonial Ave
Roanoke, VA 24018

[ View School Profile ]
",iconGr); Roanoke[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Virginia Western Community College",'Roanoke=' + Roanoke.length); tmpLatLng=new GLatLng(36.95159300000000257,-81.0704250000000001); tmpLen=Wytheville.length; Wytheville[tmpLen] = createMarker(tmpLatLng,"
Wytheville Community College
1000 E. Main Street
Wytheville, VA 24382

[ View School Profile ]
",iconGr); Wytheville[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Wytheville Community College",'Wytheville=' + Wytheville.length); map.removeOverlays(Abingdon); map.removeOverlays(Alberta); map.removeOverlays(Annandale); map.removeOverlays(Big_Stone_Gap); map.removeOverlays(Charlottesville); map.removeOverlays(Chester); map.removeOverlays(Clifton_Forge); map.removeOverlays(Danville); map.removeOverlays(Dublin); map.removeOverlays(Franklin); map.removeOverlays(Glenns); map.removeOverlays(Hampton); map.removeOverlays(Locust_Grove); map.removeOverlays(Lynchburg); map.removeOverlays(Martinsville); map.removeOverlays(Melfa); map.removeOverlays(Middletown); map.removeOverlays(Norfolk); map.removeOverlays(Petersburg); map.removeOverlays(Richlands); map.removeOverlays(Richmond); map.removeOverlays(Roanoke); map.removeOverlays(Salem); map.removeOverlays(Virginia_Beach); map.removeOverlays(Weyers_Cave); map.removeOverlays(Wytheville); setTimeout(function(){map.addOverlays(Abingdon)},1000); setTimeout(function(){map.addOverlays(Alberta)},1000); setTimeout(function(){map.addOverlays(Annandale)},1000); setTimeout(function(){map.addOverlays(Big_Stone_Gap)},1000); setTimeout(function(){map.addOverlays(Charlottesville)},1000); setTimeout(function(){map.addOverlays(Chester)},1000); setTimeout(function(){map.addOverlays(Clifton_Forge)},1000); setTimeout(function(){map.addOverlays(Danville)},1000); setTimeout(function(){map.addOverlays(Dublin)},1000); setTimeout(function(){map.addOverlays(Franklin)},1000); setTimeout(function(){map.addOverlays(Glenns)},1000); setTimeout(function(){map.addOverlays(Hampton)},1000); setTimeout(function(){map.addOverlays(Locust_Grove)},1000); setTimeout(function(){map.addOverlays(Lynchburg)},1000); setTimeout(function(){map.addOverlays(Martinsville)},1000); setTimeout(function(){map.addOverlays(Melfa)},1000); setTimeout(function(){map.addOverlays(Middletown)},1000); setTimeout(function(){map.addOverlays(Norfolk)},1000); setTimeout(function(){map.addOverlays(Petersburg)},1000); setTimeout(function(){map.addOverlays(Richlands)},1000); setTimeout(function(){map.addOverlays(Richmond)},1000); setTimeout(function(){map.addOverlays(Roanoke)},1000); setTimeout(function(){map.addOverlays(Salem)},1000); setTimeout(function(){map.addOverlays(Virginia_Beach)},1000); setTimeout(function(){map.addOverlays(Weyers_Cave)},1000); setTimeout(function(){map.addOverlays(Wytheville)},1000); getPoly("","state","","VA");} // End addStateMarkers JavaScript Function //open all when map is defined function openAll() { if (map) { selectChange("all"); } else { setTimeout("openAll()",200); } } // 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].point.x; var markLat = myArray[i].point.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].point.x; maxLat = myArray[0].point.y; minLng = myArray[0].point.x; minLat = myArray[0].point.y; } // Recenter map based on global max/mins function reCenterMap(){ //alert('#' + minLat + '#' + minLng + '#' + maxLat + '#' + maxLng); 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) { if (selection.options) { var _openNewWindow=true; var myVal = selection.options[selection.selectedIndex].value; } else { var _openNewWindow=false; var myVal=selection; } 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('schools-by-distance') == -1) window.open(location.href + '/map/all'); else window.open('/search////all'); map.removeOverlays(Abingdon); map.removeOverlays(Alberta); map.removeOverlays(Annandale); map.removeOverlays(Big_Stone_Gap); map.removeOverlays(Charlottesville); map.removeOverlays(Chester); map.removeOverlays(Clifton_Forge); map.removeOverlays(Danville); map.removeOverlays(Dublin); map.removeOverlays(Franklin); map.removeOverlays(Glenns); map.removeOverlays(Hampton); map.removeOverlays(Locust_Grove); map.removeOverlays(Lynchburg); map.removeOverlays(Martinsville); map.removeOverlays(Melfa); map.removeOverlays(Middletown); map.removeOverlays(Norfolk); map.removeOverlays(Petersburg); map.removeOverlays(Richlands); map.removeOverlays(Richmond); map.removeOverlays(Roanoke); map.removeOverlays(Salem); map.removeOverlays(Virginia_Beach); map.removeOverlays(Weyers_Cave); map.removeOverlays(Wytheville); 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(Weyers_Cave);map.removeOverlays(Abingdon); map.removeOverlays(Alberta); map.removeOverlays(Annandale); map.removeOverlays(Big_Stone_Gap); map.removeOverlays(Charlottesville); map.removeOverlays(Chester); map.removeOverlays(Clifton_Forge); map.removeOverlays(Danville); map.removeOverlays(Dublin); map.removeOverlays(Franklin); map.removeOverlays(Glenns); map.removeOverlays(Hampton); map.removeOverlays(Locust_Grove); map.removeOverlays(Lynchburg); map.removeOverlays(Martinsville); map.removeOverlays(Melfa); map.removeOverlays(Middletown); map.removeOverlays(Norfolk); map.removeOverlays(Petersburg); map.removeOverlays(Richlands); map.removeOverlays(Richmond); map.removeOverlays(Roanoke); map.removeOverlays(Salem); map.removeOverlays(Virginia_Beach); map.removeOverlays(Weyers_Cave); map.removeOverlays(Wytheville); map.addOverlays(Abingdon); centerByArray(Abingdon, false, false); cntMarker += Abingdon.length; map.addOverlays(Alberta); centerByArray(Alberta, false, false); cntMarker += Alberta.length; map.addOverlays(Annandale); centerByArray(Annandale, false, false); cntMarker += Annandale.length; map.addOverlays(Big_Stone_Gap); centerByArray(Big_Stone_Gap, false, false); cntMarker += Big_Stone_Gap.length; map.addOverlays(Charlottesville); centerByArray(Charlottesville, false, false); cntMarker += Charlottesville.length; map.addOverlays(Chester); centerByArray(Chester, false, false); cntMarker += Chester.length; map.addOverlays(Clifton_Forge); centerByArray(Clifton_Forge, false, false); cntMarker += Clifton_Forge.length; map.addOverlays(Danville); centerByArray(Danville, false, false); cntMarker += Danville.length; map.addOverlays(Dublin); centerByArray(Dublin, false, false); cntMarker += Dublin.length; map.addOverlays(Franklin); centerByArray(Franklin, false, false); cntMarker += Franklin.length; map.addOverlays(Glenns); centerByArray(Glenns, false, false); cntMarker += Glenns.length; map.addOverlays(Hampton); centerByArray(Hampton, false, false); cntMarker += Hampton.length; map.addOverlays(Locust_Grove); centerByArray(Locust_Grove, false, false); cntMarker += Locust_Grove.length; map.addOverlays(Lynchburg); centerByArray(Lynchburg, false, false); cntMarker += Lynchburg.length; map.addOverlays(Martinsville); centerByArray(Martinsville, false, false); cntMarker += Martinsville.length; map.addOverlays(Melfa); centerByArray(Melfa, false, false); cntMarker += Melfa.length; map.addOverlays(Middletown); centerByArray(Middletown, false, false); cntMarker += Middletown.length; map.addOverlays(Norfolk); centerByArray(Norfolk, false, false); cntMarker += Norfolk.length; map.addOverlays(Petersburg); centerByArray(Petersburg, false, false); cntMarker += Petersburg.length; map.addOverlays(Richlands); centerByArray(Richlands, false, false); cntMarker += Richlands.length; map.addOverlays(Richmond); centerByArray(Richmond, false, false); cntMarker += Richmond.length; map.addOverlays(Roanoke); centerByArray(Roanoke, false, false); cntMarker += Roanoke.length; map.addOverlays(Salem); centerByArray(Salem, false, false); cntMarker += Salem.length; map.addOverlays(Virginia_Beach); centerByArray(Virginia_Beach, false, false); cntMarker += Virginia_Beach.length; map.addOverlays(Weyers_Cave); centerByArray(Weyers_Cave, false, false); cntMarker += Weyers_Cave.length; map.addOverlays(Wytheville); centerByArray(Wytheville, false, false); cntMarker += Wytheville.length; reCenterMap(); //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'); } } function createMarker(point, label, icon){ var marker = new GMarker(point, icon); var html = label; GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); }); return marker; }