function addMarkers()
{
mySelect = document.getElementById('selection');
Hamilton = [];West_Chester = [];Middletown = [];Trenton = [];Liberty_Twp = [];Fairfield = [];Monroe = [];Liberty_Township = [];Oxford = [];Seven_Mile = [];Cincinnati = [];mySelect.options[mySelect.options.length] = new Option("Cincinnati schools",'all=Cincinnati');
mySelect.options[mySelect.options.length] = new Option("Fairfield schools",'all=Fairfield');
mySelect.options[mySelect.options.length] = new Option("Hamilton schools",'all=Hamilton');
mySelect.options[mySelect.options.length] = new Option("Liberty Township schools",'all=Liberty_Township');
mySelect.options[mySelect.options.length] = new Option("Liberty Twp schools",'all=Liberty_Twp');
mySelect.options[mySelect.options.length] = new Option("Middletown schools",'all=Middletown');
mySelect.options[mySelect.options.length] = new Option("Monroe schools",'all=Monroe');
mySelect.options[mySelect.options.length] = new Option("Oxford schools",'all=Oxford');
mySelect.options[mySelect.options.length] = new Option("Seven Mile schools",'all=Seven_Mile');
mySelect.options[mySelect.options.length] = new Option("Trenton schools",'all=Trenton');
mySelect.options[mySelect.options.length] = new Option("West Chester schools",'all=West_Chester');
mySelect.options[mySelect.options.length] = new Option("---------------------------",'');
Hamilton[Hamilton.length] = createMarker(new GPoint(-84.57684326,39.40135574),"
",iconRd);
mySelect.options[mySelect.options.length] = new Option("Adams Elementary School",'Hamilton=' + Hamilton.length);
West_Chester[West_Chester.length] = createMarker(new GPoint(-84.38690948,39.31585312),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Adena Elementary School",'West_Chester=' + West_Chester.length);
Middletown[Middletown.length] = createMarker(new GPoint(-84.40929413,39.48031235),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Amanda Elementary School",'Middletown=' + Middletown.length);
Trenton[Trenton.length] = createMarker(new GPoint(-84.45689392,39.47271729),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Babeck Elementary School",'Trenton=' + Trenton.length);
Trenton[Trenton.length] = createMarker(new GPoint(-84.45851898,39.48474121),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Bloomfield Elementary School",'Trenton=' + Trenton.length);
Hamilton[Hamilton.length] = createMarker(new GPoint(-84.54588318,39.39089203),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Buchanan Elementary School",'Hamilton=' + Hamilton.length);
Hamilton[Hamilton.length] = createMarker(new GPoint(-84.56166077,39.40327835),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Butler County Program Of Pn",'Hamilton=' + Hamilton.length);
Middletown[Middletown.length] = createMarker(new GPoint(-84.39848328,39.51340866),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Central Academy Nongraded Elementary School",'Middletown=' + Middletown.length);
Liberty_Twp[Liberty_Twp.length] = createMarker(new GPoint(-84.43846893,39.41735077),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Cherokee Elementary School",'Liberty_Twp=' + Liberty_Twp.length);
Hamilton[Hamilton.length] = createMarker(new GPoint(-84.60665131,39.41855621),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Cleveland Elementary School",'Hamilton=' + Hamilton.length);
Middletown[Middletown.length] = createMarker(new GPoint(-84.34380341,39.50722885),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Creekview Elementary School",'Middletown=' + Middletown.length);
Hamilton[Hamilton.length] = createMarker(new GPoint(-84.49358368,39.41077805),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("D Russel Lee Career-technology Center",'Hamilton=' + Hamilton.length);
West_Chester[West_Chester.length] = createMarker(new GPoint(-84.44830322,39.36147308),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Early Childhood Center Elementary School",'West_Chester=' + West_Chester.length);
Trenton[Trenton.length] = createMarker(new GPoint(-84.44355774,39.48153687),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Edgewood High School",'Trenton=' + Trenton.length);
Hamilton[Hamilton.length] = createMarker(new GPoint(-84.48953247,39.47829819),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Edgewood Middle School",'Hamilton=' + Hamilton.length);
Hamilton[Hamilton.length] = createMarker(new GPoint(-84.64192963,39.31941223),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Elda Elementary School",'Hamilton=' + Hamilton.length);
Fairfield[Fairfield.length] = createMarker(new GPoint(-84.53498840,39.34053802),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Fairfield Central Elementary School",'Fairfield=' + Fairfield.length);
Hamilton[Hamilton.length] = createMarker(new GPoint(-84.49642181,39.38716888),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Fairfield East Elementary School",'Hamilton=' + Hamilton.length);
Fairfield[Fairfield.length] = createMarker(new GPoint(-84.53513336,39.34069061),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Fairfield Freshman High School",'Fairfield=' + Fairfield.length);
Fairfield[Fairfield.length] = createMarker(new GPoint(-84.51445770,39.33760834),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Fairfield High School",'Fairfield=' + Fairfield.length);
Fairfield[Fairfield.length] = createMarker(new GPoint(-84.52987671,39.34219742),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Fairfield Intermediate Elementary School",'Fairfield=' + Fairfield.length);
Fairfield[Fairfield.length] = createMarker(new GPoint(-84.54181671,39.33660126),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Fairfield Middle School",'Fairfield=' + Fairfield.length);
Hamilton[Hamilton.length] = createMarker(new GPoint(-84.49455261,39.40324783),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Fairfield North Elementary School",'Hamilton=' + Hamilton.length);
Fairfield[Fairfield.length] = createMarker(new GPoint(-84.55442047,39.33012009),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Fairfield South Elementary School",'Fairfield=' + Fairfield.length);
Fairfield[Fairfield.length] = createMarker(new GPoint(-84.56753540,39.34845352),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Fairfield West Elementary School",'Fairfield=' + Fairfield.length);
Hamilton[Hamilton.length] = createMarker(new GPoint(-84.58386993,39.41532898),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Fillmore Elementary School",'Hamilton=' + Hamilton.length);
West_Chester[West_Chester.length] = createMarker(new GPoint(-84.42359924,39.34436035),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Freedom Elementary School",'West_Chester=' + West_Chester.length);
Middletown[Middletown.length] = createMarker(new GPoint(-84.39846802,39.49644852),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Garfield Alt Education Center",'Middletown=' + Middletown.length);
Hamilton[Hamilton.length] = createMarker(new GPoint(-84.54214478,39.39565659),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Garfield Junior High School",'Hamilton=' + Hamilton.length);
Hamilton[Hamilton.length] = createMarker(new GPoint(-84.55536300,39.35452600),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("George Washington Education Center",'Hamilton=' + Hamilton.length);
Hamilton[Hamilton.length] = createMarker(new GPoint(-84.53310394,39.40602875),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Grant Elementary School",'Hamilton=' + Hamilton.length);
Monroe[Monroe.length] = createMarker(new GPoint(-84.36751100,39.44376200),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Greentree Health Science Academy",'Monroe=' + Monroe.length);
Hamilton[Hamilton.length] = createMarker(new GPoint(-84.60285950,39.42306137),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Hamilton Freshman High School",'Hamilton=' + Hamilton.length);
Hamilton[Hamilton.length] = createMarker(new GPoint(-84.57724762,39.42475510),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Hamilton High School",'Hamilton=' + Hamilton.length);
Hamilton[Hamilton.length] = createMarker(new GPoint(-84.56405640,39.38710403),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Harrison Elementary School",'Hamilton=' + Hamilton.length);
Hamilton[Hamilton.length] = createMarker(new GPoint(-84.55374146,39.35625458),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hayes Elementary School",'Hamilton=' + Hamilton.length);
Liberty_Twp[Liberty_Twp.length] = createMarker(new GPoint(-84.45178986,39.37370682),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Heritage Elementary School",'Liberty_Twp=' + Liberty_Twp.length);
West_Chester[West_Chester.length] = createMarker(new GPoint(-84.36595154,39.34053421),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hopewell Elementary School",'West_Chester=' + West_Chester.length);
West_Chester[West_Chester.length] = createMarker(new GPoint(-84.36571503,39.34291077),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Hopewell Junior School",'West_Chester=' + West_Chester.length);
Liberty_Township[Liberty_Township.length] = createMarker(new GPoint(-84.37303925,39.39169693),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Independence Elementary School",'Liberty_Township=' + Liberty_Township.length);
Hamilton[Hamilton.length] = createMarker(new GPoint(-84.55537415,39.39331055),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Jefferson Elementary School",'Hamilton=' + Hamilton.length);
Middletown[Middletown.length] = createMarker(new GPoint(-84.39044189,39.52215576),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Jefferson Elementary School",'Middletown=' + Middletown.length);
Fairfield[Fairfield.length] = createMarker(new GPoint(-84.54010773,39.35024643),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Kindergarten Center Elementary School",'Fairfield=' + Fairfield.length);
Oxford[Oxford.length] = createMarker(new GPoint(-84.74810028,39.51533890),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Kramer Elementary School",'Oxford=' + Oxford.length);
Liberty_Township[Liberty_Township.length] = createMarker(new GPoint(-84.37278748,39.38065338),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Lakota East High School",'Liberty_Township=' + Liberty_Township.length);
West_Chester[West_Chester.length] = createMarker(new GPoint(-84.45018005,39.36167145),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Lakota Freshman School",'West_Chester=' + West_Chester.length);
Liberty_Township[Liberty_Township.length] = createMarker(new GPoint(-84.43681335,39.38753128),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Lakota Plains Junior School",'Liberty_Township=' + Liberty_Township.length);
West_Chester[West_Chester.length] = createMarker(new GPoint(-84.41815186,39.34441376),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Lakota Ridge Junior School",'West_Chester=' + West_Chester.length);
West_Chester[West_Chester.length] = createMarker(new GPoint(-84.43490601,39.33147049),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Lakota West High School",'West_Chester=' + West_Chester.length);
Monroe[Monroe.length] = createMarker(new GPoint(-84.36347961,39.44216537),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Lemon-monroe High School",'Monroe=' + Monroe.length);
Liberty_Twp[Liberty_Twp.length] = createMarker(new GPoint(-84.41933441,39.38683701),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Liberty Elementary School",'Liberty_Twp=' + Liberty_Twp.length);
Liberty_Township[Liberty_Township.length] = createMarker(new GPoint(-84.39271545,39.37744904),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Liberty Junior School",'Liberty_Township=' + Liberty_Township.length);
Middletown[Middletown.length] = createMarker(new GPoint(-84.35498047,39.50420761),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Life Skills Center-middletown High School",'Middletown=' + Middletown.length);
Hamilton[Hamilton.length] = createMarker(new GPoint(-84.56934357,39.41265488),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lincoln Elementary School",'Hamilton=' + Hamilton.length);
Hamilton[Hamilton.length] = createMarker(new GPoint(-84.55049133,39.39986801),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Madison Elementary School",'Hamilton=' + Hamilton.length);
Middletown[Middletown.length] = createMarker(new GPoint(-84.44659424,39.53072357),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Madison Intermediate School",'Middletown=' + Middletown.length);
Middletown[Middletown.length] = createMarker(new GPoint(-84.44032288,39.53430557),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Madison Jr/sr High School",'Middletown=' + Middletown.length);
Middletown[Middletown.length] = createMarker(new GPoint(-84.44683838,39.53078079),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Madison Primary Elementary School",'Middletown=' + Middletown.length);
Oxford[Oxford.length] = createMarker(new GPoint(-84.70266724,39.46959686),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Maude Marshall Elementary School",'Oxford=' + Oxford.length);
Middletown[Middletown.length] = createMarker(new GPoint(-84.37190247,39.49533463),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mayfield Elementary School",'Middletown=' + Middletown.length);
Middletown[Middletown.length] = createMarker(new GPoint(-84.40959930,39.50427246),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Mckinley Elementary School",'Middletown=' + Middletown.length);
Hamilton[Hamilton.length] = createMarker(new GPoint(-84.59458160,39.40782547),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mckinley Elementary School",'Hamilton=' + Hamilton.length);
Middletown[Middletown.length] = createMarker(new GPoint(-84.40505981,39.51705551),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Middletown Fitness & Prep Academy",'Middletown=' + Middletown.length);
Middletown[Middletown.length] = createMarker(new GPoint(-84.37058258,39.53160095),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Middletown High School",'Middletown=' + Middletown.length);
Hamilton[Hamilton.length] = createMarker(new GPoint(-84.58153534,39.38825607),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Monroe Elementary School",'Hamilton=' + Hamilton.length);
Monroe[Monroe.length] = createMarker(new GPoint(-84.36756134,39.44362259),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Monroe Elementary School",'Monroe=' + Monroe.length);
Monroe[Monroe.length] = createMarker(new GPoint(-84.36347961,39.44216537),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Monroe Junior High School",'Monroe=' + Monroe.length);
Hamilton[Hamilton.length] = createMarker(new GPoint(-84.74028778,39.33622360),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Morgan Elementary School",'Hamilton=' + Hamilton.length);
Hamilton[Hamilton.length] = createMarker(new GPoint(-84.53845978,39.43859100),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("New Miami Elementary School",'Hamilton=' + Hamilton.length);
Hamilton[Hamilton.length] = createMarker(new GPoint(-84.53865814,39.43834686),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("New Miami Jr/sr High School",'Hamilton=' + Hamilton.length);
Middletown[Middletown.length] = createMarker(new GPoint(-84.38040161,39.46549988),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Oneida Elementary School",'Middletown=' + Middletown.length);
Hamilton[Hamilton.length] = createMarker(new GPoint(-84.56501300,39.39985000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Options Academy Arts",'Hamilton=' + Hamilton.length);
Hamilton[Hamilton.length] = createMarker(new GPoint(-84.56141100,39.40062300),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Options Business Academy",'Hamilton=' + Hamilton.length);
Hamilton[Hamilton.length] = createMarker(new GPoint(-84.56097412,39.36796951),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Pierce Elementary School",'Hamilton=' + Hamilton.length);
Hamilton[Hamilton.length] = createMarker(new GPoint(-84.18498230,39.76199722),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Richard Allen Academy Iii",'Hamilton=' + Hamilton.length);
Middletown[Middletown.length] = createMarker(new GPoint(-84.37963867,39.51215744),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Roosevelt Elementary School",'Middletown=' + Middletown.length);
Middletown[Middletown.length] = createMarker(new GPoint(-84.34613800,39.51475906),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Rosedale Elementary School",'Middletown=' + Middletown.length);
Hamilton[Hamilton.length] = createMarker(new GPoint(-84.63182831,39.33172226),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Ross High School",'Hamilton=' + Hamilton.length);
Hamilton[Hamilton.length] = createMarker(new GPoint(-84.63008118,39.33472443),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Ross Middle School",'Hamilton=' + Hamilton.length);
Seven_Mile[Seven_Mile.length] = createMarker(new GPoint(-84.55377197,39.47963715),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Seven Mile Elementary School",'Seven_Mile=' + Seven_Mile.length);
Cincinnati[Cincinnati.length] = createMarker(new GPoint(-84.37180328,39.31294250),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Shawnee Elementary School",'Cincinnati=' + Cincinnati.length);
Middletown[Middletown.length] = createMarker(new GPoint(-84.39969635,39.51175690),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Stephen Vail Middle School",'Middletown=' + Middletown.length);
Oxford[Oxford.length] = createMarker(new GPoint(-84.74552155,39.50704575),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Stewart Elementary School",'Oxford=' + Oxford.length);
Middletown[Middletown.length] = createMarker(new GPoint(-84.40359300,39.50989700),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Summit Academy Secondary School - Middletown",'Middletown=' + Middletown.length);
Middletown[Middletown.length] = createMarker(new GPoint(-84.34492493,39.51018524),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Summit Academy-middletown Elementary School",'Middletown=' + Middletown.length);
Middletown[Middletown.length] = createMarker(new GPoint(-84.40792084,39.50591660),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Taft Elementary School",'Middletown=' + Middletown.length);
Oxford[Oxford.length] = createMarker(new GPoint(-84.74440765,39.50046158),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Talawanda High School",'Oxford=' + Oxford.length);
Oxford[Oxford.length] = createMarker(new GPoint(-84.75920868,39.48806000),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Talawanda Middle School",'Oxford=' + Oxford.length);
West_Chester[West_Chester.length] = createMarker(new GPoint(-84.40399170,39.33403397),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Union Elementary School",'West_Chester=' + West_Chester.length);
Hamilton[Hamilton.length] = createMarker(new GPoint(-84.54020691,39.37929535),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Van Buren Elementary School",'Hamilton=' + Hamilton.length);
Liberty_Township[Liberty_Township.length] = createMarker(new GPoint(-84.42974854,39.39015579),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Vangorden Elementary School",'Liberty_Township=' + Liberty_Township.length);
Middletown[Middletown.length] = createMarker(new GPoint(-84.35219574,39.49475479),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Verity Middle School",'Middletown=' + Middletown.length);
Hamilton[Hamilton.length] = createMarker(new GPoint(-84.55564117,39.35456467),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Washington Junior High School",'Hamilton=' + Hamilton.length);
Middletown[Middletown.length] = createMarker(new GPoint(-84.36998749,39.52532196),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Wildwood Elementary School",'Middletown=' + Middletown.length);
Middletown[Middletown.length] = createMarker(new GPoint(-84.36491394,39.51051331),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Wilson Elementary School",'Middletown=' + Middletown.length);
Hamilton[Hamilton.length] = createMarker(new GPoint(-84.57441711,39.41643524),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Wilson Junior High School",'Hamilton=' + Hamilton.length);
Liberty_Township[Liberty_Township.length] = createMarker(new GPoint(-84.39443970,39.38045120),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Woodland Elementary School",'Liberty_Township=' + Liberty_Township.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(Cincinnati);
map.removeOverlays(Fairfield);
map.removeOverlays(Hamilton);
map.removeOverlays(Liberty_Township);
map.removeOverlays(Liberty_Twp);
map.removeOverlays(Middletown);
map.removeOverlays(Monroe);
map.removeOverlays(Oxford);
map.removeOverlays(Seven_Mile);
map.removeOverlays(Trenton);
map.removeOverlays(West_Chester);
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(Hamilton);map.removeOverlays(Cincinnati);
map.removeOverlays(Fairfield);
map.removeOverlays(Hamilton);
map.removeOverlays(Liberty_Township);
map.removeOverlays(Liberty_Twp);
map.removeOverlays(Middletown);
map.removeOverlays(Monroe);
map.removeOverlays(Oxford);
map.removeOverlays(Seven_Mile);
map.removeOverlays(Trenton);
map.removeOverlays(West_Chester);
map.addOverlays(Cincinnati);
centerByArray(Cincinnati, false, false);
cntMarker += Cincinnati.length;
map.addOverlays(Fairfield);
centerByArray(Fairfield, false, false);
cntMarker += Fairfield.length;
map.addOverlays(Hamilton);
centerByArray(Hamilton, false, false);
cntMarker += Hamilton.length;
map.addOverlays(Liberty_Township);
centerByArray(Liberty_Township, false, false);
cntMarker += Liberty_Township.length;
map.addOverlays(Liberty_Twp);
centerByArray(Liberty_Twp, false, false);
cntMarker += Liberty_Twp.length;
map.addOverlays(Middletown);
centerByArray(Middletown, false, false);
cntMarker += Middletown.length;
map.addOverlays(Monroe);
centerByArray(Monroe, false, false);
cntMarker += Monroe.length;
map.addOverlays(Oxford);
centerByArray(Oxford, false, false);
cntMarker += Oxford.length;
map.addOverlays(Seven_Mile);
centerByArray(Seven_Mile, false, false);
cntMarker += Seven_Mile.length;
map.addOverlays(Trenton);
centerByArray(Trenton, false, false);
cntMarker += Trenton.length;
map.addOverlays(West_Chester);
centerByArray(West_Chester, false, false);
cntMarker += West_Chester.length;
centerByArray(Hamilton,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');
}
}