function addStateMarkers()
{
mySelect = document.getElementById('selection');
girls[girls.length] = createMarker(new GPoint(-122.458797,47.268113),"
",iconRd);
mySelect.options[mySelect.options.length] = new Option("Annie Wright School",'girls=' + girls.length);
coEd[coEd.length] = createMarker(new GPoint(-85.332423,35.085592),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Baylor 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(-81.627032,30.243634),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("The Bolles School",'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);
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(-72.807511,41.45667),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Choate Rosemary Hall",'coEd=' + coEd.length);
boys[boys.length] = createMarker(new GPoint(-76.546749,37.609504),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Christchurch School",'boys=' + boys.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(-85.18276,34.224318),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Darlington School",'coEd=' + coEd.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(-72.069609,42.90525),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Dublin School",'coEd=' + coEd.length);
girls[girls.length] = createMarker(new GPoint(-73.665465,42.711862),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Emma Willard School",'girls=' + girls.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);
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(-73.310565,41.629329),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("The Gunnery",'coEd=' + coEd.length);
girls[girls.length] = createMarker(new GPoint(-96.829562,32.907256),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("The Hockaday School",'girls=' + girls.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(-69.820655,43.906893),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Hyde-Bath",'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(-73.187752,40.915613),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("The Knox School",'coEd=' + coEd.length);
boys[boys.length] = createMarker(new GPoint(-85.273401,35.030406),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("McCallie School",'boys=' + boys.length);
coEd[coEd.length] = createMarker(new GPoint(-71.371622,42.493361),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Middlesex School",'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(-72.488606,42.673004),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Northfield Mount Hermon School",'coEd=' + coEd.length);
coEd[coEd.length] = createMarker(new GPoint(-73.983217,44.27901),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Northwood School",'coEd=' + coEd.length);
coEd[coEd.length] = createMarker(new GPoint(-74.539664,40.276315),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Peddie School",'coEd=' + coEd.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(-72.540423,42.97163),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("The Putney 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(-83.832271,34.336459),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Riverside Military Academy",'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);
girls[girls.length] = createMarker(new GPoint(-76.899868,37.905395),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("St. Margaret's School",'girls=' + girls.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);
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);
}
}