function addStateMarkers()
{
mySelect = document.getElementById('selection');
boys[boys.length] = createMarker(new GPoint(-72.836502,41.781261),"
",iconBl);
mySelect.options[mySelect.options.length] = new Option("Avon Old Farms School",'boys=' + boys.length);
coEd[coEd.length] = createMarker(new GPoint(-72.603726,42.548158),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Bement School",'coEd=' + coEd.length);
coEd[coEd.length] = createMarker(new GPoint(-73.408248,42.115787),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Berkshire School",'coEd=' + coEd.length);
coEd[coEd.length] = createMarker(new GPoint(-74.96288,40.983113),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Blair Academy",'coEd=' + coEd.length);
coEd[coEd.length] = createMarker(new GPoint(-123.558769,48.668178),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Brentwood College School",'coEd=' + coEd.length);
coEd[coEd.length] = createMarker(new GPoint(-71.08288,42.707418),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Brooks School",'coEd=' + coEd.length);
coEd[coEd.length] = createMarker(new GPoint(-73.412634,41.585649),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Canterbury School",'coEd=' + coEd.length);
coEd[coEd.length] = createMarker(new GPoint(-119.5033,34.389796),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Cate School",'coEd=' + coEd.length);
coEd[coEd.length] = createMarker(new GPoint(-72.807511,41.45667),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Choate Rosemary Hall",'coEd=' + coEd.length);
coEd[coEd.length] = createMarker(new GPoint(-71.354201,42.459272),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Concord Academy",'coEd=' + coEd.length);
girls[girls.length] = createMarker(new GPoint(-71.287817,42.291943),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Dana Hall School",'girls=' + girls.length);
coEd[coEd.length] = createMarker(new GPoint(-72.601999,42.54247),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Deerfield Academy",'coEd=' + coEd.length);
coEd[coEd.length] = createMarker(new GPoint(-77.088839,38.82517),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Episcopal High School",'coEd=' + coEd.length);
girls[girls.length] = createMarker(new GPoint(-72.835373,41.849302),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("The Ethel Walker School",'girls=' + girls.length);
coEd[coEd.length] = createMarker(new GPoint(-104.715236,38.739758),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Fountain Valley School of Colorado",'coEd=' + coEd.length);
boys[boys.length] = createMarker(new GPoint(-78.583241,42.708586),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("The Gow School",'boys=' + boys.length);
coEd[coEd.length] = createMarker(new GPoint(-71.582122,42.593804),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Groton School",'coEd=' + coEd.length);
coEd[coEd.length] = createMarker(new GPoint(-75.636972,40.244114),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Hill School",'coEd=' + coEd.length);
coEd[coEd.length] = createMarker(new GPoint(-73.440469,41.96427),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("The Hotchkiss School",'coEd=' + coEd.length);
coEd[coEd.length] = createMarker(new GPoint(-73.502981,41.778838),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Kent School",'coEd=' + coEd.length);
coEd[coEd.length] = createMarker(new GPoint(-72.644174,41.85076),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("The Loomis Chaffee School",'coEd=' + coEd.length);
girls[girls.length] = createMarker(new GPoint(-77.232151,38.964335),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("The Madeira School",'girls=' + girls.length);
coEd[coEd.length] = createMarker(new GPoint(-77.899955,39.828176),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Mercersburg Academy",'coEd=' + coEd.length);
coEd[coEd.length] = createMarker(new GPoint(-71.371622,42.493361),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Middlesex School",'coEd=' + coEd.length);
coEd[coEd.length] = createMarker(new GPoint(-73.616262,41.845257),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Millbrook School",'coEd=' + coEd.length);
coEd[coEd.length] = createMarker(new GPoint(-71.07054,42.25648),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Milton Academy",'coEd=' + coEd.length);
girls[girls.length] = createMarker(new GPoint(-72.829305,41.722305),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Miss Porter's School",'girls=' + girls.length);
coEd[coEd.length] = createMarker(new GPoint(-71.134868,42.648486),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Phillips Academy Andover",'coEd=' + coEd.length);
coEd[coEd.length] = createMarker(new GPoint(-70.952346,42.981339),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Phillips Exeter Academy",'coEd=' + coEd.length);
coEd[coEd.length] = createMarker(new GPoint(-71.960109,41.897689),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Pomfret School",'coEd=' + coEd.length);
coEd[coEd.length] = createMarker(new GPoint(-71.253192,41.588797),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Portsmouth Abbey School",'coEd=' + coEd.length);
coEd[coEd.length] = createMarker(new GPoint(-79.248669,43.156335),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Ridley College",'coEd=' + coEd.length);
boys[boys.length] = createMarker(new GPoint(-79.471016,44.013292),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("St. Andrew's College",'boys=' + boys.length);
coEd[coEd.length] = createMarker(new GPoint(-75.697925,39.473931),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Andrew's School, DE",'coEd=' + coEd.length);
coEd[coEd.length] = createMarker(new GPoint(-78.512647,38.043096),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Anne's-Belfield School",'coEd=' + coEd.length);
coEd[coEd.length] = createMarker(new GPoint(-71.311849,41.49655),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. George's School",'coEd=' + coEd.length);
coEd[coEd.length] = createMarker(new GPoint(-71.531945,42.305764),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Mark's School",'coEd=' + coEd.length);
coEd[coEd.length] = createMarker(new GPoint(-71.567187,43.197562),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St. Paul's School",'coEd=' + coEd.length);
girls[girls.length] = createMarker(new GPoint(-76.685687,39.40758),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("St. Timothy's School",'girls=' + girls.length);
boys[boys.length] = createMarker(new GPoint(-73.392929,42.000938),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Salisbury School",'boys=' + boys.length);
var markers = coEd.concat(boys);
markers = girls.concat(markers);
var bounds = arrayBounds(markers);
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 = myMap.getBoundsZoomLevel(bounds);
myMap.setCenter(center,zoom);
myMap.addOverlays(coEd);
myMap.addOverlays(boys);
myMap.addOverlays(girls);
} // End addStateMarkers JavaScript Function
function createMarker(point, label, icon)
{
var marker = new GMarker(point, icon);
var html = label;
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(html);
});
return marker;
}
function selectChange(selection)
{
var myVal = selection.options[selection.selectedIndex].value;
if (myVal.indexOf('boys') != -1 && myVal.indexOf('all') == -1)
{
var temp = myVal.split('=');
var myIndex = parseInt(temp[1]) - 1;
myMap.removeOverlay(boys[myIndex]);
myMap.addOverlay(boys[myIndex]);
GEvent.trigger(boys[myIndex],'click');
}
if (myVal.indexOf('coEd') != -1 && myVal.indexOf('all') == -1)
{
var temp = myVal.split('=');
var myIndex = parseInt(temp[1]) - 1;
myMap.removeOverlay(coEd[myIndex]);
myMap.addOverlay(coEd[myIndex]);
GEvent.trigger(coEd[myIndex],'click');
}
if (myVal.indexOf('girls') != -1 && myVal.indexOf('all') == -1)
{
var temp = myVal.split('=');
var myIndex = parseInt(temp[1]) - 1;
myMap.removeOverlay(girls[myIndex]);
myMap.addOverlay(girls[myIndex]);
GEvent.trigger(girls[myIndex],'click');
}
if (myVal.indexOf('all') != -1 && myVal != 'all')
{
var temp = myVal.split('=');
var showArray = temp[1];
myMap.clearOverlays()
myMap.addOverlays(eval(showArray));
}
if (myVal == 'all')
{
myMap.clearOverlays()
myMap.addOverlays(coEd);
myMap.addOverlays(boys);
myMap.addOverlays(girls);
}
}