function addMarkers()
{
mySelect = document.getElementById('selection');
Alburtis = [];Allentown = [];Bethlehem = [];Whitehall = [];Emmaus = [];Macungie = [];Breinigsville = [];Catasauqua = [];Center_Valley = [];Coplay = [];Orefield = [];Old_Zionsville = [];Schnecksville = [];Coopersburg = [];Slatington = [];New_Tripoli = [];Kutztown = [];Wescosville = [];mySelect.options[mySelect.options.length] = new Option("Alburtis schools",'all=Alburtis');
mySelect.options[mySelect.options.length] = new Option("Allentown schools",'all=Allentown');
mySelect.options[mySelect.options.length] = new Option("Bethlehem schools",'all=Bethlehem');
mySelect.options[mySelect.options.length] = new Option("Breinigsville schools",'all=Breinigsville');
mySelect.options[mySelect.options.length] = new Option("Catasauqua schools",'all=Catasauqua');
mySelect.options[mySelect.options.length] = new Option("Center Valley schools",'all=Center_Valley');
mySelect.options[mySelect.options.length] = new Option("Coopersburg schools",'all=Coopersburg');
mySelect.options[mySelect.options.length] = new Option("Coplay schools",'all=Coplay');
mySelect.options[mySelect.options.length] = new Option("Emmaus schools",'all=Emmaus');
mySelect.options[mySelect.options.length] = new Option("Kutztown schools",'all=Kutztown');
mySelect.options[mySelect.options.length] = new Option("Macungie schools",'all=Macungie');
mySelect.options[mySelect.options.length] = new Option("New Tripoli schools",'all=New_Tripoli');
mySelect.options[mySelect.options.length] = new Option("Old Zionsville schools",'all=Old_Zionsville');
mySelect.options[mySelect.options.length] = new Option("Orefield schools",'all=Orefield');
mySelect.options[mySelect.options.length] = new Option("Schnecksville schools",'all=Schnecksville');
mySelect.options[mySelect.options.length] = new Option("Slatington schools",'all=Slatington');
mySelect.options[mySelect.options.length] = new Option("Wescosville schools",'all=Wescosville');
mySelect.options[mySelect.options.length] = new Option("Whitehall schools",'all=Whitehall');
mySelect.options[mySelect.options.length] = new Option("---------------------------",'');
Alburtis[Alburtis.length] = createMarker(new GPoint(-75.60509491,40.50844574),"
",iconRd);
mySelect.options[mySelect.options.length] = new Option("Alburtis Elementary School",'Alburtis=' + Alburtis.length);
Allentown[Allentown.length] = createMarker(new GPoint(-75.43125153,40.61943054),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Allentown Secure Treatment Unt High School",'Allentown=' + Allentown.length);
Bethlehem[Bethlehem.length] = createMarker(new GPoint(-75.39667511,40.61876297),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Calypso Elementary School",'Bethlehem=' + Bethlehem.length);
Allentown[Allentown.length] = createMarker(new GPoint(-75.47609711,40.60433578),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Central Elementary School",'Allentown=' + Allentown.length);
Allentown[Allentown.length] = createMarker(new GPoint(-75.53285980,40.58536148),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Cetronia School",'Allentown=' + Allentown.length);
Whitehall[Whitehall.length] = createMarker(new GPoint(-75.50065613,40.65069580),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Clarence M Gockley Elementary School",'Whitehall=' + Whitehall.length);
Bethlehem[Bethlehem.length] = createMarker(new GPoint(-75.41869354,40.63787842),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Clearview Elementary School",'Bethlehem=' + Bethlehem.length);
Allentown[Allentown.length] = createMarker(new GPoint(-75.47858429,40.60729980),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Cleveland Elementary School",'Allentown=' + Allentown.length);
Emmaus[Emmaus.length] = createMarker(new GPoint(-75.49114400,40.53498500),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Emmaus High School",'Emmaus=' + Emmaus.length);
Macungie[Macungie.length] = createMarker(new GPoint(-75.54340363,40.51609039),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Eyer Middle School",'Macungie=' + Macungie.length);
Breinigsville[Breinigsville.length] = createMarker(new GPoint(-75.61638641,40.56968689),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Fogelsville School",'Breinigsville=' + Breinigsville.length);
Bethlehem[Bethlehem.length] = createMarker(new GPoint(-75.39797974,40.59830093),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Fountain Hill Elementary School",'Bethlehem=' + Bethlehem.length);
Allentown[Allentown.length] = createMarker(new GPoint(-75.49269867,40.59468460),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Francis D Raub Middle School",'Allentown=' + Allentown.length);
Catasauqua[Catasauqua.length] = createMarker(new GPoint(-75.45864868,40.65592575),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Francis H Sheckler Elementary School",'Catasauqua=' + Catasauqua.length);
Whitehall[Whitehall.length] = createMarker(new GPoint(-75.50062561,40.65067673),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("George D Steckel Elementary School",'Whitehall=' + Whitehall.length);
Allentown[Allentown.length] = createMarker(new GPoint(-75.46074677,40.60786057),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Harrison-morton Middle School",'Allentown=' + Allentown.length);
Allentown[Allentown.length] = createMarker(new GPoint(-75.42775726,40.58994675),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Harry S Truman Elementary School",'Allentown=' + Allentown.length);
Allentown[Allentown.length] = createMarker(new GPoint(-75.46078491,40.57833862),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hiram W Dodd Elementary School",'Allentown=' + Allentown.length);
Center_Valley[Center_Valley.length] = createMarker(new GPoint(-75.42440796,40.53650284),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hopewell Elementary School",'Center_Valley=' + Center_Valley.length);
Coplay[Coplay.length] = createMarker(new GPoint(-75.56063080,40.66106033),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Ironton School",'Coplay=' + Coplay.length);
Allentown[Allentown.length] = createMarker(new GPoint(-75.49152374,40.60539246),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Jackson Elementary School",'Allentown=' + Allentown.length);
Bethlehem[Bethlehem.length] = createMarker(new GPoint(-75.40673828,40.63949585),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("James Buchanan Elementary School",'Bethlehem=' + Bethlehem.length);
Allentown[Allentown.length] = createMarker(new GPoint(-75.48549652,40.60828018),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Jefferson Elementary School",'Allentown=' + Allentown.length);
Emmaus[Emmaus.length] = createMarker(new GPoint(-75.49661255,40.53716278),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Jefferson Elementary School",'Emmaus=' + Emmaus.length);
Orefield[Orefield.length] = createMarker(new GPoint(-75.59745789,40.63328552),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Kernsville School",'Orefield=' + Orefield.length);
Old_Zionsville[Old_Zionsville.length] = createMarker(new GPoint(-75.52384949,40.48965454),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Kings Highway Elementary School",'Old_Zionsville=' + Old_Zionsville.length);
Allentown[Allentown.length] = createMarker(new GPoint(-75.51484680,40.61989975),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Kratzer School",'Allentown=' + Allentown.length);
Schnecksville[Schnecksville.length] = createMarker(new GPoint(-75.61027527,40.66270065),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Lehigh Career & Technical Inst",'Schnecksville=' + Schnecksville.length);
Allentown[Allentown.length] = createMarker(new GPoint(-75.48482513,40.57727814),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lehigh Park Elementary School",'Allentown=' + Allentown.length);
Coopersburg[Coopersburg.length] = createMarker(new GPoint(-75.39523315,40.51340485),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Liberty Bell Elementary School",'Coopersburg=' + Coopersburg.length);
Allentown[Allentown.length] = createMarker(new GPoint(-75.48544312,40.59672928),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lincoln Early Chld Center",'Allentown=' + Allentown.length);
Emmaus[Emmaus.length] = createMarker(new GPoint(-75.49504089,40.53958130),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lincoln Elementary School",'Emmaus=' + Emmaus.length);
Catasauqua[Catasauqua.length] = createMarker(new GPoint(-75.46946716,40.65355301),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Lincoln Middle School",'Catasauqua=' + Catasauqua.length);
Allentown[Allentown.length] = createMarker(new GPoint(-75.44273376,40.62159729),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Louis E Dieruff High School",'Allentown=' + Allentown.length);
Macungie[Macungie.length] = createMarker(new GPoint(-75.56871033,40.54752350),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lower Macungie Elementary School",'Macungie=' + Macungie.length);
Macungie[Macungie.length] = createMarker(new GPoint(-75.57018280,40.54779816),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Lower Macungie Middle School",'Macungie=' + Macungie.length);
Coopersburg[Coopersburg.length] = createMarker(new GPoint(-75.46556091,40.47861099),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lower Milford Elementary School",'Coopersburg=' + Coopersburg.length);
Macungie[Macungie.length] = createMarker(new GPoint(-75.54103088,40.51306152),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Macungie Elementary School",'Macungie=' + Macungie.length);
Allentown[Allentown.length] = createMarker(new GPoint(-75.48197937,40.60242462),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mckinley Elementary School",'Allentown=' + Allentown.length);
Allentown[Allentown.length] = createMarker(new GPoint(-75.42642975,40.62960815),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Midway Manor Early Chld Center",'Allentown=' + Allentown.length);
Allentown[Allentown.length] = createMarker(new GPoint(-75.44550323,40.60820007),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mosser Elementary School",'Allentown=' + Allentown.length);
Allentown[Allentown.length] = createMarker(new GPoint(-75.50581360,40.60475159),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Muhlenberg Elementary School",'Allentown=' + Allentown.length);
Bethlehem[Bethlehem.length] = createMarker(new GPoint(-75.39516449,40.62516403),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Nitschmann Middle School",'Bethlehem=' + Bethlehem.length);
Slatington[Slatington.length] = createMarker(new GPoint(-75.60973358,40.75915527),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Northern Lehigh Middle School",'Slatington=' + Slatington.length);
Slatington[Slatington.length] = createMarker(new GPoint(-75.61447906,40.76416397),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Northern Lehigh Senior High School",'Slatington=' + Slatington.length);
New_Tripoli[New_Tripoli.length] = createMarker(new GPoint(-75.72409058,40.68013763),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Northwestern Lehigh Elementary School",'New_Tripoli=' + New_Tripoli.length);
New_Tripoli[New_Tripoli.length] = createMarker(new GPoint(-75.72409058,40.68013763),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Northwestern Lehigh High School",'New_Tripoli=' + New_Tripoli.length);
New_Tripoli[New_Tripoli.length] = createMarker(new GPoint(-75.72269440,40.68575287),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Northwestern Lehigh Middle School",'New_Tripoli=' + New_Tripoli.length);
Orefield[Orefield.length] = createMarker(new GPoint(-75.60289764,40.62440109),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Orefield Middle School",'Orefield=' + Orefield.length);
Allentown[Allentown.length] = createMarker(new GPoint(-75.54360962,40.63826370),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Parkland Senior High School",'Allentown=' + Allentown.length);
Allentown[Allentown.length] = createMarker(new GPoint(-75.54903412,40.59349442),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Parkway Manor School",'Allentown=' + Allentown.length);
Slatington[Slatington.length] = createMarker(new GPoint(-75.64011383,40.72162628),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Peters Elementary School",'Slatington=' + Slatington.length);
Allentown[Allentown.length] = createMarker(new GPoint(-75.43220520,40.62065506),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Ritter Elementary School",'Allentown=' + Allentown.length);
Allentown[Allentown.length] = createMarker(new GPoint(-75.46434021,40.60128021),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Roberto Clemente Charter School",'Allentown=' + Allentown.length);
Allentown[Allentown.length] = createMarker(new GPoint(-75.45594025,40.59033966),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Roosevelt Elementary School",'Allentown=' + Allentown.length);
Allentown[Allentown.length] = createMarker(new GPoint(-75.50096893,40.56007385),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Salisbury Middle School",'Allentown=' + Allentown.length);
Allentown[Allentown.length] = createMarker(new GPoint(-75.44189453,40.58478165),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Salisbury Senior High School",'Allentown=' + Allentown.length);
Schnecksville[Schnecksville.length] = createMarker(new GPoint(-75.60388947,40.66880035),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Schnecksville School",'Schnecksville=' + Schnecksville.length);
Allentown[Allentown.length] = createMarker(new GPoint(-75.46311951,40.61290359),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Sheridan Elementary School",'Allentown=' + Allentown.length);
Macungie[Macungie.length] = createMarker(new GPoint(-75.54364014,40.51129913),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Shoemaker Elementary School",'Macungie=' + Macungie.length);
Slatington[Slatington.length] = createMarker(new GPoint(-75.61458588,40.76545334),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Slatington Elementary School",'Slatington=' + Slatington.length);
Allentown[Allentown.length] = createMarker(new GPoint(-75.46182251,40.57455826),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("South Mountain Middle School",'Allentown=' + Allentown.length);
Center_Valley[Center_Valley.length] = createMarker(new GPoint(-75.40096283,40.53591156),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Southern Lehigh Middle School",'Center_Valley=' + Center_Valley.length);
Center_Valley[Center_Valley.length] = createMarker(new GPoint(-75.40169525,40.53185272),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Southern Lehigh Senior High School",'Center_Valley=' + Center_Valley.length);
Allentown[Allentown.length] = createMarker(new GPoint(-75.54545593,40.60565567),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Springhouse Middle School",'Allentown=' + Allentown.length);
Allentown[Allentown.length] = createMarker(new GPoint(-75.49359131,40.60988235),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Trexler Middle School",'Allentown=' + Allentown.length);
Allentown[Allentown.length] = createMarker(new GPoint(-75.49669647,40.59264755),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Union Terrace Elementary School",'Allentown=' + Allentown.length);
Bethlehem[Bethlehem.length] = createMarker(new GPoint(-75.38932037,40.62661743),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Vitalistic Therapeutic Charter School",'Bethlehem=' + Bethlehem.length);
Allentown[Allentown.length] = createMarker(new GPoint(-75.48110199,40.61344910),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Washington Elementary School",'Allentown=' + Allentown.length);
Kutztown[Kutztown.length] = createMarker(new GPoint(-75.71077728,40.59106445),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Weisenberg Elementary School",'Kutztown=' + Kutztown.length);
Wescosville[Wescosville.length] = createMarker(new GPoint(-75.55506134,40.56197357),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Wescosville Elementary School",'Wescosville=' + Wescosville.length);
Allentown[Allentown.length] = createMarker(new GPoint(-75.49985504,40.56081390),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Western Salisbury Elementary School",'Allentown=' + Allentown.length);
Whitehall[Whitehall.length] = createMarker(new GPoint(-75.50528717,40.64952087),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Whitehall High School",'Whitehall=' + Whitehall.length);
Whitehall[Whitehall.length] = createMarker(new GPoint(-75.50064087,40.65068436),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Whitehall-coplay Middle School",'Whitehall=' + Whitehall.length);
Allentown[Allentown.length] = createMarker(new GPoint(-75.49340057,40.59862137),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("William Allen Senior High School",'Allentown=' + Allentown.length);
Allentown[Allentown.length] = createMarker(new GPoint(-75.45362091,40.57837677),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Wilson Early Chld Center",'Allentown=' + Allentown.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(Alburtis);
map.removeOverlays(Allentown);
map.removeOverlays(Bethlehem);
map.removeOverlays(Breinigsville);
map.removeOverlays(Catasauqua);
map.removeOverlays(Center_Valley);
map.removeOverlays(Coopersburg);
map.removeOverlays(Coplay);
map.removeOverlays(Emmaus);
map.removeOverlays(Kutztown);
map.removeOverlays(Macungie);
map.removeOverlays(New_Tripoli);
map.removeOverlays(Old_Zionsville);
map.removeOverlays(Orefield);
map.removeOverlays(Schnecksville);
map.removeOverlays(Slatington);
map.removeOverlays(Wescosville);
map.removeOverlays(Whitehall);
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(Alburtis);map.removeOverlays(Alburtis);
map.removeOverlays(Allentown);
map.removeOverlays(Bethlehem);
map.removeOverlays(Breinigsville);
map.removeOverlays(Catasauqua);
map.removeOverlays(Center_Valley);
map.removeOverlays(Coopersburg);
map.removeOverlays(Coplay);
map.removeOverlays(Emmaus);
map.removeOverlays(Kutztown);
map.removeOverlays(Macungie);
map.removeOverlays(New_Tripoli);
map.removeOverlays(Old_Zionsville);
map.removeOverlays(Orefield);
map.removeOverlays(Schnecksville);
map.removeOverlays(Slatington);
map.removeOverlays(Wescosville);
map.removeOverlays(Whitehall);
map.addOverlays(Alburtis);
centerByArray(Alburtis, false, false);
cntMarker += Alburtis.length;
map.addOverlays(Allentown);
centerByArray(Allentown, false, false);
cntMarker += Allentown.length;
map.addOverlays(Bethlehem);
centerByArray(Bethlehem, false, false);
cntMarker += Bethlehem.length;
map.addOverlays(Breinigsville);
centerByArray(Breinigsville, false, false);
cntMarker += Breinigsville.length;
map.addOverlays(Catasauqua);
centerByArray(Catasauqua, false, false);
cntMarker += Catasauqua.length;
map.addOverlays(Center_Valley);
centerByArray(Center_Valley, false, false);
cntMarker += Center_Valley.length;
map.addOverlays(Coopersburg);
centerByArray(Coopersburg, false, false);
cntMarker += Coopersburg.length;
map.addOverlays(Coplay);
centerByArray(Coplay, false, false);
cntMarker += Coplay.length;
map.addOverlays(Emmaus);
centerByArray(Emmaus, false, false);
cntMarker += Emmaus.length;
map.addOverlays(Kutztown);
centerByArray(Kutztown, false, false);
cntMarker += Kutztown.length;
map.addOverlays(Macungie);
centerByArray(Macungie, false, false);
cntMarker += Macungie.length;
map.addOverlays(New_Tripoli);
centerByArray(New_Tripoli, false, false);
cntMarker += New_Tripoli.length;
map.addOverlays(Old_Zionsville);
centerByArray(Old_Zionsville, false, false);
cntMarker += Old_Zionsville.length;
map.addOverlays(Orefield);
centerByArray(Orefield, false, false);
cntMarker += Orefield.length;
map.addOverlays(Schnecksville);
centerByArray(Schnecksville, false, false);
cntMarker += Schnecksville.length;
map.addOverlays(Slatington);
centerByArray(Slatington, false, false);
cntMarker += Slatington.length;
map.addOverlays(Wescosville);
centerByArray(Wescosville, false, false);
cntMarker += Wescosville.length;
map.addOverlays(Whitehall);
centerByArray(Whitehall, false, false);
cntMarker += Whitehall.length;
centerByArray(Alburtis,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');
}
}