function addMarkers()
{
mySelect = document.getElementById('selection');
Elgin = [];Algonquin = [];Batavia = [];Saint_Charles = [];St_Charles = [];Big_Rock = [];Aurora = [];Carpentersville = [];Burlington = [];South_Elgin = [];Geneva = [];West_Dundee = [];Dundee = [];North_Aurora = [];Maple_Park = [];Hampshire = [];Huntley = [];Elburn = [];Montgomery = [];Sugar_Grove = [];Sleepy_Hollow = [];Hoffman_Estates = [];Wasco = [];mySelect.options[mySelect.options.length] = new Option("Algonquin schools",'all=Algonquin');
mySelect.options[mySelect.options.length] = new Option("Aurora schools",'all=Aurora');
mySelect.options[mySelect.options.length] = new Option("Batavia schools",'all=Batavia');
mySelect.options[mySelect.options.length] = new Option("Big Rock schools",'all=Big_Rock');
mySelect.options[mySelect.options.length] = new Option("Burlington schools",'all=Burlington');
mySelect.options[mySelect.options.length] = new Option("Carpentersville schools",'all=Carpentersville');
mySelect.options[mySelect.options.length] = new Option("Dundee schools",'all=Dundee');
mySelect.options[mySelect.options.length] = new Option("Elburn schools",'all=Elburn');
mySelect.options[mySelect.options.length] = new Option("Elgin schools",'all=Elgin');
mySelect.options[mySelect.options.length] = new Option("Geneva schools",'all=Geneva');
mySelect.options[mySelect.options.length] = new Option("Hampshire schools",'all=Hampshire');
mySelect.options[mySelect.options.length] = new Option("Hoffman Estates schools",'all=Hoffman_Estates');
mySelect.options[mySelect.options.length] = new Option("Huntley schools",'all=Huntley');
mySelect.options[mySelect.options.length] = new Option("Maple Park schools",'all=Maple_Park');
mySelect.options[mySelect.options.length] = new Option("Montgomery schools",'all=Montgomery');
mySelect.options[mySelect.options.length] = new Option("North Aurora schools",'all=North_Aurora');
mySelect.options[mySelect.options.length] = new Option("Saint Charles schools",'all=Saint_Charles');
mySelect.options[mySelect.options.length] = new Option("Sleepy Hollow schools",'all=Sleepy_Hollow');
mySelect.options[mySelect.options.length] = new Option("South Elgin schools",'all=South_Elgin');
mySelect.options[mySelect.options.length] = new Option("St Charles schools",'all=St_Charles');
mySelect.options[mySelect.options.length] = new Option("Sugar Grove schools",'all=Sugar_Grove');
mySelect.options[mySelect.options.length] = new Option("Wasco schools",'all=Wasco');
mySelect.options[mySelect.options.length] = new Option("West Dundee schools",'all=West_Dundee');
mySelect.options[mySelect.options.length] = new Option("---------------------------",'');
Elgin[Elgin.length] = createMarker(new GPoint(-88.30220032,42.03316116),"
",iconBl);
mySelect.options[mySelect.options.length] = new Option("Abbott Middle School",'Elgin=' + Elgin.length);
Algonquin[Algonquin.length] = createMarker(new GPoint(-88.27188873,42.14996338),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Algonquin Lakes Elementary School",'Algonquin=' + Algonquin.length);
Batavia[Batavia.length] = createMarker(new GPoint(-88.32179260,41.83791351),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Alice Gustafson Elementary School",'Batavia=' + Batavia.length);
Saint_Charles[Saint_Charles.length] = createMarker(new GPoint(-88.30274200,41.96311188),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Anderson Elementary School",'Saint_Charles=' + Saint_Charles.length);
Batavia[Batavia.length] = createMarker(new GPoint(-88.32817841,41.84676361),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Batavia Senior High School",'Batavia=' + Batavia.length);
St_Charles[St_Charles.length] = createMarker(new GPoint(-88.38916779,41.93415070),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Bell-graham Elementary School",'St_Charles=' + St_Charles.length);
Big_Rock[Big_Rock.length] = createMarker(new GPoint(-88.54380035,41.75759888),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Big Rock Elementary School",'Big_Rock=' + Big_Rock.length);
Aurora[Aurora.length] = createMarker(new GPoint(-88.28820801,41.77743912),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("C F Simmons Middle School",'Aurora=' + Aurora.length);
Aurora[Aurora.length] = createMarker(new GPoint(-88.26995087,41.76401138),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("C I Johnson Elementary School",'Aurora=' + Aurora.length);
Aurora[Aurora.length] = createMarker(new GPoint(-88.32003784,41.74542236),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("C M Bardwell Elementary School",'Aurora=' + Aurora.length);
Carpentersville[Carpentersville.length] = createMarker(new GPoint(-88.28157806,42.10880661),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Carpentersville Middle School",'Carpentersville=' + Carpentersville.length);
Burlington[Burlington.length] = createMarker(new GPoint(-88.54740143,42.05130005),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Central High School",'Burlington=' + Burlington.length);
Burlington[Burlington.length] = createMarker(new GPoint(-88.54740143,42.05130005),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Central Middle School",'Burlington=' + Burlington.length);
Elgin[Elgin.length] = createMarker(new GPoint(-88.27780914,42.03706360),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Central School Program",'Elgin=' + Elgin.length);
Elgin[Elgin.length] = createMarker(new GPoint(-88.31118011,42.06424332),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Century Oaks Elementary School",'Elgin=' + Elgin.length);
Elgin[Elgin.length] = createMarker(new GPoint(-88.27351379,42.03599548),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Channing Memorial Elementary School",'Elgin=' + Elgin.length);
South_Elgin[South_Elgin.length] = createMarker(new GPoint(-88.28443909,41.99533844),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Clinton Elementary School",'South_Elgin=' + South_Elgin.length);
Elgin[Elgin.length] = createMarker(new GPoint(-88.26639557,42.05991364),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Coleman Elementary School",'Elgin=' + Elgin.length);
South_Elgin[South_Elgin.length] = createMarker(new GPoint(-88.27462006,42.01393890),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Corron Elementary School",'South_Elgin=' + South_Elgin.length);
Geneva[Geneva.length] = createMarker(new GPoint(-88.31789398,41.89093781),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Coultrap Elementary School",'Geneva=' + Geneva.length);
Elgin[Elgin.length] = createMarker(new GPoint(-88.32483673,42.04851151),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Creekside Elementary School",'Elgin=' + Elgin.length);
St_Charles[St_Charles.length] = createMarker(new GPoint(-88.32008362,41.90288162),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Davis Elementary School",'St_Charles=' + St_Charles.length);
Carpentersville[Carpentersville.length] = createMarker(new GPoint(-88.26483917,42.13203430),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Delacey Family Educ Center",'Carpentersville=' + Carpentersville.length);
Geneva[Geneva.length] = createMarker(new GPoint(-88.30844879,41.89051437),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("District Special Services Office Elementary School",'Geneva=' + Geneva.length);
West_Dundee[West_Dundee.length] = createMarker(new GPoint(-88.28231049,42.09492493),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Dundee Highlands Elementary School",'West_Dundee=' + West_Dundee.length);
Dundee[Dundee.length] = createMarker(new GPoint(-88.33347321,42.10353851),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Dundee Middle School",'Dundee=' + Dundee.length);
Carpentersville[Carpentersville.length] = createMarker(new GPoint(-88.25753784,42.12088013),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Dundee-crown High School",'Carpentersville=' + Carpentersville.length);
Aurora[Aurora.length] = createMarker(new GPoint(-88.31721800,41.78191000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Early Childhood Dev Cntr",'Aurora=' + Aurora.length);
Aurora[Aurora.length] = createMarker(new GPoint(-88.29800415,41.74577332),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("East High School",'Aurora=' + Aurora.length);
Aurora[Aurora.length] = createMarker(new GPoint(-88.29189301,41.75671768),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Edna Rollins Elementary School",'Aurora=' + Aurora.length);
Elgin[Elgin.length] = createMarker(new GPoint(-88.26781464,42.03325272),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Ellis Middle School",'Elgin=' + Elgin.length);
North_Aurora[North_Aurora.length] = createMarker(new GPoint(-88.36174011,41.81286240),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Fearn Elementary School",'North_Aurora=' + North_Aurora.length);
St_Charles[St_Charles.length] = createMarker(new GPoint(-88.36128235,41.95577621),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Ferson Creek School",'St_Charles=' + St_Charles.length);
South_Elgin[South_Elgin.length] = createMarker(new GPoint(-88.31864929,42.00326920),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Fox Meadow Elementary School",'South_Elgin=' + South_Elgin.length);
St_Charles[St_Charles.length] = createMarker(new GPoint(-88.28149414,41.90756226),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Fox Ridge School",'St_Charles=' + St_Charles.length);
Maple_Park[Maple_Park.length] = createMarker(new GPoint(-88.52819061,41.88042831),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Fox Valley Career Center",'Maple_Park=' + Maple_Park.length);
Aurora[Aurora.length] = createMarker(new GPoint(-88.34978485,41.75888824),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Freeman Elementary School",'Aurora=' + Aurora.length);
Aurora[Aurora.length] = createMarker(new GPoint(-88.31068420,41.73384857),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("G N Dieterich Elementary School",'Aurora=' + Aurora.length);
Elgin[Elgin.length] = createMarker(new GPoint(-88.27037811,42.02466583),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Garfield Elementary School",'Elgin=' + Elgin.length);
Geneva[Geneva.length] = createMarker(new GPoint(-88.31646729,41.89307404),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Geneva Community High School",'Geneva=' + Geneva.length);
Geneva[Geneva.length] = createMarker(new GPoint(-88.35231018,41.86548233),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Geneva Middle School",'Geneva=' + Geneva.length);
Elgin[Elgin.length] = createMarker(new GPoint(-88.27606201,42.03648758),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Gifford Street High School",'Elgin=' + Elgin.length);
Carpentersville[Carpentersville.length] = createMarker(new GPoint(-88.24884033,42.11060333),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Golfview Elementary School",'Carpentersville=' + Carpentersville.length);
North_Aurora[North_Aurora.length] = createMarker(new GPoint(-88.34121704,41.80545425),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Goodwin Elementary School",'North_Aurora=' + North_Aurora.length);
Batavia[Batavia.length] = createMarker(new GPoint(-88.35607910,41.84474945),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Grace Mcwayne Elementary School",'Batavia=' + Batavia.length);
Aurora[Aurora.length] = createMarker(new GPoint(-88.33354187,41.76190567),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Greenman Elementary School",'Aurora=' + Aurora.length);
Batavia[Batavia.length] = createMarker(new GPoint(-88.32159424,41.85404968),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("H C Storm Elementary School",'Batavia=' + Batavia.length);
St_Charles[St_Charles.length] = createMarker(new GPoint(-88.32407379,41.90986252),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Haines Middle School",'St_Charles=' + St_Charles.length);
Aurora[Aurora.length] = createMarker(new GPoint(-88.36337280,41.77343750),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hall Elementary School",'Aurora=' + Aurora.length);
Hampshire[Hampshire.length] = createMarker(new GPoint(-88.53527069,42.09555054),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hampshire Elementary School",'Hampshire=' + Hampshire.length);
Hampshire[Hampshire.length] = createMarker(new GPoint(-88.53028107,42.09344101),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Hampshire High School",'Hampshire=' + Hampshire.length);
Hampshire[Hampshire.length] = createMarker(new GPoint(-88.53028107,42.09344101),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Hampshire Middle School",'Hampshire=' + Hampshire.length);
Elgin[Elgin.length] = createMarker(new GPoint(-88.30948639,42.02801895),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Harriet Gifford Elementary School",'Elgin=' + Elgin.length);
Geneva[Geneva.length] = createMarker(new GPoint(-82.46166992,28.19346237),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Harrison Street Elementary School",'Geneva=' + Geneva.length);
Geneva[Geneva.length] = createMarker(new GPoint(-88.35248566,41.88806152),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Heartland Elementary School",'Geneva=' + Geneva.length);
Aurora[Aurora.length] = createMarker(new GPoint(-88.28141785,41.76378250),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Henry W Cowherd Middle School",'Aurora=' + Aurora.length);
Aurora[Aurora.length] = createMarker(new GPoint(-88.37987200,41.79458900),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Herget Middle School",'Aurora=' + Aurora.length);
Elgin[Elgin.length] = createMarker(new GPoint(-88.30838776,42.03862381),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Highland Elementary School",'Elgin=' + Elgin.length);
Aurora[Aurora.length] = createMarker(new GPoint(-88.32147980,41.77146530),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hill Elementary School",'Aurora=' + Aurora.length);
Elgin[Elgin.length] = createMarker(new GPoint(-88.32908630,42.03459930),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hillcrest Elementary School",'Elgin=' + Elgin.length);
Elgin[Elgin.length] = createMarker(new GPoint(-88.22237400,42.04337200),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hilltop Elementary School",'Elgin=' + Elgin.length);
Batavia[Batavia.length] = createMarker(new GPoint(-88.28451538,41.83023453),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hoover Wood Elementary School",'Batavia=' + Batavia.length);
Aurora[Aurora.length] = createMarker(new GPoint(-88.32582092,41.78164291),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Hope D Wall Tmh Child Dev Center",'Aurora=' + Aurora.length);
Burlington[Burlington.length] = createMarker(new GPoint(-88.54740143,42.05130005),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Howard B Thomas Grade School",'Burlington=' + Burlington.length);
Huntley[Huntley.length] = createMarker(new GPoint(-88.43271637,42.16466141),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Huntley South School",'Huntley=' + Huntley.length);
Aurora[Aurora.length] = createMarker(new GPoint(-88.35823822,41.78816223),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Il Mathematics & Science Academy",'Aurora=' + Aurora.length);
Elgin[Elgin.length] = createMarker(new GPoint(-88.31063843,42.04903030),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Illinois Park Elementary School",'Elgin=' + Elgin.length);
St_Charles[St_Charles.length] = createMarker(new GPoint(-88.34462738,41.90346909),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Illinois Youth Center - St Charles",'St_Charles=' + St_Charles.length);
St_Charles[St_Charles.length] = createMarker(new GPoint(-88.34462738,41.90346909),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Illinois Youth Ctr-valley View",'St_Charles=' + St_Charles.length);
Batavia[Batavia.length] = createMarker(new GPoint(-88.29840851,41.84639740),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("J B Nelson Elementary School",'Batavia=' + Batavia.length);
Aurora[Aurora.length] = createMarker(new GPoint(-88.34360504,41.76683807),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Jefferson Middle School",'Aurora=' + Aurora.length);
North_Aurora[North_Aurora.length] = createMarker(new GPoint(-88.36068726,41.80954361),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Jewel Middle School",'North_Aurora=' + North_Aurora.length);
Aurora[Aurora.length] = createMarker(new GPoint(-88.30141449,41.74183655),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("John Gates Elementary School",'Aurora=' + Aurora.length);
Aurora[Aurora.length] = createMarker(new GPoint(-88.30716705,41.75204468),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("K D Waldo Middle School",'Aurora=' + Aurora.length);
Elburn[Elburn.length] = createMarker(new GPoint(-88.45607800,41.87708300),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Kaneland Blackberry Creek Elementary School",'Elburn=' + Elburn.length);
Montgomery[Montgomery.length] = createMarker(new GPoint(-88.40102500,41.72588600),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Kaneland Mcdole Elementary School",'Montgomery=' + Montgomery.length);
Maple_Park[Maple_Park.length] = createMarker(new GPoint(-88.53669739,41.88145065),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Kaneland Middle School",'Maple_Park=' + Maple_Park.length);
Elburn[Elburn.length] = createMarker(new GPoint(-88.45945740,41.90026474),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Kaneland North Elementary School",'Elburn=' + Elburn.length);
Maple_Park[Maple_Park.length] = createMarker(new GPoint(-88.52819061,41.88042831),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Kaneland Senior High School",'Maple_Park=' + Maple_Park.length);
Sugar_Grove[Sugar_Grove.length] = createMarker(new GPoint(-88.44398499,41.76206970),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Kaneland South Elementary School",'Sugar_Grove=' + Sugar_Grove.length);
South_Elgin[South_Elgin.length] = createMarker(new GPoint(-88.28319800,42.00630900),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Kenyon Woods Middle School",'South_Elgin=' + South_Elgin.length);
Elgin[Elgin.length] = createMarker(new GPoint(-88.31171417,42.04396820),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Kimball Middle School",'Elgin=' + Elgin.length);
Aurora[Aurora.length] = createMarker(new GPoint(-88.30159760,41.76002121),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("L D Brady Elementary School",'Aurora=' + Aurora.length);
Algonquin[Algonquin.length] = createMarker(new GPoint(-88.31485748,42.18298721),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lake In Hills Elementary School",'Algonquin=' + Algonquin.length);
Carpentersville[Carpentersville.length] = createMarker(new GPoint(-88.25888062,42.11167526),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Lakewood School",'Carpentersville=' + Carpentersville.length);
Elgin[Elgin.length] = createMarker(new GPoint(-88.31377411,42.03464127),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Larkin High School",'Elgin=' + Elgin.length);
Elgin[Elgin.length] = createMarker(new GPoint(-88.27317810,42.04939270),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Larsen Middle School",'Elgin=' + Elgin.length);
Carpentersville[Carpentersville.length] = createMarker(new GPoint(-88.28330231,42.12220001),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Liberty Elementary School",'Carpentersville=' + Carpentersville.length);
Maple_Park[Maple_Park.length] = createMarker(new GPoint(-88.47791290,41.94972229),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lily Lake Grade School",'Maple_Park=' + Maple_Park.length);
Saint_Charles[Saint_Charles.length] = createMarker(new GPoint(-88.30752563,41.91289139),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lincoln Elementary School",'Saint_Charles=' + Saint_Charles.length);
Aurora[Aurora.length] = createMarker(new GPoint(-88.33257294,41.74926376),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lincoln Elementary School",'Aurora=' + Aurora.length);
Batavia[Batavia.length] = createMarker(new GPoint(-88.30132294,41.85934830),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Louise White Elementary School",'Batavia=' + Batavia.length);
Elgin[Elgin.length] = createMarker(new GPoint(-88.28452301,42.02643585),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lowrie Elementary School",'Elgin=' + Elgin.length);
Aurora[Aurora.length] = createMarker(new GPoint(-88.27475739,41.78513718),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mabel Odonnell Elementary School",'Aurora=' + Aurora.length);
Saint_Charles[Saint_Charles.length] = createMarker(new GPoint(-88.29416656,41.90641403),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Mades Johnstone Center",'Saint_Charles=' + Saint_Charles.length);
Aurora[Aurora.length] = createMarker(new GPoint(-88.33886719,41.77019882),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mccleery Elementary School",'Aurora=' + Aurora.length);
Elgin[Elgin.length] = createMarker(new GPoint(-88.28066254,42.05003738),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mckinley Elementary School",'Elgin=' + Elgin.length);
Carpentersville[Carpentersville.length] = createMarker(new GPoint(-88.25638580,42.12471008),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Meadowdale Elementary School",'Carpentersville=' + Carpentersville.length);
Geneva[Geneva.length] = createMarker(new GPoint(-88.38528442,41.88003540),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mill Creek School",'Geneva=' + Geneva.length);
Saint_Charles[Saint_Charles.length] = createMarker(new GPoint(-88.29411316,41.90506363),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Munhall Elementary School",'Saint_Charles=' + Saint_Charles.length);
Aurora[Aurora.length] = createMarker(new GPoint(-88.29361725,41.77723694),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Nicholas A Hermes Elementary School",'Aurora=' + Aurora.length);
Montgomery[Montgomery.length] = createMarker(new GPoint(-88.33972168,41.73334885),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Nicholson Elementary School",'Montgomery=' + Montgomery.length);
Aurora[Aurora.length] = createMarker(new GPoint(-88.28621674,41.76413727),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Oak Park Elementary School",'Aurora=' + Aurora.length);
Carpentersville[Carpentersville.length] = createMarker(new GPoint(-88.26671600,42.12116241),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Oak Ridge School",'Carpentersville=' + Carpentersville.length);
Aurora[Aurora.length] = createMarker(new GPoint(-88.28121185,41.74236298),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Olney C Allen Elementary School",'Aurora=' + Aurora.length);
Elgin[Elgin.length] = createMarker(new GPoint(-88.32884216,41.99607849),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Otter Creek Elementary School",'Elgin=' + Elgin.length);
Carpentersville[Carpentersville.length] = createMarker(new GPoint(-88.28161621,42.10736465),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Parkview Elementary School",'Carpentersville=' + Carpentersville.length);
Carpentersville[Carpentersville.length] = createMarker(new GPoint(-88.26606750,42.13584137),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Perry Elementary School",'Carpentersville=' + Carpentersville.length);
Elgin[Elgin.length] = createMarker(new GPoint(-88.37742615,42.02581406),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Prairie View Grade School",'Elgin=' + Elgin.length);
Geneva[Geneva.length] = createMarker(new GPoint(-88.31272125,41.88621140),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Regional Safe School Prog",'Geneva=' + Geneva.length);
Saint_Charles[Saint_Charles.length] = createMarker(new GPoint(-88.32860565,41.90996933),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Richmond Elementary School",'Saint_Charles=' + Saint_Charles.length);
Aurora[Aurora.length] = createMarker(new GPoint(-88.32283020,41.73283768),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Rose E Krug Elementary School",'Aurora=' + Aurora.length);
Batavia[Batavia.length] = createMarker(new GPoint(-88.28948212,41.83155441),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Sam Rotolo Middle School Of Batavia",'Batavia=' + Batavia.length);
North_Aurora[North_Aurora.length] = createMarker(new GPoint(-88.31268311,41.81395721),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Schneider Elementary School",'North_Aurora=' + North_Aurora.length);
Elgin[Elgin.length] = createMarker(new GPoint(-88.27016449,42.04293823),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Sheridan Elementary School",'Elgin=' + Elgin.length);
Sleepy_Hollow[Sleepy_Hollow.length] = createMarker(new GPoint(-88.31006622,42.09017944),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Sleepy Hollow Elementary School",'Sleepy_Hollow=' + Sleepy_Hollow.length);
Aurora[Aurora.length] = createMarker(new GPoint(-88.33383942,41.78550720),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Smith Elementary School",'Aurora=' + Aurora.length);
South_Elgin[South_Elgin.length] = createMarker(new GPoint(-88.27963700,42.00058600),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("South Elgin High School",'South_Elgin=' + South_Elgin.length);
Saint_Charles[Saint_Charles.length] = createMarker(new GPoint(-88.28439331,41.92584610),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St Charles East High School",'Saint_Charles=' + Saint_Charles.length);
Saint_Charles[Saint_Charles.length] = createMarker(new GPoint(-88.32407379,41.95066452),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St Charles North High School",'Saint_Charles=' + Saint_Charles.length);
Carpentersville[Carpentersville.length] = createMarker(new GPoint(-88.25198364,42.13253784),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Sunny Hill Elementary School",'Carpentersville=' + Carpentersville.length);
Saint_Charles[Saint_Charles.length] = createMarker(new GPoint(-88.32164764,41.91246414),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Thompson Middle School",'Saint_Charles=' + Saint_Charles.length);
Hoffman_Estates[Hoffman_Estates.length] = createMarker(new GPoint(-88.21224800,42.05695200),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Timber Trails Elementary School",'Hoffman_Estates=' + Hoffman_Estates.length);
Aurora[Aurora.length] = createMarker(new GPoint(-88.31946564,41.76168823),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Todd Elementary School",'Aurora=' + Aurora.length);
Aurora[Aurora.length] = createMarker(new GPoint(-88.29261780,41.75098419),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("W S Beaupre Elementary School",'Aurora=' + Aurora.length);
Wasco[Wasco.length] = createMarker(new GPoint(-88.40287781,41.93776321),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Wasco Elementary School",'Wasco=' + Wasco.length);
Elgin[Elgin.length] = createMarker(new GPoint(-88.29861450,42.03446198),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Washington Elementary School",'Elgin=' + Elgin.length);
Aurora[Aurora.length] = createMarker(new GPoint(-88.37034607,41.76589203),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Washington Middle School",'Aurora=' + Aurora.length);
Aurora[Aurora.length] = createMarker(new GPoint(-88.34371185,41.76343536),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("West Aurora High School",'Aurora=' + Aurora.length);
Geneva[Geneva.length] = createMarker(new GPoint(-88.32254791,41.87212753),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Western Avenue Elementary School",'Geneva=' + Geneva.length);
Algonquin[Algonquin.length] = createMarker(new GPoint(-88.32138062,42.14634323),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Westfield Community School",'Algonquin=' + Algonquin.length);
St_Charles[St_Charles.length] = createMarker(new GPoint(-88.33473206,41.92328644),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Wild Rose Elementary School",'St_Charles=' + St_Charles.length);
South_Elgin[South_Elgin.length] = createMarker(new GPoint(-88.29978180,41.99513626),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Willard Elementary School",'South_Elgin=' + South_Elgin.length);
Carpentersville[Carpentersville.length] = createMarker(new GPoint(-88.25062561,42.13799667),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Woodland Elementary School",'Carpentersville=' + Carpentersville.length);
Saint_Charles[Saint_Charles.length] = createMarker(new GPoint(-88.28379822,41.92787170),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Wredling Middle School",'Saint_Charles=' + Saint_Charles.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(Algonquin);
map.removeOverlays(Aurora);
map.removeOverlays(Batavia);
map.removeOverlays(Big_Rock);
map.removeOverlays(Burlington);
map.removeOverlays(Carpentersville);
map.removeOverlays(Dundee);
map.removeOverlays(Elburn);
map.removeOverlays(Elgin);
map.removeOverlays(Geneva);
map.removeOverlays(Hampshire);
map.removeOverlays(Hoffman_Estates);
map.removeOverlays(Huntley);
map.removeOverlays(Maple_Park);
map.removeOverlays(Montgomery);
map.removeOverlays(North_Aurora);
map.removeOverlays(Saint_Charles);
map.removeOverlays(Sleepy_Hollow);
map.removeOverlays(South_Elgin);
map.removeOverlays(St_Charles);
map.removeOverlays(Sugar_Grove);
map.removeOverlays(Wasco);
map.removeOverlays(West_Dundee);
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(Elgin);map.removeOverlays(Algonquin);
map.removeOverlays(Aurora);
map.removeOverlays(Batavia);
map.removeOverlays(Big_Rock);
map.removeOverlays(Burlington);
map.removeOverlays(Carpentersville);
map.removeOverlays(Dundee);
map.removeOverlays(Elburn);
map.removeOverlays(Elgin);
map.removeOverlays(Geneva);
map.removeOverlays(Hampshire);
map.removeOverlays(Hoffman_Estates);
map.removeOverlays(Huntley);
map.removeOverlays(Maple_Park);
map.removeOverlays(Montgomery);
map.removeOverlays(North_Aurora);
map.removeOverlays(Saint_Charles);
map.removeOverlays(Sleepy_Hollow);
map.removeOverlays(South_Elgin);
map.removeOverlays(St_Charles);
map.removeOverlays(Sugar_Grove);
map.removeOverlays(Wasco);
map.removeOverlays(West_Dundee);
map.addOverlays(Algonquin);
centerByArray(Algonquin, false, false);
cntMarker += Algonquin.length;
map.addOverlays(Aurora);
centerByArray(Aurora, false, false);
cntMarker += Aurora.length;
map.addOverlays(Batavia);
centerByArray(Batavia, false, false);
cntMarker += Batavia.length;
map.addOverlays(Big_Rock);
centerByArray(Big_Rock, false, false);
cntMarker += Big_Rock.length;
map.addOverlays(Burlington);
centerByArray(Burlington, false, false);
cntMarker += Burlington.length;
map.addOverlays(Carpentersville);
centerByArray(Carpentersville, false, false);
cntMarker += Carpentersville.length;
map.addOverlays(Dundee);
centerByArray(Dundee, false, false);
cntMarker += Dundee.length;
map.addOverlays(Elburn);
centerByArray(Elburn, false, false);
cntMarker += Elburn.length;
map.addOverlays(Elgin);
centerByArray(Elgin, false, false);
cntMarker += Elgin.length;
map.addOverlays(Geneva);
centerByArray(Geneva, false, false);
cntMarker += Geneva.length;
map.addOverlays(Hampshire);
centerByArray(Hampshire, false, false);
cntMarker += Hampshire.length;
map.addOverlays(Hoffman_Estates);
centerByArray(Hoffman_Estates, false, false);
cntMarker += Hoffman_Estates.length;
map.addOverlays(Huntley);
centerByArray(Huntley, false, false);
cntMarker += Huntley.length;
map.addOverlays(Maple_Park);
centerByArray(Maple_Park, false, false);
cntMarker += Maple_Park.length;
map.addOverlays(Montgomery);
centerByArray(Montgomery, false, false);
cntMarker += Montgomery.length;
map.addOverlays(North_Aurora);
centerByArray(North_Aurora, false, false);
cntMarker += North_Aurora.length;
map.addOverlays(Saint_Charles);
centerByArray(Saint_Charles, false, false);
cntMarker += Saint_Charles.length;
map.addOverlays(Sleepy_Hollow);
centerByArray(Sleepy_Hollow, false, false);
cntMarker += Sleepy_Hollow.length;
map.addOverlays(South_Elgin);
centerByArray(South_Elgin, false, false);
cntMarker += South_Elgin.length;
map.addOverlays(St_Charles);
centerByArray(St_Charles, false, false);
cntMarker += St_Charles.length;
map.addOverlays(Sugar_Grove);
centerByArray(Sugar_Grove, false, false);
cntMarker += Sugar_Grove.length;
map.addOverlays(Wasco);
centerByArray(Wasco, false, false);
cntMarker += Wasco.length;
map.addOverlays(West_Dundee);
centerByArray(West_Dundee, false, false);
cntMarker += West_Dundee.length;
centerByArray(Elgin,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');
}
}