function addMarkers()
{
mySelect = document.getElementById('selection');
Dacula = [];Lawrenceville = [];Snellville = [];Lilburn = [];Norcross = [];Duluth = [];Buford = [];Suwanee = [];Hoschton = [];Grayson = [];Loganville = [];Tucker = [];Sugar_Hill = [];mySelect.options[mySelect.options.length] = new Option("Buford schools",'all=Buford');
mySelect.options[mySelect.options.length] = new Option("Dacula schools",'all=Dacula');
mySelect.options[mySelect.options.length] = new Option("Duluth schools",'all=Duluth');
mySelect.options[mySelect.options.length] = new Option("Grayson schools",'all=Grayson');
mySelect.options[mySelect.options.length] = new Option("Hoschton schools",'all=Hoschton');
mySelect.options[mySelect.options.length] = new Option("Lawrenceville schools",'all=Lawrenceville');
mySelect.options[mySelect.options.length] = new Option("Lilburn schools",'all=Lilburn');
mySelect.options[mySelect.options.length] = new Option("Loganville schools",'all=Loganville');
mySelect.options[mySelect.options.length] = new Option("Norcross schools",'all=Norcross');
mySelect.options[mySelect.options.length] = new Option("Snellville schools",'all=Snellville');
mySelect.options[mySelect.options.length] = new Option("Sugar Hill schools",'all=Sugar_Hill');
mySelect.options[mySelect.options.length] = new Option("Suwanee schools",'all=Suwanee');
mySelect.options[mySelect.options.length] = new Option("Tucker schools",'all=Tucker');
mySelect.options[mySelect.options.length] = new Option("---------------------------",'');
Dacula[Dacula.length] = createMarker(new GPoint(-83.89990600,33.96749200),"
",iconRd);
mySelect.options[mySelect.options.length] = new Option("Alcova Elementary School",'Dacula=' + Dacula.length);
Lawrenceville[Lawrenceville.length] = createMarker(new GPoint(-84.01038361,33.90629959),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Alton C. Crews Middle School",'Lawrenceville=' + Lawrenceville.length);
Snellville[Snellville.length] = createMarker(new GPoint(-84.07033539,33.80316925),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Annistown Elementary School",'Snellville=' + Snellville.length);
Lilburn[Lilburn.length] = createMarker(new GPoint(-84.14035034,33.87303162),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Arcado Elementary School",'Lilburn=' + Lilburn.length);
Norcross[Norcross.length] = createMarker(new GPoint(-84.17318726,33.93375015),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Beaver Ridge Elementary School",'Norcross=' + Norcross.length);
Lawrenceville[Lawrenceville.length] = createMarker(new GPoint(-84.05996704,33.95219803),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Benefield Elementary School",'Lawrenceville=' + Lawrenceville.length);
Duluth[Duluth.length] = createMarker(new GPoint(-84.17516327,33.98820114),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Berkeley Lake Elementary School",'Duluth=' + Duluth.length);
Lilburn[Lilburn.length] = createMarker(new GPoint(-84.11313629,33.90956116),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Berkmar High School",'Lilburn=' + Lilburn.length);
Lilburn[Lilburn.length] = createMarker(new GPoint(-84.12641500,33.90097600),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Berkmar Middle School",'Lilburn=' + Lilburn.length);
Lawrenceville[Lawrenceville.length] = createMarker(new GPoint(-84.08496094,33.92699432),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Bethesda Elementary School",'Lawrenceville=' + Lawrenceville.length);
Snellville[Snellville.length] = createMarker(new GPoint(-84.01068115,33.85512543),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Britt Elementary School",'Snellville=' + Snellville.length);
Snellville[Snellville.length] = createMarker(new GPoint(-84.04268646,33.88019562),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Brookwood Elementary School",'Snellville=' + Snellville.length);
Snellville[Snellville.length] = createMarker(new GPoint(-84.03785706,33.88418961),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Brookwood High School",'Snellville=' + Snellville.length);
Buford[Buford.length] = createMarker(new GPoint(-83.98328400,34.12792206),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Buford Academy",'Buford=' + Buford.length);
Buford[Buford.length] = createMarker(new GPoint(-83.98425293,34.12813950),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Buford Elementary School",'Buford=' + Buford.length);
Buford[Buford.length] = createMarker(new GPoint(-83.98334503,34.12820053),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Buford High School",'Buford=' + Buford.length);
Buford[Buford.length] = createMarker(new GPoint(-83.99671936,34.11299515),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Buford Middle School",'Buford=' + Buford.length);
Lilburn[Lilburn.length] = createMarker(new GPoint(-84.11547089,33.85850525),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Camp Creek Elementary School",'Lilburn=' + Lilburn.length);
Lawrenceville[Lawrenceville.length] = createMarker(new GPoint(-84.02338409,33.92640686),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Cedar Hill Elementary School",'Lawrenceville=' + Lawrenceville.length);
Snellville[Snellville.length] = createMarker(new GPoint(-84.03465271,33.82077408),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Centerville Elementary School",'Snellville=' + Snellville.length);
Lawrenceville[Lawrenceville.length] = createMarker(new GPoint(-84.00054932,33.94975662),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Central Gwinnett High School",'Lawrenceville=' + Lawrenceville.length);
Duluth[Duluth.length] = createMarker(new GPoint(-84.14727800,33.96048200),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Charles Brant Chesney Elementary School",'Duluth=' + Duluth.length);
Duluth[Duluth.length] = createMarker(new GPoint(-84.14660645,34.01882172),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Chattahoochee Elementary School",'Duluth=' + Duluth.length);
Suwanee[Suwanee.length] = createMarker(new GPoint(-84.02046204,34.01794434),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Collins Hill High School",'Suwanee=' + Suwanee.length);
Lawrenceville[Lawrenceville.length] = createMarker(new GPoint(-83.96865845,34.00497818),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Corley Elementary School",'Lawrenceville=' + Lawrenceville.length);
Lawrenceville[Lawrenceville.length] = createMarker(new GPoint(-84.01465607,33.90385056),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Craig Elementary School",'Lawrenceville=' + Lawrenceville.length);
Lawrenceville[Lawrenceville.length] = createMarker(new GPoint(-84.01774597,33.99864578),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Creekland Middle School",'Lawrenceville=' + Lawrenceville.length);
Dacula[Dacula.length] = createMarker(new GPoint(-83.90528107,33.99886322),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Dacula Elementary School",'Dacula=' + Dacula.length);
Dacula[Dacula.length] = createMarker(new GPoint(-83.89817047,33.98982239),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Dacula High School",'Dacula=' + Dacula.length);
Dacula[Dacula.length] = createMarker(new GPoint(-83.89670563,33.99164581),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Dacula Middle School",'Dacula=' + Dacula.length);
Duluth[Duluth.length] = createMarker(new GPoint(-84.14377594,34.01036835),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Duluth High School",'Duluth=' + Duluth.length);
Duluth[Duluth.length] = createMarker(new GPoint(-84.14278412,34.00395966),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Duluth Middle School",'Duluth=' + Duluth.length);
Hoschton[Hoschton.length] = createMarker(new GPoint(-83.66526031,34.14072037),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Duncan Creek Elementary School",'Hoschton=' + Hoschton.length);
Lawrenceville[Lawrenceville.length] = createMarker(new GPoint(-83.97256470,33.98455048),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Dyer Elementary School",'Lawrenceville=' + Lawrenceville.length);
Norcross[Norcross.length] = createMarker(new GPoint(-84.20160675,33.94282150),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Edward Buchannan School",'Norcross=' + Norcross.length);
Lawrenceville[Lawrenceville.length] = createMarker(new GPoint(-84.07198334,33.88598251),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Five Forks Middle School",'Lawrenceville=' + Lawrenceville.length);
Dacula[Dacula.length] = createMarker(new GPoint(-83.92198944,34.04441833),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Fort Daniel Elementary School",'Dacula=' + Dacula.length);
Hoschton[Hoschton.length] = createMarker(new GPoint(-10.00000000,10.00000000),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Frank N. Osborne Middle School",'Hoschton=' + Hoschton.length);
Lawrenceville[Lawrenceville.length] = createMarker(new GPoint(-88.32130500,41.77153600),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Freeman's Mill Elementary School",'Lawrenceville=' + Lawrenceville.length);
Buford[Buford.length] = createMarker(new GPoint(-83.93860800,34.10180800),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Glenn C. Jones Middle School",'Buford=' + Buford.length);
Grayson[Grayson.length] = createMarker(new GPoint(-83.95772552,33.89310837),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Grayson Elementary School",'Grayson=' + Grayson.length);
Loganville[Loganville.length] = createMarker(new GPoint(-83.92337036,33.87232590),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Grayson High School",'Loganville=' + Loganville.length);
Lawrenceville[Lawrenceville.length] = createMarker(new GPoint(-84.07109833,33.89500046),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Gwin Oaks Elementary School",'Lawrenceville=' + Lawrenceville.length);
Lawrenceville[Lawrenceville.length] = createMarker(new GPoint(-83.98438263,33.95139694),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Gwinnett Intervention Education (give) Center",'Lawrenceville=' + Lawrenceville.length);
Lawrenceville[Lawrenceville.length] = createMarker(new GPoint(-83.97133636,34.00656128),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Gwinnett Technical College",'Lawrenceville=' + Lawrenceville.length);
Lawrenceville[Lawrenceville.length] = createMarker(new GPoint(-83.97687700,33.98939400),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Gwinnitt Regional Youth Detention Center",'Lawrenceville=' + Lawrenceville.length);
Dacula[Dacula.length] = createMarker(new GPoint(-83.85573578,33.94301605),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Harbins Elementary School",'Dacula=' + Dacula.length);
Buford[Buford.length] = createMarker(new GPoint(-83.97902679,34.09740448),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Harmony Elementary School",'Buford=' + Buford.length);
Duluth[Duluth.length] = createMarker(new GPoint(-84.14549255,34.00238037),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Harris Elementary School",'Duluth=' + Duluth.length);
Lilburn[Lilburn.length] = createMarker(new GPoint(-84.06316376,33.85476685),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Head Elementary School",'Lilburn=' + Lilburn.length);
Lawrenceville[Lawrenceville.length] = createMarker(new GPoint(-83.96865845,34.00497818),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Hooper Renwick Center",'Lawrenceville=' + Lawrenceville.length);
Lilburn[Lilburn.length] = createMarker(new GPoint(-84.14930725,33.90863037),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hopkins Elementary School",'Lilburn=' + Lilburn.length);
Duluth[Duluth.length] = createMarker(new GPoint(-84.10195923,34.01554871),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Hull Middle School",'Duluth=' + Duluth.length);
Buford[Buford.length] = createMarker(new GPoint(-84.00119781,34.11502075),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Ivy Creek Elementary School",'Buford=' + Buford.length);
Lawrenceville[Lawrenceville.length] = createMarker(new GPoint(-83.96865845,34.00497818),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("J. A. Alford Elementary School",'Lawrenceville=' + Lawrenceville.length);
Lawrenceville[Lawrenceville.length] = createMarker(new GPoint(-84.05943298,33.98782730),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Jackson Elementary School",'Lawrenceville=' + Lawrenceville.length);
Lawrenceville[Lawrenceville.length] = createMarker(new GPoint(-84.08213043,33.94527817),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Kanoheda Elementary School",'Lawrenceville=' + Lawrenceville.length);
Lilburn[Lilburn.length] = createMarker(new GPoint(-84.10167694,33.88570786),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Knight Elementary School",'Lilburn=' + Lilburn.length);
Buford[Buford.length] = createMarker(new GPoint(-84.03143311,34.08449173),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Lanier Middle School",'Buford=' + Buford.length);
Lawrenceville[Lawrenceville.length] = createMarker(new GPoint(-83.99771881,33.94722366),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lawrenceville Elementary School",'Lawrenceville=' + Lawrenceville.length);
Suwanee[Suwanee.length] = createMarker(new GPoint(-84.07051900,34.07288700),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Level Creek Elementary School",'Suwanee=' + Suwanee.length);
Lilburn[Lilburn.length] = createMarker(new GPoint(-84.15280914,33.89254379),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lilburn Elementary School",'Lilburn=' + Lilburn.length);
Lilburn[Lilburn.length] = createMarker(new GPoint(-84.14491272,33.88938141),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Lilburn Middle School",'Lilburn=' + Lilburn.length);
Duluth[Duluth.length] = createMarker(new GPoint(-84.14003900,33.94583900),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Louise Radloff Middle School",'Duluth=' + Duluth.length);
Duluth[Duluth.length] = createMarker(new GPoint(-84.11972046,33.99500656),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("M. H. Mason Elementary School",'Duluth=' + Duluth.length);
Loganville[Loganville.length] = createMarker(new GPoint(-83.94298553,33.83827972),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Magill Elementary School",'Loganville=' + Loganville.length);
Lawrenceville[Lawrenceville.length] = createMarker(new GPoint(-84.00146800,33.92657100),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Margaret Winn Holt Elementary School",'Lawrenceville=' + Lawrenceville.length);
Lawrenceville[Lawrenceville.length] = createMarker(new GPoint(-83.96865845,34.00497818),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Maxwell High School Of Technology",'Lawrenceville=' + Lawrenceville.length);
Loganville[Loganville.length] = createMarker(new GPoint(-83.91324615,33.89362717),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Mcconnell Middle School",'Loganville=' + Loganville.length);
Lawrenceville[Lawrenceville.length] = createMarker(new GPoint(-84.02339935,33.98440552),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mckendree Elementary School",'Lawrenceville=' + Lawrenceville.length);
Norcross[Norcross.length] = createMarker(new GPoint(-84.16595459,33.92013931),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Meadowcreek Elementary School",'Norcross=' + Norcross.length);
Norcross[Norcross.length] = createMarker(new GPoint(-84.14833832,33.91944122),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Meadowcreek High School",'Norcross=' + Norcross.length);
Hoschton[Hoschton.length] = createMarker(new GPoint(-10.00000000,10.00000000),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Mill Creek High School",'Hoschton=' + Hoschton.length);
Lilburn[Lilburn.length] = createMarker(new GPoint(-84.12528992,33.91536331),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Minor Elementary School",'Lilburn=' + Lilburn.length);
Duluth[Duluth.length] = createMarker(new GPoint(-84.14324600,34.00533600),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Monarch School",'Duluth=' + Duluth.length);
Lilburn[Lilburn.length] = createMarker(new GPoint(-84.11586761,33.83995056),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mountain Park Elementary School",'Lilburn=' + Lilburn.length);
Tucker[Tucker.length] = createMarker(new GPoint(-84.20033264,33.87472534),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Nesbit Elementary School",'Tucker=' + Tucker.length);
Norcross[Norcross.length] = createMarker(new GPoint(-84.20647430,33.94577026),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Norcross Elementary School",'Norcross=' + Norcross.length);
Norcross[Norcross.length] = createMarker(new GPoint(-84.21213531,33.96794510),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Norcross High School",'Norcross=' + Norcross.length);
Suwanee[Suwanee.length] = createMarker(new GPoint(-84.07178497,34.08470535),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("North Gwinnett High School",'Suwanee=' + Suwanee.length);
Snellville[Snellville.length] = createMarker(new GPoint(-84.00942993,33.81058884),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Norton Elementary School",'Snellville=' + Snellville.length);
Lawrenceville[Lawrenceville.length] = createMarker(new GPoint(-84.05996704,33.95215225),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Oakland Center",'Lawrenceville=' + Lawrenceville.length);
Lilburn[Lilburn.length] = createMarker(new GPoint(-84.11477661,33.85749054),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Parkview High School",'Lilburn=' + Lilburn.length);
Suwanee[Suwanee.length] = createMarker(new GPoint(-84.08232117,34.08837891),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Parsons Elementary School",'Suwanee=' + Suwanee.length);
Snellville[Snellville.length] = createMarker(new GPoint(-84.05450439,33.79481888),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Partee Elementary School",'Snellville=' + Snellville.length);
Norcross[Norcross.length] = createMarker(new GPoint(-84.23708344,33.96150208),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Peachtree Elementary School",'Norcross=' + Norcross.length);
Suwanee[Suwanee.length] = createMarker(new GPoint(-84.08258057,34.08803940),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Peachtree Ridge High School",'Suwanee=' + Suwanee.length);
Snellville[Snellville.length] = createMarker(new GPoint(-84.00627899,33.88998413),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Pharr Elementary School",'Snellville=' + Snellville.length);
Lawrenceville[Lawrenceville.length] = createMarker(new GPoint(-84.00594330,33.96199417),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Phoenix High School",'Lawrenceville=' + Lawrenceville.length);
Norcross[Norcross.length] = createMarker(new GPoint(-84.23019409,33.98636627),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Pinckneyville Middle School",'Norcross=' + Norcross.length);
Lawrenceville[Lawrenceville.length] = createMarker(new GPoint(-84.02140808,33.92601013),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Richards Middle School",'Lawrenceville=' + Lawrenceville.length);
Suwanee[Suwanee.length] = createMarker(new GPoint(-84.10220337,34.09427643),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Riverside Elementary School",'Suwanee=' + Suwanee.length);
Lawrenceville[Lawrenceville.length] = createMarker(new GPoint(-84.00370026,34.04910660),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Rock Springs Elementary School",'Lawrenceville=' + Lawrenceville.length);
Norcross[Norcross.length] = createMarker(new GPoint(-84.19368744,33.90069580),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Rockbridge Elementary School",'Norcross=' + Norcross.length);
Snellville[Snellville.length] = createMarker(new GPoint(-84.07786560,33.82900620),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Shiloh Elementary School",'Snellville=' + Snellville.length);
Snellville[Snellville.length] = createMarker(new GPoint(-84.06804657,33.82490158),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Shiloh High School",'Snellville=' + Snellville.length);
Snellville[Snellville.length] = createMarker(new GPoint(-84.07031250,33.82503510),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Shiloh Middle School",'Snellville=' + Snellville.length);
Lawrenceville[Lawrenceville.length] = createMarker(new GPoint(-83.95709991,33.93590164),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Simonton Elementary School",'Lawrenceville=' + Lawrenceville.length);
Norcross[Norcross.length] = createMarker(new GPoint(-84.22788239,33.99645233),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Simpson Elementary School",'Norcross=' + Norcross.length);
Snellville[Snellville.length] = createMarker(new GPoint(-84.00316620,33.83486557),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Snellville Middle School",'Snellville=' + Snellville.length);
Snellville[Snellville.length] = createMarker(new GPoint(-84.00789642,33.85462570),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("South Gwinnett High School",'Snellville=' + Snellville.length);
Buford[Buford.length] = createMarker(new GPoint(-84.04125977,34.10036469),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Sugar Hill Elementary School",'Buford=' + Buford.length);
Norcross[Norcross.length] = createMarker(new GPoint(-84.20574188,33.93810272),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Summerour Middle School",'Norcross=' + Norcross.length);
Norcross[Norcross.length] = createMarker(new GPoint(-84.23135376,33.94219589),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Susan Stripling Elementary School",'Norcross=' + Norcross.length);
Suwanee[Suwanee.length] = createMarker(new GPoint(-84.08232117,34.08837891),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Suwanee Elementary School",'Suwanee=' + Suwanee.length);
Lawrenceville[Lawrenceville.length] = createMarker(new GPoint(-84.10782623,33.92738724),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Sweetwater Middle School",'Lawrenceville=' + Lawrenceville.length);
Sugar_Hill[Sugar_Hill.length] = createMarker(new GPoint(-84.00119781,34.11502075),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Sycamore Elementary School",'Sugar_Hill=' + Sugar_Hill.length);
Buford[Buford.length] = createMarker(new GPoint(-84.03549194,34.10592270),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("T. Carl Buice Center",'Buford=' + Buford.length);
Lawrenceville[Lawrenceville.length] = createMarker(new GPoint(-83.99291992,34.01045990),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Taylor Elementary School",'Lawrenceville=' + Lawrenceville.length);
Lilburn[Lilburn.length] = createMarker(new GPoint(-84.11564636,33.85876083),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Trickum Middle School",'Lilburn=' + Lilburn.length);
Loganville[Loganville.length] = createMarker(new GPoint(-83.96958160,33.84772110),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("W. J. Cooper Elementary School",'Loganville=' + Loganville.length);
Suwanee[Suwanee.length] = createMarker(new GPoint(-84.02103424,34.01795959),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Walnut Grove Elementary School",'Suwanee=' + Suwanee.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(Buford);
map.removeOverlays(Dacula);
map.removeOverlays(Duluth);
map.removeOverlays(Grayson);
map.removeOverlays(Hoschton);
map.removeOverlays(Lawrenceville);
map.removeOverlays(Lilburn);
map.removeOverlays(Loganville);
map.removeOverlays(Norcross);
map.removeOverlays(Snellville);
map.removeOverlays(Sugar_Hill);
map.removeOverlays(Suwanee);
map.removeOverlays(Tucker);
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(Dacula);map.removeOverlays(Buford);
map.removeOverlays(Dacula);
map.removeOverlays(Duluth);
map.removeOverlays(Grayson);
map.removeOverlays(Hoschton);
map.removeOverlays(Lawrenceville);
map.removeOverlays(Lilburn);
map.removeOverlays(Loganville);
map.removeOverlays(Norcross);
map.removeOverlays(Snellville);
map.removeOverlays(Sugar_Hill);
map.removeOverlays(Suwanee);
map.removeOverlays(Tucker);
map.addOverlays(Buford);
centerByArray(Buford, false, false);
cntMarker += Buford.length;
map.addOverlays(Dacula);
centerByArray(Dacula, false, false);
cntMarker += Dacula.length;
map.addOverlays(Duluth);
centerByArray(Duluth, false, false);
cntMarker += Duluth.length;
map.addOverlays(Grayson);
centerByArray(Grayson, false, false);
cntMarker += Grayson.length;
map.addOverlays(Hoschton);
centerByArray(Hoschton, false, false);
cntMarker += Hoschton.length;
map.addOverlays(Lawrenceville);
centerByArray(Lawrenceville, false, false);
cntMarker += Lawrenceville.length;
map.addOverlays(Lilburn);
centerByArray(Lilburn, false, false);
cntMarker += Lilburn.length;
map.addOverlays(Loganville);
centerByArray(Loganville, false, false);
cntMarker += Loganville.length;
map.addOverlays(Norcross);
centerByArray(Norcross, false, false);
cntMarker += Norcross.length;
map.addOverlays(Snellville);
centerByArray(Snellville, false, false);
cntMarker += Snellville.length;
map.addOverlays(Sugar_Hill);
centerByArray(Sugar_Hill, false, false);
cntMarker += Sugar_Hill.length;
map.addOverlays(Suwanee);
centerByArray(Suwanee, false, false);
cntMarker += Suwanee.length;
map.addOverlays(Tucker);
centerByArray(Tucker, false, false);
cntMarker += Tucker.length;
centerByArray(Dacula,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');
}
}