function addMarkers()
{
mySelect = document.getElementById('selection');
Charlotte = [];Matthews = [];Davidson = [];Cornelius = [];Huntersville = [];Pineville = [];Mint_Hill = [];Wahpeton = [];mySelect.options[mySelect.options.length] = new Option("Charlotte schools",'all=Charlotte');
mySelect.options[mySelect.options.length] = new Option("Cornelius schools",'all=Cornelius');
mySelect.options[mySelect.options.length] = new Option("Davidson schools",'all=Davidson');
mySelect.options[mySelect.options.length] = new Option("Huntersville schools",'all=Huntersville');
mySelect.options[mySelect.options.length] = new Option("Matthews schools",'all=Matthews');
mySelect.options[mySelect.options.length] = new Option("Mint Hill schools",'all=Mint_Hill');
mySelect.options[mySelect.options.length] = new Option("Pineville schools",'all=Pineville');
mySelect.options[mySelect.options.length] = new Option("Wahpeton schools",'all=Wahpeton');
mySelect.options[mySelect.options.length] = new Option("---------------------------",'');
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.73098755,35.19726181),"
",iconRd);
mySelect.options[mySelect.options.length] = new Option("Albemarle Road Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.73107147,35.20036316),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Albemarle Road Middle School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.83256531,35.16564178),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Alexander Graham Middle School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.91370392,35.26168060),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Allenbrook Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.90072632,35.20418549),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Amay James Montessori",'Charlotte=' + Charlotte.length);
Matthews[Matthews.length] = createMarker(new GPoint(-80.72254100,35.05501600),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Antioch Elementary School",'Matthews=' + Matthews.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.89117432,35.23219681),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Ashley Park Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.64817047,35.17554474),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Bain Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.88968658,35.21120834),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Barringer Academic Center",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.99070740,35.21369553),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Berryhill Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.83815002,35.13137054),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Beverly Woods Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.76587677,35.25053024),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Briarwood Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.86519623,35.23933792),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Bruns Avenue Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.80503082,35.12969589),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Carmel Middle School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.80051500,35.20778400),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Chantilly Montessori",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.80036163,35.20669174),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Chantilly/billingsville Elementary School",'Charlotte=' + Charlotte.length);
Davidson[Davidson.length] = createMarker(new GPoint(-83.56640300,41.62584500),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Children's Community School",'Davidson=' + Davidson.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.62580109,35.22323990),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Clear Creek Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.75141144,35.24770355),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Cochrane Middle School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.87026978,35.18420410),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Collinswood Language Acdmy Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.83458710,35.21987534),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Community Charter School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.82360100,35.03585600),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Community House Middle School",'Charlotte=' + Charlotte.length);
Cornelius[Cornelius.length] = createMarker(new GPoint(-80.86399078,35.48284531),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Cornelius Elementary School",'Cornelius=' + Cornelius.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.79913330,35.17879868),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Cotswold Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.94342041,35.30444336),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Coulwood Middle School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.83080292,35.22299957),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Covenant Academy",'Charlotte=' + Charlotte.length);
Matthews[Matthews.length] = createMarker(new GPoint(-80.71882629,35.12604141),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Crestdale Middle School",'Matthews=' + Matthews.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.73560333,35.28680038),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Crossroads Charter High School",'Charlotte=' + Charlotte.length);
Matthews[Matthews.length] = createMarker(new GPoint(-80.71372223,35.15953064),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Crown Point Elementary School",'Matthews=' + Matthews.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.80048370,35.33794403),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("David Cox Road Elementary School",'Charlotte=' + Charlotte.length);
Matthews[Matthews.length] = createMarker(new GPoint(-80.69364929,35.12016678),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("David W Butler High School",'Matthews=' + Matthews.length);
Davidson[Davidson.length] = createMarker(new GPoint(-80.82279968,35.49089813),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Davidson Elementary School",'Davidson=' + Davidson.length);
Davidson[Davidson.length] = createMarker(new GPoint(-80.82279968,35.49089813),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Davidson Intnl Bacc Middle School",'Davidson=' + Davidson.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.79711914,35.29391479),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Derita Alternative",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.79711914,35.29391479),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Derita Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.74529266,35.24576950),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Devonshire Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.85301208,35.21187210),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Dilworth Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.80902863,35.22030640),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Dolly Tate Taps",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.82508087,35.25663376),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Druid Hills Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.89720917,35.15596771),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("E E Waddell High School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.75676727,35.17606354),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("East Mecklenburg High School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.82106781,35.19706345),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Eastover Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.78133392,35.21007919),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Eastway Middle School",'Charlotte=' + Charlotte.length);
Matthews[Matthews.length] = createMarker(new GPoint(-80.74901581,35.11434174),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Elizabeth Lane Elementary School",'Matthews=' + Matthews.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.82508087,35.25663376),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Elizabeth Trad/classical Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.93212128,35.21321869),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Endhaven Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.83386230,35.22800446),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("First Ward Elementary School",'Charlotte=' + Charlotte.length);
Huntersville[Huntersville.length] = createMarker(new GPoint(-80.92373657,35.39601135),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Francis Bradley Middle School",'Huntersville=' + Huntersville.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.77896881,35.24083710),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Garinger High School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.74814606,35.15582275),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Greenway Park Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.90211487,35.23806381),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Harding University High School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.82518768,35.04542923),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hawk Ridge Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.79039764,35.22169876),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Hawthorne Trad Middle School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.72022247,35.22631454),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hickory Grove Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.78530884,35.26888275),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hidden Valley Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.80358124,35.24302673),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Highland Mill Montessori",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.80117798,35.25536346),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Highland Renaissance Academy",'Charlotte=' + Charlotte.length);
Huntersville[Huntersville.length] = createMarker(new GPoint(-80.85415649,35.26974106),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Hopewell High School",'Huntersville=' + Huntersville.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.86625671,35.32430649),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hornets Nest Elementary School",'Charlotte=' + Charlotte.length);
Huntersville[Huntersville.length] = createMarker(new GPoint(-80.86789703,35.41809845),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Huntersville Elementary School",'Huntersville=' + Huntersville.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.85980225,35.13380432),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Huntingtowne Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.74369049,35.18628693),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Idlewild Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.68570709,35.19702148),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Independence High School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.85063934,35.23667526),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Irwin Avenue Open Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.68643188,35.21773911),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("J H Gunn Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.76934052,35.30221176),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("James Martin Middle School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.78316498,35.06413651),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Jay M Robinson Middle School",'Charlotte=' + Charlotte.length);
Huntersville[Huntersville.length] = createMarker(new GPoint(-80.83528137,35.37747955),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("John M Alexander Middle School",'Huntersville=' + Huntersville.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.77493286,35.30146790),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("John Motley Morehead Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.84052277,35.26683807),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("John T Williams Middle School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.92886353,35.21760178),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Joseph W Grier Academy",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.82499695,35.10340118),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Kennedy Charter",'Charlotte=' + Charlotte.length);
Huntersville[Huntersville.length] = createMarker(new GPoint(-80.83557892,35.39506912),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Lake Norman Charter",'Huntersville=' + Huntersville.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.97274780,35.11396027),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lake Wylie Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.78127289,35.14409256),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lansdowne Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.80201721,35.30068970),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Learning Academy-north",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.69017792,35.18457413),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lebanon Road Elementary School",'Charlotte=' + Charlotte.length);
Huntersville[Huntersville.length] = createMarker(new GPoint(-80.83522797,35.37720871),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Legette Blythe Elementary School",'Huntersville=' + Huntersville.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.84280396,35.25951385),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lincoln Heights Elementary School",'Charlotte=' + Charlotte.length);
Huntersville[Huntersville.length] = createMarker(new GPoint(-80.88840485,35.35034943),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Long Creek Elementary School",'Huntersville=' + Huntersville.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.77275848,35.33509445),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mallard Creek Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.81224823,35.21653366),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Management School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.87505341,35.20246124),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Marie G Davis Middle School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.78021800,35.26327800),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Martin Luther King, Jr Middle School",'Charlotte=' + Charlotte.length);
Matthews[Matthews.length] = createMarker(new GPoint(-80.72403717,35.11401367),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Matthews Elementary School",'Matthews=' + Matthews.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.79450226,35.26831436),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Mayfield Alternative Middle School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.82736969,35.08266068),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mcalpine Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.76589966,35.18090057),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Mcclintock Middle School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.75500488,35.06903076),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mckee Road Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.78364563,35.22113800),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Merry Oaks Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.84107971,35.21910477),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Metro",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.74657440,35.31216049),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Metrolina Regional Scholars Academy",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.80902863,35.22030640),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Midwood High/tate Taps",'Charlotte=' + Charlotte.length);
Matthews[Matthews.length] = createMarker(new GPoint(-80.71459961,35.11719894),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Mint Hill Middle School",'Matthews=' + Matthews.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.86751556,35.15230179),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Montclaire Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.83309174,35.21034241),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Morgan School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.92965698,35.30842590),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mountain Island Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.83174133,35.17291260),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Myers Park High School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.86144257,35.19184875),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Myers Park Trad Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.77368164,35.30268478),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Nathaniel Alexander Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.89456177,35.14105225),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Nations Ford Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.73327637,35.28342056),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Newell Elementary School",'Charlotte=' + Charlotte.length);
Huntersville[Huntersville.length] = createMarker(new GPoint(-80.83252716,35.37150955),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("North Mecklenburg High School",'Huntersville=' + Huntersville.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.69332886,35.19734955),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Northeast Middle School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.73110962,35.25864410),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Northridge Middle School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.85583496,35.25643158),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Northwest High School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.89595032,35.30014420),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Oakdale Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.72534180,35.26920319),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Oakhurst Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.85074615,35.25082779),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Oaklawn Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.87978300,35.30027400),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Oaklawn Language Academy",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.86519623,35.23933792),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Oaklawn/bruns Avenue Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.79870605,35.10989380),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Olde Providence Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.95099640,35.15787125),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Olympic High School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.84961700,35.17976379),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Park Road Montessori",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.94628906,35.29179382),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Paw Creek Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.95037079,35.27484131),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Pawtuckett Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.89215851,35.23840332),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Phillip O Berry Academy Of Tec",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.81201935,35.23016357),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Piedmont Open Middle School",'Charlotte=' + Charlotte.length);
Pineville[Pineville.length] = createMarker(new GPoint(-80.88919067,35.08086777),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Pineville Elementary School",'Pineville=' + Pineville.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.86326599,35.16511536),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Pinewood Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.73156738,35.17401123),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Piney Grove Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.76299286,35.10941315),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Providence High School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.84297180,35.22723007),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Providence Spring Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.84297180,35.22723007),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Quail Hollow Middle School",'Charlotte=' + Charlotte.length);
Mint_Hill[Mint_Hill.length] = createMarker(new GPoint(-83.57172000,41.63494000),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Queen's Grant Community",'Mint_Hill=' + Mint_Hill.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.77172089,35.16869354),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Rama Road Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.79261017,35.18412781),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Randolph Middle School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.83979797,35.29994583),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Ranson Middle School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.68508911,35.25893784),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Reedy Creek Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.91030121,35.20402527),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Reid Park Elem/amay James P-k Elementary School",'Charlotte=' + Charlotte.length);
Wahpeton[Wahpeton.length] = createMarker(new GPoint(-77.61436462,43.15308380),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Richland Co Vocational Technical Center",'Wahpeton=' + Wahpeton.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.95778656,35.15352631),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Robert F Kennedy Middle School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.86511230,35.19015884),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Sedgefield Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.85778809,35.19716644),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Sedgefield Middle School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.83061218,35.16766739),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Selwyn Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.78872681,35.23332596),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Shamrock Gardens Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.81557465,35.15250015),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Sharon Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.87072754,35.16306305),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Smith Language Academy",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.85122681,35.11190033),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Smithfield Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.75213400,35.15695700),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Socrates Academy",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.79765320,35.09125519),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("South Charlotte Middle School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.85797882,35.11118317),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("South Mecklenburg High School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.93212128,35.21321869),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Southwest Middle School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.88424683,35.23083496),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Spaugh Middle School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.87126923,35.14004898),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Starmount Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.84476471,35.29970551),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Statesville Road Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.84297180,35.22723007),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Steele Creek Elementary School",'Charlotte=' + Charlotte.length);
Pineville[Pineville.length] = createMarker(new GPoint(-80.89273071,35.08317947),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Sterling Elementary School",'Pineville=' + Pineville.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.79708099,35.25695038),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Sugar Creek Charter",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.89769745,35.25525665),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Thomasboro Elementary School",'Charlotte=' + Charlotte.length);
Huntersville[Huntersville.length] = createMarker(new GPoint(-80.87258900,35.41209500),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Torrence Creek Elementary School",'Huntersville=' + Huntersville.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.93973541,35.24924850),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Tuckaseegee Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.71251678,35.32441711),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("University Meadows Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.85741425,35.26107407),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("University Park Creative Arts Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.81337738,35.23740768),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Villa Heights Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.84266663,35.24375916),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Walter G Byers Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.85733032,35.26487350),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("West Charlotte High School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.95099640,35.24683380),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("West Mecklenburg High School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.91083527,35.22993851),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Westerly Hills Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.94314575,35.24716949),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Wilson Middle School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.82760620,35.30657196),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Winding Springs Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.75984192,35.22451019),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Windsor Park Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.76633453,35.20779800),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Winterfield Elementary School",'Charlotte=' + Charlotte.length);
Charlotte[Charlotte.length] = createMarker(new GPoint(-80.77127075,35.30304718),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Zebulon B Vance High School",'Charlotte=' + Charlotte.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(Charlotte);
map.removeOverlays(Cornelius);
map.removeOverlays(Davidson);
map.removeOverlays(Huntersville);
map.removeOverlays(Matthews);
map.removeOverlays(Mint_Hill);
map.removeOverlays(Pineville);
map.removeOverlays(Wahpeton);
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(Charlotte);map.removeOverlays(Charlotte);
map.removeOverlays(Cornelius);
map.removeOverlays(Davidson);
map.removeOverlays(Huntersville);
map.removeOverlays(Matthews);
map.removeOverlays(Mint_Hill);
map.removeOverlays(Pineville);
map.removeOverlays(Wahpeton);
map.addOverlays(Charlotte);
centerByArray(Charlotte, false, false);
cntMarker += Charlotte.length;
map.addOverlays(Cornelius);
centerByArray(Cornelius, false, false);
cntMarker += Cornelius.length;
map.addOverlays(Davidson);
centerByArray(Davidson, false, false);
cntMarker += Davidson.length;
map.addOverlays(Huntersville);
centerByArray(Huntersville, false, false);
cntMarker += Huntersville.length;
map.addOverlays(Matthews);
centerByArray(Matthews, false, false);
cntMarker += Matthews.length;
map.addOverlays(Mint_Hill);
centerByArray(Mint_Hill, false, false);
cntMarker += Mint_Hill.length;
map.addOverlays(Pineville);
centerByArray(Pineville, false, false);
cntMarker += Pineville.length;
map.addOverlays(Wahpeton);
centerByArray(Wahpeton, false, false);
cntMarker += Wahpeton.length;
centerByArray(Charlotte,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');
}
}