function addMarkers()
{
mySelect = document.getElementById('selection');
Hazleton = [];Wilks_barre = [];Wilkes_Barre = [];Dupont = [];Kingston = [];Mountain_Top = [];Mountaintop = [];Dallas = [];Forty_Fort = [];Drums = [];Freeland = [];Wilkes_barre = [];Shickshinny = [];Nanticoke = [];Hanover_Township = [];Huntington_Mills = [];Exeter = [];Lehman = [];Harveys_Lake = [];Plymouth = [];West_Pittston = [];Pittston = [];Sweet_Valley = [];Berwick = [];Plains = [];Larksville = [];Wyoming = [];Sugarloaf = [];West_Hazleton = [];White_Haven = [];mySelect.options[mySelect.options.length] = new Option("Berwick schools",'all=Berwick');
mySelect.options[mySelect.options.length] = new Option("Dallas schools",'all=Dallas');
mySelect.options[mySelect.options.length] = new Option("Drums schools",'all=Drums');
mySelect.options[mySelect.options.length] = new Option("Dupont schools",'all=Dupont');
mySelect.options[mySelect.options.length] = new Option("Exeter schools",'all=Exeter');
mySelect.options[mySelect.options.length] = new Option("Forty Fort schools",'all=Forty_Fort');
mySelect.options[mySelect.options.length] = new Option("Freeland schools",'all=Freeland');
mySelect.options[mySelect.options.length] = new Option("Hanover Township schools",'all=Hanover_Township');
mySelect.options[mySelect.options.length] = new Option("Harveys Lake schools",'all=Harveys_Lake');
mySelect.options[mySelect.options.length] = new Option("Hazleton schools",'all=Hazleton');
mySelect.options[mySelect.options.length] = new Option("Huntington Mills schools",'all=Huntington_Mills');
mySelect.options[mySelect.options.length] = new Option("Kingston schools",'all=Kingston');
mySelect.options[mySelect.options.length] = new Option("Larksville schools",'all=Larksville');
mySelect.options[mySelect.options.length] = new Option("Lehman schools",'all=Lehman');
mySelect.options[mySelect.options.length] = new Option("Mountain Top schools",'all=Mountain_Top');
mySelect.options[mySelect.options.length] = new Option("Mountaintop schools",'all=Mountaintop');
mySelect.options[mySelect.options.length] = new Option("Nanticoke schools",'all=Nanticoke');
mySelect.options[mySelect.options.length] = new Option("Pittston schools",'all=Pittston');
mySelect.options[mySelect.options.length] = new Option("Plains schools",'all=Plains');
mySelect.options[mySelect.options.length] = new Option("Plymouth schools",'all=Plymouth');
mySelect.options[mySelect.options.length] = new Option("Shickshinny schools",'all=Shickshinny');
mySelect.options[mySelect.options.length] = new Option("Sugarloaf schools",'all=Sugarloaf');
mySelect.options[mySelect.options.length] = new Option("Sweet Valley schools",'all=Sweet_Valley');
mySelect.options[mySelect.options.length] = new Option("West Hazleton schools",'all=West_Hazleton');
mySelect.options[mySelect.options.length] = new Option("West Pittston schools",'all=West_Pittston');
mySelect.options[mySelect.options.length] = new Option("White Haven schools",'all=White_Haven');
mySelect.options[mySelect.options.length] = new Option("Wilkes Barre schools",'all=Wilkes_Barre');
mySelect.options[mySelect.options.length] = new Option("Wilkes barre schools",'all=Wilkes_barre');
mySelect.options[mySelect.options.length] = new Option("Wilks barre schools",'all=Wilks_barre');
mySelect.options[mySelect.options.length] = new Option("Wyoming schools",'all=Wyoming');
mySelect.options[mySelect.options.length] = new Option("---------------------------",'');
Hazleton[Hazleton.length] = createMarker(new GPoint(-75.96469116,40.96658707),"
",iconRd);
mySelect.options[mySelect.options.length] = new Option("Arthur Street Elementary School",'Hazleton=' + Hazleton.length);
Wilks_barre[Wilks_barre.length] = createMarker(new GPoint(-75.82616200,41.24522600),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Bear Creek Community Charter School",'Wilks_barre=' + Wilks_barre.length);
Wilkes_Barre[Wilkes_Barre.length] = createMarker(new GPoint(-75.88094330,41.24528122),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Bear Creek Township Elementary School",'Wilkes_Barre=' + Wilkes_Barre.length);
Dupont[Dupont.length] = createMarker(new GPoint(-75.74552155,41.32181931),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Ben Franklin Kdg Center",'Dupont=' + Dupont.length);
Kingston[Kingston.length] = createMarker(new GPoint(-75.89099884,41.26260376),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Chester Street Elementary School",'Kingston=' + Kingston.length);
Mountain_Top[Mountain_Top.length] = createMarker(new GPoint(-75.90171814,41.13987350),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Crestwood High School",'Mountain_Top=' + Mountain_Top.length);
Mountaintop[Mountaintop.length] = createMarker(new GPoint(-75.90171814,41.13987350),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Crestwood Middle School",'Mountaintop=' + Mountaintop.length);
Dallas[Dallas.length] = createMarker(new GPoint(-75.97319794,41.34230042),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Dallas Elementary School",'Dallas=' + Dallas.length);
Dallas[Dallas.length] = createMarker(new GPoint(-75.97319794,41.34230042),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Dallas Middle School",'Dallas=' + Dallas.length);
Dallas[Dallas.length] = createMarker(new GPoint(-75.97319794,41.34230042),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Dallas Senior High School",'Dallas=' + Dallas.length);
Forty_Fort[Forty_Fort.length] = createMarker(new GPoint(-75.87631989,41.28399658),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Dana El Center",'Forty_Fort=' + Forty_Fort.length);
Wilkes_Barre[Wilkes_Barre.length] = createMarker(new GPoint(-75.86474609,41.25444412),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Daniel J Flood Elementary School",'Wilkes_Barre=' + Wilkes_Barre.length);
Wilkes_Barre[Wilkes_Barre.length] = createMarker(new GPoint(-75.89502716,41.23164368),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Dodson Elementary School",'Wilkes_Barre=' + Wilkes_Barre.length);
Wilkes_Barre[Wilkes_Barre.length] = createMarker(new GPoint(-75.90987396,41.24059677),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Dr David W Kistler Elementary School",'Wilkes_Barre=' + Wilkes_Barre.length);
Drums[Drums.length] = createMarker(new GPoint(-75.97614288,41.06018066),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Drums El/ms Elementary School",'Drums=' + Drums.length);
Wilkes_Barre[Wilkes_Barre.length] = createMarker(new GPoint(-75.90852356,41.23869705),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Elmer L Meyers Junior Senior High School",'Wilkes_Barre=' + Wilkes_Barre.length);
Mountaintop[Mountaintop.length] = createMarker(new GPoint(-75.88072968,41.15512085),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Fairview Elementary School",'Mountaintop=' + Mountaintop.length);
Freeland[Freeland.length] = createMarker(new GPoint(-75.89196014,41.02219009),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Freeland El/ms Elementary School",'Freeland=' + Freeland.length);
Wilkes_barre[Wilkes_barre.length] = createMarker(new GPoint(-75.87397766,41.23989868),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("G A R Memorial Junior Senior High School",'Wilkes_barre=' + Wilkes_barre.length);
Shickshinny[Shickshinny.length] = createMarker(new GPoint(-76.15117645,41.15258026),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Garrison Memorial School",'Shickshinny=' + Shickshinny.length);
Nanticoke[Nanticoke.length] = createMarker(new GPoint(-75.99140167,41.20225143),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Gna El Center",'Nanticoke=' + Nanticoke.length);
Nanticoke[Nanticoke.length] = createMarker(new GPoint(-75.98951721,41.20228195),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Greater Nanticoke Area Ed Center",'Nanticoke=' + Nanticoke.length);
Nanticoke[Nanticoke.length] = createMarker(new GPoint(-75.99244690,41.20387268),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Greater Nanticoke Area Senior High School",'Nanticoke=' + Nanticoke.length);
Hanover_Township[Hanover_Township.length] = createMarker(new GPoint(-75.95059967,41.21540451),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Hanover Area Junior Senior High School",'Hanover_Township=' + Hanover_Township.length);
Hanover_Township[Hanover_Township.length] = createMarker(new GPoint(-75.85379791,41.28023148),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Hanover Area Memorial Elementary School",'Hanover_Township=' + Hanover_Township.length);
Hanover_Township[Hanover_Township.length] = createMarker(new GPoint(-75.94855499,41.21923828),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hanover Green Elementary School",'Hanover_Township=' + Hanover_Township.length);
Hazleton[Hazleton.length] = createMarker(new GPoint(-75.99028015,40.97256470),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hazle Elementary School",'Hazleton=' + Hazleton.length);
Hazleton[Hazleton.length] = createMarker(new GPoint(-75.99117279,40.97268295),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Hazleton Area Career Center",'Hazleton=' + Hazleton.length);
Hazleton[Hazleton.length] = createMarker(new GPoint(-75.99370575,40.97212219),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Hazleton Area High School",'Hazleton=' + Hazleton.length);
Hazleton[Hazleton.length] = createMarker(new GPoint(-75.96941376,40.94517136),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Heights Terrace El/ms Elementary School",'Hazleton=' + Hazleton.length);
Wilkes_Barre[Wilkes_Barre.length] = createMarker(new GPoint(-75.87505341,41.23792267),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Heights/murray Elementary School",'Wilkes_Barre=' + Wilkes_Barre.length);
Shickshinny[Shickshinny.length] = createMarker(new GPoint(-76.11737823,41.21905518),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hunlock Creek School",'Shickshinny=' + Shickshinny.length);
Shickshinny[Shickshinny.length] = createMarker(new GPoint(-76.23131561,41.19311142),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Huntington Mills School",'Shickshinny=' + Shickshinny.length);
Huntington_Mills[Huntington_Mills.length] = createMarker(new GPoint(-76.23397064,41.19067001),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Huntington Township Elementary School",'Huntington_Mills=' + Huntington_Mills.length);
Nanticoke[Nanticoke.length] = createMarker(new GPoint(-75.99191284,41.20306396),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("J F Kennedy Elementary School",'Nanticoke=' + Nanticoke.length);
Wilkes_Barre[Wilkes_Barre.length] = createMarker(new GPoint(-75.87832642,41.24623871),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("James M Coughlin Junior Senior High School",'Wilkes_Barre=' + Wilkes_Barre.length);
Nanticoke[Nanticoke.length] = createMarker(new GPoint(-76.01100159,41.18457031),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("K M Smith Elementary School",'Nanticoke=' + Nanticoke.length);
Exeter[Exeter.length] = createMarker(new GPoint(-75.81260681,41.32188034),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Kennedy El Center",'Exeter=' + Exeter.length);
Lehman[Lehman.length] = createMarker(new GPoint(-76.02275085,41.31639099),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Lake-lehman Junior Senior High School",'Lehman=' + Lehman.length);
Lehman[Lehman.length] = createMarker(new GPoint(-76.02275085,41.31639099),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Lake-lehman Middle Ed Building",'Lehman=' + Lehman.length);
Harveys_Lake[Harveys_Lake.length] = createMarker(new GPoint(-76.05010223,41.37530136),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lake-noxen Elementary School",'Harveys_Lake=' + Harveys_Lake.length);
Hanover_Township[Hanover_Township.length] = createMarker(new GPoint(-75.91530609,41.22961807),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lee Park Elementary School",'Hanover_Township=' + Hanover_Township.length);
Lehman[Lehman.length] = createMarker(new GPoint(-76.02269745,41.31689835),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lehman-jackson Elementary School",'Lehman=' + Lehman.length);
Hanover_Township[Hanover_Township.length] = createMarker(new GPoint(-75.93109894,41.23580170),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lyndwood Elementary School",'Hanover_Township=' + Hanover_Township.length);
Wilkes_Barre[Wilkes_Barre.length] = createMarker(new GPoint(-75.84819794,41.23849869),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mackin Elementary School",'Wilkes_Barre=' + Wilkes_Barre.length);
Plymouth[Plymouth.length] = createMarker(new GPoint(-75.94767761,41.24000168),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Main El Center",'Plymouth=' + Plymouth.length);
West_Pittston[West_Pittston.length] = createMarker(new GPoint(-75.80058289,41.32857895),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Montgomery Avenue Elementary School",'West_Pittston=' + West_Pittston.length);
Shickshinny[Shickshinny.length] = createMarker(new GPoint(-76.18975067,41.18344116),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Northwest Area High School",'Shickshinny=' + Shickshinny.length);
Pittston[Pittston.length] = createMarker(new GPoint(-75.76413727,41.34477997),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Pittston Area Middle School",'Pittston=' + Pittston.length);
Pittston[Pittston.length] = createMarker(new GPoint(-75.76700592,41.32361984),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Pittston Area Pri Center",'Pittston=' + Pittston.length);
Pittston[Pittston.length] = createMarker(new GPoint(-75.78978729,41.32588959),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Pittston Area Senior High School",'Pittston=' + Pittston.length);
Pittston[Pittston.length] = createMarker(new GPoint(-75.76413727,41.34477997),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Pittston City Intrmd Center",'Pittston=' + Pittston.length);
Kingston[Kingston.length] = createMarker(new GPoint(-75.89937592,41.27102280),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Pringle Street Elementary School",'Kingston=' + Kingston.length);
Mountain_Top[Mountain_Top.length] = createMarker(new GPoint(-75.97014618,41.14562225),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Rice Elementary School",'Mountain_Top=' + Mountain_Top.length);
Sweet_Valley[Sweet_Valley.length] = createMarker(new GPoint(-76.14453888,41.28234863),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Ross Elementary School",'Sweet_Valley=' + Sweet_Valley.length);
Berwick[Berwick.length] = createMarker(new GPoint(-76.22589111,41.06597900),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Salem Elementary School",'Berwick=' + Berwick.length);
Pittston[Pittston.length] = createMarker(new GPoint(-75.81659698,41.33760071),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Sara J Dymond Elementary School",'Pittston=' + Pittston.length);
Kingston[Kingston.length] = createMarker(new GPoint(-75.88658905,41.27345276),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Schuyler Avenue Elementary School",'Kingston=' + Kingston.length);
Plains[Plains.length] = createMarker(new GPoint(-75.85012054,41.27363205),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Solomon/plains Elementary School",'Plains=' + Plains.length);
Plains[Plains.length] = createMarker(new GPoint(-75.85005188,41.27360916),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Solomon/plains Junior High School",'Plains=' + Plains.length);
Larksville[Larksville.length] = createMarker(new GPoint(-75.93231964,41.26014709),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("State El Center",'Larksville=' + Larksville.length);
Wyoming[Wyoming.length] = createMarker(new GPoint(-75.84100342,41.30780029),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Tenth Street Elementary School",'Wyoming=' + Wyoming.length);
Kingston[Kingston.length] = createMarker(new GPoint(-75.89757538,41.26145935),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Third Avenue Elementary School",'Kingston=' + Kingston.length);
Sugarloaf[Sugarloaf.length] = createMarker(new GPoint(-76.07458496,40.98641968),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Valley El/ms Elementary School",'Sugarloaf=' + Sugarloaf.length);
West_Hazleton[West_Hazleton.length] = createMarker(new GPoint(-75.99977875,40.96024323),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("West Hazleton El/ms Elementary School",'West_Hazleton=' + West_Hazleton.length);
Kingston[Kingston.length] = createMarker(new GPoint(-75.89757538,41.26145935),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("West Side Avts High School",'Kingston=' + Kingston.length);
Wilkes_barre[Wilkes_barre.length] = createMarker(new GPoint(-75.89230347,41.27479935),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Wilkes-barre Avts",'Wilkes_barre=' + Wilkes_barre.length);
Dallas[Dallas.length] = createMarker(new GPoint(-75.97319794,41.34230042),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Wycallis Elementary School",'Dallas=' + Dallas.length);
Exeter[Exeter.length] = createMarker(new GPoint(-75.81031036,41.32317734),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Wyoming Area Sec Center",'Exeter=' + Exeter.length);
Kingston[Kingston.length] = createMarker(new GPoint(-75.89054108,41.26161194),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Wyoming Valley West Middle School",'Kingston=' + Kingston.length);
Plymouth[Plymouth.length] = createMarker(new GPoint(-75.94886780,41.24133301),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Wyoming Valley West Senior High School",'Plymouth=' + Plymouth.length);
White_Haven[White_Haven.length] = createMarker(new GPoint(-75.77474213,41.06105042),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Youth Forestry Camp #2 High School",'White_Haven=' + White_Haven.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(Berwick);
map.removeOverlays(Dallas);
map.removeOverlays(Drums);
map.removeOverlays(Dupont);
map.removeOverlays(Exeter);
map.removeOverlays(Forty_Fort);
map.removeOverlays(Freeland);
map.removeOverlays(Hanover_Township);
map.removeOverlays(Harveys_Lake);
map.removeOverlays(Hazleton);
map.removeOverlays(Huntington_Mills);
map.removeOverlays(Kingston);
map.removeOverlays(Larksville);
map.removeOverlays(Lehman);
map.removeOverlays(Mountain_Top);
map.removeOverlays(Mountaintop);
map.removeOverlays(Nanticoke);
map.removeOverlays(Pittston);
map.removeOverlays(Plains);
map.removeOverlays(Plymouth);
map.removeOverlays(Shickshinny);
map.removeOverlays(Sugarloaf);
map.removeOverlays(Sweet_Valley);
map.removeOverlays(West_Hazleton);
map.removeOverlays(West_Pittston);
map.removeOverlays(White_Haven);
map.removeOverlays(Wilkes_Barre);
map.removeOverlays(Wilkes_barre);
map.removeOverlays(Wilks_barre);
map.removeOverlays(Wyoming);
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(Hazleton);map.removeOverlays(Berwick);
map.removeOverlays(Dallas);
map.removeOverlays(Drums);
map.removeOverlays(Dupont);
map.removeOverlays(Exeter);
map.removeOverlays(Forty_Fort);
map.removeOverlays(Freeland);
map.removeOverlays(Hanover_Township);
map.removeOverlays(Harveys_Lake);
map.removeOverlays(Hazleton);
map.removeOverlays(Huntington_Mills);
map.removeOverlays(Kingston);
map.removeOverlays(Larksville);
map.removeOverlays(Lehman);
map.removeOverlays(Mountain_Top);
map.removeOverlays(Mountaintop);
map.removeOverlays(Nanticoke);
map.removeOverlays(Pittston);
map.removeOverlays(Plains);
map.removeOverlays(Plymouth);
map.removeOverlays(Shickshinny);
map.removeOverlays(Sugarloaf);
map.removeOverlays(Sweet_Valley);
map.removeOverlays(West_Hazleton);
map.removeOverlays(West_Pittston);
map.removeOverlays(White_Haven);
map.removeOverlays(Wilkes_Barre);
map.removeOverlays(Wilkes_barre);
map.removeOverlays(Wilks_barre);
map.removeOverlays(Wyoming);
map.addOverlays(Berwick);
centerByArray(Berwick, false, false);
cntMarker += Berwick.length;
map.addOverlays(Dallas);
centerByArray(Dallas, false, false);
cntMarker += Dallas.length;
map.addOverlays(Drums);
centerByArray(Drums, false, false);
cntMarker += Drums.length;
map.addOverlays(Dupont);
centerByArray(Dupont, false, false);
cntMarker += Dupont.length;
map.addOverlays(Exeter);
centerByArray(Exeter, false, false);
cntMarker += Exeter.length;
map.addOverlays(Forty_Fort);
centerByArray(Forty_Fort, false, false);
cntMarker += Forty_Fort.length;
map.addOverlays(Freeland);
centerByArray(Freeland, false, false);
cntMarker += Freeland.length;
map.addOverlays(Hanover_Township);
centerByArray(Hanover_Township, false, false);
cntMarker += Hanover_Township.length;
map.addOverlays(Harveys_Lake);
centerByArray(Harveys_Lake, false, false);
cntMarker += Harveys_Lake.length;
map.addOverlays(Hazleton);
centerByArray(Hazleton, false, false);
cntMarker += Hazleton.length;
map.addOverlays(Huntington_Mills);
centerByArray(Huntington_Mills, false, false);
cntMarker += Huntington_Mills.length;
map.addOverlays(Kingston);
centerByArray(Kingston, false, false);
cntMarker += Kingston.length;
map.addOverlays(Larksville);
centerByArray(Larksville, false, false);
cntMarker += Larksville.length;
map.addOverlays(Lehman);
centerByArray(Lehman, false, false);
cntMarker += Lehman.length;
map.addOverlays(Mountain_Top);
centerByArray(Mountain_Top, false, false);
cntMarker += Mountain_Top.length;
map.addOverlays(Mountaintop);
centerByArray(Mountaintop, false, false);
cntMarker += Mountaintop.length;
map.addOverlays(Nanticoke);
centerByArray(Nanticoke, false, false);
cntMarker += Nanticoke.length;
map.addOverlays(Pittston);
centerByArray(Pittston, false, false);
cntMarker += Pittston.length;
map.addOverlays(Plains);
centerByArray(Plains, false, false);
cntMarker += Plains.length;
map.addOverlays(Plymouth);
centerByArray(Plymouth, false, false);
cntMarker += Plymouth.length;
map.addOverlays(Shickshinny);
centerByArray(Shickshinny, false, false);
cntMarker += Shickshinny.length;
map.addOverlays(Sugarloaf);
centerByArray(Sugarloaf, false, false);
cntMarker += Sugarloaf.length;
map.addOverlays(Sweet_Valley);
centerByArray(Sweet_Valley, false, false);
cntMarker += Sweet_Valley.length;
map.addOverlays(West_Hazleton);
centerByArray(West_Hazleton, false, false);
cntMarker += West_Hazleton.length;
map.addOverlays(West_Pittston);
centerByArray(West_Pittston, false, false);
cntMarker += West_Pittston.length;
map.addOverlays(White_Haven);
centerByArray(White_Haven, false, false);
cntMarker += White_Haven.length;
map.addOverlays(Wilkes_Barre);
centerByArray(Wilkes_Barre, false, false);
cntMarker += Wilkes_Barre.length;
map.addOverlays(Wilkes_barre);
centerByArray(Wilkes_barre, false, false);
cntMarker += Wilkes_barre.length;
map.addOverlays(Wilks_barre);
centerByArray(Wilks_barre, false, false);
cntMarker += Wilks_barre.length;
map.addOverlays(Wyoming);
centerByArray(Wyoming, false, false);
cntMarker += Wyoming.length;
centerByArray(Hazleton,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');
}
}