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(-73.408248,42.115787),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Berkshire School",'coEd=' + coEd.length);
girls[girls.length] = createMarker(new GPoint(-79.409323,43.689616),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("The Bishop Strachan School",'girls=' + girls.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.20654,43.581712),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Brewster Academy",'coEd=' + coEd.length);
boys[boys.length] = createMarker(new GPoint(-70.704079,44.05502),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Bridgton Academy",'boys=' + boys.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);
boys[boys.length] = createMarker(new GPoint(-72.036496,43.676448),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Cardigan Mountain School",'boys=' + boys.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(-83.245219,42.58384),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Cranbrook Schools",'coEd=' + coEd.length);
coEd[coEd.length] = createMarker(new GPoint(-86.407273,41.222456),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Culver Academies",'coEd=' + coEd.length);
coEd[coEd.length] = createMarker(new GPoint(-71.908354,42.6358),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Cushing 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(-71.532888,42.305315),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Fay School",'coEd=' + coEd.length);
coEd[coEd.length] = createMarker(new GPoint(-73.193369,41.746775),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("The Forman School",'coEd=' + coEd.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);
coEd[coEd.length] = createMarker(new GPoint(-70.976421,44.019861),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Fryeburg Academy",'coEd=' + coEd.length);
boys[boys.length] = createMarker(new GPoint(-77.107054,39.034361),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Georgetown Preparatory School",'boys=' + boys.length);
coEd[coEd.length] = createMarker(new GPoint(-70.895894,42.750704),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("The Governor's Academy <br> (formerly Governor Dummer Academy)",'coEd=' + coEd.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(-73.310565,41.629329),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("The Gunnery",'coEd=' + coEd.length);
coEd[coEd.length] = createMarker(new GPoint(-70.407614,44.19822),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Hebron Academy",'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);
boys[boys.length] = createMarker(new GPoint(-71.604902,42.350966),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Hillside School",'boys=' + boys.length);
coEd[coEd.length] = createMarker(new GPoint(-71.688166,43.757797),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Holderness School",'coEd=' + coEd.length);
coEd[coEd.length] = createMarker(new GPoint(-73.328892,42.862203),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Hoosac 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(-74.68237,40.337961),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("The Hun School of Princeton",'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(-70.027169,44.40958),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Kents Hill School",'coEd=' + coEd.length);
coEd[coEd.length] = createMarker(new GPoint(-72.267903,43.535228),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Kimball Union Academy",'coEd=' + coEd.length);
boys[boys.length] = createMarker(new GPoint(-79.456709,40.488088),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("The Kiski School",'boys=' + boys.length);
coEd[coEd.length] = createMarker(new GPoint(-87.890068,42.248175),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Lake Forest Academy",'coEd=' + coEd.length);
coEd[coEd.length] = createMarker(new GPoint(-71.571599,42.608505),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Lawrence Academy",'coEd=' + coEd.length);
coEd[coEd.length] = createMarker(new GPoint(7.008235,46.341739),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Leysin American School in Switzerland (LAS)",'coEd=' + coEd.length);
boys[boys.length] = createMarker(new GPoint(-72.45345,42.649822),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Linden Hill School",'boys=' + boys.length);
coEd[coEd.length] = createMarker(new GPoint(-80.694328,40.075265),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("The Linsly School",'coEd=' + coEd.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);
}
}