function addMarkers(){
mySelect = document.getElementById('selection');
Baltimore = [];Owings_Mills = [];Potomac = [];Gaithersburg = [];Arnold = [];Cockeysville = [];Rockville = [];Hagerstown = [];California = [];Gambrills = [];Eldersburg = [];Columbia = [];Waldorf = [];Hyattsville = [];Cumberland = [];Oxon_Hill = [];Middletown = [];Takoma_Park = [];Pasadena = [];Gwynn_Oak = [];Linthicum = [];Annapolis = [];Silver_Spring = [];Laurel = [];Ellicott_City = [];Towson = [];Bethesda = [];mySelect.options[mySelect.options.length] = new Option("Annapolis schools",'all=Annapolis');
mySelect.options[mySelect.options.length] = new Option("Arnold schools",'all=Arnold');
mySelect.options[mySelect.options.length] = new Option("Baltimore schools",'all=Baltimore');
mySelect.options[mySelect.options.length] = new Option("Bethesda schools",'all=Bethesda');
mySelect.options[mySelect.options.length] = new Option("California schools",'all=California');
mySelect.options[mySelect.options.length] = new Option("Cockeysville schools",'all=Cockeysville');
mySelect.options[mySelect.options.length] = new Option("Columbia schools",'all=Columbia');
mySelect.options[mySelect.options.length] = new Option("Cumberland schools",'all=Cumberland');
mySelect.options[mySelect.options.length] = new Option("Eldersburg schools",'all=Eldersburg');
mySelect.options[mySelect.options.length] = new Option("Ellicott City schools",'all=Ellicott_City');
mySelect.options[mySelect.options.length] = new Option("Gaithersburg schools",'all=Gaithersburg');
mySelect.options[mySelect.options.length] = new Option("Gambrills schools",'all=Gambrills');
mySelect.options[mySelect.options.length] = new Option("Gwynn Oak schools",'all=Gwynn_Oak');
mySelect.options[mySelect.options.length] = new Option("Hagerstown schools",'all=Hagerstown');
mySelect.options[mySelect.options.length] = new Option("Hyattsville schools",'all=Hyattsville');
mySelect.options[mySelect.options.length] = new Option("Laurel schools",'all=Laurel');
mySelect.options[mySelect.options.length] = new Option("Linthicum schools",'all=Linthicum');
mySelect.options[mySelect.options.length] = new Option("Middletown schools",'all=Middletown');
mySelect.options[mySelect.options.length] = new Option("Owings Mills schools",'all=Owings_Mills');
mySelect.options[mySelect.options.length] = new Option("Oxon Hill schools",'all=Oxon_Hill');
mySelect.options[mySelect.options.length] = new Option("Pasadena schools",'all=Pasadena');
mySelect.options[mySelect.options.length] = new Option("Potomac schools",'all=Potomac');
mySelect.options[mySelect.options.length] = new Option("Rockville schools",'all=Rockville');
mySelect.options[mySelect.options.length] = new Option("Silver Spring schools",'all=Silver_Spring');
mySelect.options[mySelect.options.length] = new Option("Takoma Park schools",'all=Takoma_Park');
mySelect.options[mySelect.options.length] = new Option("Towson schools",'all=Towson');
mySelect.options[mySelect.options.length] = new Option("Waldorf schools",'all=Waldorf');
mySelect.options[mySelect.options.length] = new Option("---------------------------",'');
Baltimore[Baltimore.length] = createMarker(new GPoint(-76.62302700,39.35144300),"
",iconGr);
mySelect.options[mySelect.options.length] = new Option("A Child S Place",'Baltimore=' + Baltimore.length);
Owings_Mills[Owings_Mills.length] = createMarker(new GPoint(-76.78866100,39.39455700),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("A Small World",'Owings_Mills=' + Owings_Mills.length);
Potomac[Potomac.length] = createMarker(new GPoint(-77.18752300,39.05895200),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Academy Child Development Cent",'Potomac=' + Potomac.length);
Gaithersburg[Gaithersburg.length] = createMarker(new GPoint(-77.23836200,39.10161800),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Academy Child Development Center At Dofief",'Gaithersburg=' + Gaithersburg.length);
Arnold[Arnold.length] = createMarker(new GPoint(-76.49811800,39.03433700),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Asbury Community Christian Preschool",'Arnold=' + Arnold.length);
Cockeysville[Cockeysville.length] = createMarker(new GPoint(-76.64466800,39.49322800),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Ashland Preschool Center",'Cockeysville=' + Cockeysville.length);
Arnold[Arnold.length] = createMarker(new GPoint(-76.52204600,39.04434000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Chesapeake Academy",'Arnold=' + Arnold.length);
Rockville[Rockville.length] = createMarker(new GPoint(-77.09034600,39.09139800),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("The Children's Learning Center Inc",'Rockville=' + Rockville.length);
Baltimore[Baltimore.length] = createMarker(new GPoint(-76.62513800,39.36517300),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Church Of The Redeemer Day School",'Baltimore=' + Baltimore.length);
Hagerstown[Hagerstown.length] = createMarker(new GPoint(-77.72801900,39.71542400),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Citicorp Family Center",'Hagerstown=' + Hagerstown.length);
California[California.length] = createMarker(new GPoint(-76.49801900,38.29348100),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("The Creative Beginnings School",'California=' + California.length);
Gambrills[Gambrills.length] = createMarker(new GPoint(-76.68759600,39.02725200),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Daily Discoveries And The Discovery School",'Gambrills=' + Gambrills.length);
Owings_Mills[Owings_Mills.length] = createMarker(new GPoint(-76.74780400,39.39644900),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Day Timers Early Learning Center",'Owings_Mills=' + Owings_Mills.length);
Baltimore[Baltimore.length] = createMarker(new GPoint(-76.61861300,39.29879900),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Downtown Baltimore Childcare Inc.",'Baltimore=' + Baltimore.length);
Gaithersburg[Gaithersburg.length] = createMarker(new GPoint(-77.18649100,39.12750900),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Epworth Preschool And Kindergarten",'Gaithersburg=' + Gaithersburg.length);
Rockville[Rockville.length] = createMarker(new GPoint(-77.12014200,39.04846600),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Executive Child Development Center",'Rockville=' + Rockville.length);
Baltimore[Baltimore.length] = createMarker(new GPoint(-76.61794100,39.33500200),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("First English Preschool And Kindergarten",'Baltimore=' + Baltimore.length);
Rockville[Rockville.length] = createMarker(new GPoint(-77.12424900,39.05283700),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Ganon Gil Preschool",'Rockville=' + Rockville.length);
Rockville[Rockville.length] = createMarker(new GPoint(-77.16960100,39.03133900),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Georgetown Hill Early School",'Rockville=' + Rockville.length);
Eldersburg[Eldersburg.length] = createMarker(new GPoint(-76.92427100,39.39711900),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Goddard School Of Eldersburg, The",'Eldersburg=' + Eldersburg.length);
Columbia[Columbia.length] = createMarker(new GPoint(-76.81569900,39.23262400),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Goddard School, The",'Columbia=' + Columbia.length);
Waldorf[Waldorf.length] = createMarker(new GPoint(-76.91402200,38.60521600),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Good Shepherd Education Center",'Waldorf=' + Waldorf.length);
Rockville[Rockville.length] = createMarker(new GPoint(-77.12355600,39.07676300),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Good Shepherd Montessori School",'Rockville=' + Rockville.length);
Baltimore[Baltimore.length] = createMarker(new GPoint(-76.61017700,39.36186600),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Govans Presbyterian Preschool",'Baltimore=' + Baltimore.length);
Baltimore[Baltimore.length] = createMarker(new GPoint(-76.62458600,39.36053700),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Grace United Methodist Preschool",'Baltimore=' + Baltimore.length);
Hyattsville[Hyattsville.length] = createMarker(new GPoint(-76.96510000,38.96350000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Greenwood School",'Hyattsville=' + Hyattsville.length);
Hagerstown[Hagerstown.length] = createMarker(new GPoint(-77.72237700,39.63952900),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Hagerstown Childrens School",'Hagerstown=' + Hagerstown.length);
Hagerstown[Hagerstown.length] = createMarker(new GPoint(-77.66545600,39.62801300),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Hcc Children's Learning Center",'Hagerstown=' + Hagerstown.length);
Cumberland[Cumberland.length] = createMarker(new GPoint(-78.76471200,39.65529500),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Humpty Dumpty Learning Center",'Cumberland=' + Cumberland.length);
Baltimore[Baltimore.length] = createMarker(new GPoint(-76.60024200,39.34348200),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Ivey League Learning Center, Inc.",'Baltimore=' + Baltimore.length);
Oxon_Hill[Oxon_Hill.length] = createMarker(new GPoint(-76.97643300,38.80511700),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Kiddie Academy Of Oxon Hill",'Oxon_Hill=' + Oxon_Hill.length);
Waldorf[Waldorf.length] = createMarker(new GPoint(-76.93560000,38.61909300),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Kindercare Learning Center",'Waldorf=' + Waldorf.length);
Middletown[Middletown.length] = createMarker(new GPoint(-77.59040400,39.48309700),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Lucy School",'Middletown=' + Middletown.length);
Middletown[Middletown.length] = createMarker(new GPoint(-77.50923600,39.42990600),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Middletown United Methodist Preschool & Kdgn",'Middletown=' + Middletown.length);
Gaithersburg[Gaithersburg.length] = createMarker(new GPoint(-77.21915700,39.13336000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Nist Child Care Center",'Gaithersburg=' + Gaithersburg.length);
Takoma_Park[Takoma_Park.length] = createMarker(new GPoint(-76.99139700,38.97752900),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Our Lady Of Sorrows School",'Takoma_Park=' + Takoma_Park.length);
Pasadena[Pasadena.length] = createMarker(new GPoint(-76.51541300,39.13223900),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Pasadena Child Care and Homework Center",'Pasadena=' + Pasadena.length);
Gwynn_Oak[Gwynn_Oak.length] = createMarker(new GPoint(-76.69782100,39.31021200),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Phyllis Wheatley Education Center",'Gwynn_Oak=' + Gwynn_Oak.length);
Linthicum[Linthicum.length] = createMarker(new GPoint(-76.67853300,39.19987800),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Quala Care Child Center Inc",'Linthicum=' + Linthicum.length);
Gaithersburg[Gaithersburg.length] = createMarker(new GPoint(-77.23378100,39.13011300),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Quince Orchard Kindercare",'Gaithersburg=' + Gaithersburg.length);
Annapolis[Annapolis.length] = createMarker(new GPoint(-76.48404700,38.93956700),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Anne's School of Annapolis",'Annapolis=' + Annapolis.length);
Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-76.98226100,39.01089900),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Camillus School & Early Childhood Learning Center",'Silver_Spring=' + Silver_Spring.length);
Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-77.06889900,39.04864500),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Catherine Laboure School",'Silver_Spring=' + Silver_Spring.length);
Laurel[Laurel.length] = createMarker(new GPoint(-76.85590900,39.10896000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Mary Of The Mills School",'Laurel=' + Laurel.length);
Pasadena[Pasadena.length] = createMarker(new GPoint(-76.56688600,39.10039200),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Severna Park Children's Centre",'Pasadena=' + Pasadena.length);
Ellicott_City[Ellicott_City.length] = createMarker(new GPoint(-76.82996800,39.27268100),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St Johns Parish Day School",'Ellicott_City=' + Ellicott_City.length);
Hagerstown[Hagerstown.length] = createMarker(new GPoint(-77.72961900,39.63395900),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Surrey Child Care Center",'Hagerstown=' + Hagerstown.length);
Towson[Towson.length] = createMarker(new GPoint(-76.61145200,39.40035900),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Towson Presbyterian Kindergarten & Nursery",'Towson=' + Towson.length);
Bethesda[Bethesda.length] = createMarker(new GPoint(-77.10099900,38.96298000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Washington Episcopal School",'Bethesda=' + Bethesda.length);
map.removeOverlays(Annapolis);
map.removeOverlays(Arnold);
map.removeOverlays(Baltimore);
map.removeOverlays(Bethesda);
map.removeOverlays(California);
map.removeOverlays(Cockeysville);
map.removeOverlays(Columbia);
map.removeOverlays(Cumberland);
map.removeOverlays(Eldersburg);
map.removeOverlays(Ellicott_City);
map.removeOverlays(Gaithersburg);
map.removeOverlays(Gambrills);
map.removeOverlays(Gwynn_Oak);
map.removeOverlays(Hagerstown);
map.removeOverlays(Hyattsville);
map.removeOverlays(Laurel);
map.removeOverlays(Linthicum);
map.removeOverlays(Middletown);
map.removeOverlays(Owings_Mills);
map.removeOverlays(Oxon_Hill);
map.removeOverlays(Pasadena);
map.removeOverlays(Potomac);
map.removeOverlays(Rockville);
map.removeOverlays(Silver_Spring);
map.removeOverlays(Takoma_Park);
map.removeOverlays(Towson);
map.removeOverlays(Waldorf);
setTimeout(function(){map.addOverlays(Annapolis)},1000);
setTimeout(function(){map.addOverlays(Arnold)},1000);
setTimeout(function(){map.addOverlays(Baltimore)},1000);
setTimeout(function(){map.addOverlays(Bethesda)},1000);
setTimeout(function(){map.addOverlays(California)},1000);
setTimeout(function(){map.addOverlays(Cockeysville)},1000);
setTimeout(function(){map.addOverlays(Columbia)},1000);
setTimeout(function(){map.addOverlays(Cumberland)},1000);
setTimeout(function(){map.addOverlays(Eldersburg)},1000);
setTimeout(function(){map.addOverlays(Ellicott_City)},1000);
setTimeout(function(){map.addOverlays(Gaithersburg)},1000);
setTimeout(function(){map.addOverlays(Gambrills)},1000);
setTimeout(function(){map.addOverlays(Gwynn_Oak)},1000);
setTimeout(function(){map.addOverlays(Hagerstown)},1000);
setTimeout(function(){map.addOverlays(Hyattsville)},1000);
setTimeout(function(){map.addOverlays(Laurel)},1000);
setTimeout(function(){map.addOverlays(Linthicum)},1000);
setTimeout(function(){map.addOverlays(Middletown)},1000);
setTimeout(function(){map.addOverlays(Owings_Mills)},1000);
setTimeout(function(){map.addOverlays(Oxon_Hill)},1000);
setTimeout(function(){map.addOverlays(Pasadena)},1000);
setTimeout(function(){map.addOverlays(Potomac)},1000);
setTimeout(function(){map.addOverlays(Rockville)},1000);
setTimeout(function(){map.addOverlays(Silver_Spring)},1000);
setTimeout(function(){map.addOverlays(Takoma_Park)},1000);
setTimeout(function(){map.addOverlays(Towson)},1000);
setTimeout(function(){map.addOverlays(Waldorf)},1000);
maxLng = -76.48404700;
maxLat = 39.71542400;
minLng = -78.76471200;
minLat = 38.29348100;
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(Annapolis);
map.removeOverlays(Arnold);
map.removeOverlays(Baltimore);
map.removeOverlays(Bethesda);
map.removeOverlays(California);
map.removeOverlays(Cockeysville);
map.removeOverlays(Columbia);
map.removeOverlays(Cumberland);
map.removeOverlays(Eldersburg);
map.removeOverlays(Ellicott_City);
map.removeOverlays(Gaithersburg);
map.removeOverlays(Gambrills);
map.removeOverlays(Gwynn_Oak);
map.removeOverlays(Hagerstown);
map.removeOverlays(Hyattsville);
map.removeOverlays(Laurel);
map.removeOverlays(Linthicum);
map.removeOverlays(Middletown);
map.removeOverlays(Owings_Mills);
map.removeOverlays(Oxon_Hill);
map.removeOverlays(Pasadena);
map.removeOverlays(Potomac);
map.removeOverlays(Rockville);
map.removeOverlays(Silver_Spring);
map.removeOverlays(Takoma_Park);
map.removeOverlays(Towson);
map.removeOverlays(Waldorf);
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(Baltimore);map.removeOverlays(Annapolis);
map.removeOverlays(Arnold);
map.removeOverlays(Baltimore);
map.removeOverlays(Bethesda);
map.removeOverlays(California);
map.removeOverlays(Cockeysville);
map.removeOverlays(Columbia);
map.removeOverlays(Cumberland);
map.removeOverlays(Eldersburg);
map.removeOverlays(Ellicott_City);
map.removeOverlays(Gaithersburg);
map.removeOverlays(Gambrills);
map.removeOverlays(Gwynn_Oak);
map.removeOverlays(Hagerstown);
map.removeOverlays(Hyattsville);
map.removeOverlays(Laurel);
map.removeOverlays(Linthicum);
map.removeOverlays(Middletown);
map.removeOverlays(Owings_Mills);
map.removeOverlays(Oxon_Hill);
map.removeOverlays(Pasadena);
map.removeOverlays(Potomac);
map.removeOverlays(Rockville);
map.removeOverlays(Silver_Spring);
map.removeOverlays(Takoma_Park);
map.removeOverlays(Towson);
map.removeOverlays(Waldorf);
map.addOverlays(Annapolis);
centerByArray(Annapolis, false, false);
cntMarker += Annapolis.length;
map.addOverlays(Arnold);
centerByArray(Arnold, false, false);
cntMarker += Arnold.length;
map.addOverlays(Baltimore);
centerByArray(Baltimore, false, false);
cntMarker += Baltimore.length;
map.addOverlays(Bethesda);
centerByArray(Bethesda, false, false);
cntMarker += Bethesda.length;
map.addOverlays(California);
centerByArray(California, false, false);
cntMarker += California.length;
map.addOverlays(Cockeysville);
centerByArray(Cockeysville, false, false);
cntMarker += Cockeysville.length;
map.addOverlays(Columbia);
centerByArray(Columbia, false, false);
cntMarker += Columbia.length;
map.addOverlays(Cumberland);
centerByArray(Cumberland, false, false);
cntMarker += Cumberland.length;
map.addOverlays(Eldersburg);
centerByArray(Eldersburg, false, false);
cntMarker += Eldersburg.length;
map.addOverlays(Ellicott_City);
centerByArray(Ellicott_City, false, false);
cntMarker += Ellicott_City.length;
map.addOverlays(Gaithersburg);
centerByArray(Gaithersburg, false, false);
cntMarker += Gaithersburg.length;
map.addOverlays(Gambrills);
centerByArray(Gambrills, false, false);
cntMarker += Gambrills.length;
map.addOverlays(Gwynn_Oak);
centerByArray(Gwynn_Oak, false, false);
cntMarker += Gwynn_Oak.length;
map.addOverlays(Hagerstown);
centerByArray(Hagerstown, false, false);
cntMarker += Hagerstown.length;
map.addOverlays(Hyattsville);
centerByArray(Hyattsville, false, false);
cntMarker += Hyattsville.length;
map.addOverlays(Laurel);
centerByArray(Laurel, false, false);
cntMarker += Laurel.length;
map.addOverlays(Linthicum);
centerByArray(Linthicum, false, false);
cntMarker += Linthicum.length;
map.addOverlays(Middletown);
centerByArray(Middletown, false, false);
cntMarker += Middletown.length;
map.addOverlays(Owings_Mills);
centerByArray(Owings_Mills, false, false);
cntMarker += Owings_Mills.length;
map.addOverlays(Oxon_Hill);
centerByArray(Oxon_Hill, false, false);
cntMarker += Oxon_Hill.length;
map.addOverlays(Pasadena);
centerByArray(Pasadena, false, false);
cntMarker += Pasadena.length;
map.addOverlays(Potomac);
centerByArray(Potomac, false, false);
cntMarker += Potomac.length;
map.addOverlays(Rockville);
centerByArray(Rockville, false, false);
cntMarker += Rockville.length;
map.addOverlays(Silver_Spring);
centerByArray(Silver_Spring, false, false);
cntMarker += Silver_Spring.length;
map.addOverlays(Takoma_Park);
centerByArray(Takoma_Park, false, false);
cntMarker += Takoma_Park.length;
map.addOverlays(Towson);
centerByArray(Towson, false, false);
cntMarker += Towson.length;
map.addOverlays(Waldorf);
centerByArray(Waldorf, false, false);
cntMarker += Waldorf.length;
centerByArray(Baltimore,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///12644,12644,12067,12149,12039,12182,12222,12259,12311,12323,35413,12836,12776,12073,12303,12370,12301,12685,12044,12239,35071,35072,35070,12569,12185,12330,35417,12758,12327,12704,35659,32478,12468,12040,12215,12409,12411,12617,12042,12168,12241,12285,12291,12870,12652,12653,12548,12809,12867,12415,/all');
//window.open('/map.php?type=2&schools=12644,12644,12067,12149,12039,12182,12222,12259,12311,12323,35413,12836,12776,12073,12303,12370,12301,12685,12044,12239,35071,35072,35070,12569,12185,12330,35417,12758,12327,12704,35659,32478,12468,12040,12215,12409,12411,12617,12042,12168,12241,12285,12291,12870,12652,12653,12548,12809,12867,12415,&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;
}