function addMarkers()
{
mySelect = document.getElementById('selection');
Hanover = [];East_Prospect = [];York = [];Brogue = [];Lewisberry = [];Dallastown = [];Delta = [];Dillsburg = [];Dover = [];Wrightsville = [];Red_Lion = [];New_Cumberland = [];Fawn_Grove = [];Glen_Rock = [];Spring_Grove = [];East_Berlin = [];Hellam = [];Glenville = [];Mt_Wolf = [];Etters = [];Manchester = [];Thomasville = [];Stewartstown = [];Wellsville = [];Windsor = [];York_Haven = [];mySelect.options[mySelect.options.length] = new Option("Brogue schools",'all=Brogue');
mySelect.options[mySelect.options.length] = new Option("Dallastown schools",'all=Dallastown');
mySelect.options[mySelect.options.length] = new Option("Delta schools",'all=Delta');
mySelect.options[mySelect.options.length] = new Option("Dillsburg schools",'all=Dillsburg');
mySelect.options[mySelect.options.length] = new Option("Dover schools",'all=Dover');
mySelect.options[mySelect.options.length] = new Option("East Berlin schools",'all=East_Berlin');
mySelect.options[mySelect.options.length] = new Option("East Prospect schools",'all=East_Prospect');
mySelect.options[mySelect.options.length] = new Option("Etters schools",'all=Etters');
mySelect.options[mySelect.options.length] = new Option("Fawn Grove schools",'all=Fawn_Grove');
mySelect.options[mySelect.options.length] = new Option("Glen Rock schools",'all=Glen_Rock');
mySelect.options[mySelect.options.length] = new Option("Glenville schools",'all=Glenville');
mySelect.options[mySelect.options.length] = new Option("Hanover schools",'all=Hanover');
mySelect.options[mySelect.options.length] = new Option("Hellam schools",'all=Hellam');
mySelect.options[mySelect.options.length] = new Option("Lewisberry schools",'all=Lewisberry');
mySelect.options[mySelect.options.length] = new Option("Manchester schools",'all=Manchester');
mySelect.options[mySelect.options.length] = new Option("Mt Wolf schools",'all=Mt_Wolf');
mySelect.options[mySelect.options.length] = new Option("New Cumberland schools",'all=New_Cumberland');
mySelect.options[mySelect.options.length] = new Option("Red Lion schools",'all=Red_Lion');
mySelect.options[mySelect.options.length] = new Option("Spring Grove schools",'all=Spring_Grove');
mySelect.options[mySelect.options.length] = new Option("Stewartstown schools",'all=Stewartstown');
mySelect.options[mySelect.options.length] = new Option("Thomasville schools",'all=Thomasville');
mySelect.options[mySelect.options.length] = new Option("Wellsville schools",'all=Wellsville');
mySelect.options[mySelect.options.length] = new Option("Windsor schools",'all=Windsor');
mySelect.options[mySelect.options.length] = new Option("Wrightsville schools",'all=Wrightsville');
mySelect.options[mySelect.options.length] = new Option("York schools",'all=York');
mySelect.options[mySelect.options.length] = new Option("York Haven schools",'all=York_Haven');
mySelect.options[mySelect.options.length] = new Option("---------------------------",'');
Hanover[Hanover.length] = createMarker(new GPoint(-76.96576691,39.80279541),"
",iconRd);
mySelect.options[mySelect.options.length] = new Option("Baresville Elementary School",'Hanover=' + Hanover.length);
East_Prospect[East_Prospect.length] = createMarker(new GPoint(-76.52020264,39.97190094),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Canadochly Elementary School",'East_Prospect=' + East_Prospect.length);
York[York.length] = createMarker(new GPoint(-76.72757721,39.97880173),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Central York High School",'York=' + York.length);
York[York.length] = createMarker(new GPoint(-76.69429779,39.99036026),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Central York Middle School",'York=' + York.length);
Brogue[Brogue.length] = createMarker(new GPoint(-76.48486328,39.87033844),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Chanceford Elementary School",'Brogue=' + Brogue.length);
Hanover[Hanover.length] = createMarker(new GPoint(-76.98930359,39.81458282),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Clearview Elementary School",'Hanover=' + Hanover.length);
Brogue[Brogue.length] = createMarker(new GPoint(-76.38529968,39.89939880),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Clearview Elementary School",'Brogue=' + Brogue.length);
York[York.length] = createMarker(new GPoint(-76.77994537,40.06107330),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Conewago Elementary School",'York=' + York.length);
York[York.length] = createMarker(new GPoint(-76.72138977,39.95486450),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Crispus Attucks Youthbuild Charter School",'York=' + York.length);
Lewisberry[Lewisberry.length] = createMarker(new GPoint(-76.84378815,40.17987442),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Crossroads Middle School",'Lewisberry=' + Lewisberry.length);
Dallastown[Dallastown.length] = createMarker(new GPoint(-76.64975739,39.89173126),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Dallastown Area Middle School",'Dallastown=' + Dallastown.length);
Dallastown[Dallastown.length] = createMarker(new GPoint(-76.64095900,39.90037000),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Dallastown Area MiddleSchool",'Dallastown=' + Dallastown.length);
Dallastown[Dallastown.length] = createMarker(new GPoint(-76.64975739,39.89173126),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Dallastown Area Senior High School",'Dallastown=' + Dallastown.length);
Dallastown[Dallastown.length] = createMarker(new GPoint(-76.64210510,39.89867401),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Dallastown Elementary School",'Dallastown=' + Dallastown.length);
York[York.length] = createMarker(new GPoint(-76.69763947,39.96533966),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Davis School",'York=' + York.length);
Delta[Delta.length] = createMarker(new GPoint(-76.31603241,39.73138428),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Delta-peach Bottom Elementary School",'Delta=' + Delta.length);
York[York.length] = createMarker(new GPoint(-76.74755096,39.97260284),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Devers School",'York=' + York.length);
Dillsburg[Dillsburg.length] = createMarker(new GPoint(-77.03280640,40.10888672),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Dillsburg Elementary School",'Dillsburg=' + Dillsburg.length);
Dover[Dover.length] = createMarker(new GPoint(-76.84420776,40.00483704),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Dover Area Elementary School",'Dover=' + Dover.length);
Dover[Dover.length] = createMarker(new GPoint(-76.85124969,40.00057220),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Dover Area High School",'Dover=' + Dover.length);
Dover[Dover.length] = createMarker(new GPoint(-76.85665131,39.99999619),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Dover Area Intrmd School",'Dover=' + Dover.length);
York[York.length] = createMarker(new GPoint(-76.67942047,39.96460724),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("East York Elementary School",'York=' + York.length);
Wrightsville[Wrightsville.length] = createMarker(new GPoint(-76.52580261,39.99810028),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Eastern York High School",'Wrightsville=' + Wrightsville.length);
Wrightsville[Wrightsville.length] = createMarker(new GPoint(-76.52580261,39.99810028),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Eastern York Middle School",'Wrightsville=' + Wrightsville.length);
York[York.length] = createMarker(new GPoint(-76.75386047,39.96326447),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Edgar Fahs Smith Middle School",'York=' + York.length);
Red_Lion[Red_Lion.length] = createMarker(new GPoint(-76.60939026,39.89383316),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Edgar Moore Elementary School",'Red_Lion=' + Red_Lion.length);
New_Cumberland[New_Cumberland.length] = createMarker(new GPoint(-76.88559723,40.20203400),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Fairview Elementary School",'New_Cumberland=' + New_Cumberland.length);
Fawn_Grove[Fawn_Grove.length] = createMarker(new GPoint(-76.46701813,39.73237610),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Fawn Area Elementary School",'Fawn_Grove=' + Fawn_Grove.length);
York[York.length] = createMarker(new GPoint(-76.73903656,39.96656418),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Ferguson School",'York=' + York.length);
Lewisberry[Lewisberry.length] = createMarker(new GPoint(-76.84029388,40.17933655),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Fishing Creek Elementary School",'Lewisberry=' + Lewisberry.length);
Glen_Rock[Glen_Rock.length] = createMarker(new GPoint(-76.76638031,39.76278687),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Friendship Elementary School",'Glen_Rock=' + Glen_Rock.length);
York[York.length] = createMarker(new GPoint(-76.72084045,39.96827316),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Goode School",'York=' + York.length);
York[York.length] = createMarker(new GPoint(-76.71581268,39.95732880),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Hannah Penn Middle School",'York=' + York.length);
Hanover[Hanover.length] = createMarker(new GPoint(-76.97004700,39.82224274),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Hanover Middle School",'Hanover=' + Hanover.length);
Hanover[Hanover.length] = createMarker(new GPoint(-76.97196198,39.81782532),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Hanover Senior High School",'Hanover=' + Hanover.length);
Hanover[Hanover.length] = createMarker(new GPoint(-76.97795868,39.79790115),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hanover Street Elementary School",'Hanover=' + Hanover.length);
York[York.length] = createMarker(new GPoint(-76.73190308,40.00443649),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hayshire Elementary School",'York=' + York.length);
Spring_Grove[Spring_Grove.length] = createMarker(new GPoint(-76.92033386,39.83240509),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Heidelberg Elementary School",'Spring_Grove=' + Spring_Grove.length);
York[York.length] = createMarker(new GPoint(-76.75241852,39.93712234),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Indian Rock Elementary School",'York=' + York.length);
York[York.length] = createMarker(new GPoint(-76.71862793,39.95318985),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Jackson School",'York=' + York.length);
Fawn_Grove[Fawn_Grove.length] = createMarker(new GPoint(-76.46348572,39.73136139),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Kennard-dale High School",'Fawn_Grove=' + Fawn_Grove.length);
East_Berlin[East_Berlin.length] = createMarker(new GPoint(-76.98068237,40.01666260),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Kralltown Elementary School",'East_Berlin=' + East_Berlin.length);
Hellam[Hellam.length] = createMarker(new GPoint(-76.71431732,39.96794128),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Kreutz Creek Elementary School",'Hellam=' + Hellam.length);
York[York.length] = createMarker(new GPoint(-76.71697998,39.91073990),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Leaders Heights Elementary School",'York=' + York.length);
Dover[Dover.length] = createMarker(new GPoint(-76.83067322,39.97041321),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Leib Elementary School",'Dover=' + Dover.length);
York[York.length] = createMarker(new GPoint(-76.74138641,39.95673752),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lincoln Charter School",'York=' + York.length);
York[York.length] = createMarker(new GPoint(-76.77949524,39.95084763),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lincolnway Elementary School",'York=' + York.length);
York[York.length] = createMarker(new GPoint(-76.62091064,39.96226120),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Locust Grove Elementary School",'York=' + York.length);
York[York.length] = createMarker(new GPoint(-76.70399475,39.86070251),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Loganville-springfield Elementary School",'York=' + York.length);
York[York.length] = createMarker(new GPoint(-76.75678253,39.95127869),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Loucks Elementary School",'York=' + York.length);
Glenville[Glenville.length] = createMarker(new GPoint(-76.85508728,39.76319122),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Manheim Elementary School",'Glenville=' + Glenville.length);
Hanover[Hanover.length] = createMarker(new GPoint(-76.96002960,39.78499985),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Markle Intrmd School",'Hanover=' + Hanover.length);
Red_Lion[Red_Lion.length] = createMarker(new GPoint(-76.60832214,39.90560532),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mazie Gable Elementary School",'Red_Lion=' + Red_Lion.length);
York[York.length] = createMarker(new GPoint(-76.72920227,39.95282364),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mckinley School",'York=' + York.length);
Mt_Wolf[Mt_Wolf.length] = createMarker(new GPoint(-76.70330048,40.06050110),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mt Wolf Early Learning Center",'Mt_Wolf=' + Mt_Wolf.length);
Lewisberry[Lewisberry.length] = createMarker(new GPoint(-76.88961792,40.17186356),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mt Zion Elementary School",'Lewisberry=' + Lewisberry.length);
Red_Lion[Red_Lion.length] = createMarker(new GPoint(-76.61804199,39.83530426),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("N Hopewell-winterstown Elementary School",'Red_Lion=' + Red_Lion.length);
York[York.length] = createMarker(new GPoint(-76.79441833,39.89910126),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("New Salem Elementary School",'York=' + York.length);
Etters[Etters.length] = createMarker(new GPoint(-76.80013275,40.13126755),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Newberry Elementary School",'Etters=' + Etters.length);
York[York.length] = createMarker(new GPoint(-76.69517517,39.98356628),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("North Hills Elementary School",'York=' + York.length);
Dover[Dover.length] = createMarker(new GPoint(-76.86520386,39.99515915),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("North Salem Elementary School",'Dover=' + Dover.length);
Manchester[Manchester.length] = createMarker(new GPoint(-76.71617126,40.06330872),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Northeastern Middle School",'Manchester=' + Manchester.length);
Manchester[Manchester.length] = createMarker(new GPoint(-76.71546936,40.06708527),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Northeastern Senior High School",'Manchester=' + Manchester.length);
Dillsburg[Dillsburg.length] = createMarker(new GPoint(-77.03091431,40.09542465),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Northern Elementary School",'Dillsburg=' + Dillsburg.length);
Dillsburg[Dillsburg.length] = createMarker(new GPoint(-77.03091431,40.09563446),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Northern High School",'Dillsburg=' + Dillsburg.length);
Dillsburg[Dillsburg.length] = createMarker(new GPoint(-77.03091431,40.09552765),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Northern Middle School",'Dillsburg=' + Dillsburg.length);
York[York.length] = createMarker(new GPoint(-76.66096497,39.93083954),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Ore Valley Elementary School",'York=' + York.length);
Manchester[Manchester.length] = createMarker(new GPoint(-76.71492004,40.06099701),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Orendorf Elementary School",'Manchester=' + Manchester.length);
Thomasville[Thomasville.length] = createMarker(new GPoint(-76.92161560,39.91510773),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Paradise Elementary School",'Thomasville=' + Thomasville.length);
Hanover[Hanover.length] = createMarker(new GPoint(-76.98200989,39.78872681),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Park Hills Elementary School",'Hanover=' + Hanover.length);
Red_Lion[Red_Lion.length] = createMarker(new GPoint(-76.58458710,39.90186691),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Pleasant View Elementary School",'Red_Lion=' + Red_Lion.length);
Lewisberry[Lewisberry.length] = createMarker(new GPoint(-76.84699249,40.17981720),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Red Land Senior High School",'Lewisberry=' + Lewisberry.length);
Red_Lion[Red_Lion.length] = createMarker(new GPoint(-76.60924530,39.89376068),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Red Lion Area Junior High School",'Red_Lion=' + Red_Lion.length);
Red_Lion[Red_Lion.length] = createMarker(new GPoint(-76.60395050,39.89501190),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Red Lion Area Senior High School",'Red_Lion=' + Red_Lion.length);
Etters[Etters.length] = createMarker(new GPoint(-76.79697418,40.15290070),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Red Mill Elementary School",'Etters=' + Etters.length);
York[York.length] = createMarker(new GPoint(-76.75514984,40.01160812),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Roundtown Elementary School",'York=' + York.length);
Glen_Rock[Glen_Rock.length] = createMarker(new GPoint(-76.73699951,39.78739929),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Shrewsbury Elementary School",'Glen_Rock=' + Glen_Rock.length);
York[York.length] = createMarker(new GPoint(-76.74906158,40.01280212),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Sinking Springs Elementary School",'York=' + York.length);
Fawn_Grove[Fawn_Grove.length] = createMarker(new GPoint(-76.46436310,39.73179245),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("South Eastern Middle School West",'Fawn_Grove=' + Fawn_Grove.length);
Fawn_Grove[Fawn_Grove.length] = createMarker(new GPoint(-76.46298981,39.73114014),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("South Eastern Ms-east Middle School",'Fawn_Grove=' + Fawn_Grove.length);
Dillsburg[Dillsburg.length] = createMarker(new GPoint(-77.06024933,40.09595490),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("South Mountain Elementary School",'Dillsburg=' + Dillsburg.length);
Hanover[Hanover.length] = createMarker(new GPoint(-76.95956421,39.78613663),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("South Western Senior High School",'Hanover=' + Hanover.length);
Glen_Rock[Glen_Rock.length] = createMarker(new GPoint(-76.73699951,39.78739929),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Southern Elementary School",'Glen_Rock=' + Glen_Rock.length);
Glen_Rock[Glen_Rock.length] = createMarker(new GPoint(-76.73699951,39.78739929),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Southern Middle School",'Glen_Rock=' + Glen_Rock.length);
Manchester[Manchester.length] = createMarker(new GPoint(-76.71456909,40.06093216),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Spring Forge Intrd School",'Manchester=' + Manchester.length);
Spring_Grove[Spring_Grove.length] = createMarker(new GPoint(-76.86952972,39.88665390),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Spring Grove Area Intrmd School",'Spring_Grove=' + Spring_Grove.length);
Spring_Grove[Spring_Grove.length] = createMarker(new GPoint(-76.86333400,39.88333000),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Spring Grove Area MiddleSchool",'Spring_Grove=' + Spring_Grove.length);
Spring_Grove[Spring_Grove.length] = createMarker(new GPoint(-76.86972046,39.88008118),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Spring Grove Area Senior High School",'Spring_Grove=' + Spring_Grove.length);
Spring_Grove[Spring_Grove.length] = createMarker(new GPoint(-76.86980438,39.88688278),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Spring Grove Elementary School",'Spring_Grove=' + Spring_Grove.length);
Stewartstown[Stewartstown.length] = createMarker(new GPoint(-76.59021759,39.76328659),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Stewartstown Elementary School",'Stewartstown=' + Stewartstown.length);
York[York.length] = createMarker(new GPoint(-76.63949585,39.99502182),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Stony Brook Elementary School",'York=' + York.length);
Glen_Rock[Glen_Rock.length] = createMarker(new GPoint(-76.73699951,39.78739929),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Susquehannock High School",'Glen_Rock=' + Glen_Rock.length);
York[York.length] = createMarker(new GPoint(-76.79623413,39.96917725),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Trimmer Elementary School",'York=' + York.length);
York[York.length] = createMarker(new GPoint(-76.69609833,39.94877625),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Valley View Center",'York=' + York.length);
York[York.length] = createMarker(new GPoint(-76.78862000,39.97853470),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Wallace Elementary School",'York=' + York.length);
Hanover[Hanover.length] = createMarker(new GPoint(-76.97247314,39.81650162),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Washington Elementary School",'Hanover=' + Hanover.length);
Dover[Dover.length] = createMarker(new GPoint(-76.82486725,39.98434448),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Weigelstown Elementary School",'Dover=' + Dover.length);
Wellsville[Wellsville.length] = createMarker(new GPoint(-76.93555450,40.04993820),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Wellsville Campus Elementary School",'Wellsville=' + Wellsville.length);
Hanover[Hanover.length] = createMarker(new GPoint(-76.94890594,39.74792480),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("West Manheim Elementary School",'Hanover=' + Hanover.length);
York[York.length] = createMarker(new GPoint(-76.76777649,39.96026230),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("West York Area Senior High School",'York=' + York.length);
York[York.length] = createMarker(new GPoint(-76.76577759,39.96036148),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("West York Middle School",'York=' + York.length);
York[York.length] = createMarker(new GPoint(-76.72784424,39.95777512),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("William Penn Senior High School",'York=' + York.length);
Windsor[Windsor.length] = createMarker(new GPoint(-76.58823395,39.92330933),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Windsor Manor Elementary School",'Windsor=' + Windsor.length);
Wrightsville[Wrightsville.length] = createMarker(new GPoint(-76.52559662,39.99829865),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Wrightsville Elementary School",'Wrightsville=' + Wrightsville.length);
York[York.length] = createMarker(new GPoint(-76.68701172,39.92987823),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("York Co School Of Technology",'York=' + York.length);
York[York.length] = createMarker(new GPoint(-76.74089500,39.98214300),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("York County High School",'York=' + York.length);
York_Haven[York_Haven.length] = createMarker(new GPoint(-76.76509857,40.11959839),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("York Haven Elementary School",'York_Haven=' + York_Haven.length);
York[York.length] = createMarker(new GPoint(-76.67275238,39.96742249),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("York Suburban Middle School",'York=' + York.length);
York[York.length] = createMarker(new GPoint(-76.69178009,39.94776154),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("York Suburban Senior High School",'York=' + York.length);
York[York.length] = createMarker(new GPoint(-76.68321228,39.91370773),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("York Township Elementary School",'York=' + York.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(Brogue);
map.removeOverlays(Dallastown);
map.removeOverlays(Delta);
map.removeOverlays(Dillsburg);
map.removeOverlays(Dover);
map.removeOverlays(East_Berlin);
map.removeOverlays(East_Prospect);
map.removeOverlays(Etters);
map.removeOverlays(Fawn_Grove);
map.removeOverlays(Glen_Rock);
map.removeOverlays(Glenville);
map.removeOverlays(Hanover);
map.removeOverlays(Hellam);
map.removeOverlays(Lewisberry);
map.removeOverlays(Manchester);
map.removeOverlays(Mt_Wolf);
map.removeOverlays(New_Cumberland);
map.removeOverlays(Red_Lion);
map.removeOverlays(Spring_Grove);
map.removeOverlays(Stewartstown);
map.removeOverlays(Thomasville);
map.removeOverlays(Wellsville);
map.removeOverlays(Windsor);
map.removeOverlays(Wrightsville);
map.removeOverlays(York);
map.removeOverlays(York_Haven);
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(Hanover);map.removeOverlays(Brogue);
map.removeOverlays(Dallastown);
map.removeOverlays(Delta);
map.removeOverlays(Dillsburg);
map.removeOverlays(Dover);
map.removeOverlays(East_Berlin);
map.removeOverlays(East_Prospect);
map.removeOverlays(Etters);
map.removeOverlays(Fawn_Grove);
map.removeOverlays(Glen_Rock);
map.removeOverlays(Glenville);
map.removeOverlays(Hanover);
map.removeOverlays(Hellam);
map.removeOverlays(Lewisberry);
map.removeOverlays(Manchester);
map.removeOverlays(Mt_Wolf);
map.removeOverlays(New_Cumberland);
map.removeOverlays(Red_Lion);
map.removeOverlays(Spring_Grove);
map.removeOverlays(Stewartstown);
map.removeOverlays(Thomasville);
map.removeOverlays(Wellsville);
map.removeOverlays(Windsor);
map.removeOverlays(Wrightsville);
map.removeOverlays(York);
map.removeOverlays(York_Haven);
map.addOverlays(Brogue);
centerByArray(Brogue, false, false);
cntMarker += Brogue.length;
map.addOverlays(Dallastown);
centerByArray(Dallastown, false, false);
cntMarker += Dallastown.length;
map.addOverlays(Delta);
centerByArray(Delta, false, false);
cntMarker += Delta.length;
map.addOverlays(Dillsburg);
centerByArray(Dillsburg, false, false);
cntMarker += Dillsburg.length;
map.addOverlays(Dover);
centerByArray(Dover, false, false);
cntMarker += Dover.length;
map.addOverlays(East_Berlin);
centerByArray(East_Berlin, false, false);
cntMarker += East_Berlin.length;
map.addOverlays(East_Prospect);
centerByArray(East_Prospect, false, false);
cntMarker += East_Prospect.length;
map.addOverlays(Etters);
centerByArray(Etters, false, false);
cntMarker += Etters.length;
map.addOverlays(Fawn_Grove);
centerByArray(Fawn_Grove, false, false);
cntMarker += Fawn_Grove.length;
map.addOverlays(Glen_Rock);
centerByArray(Glen_Rock, false, false);
cntMarker += Glen_Rock.length;
map.addOverlays(Glenville);
centerByArray(Glenville, false, false);
cntMarker += Glenville.length;
map.addOverlays(Hanover);
centerByArray(Hanover, false, false);
cntMarker += Hanover.length;
map.addOverlays(Hellam);
centerByArray(Hellam, false, false);
cntMarker += Hellam.length;
map.addOverlays(Lewisberry);
centerByArray(Lewisberry, false, false);
cntMarker += Lewisberry.length;
map.addOverlays(Manchester);
centerByArray(Manchester, false, false);
cntMarker += Manchester.length;
map.addOverlays(Mt_Wolf);
centerByArray(Mt_Wolf, false, false);
cntMarker += Mt_Wolf.length;
map.addOverlays(New_Cumberland);
centerByArray(New_Cumberland, false, false);
cntMarker += New_Cumberland.length;
map.addOverlays(Red_Lion);
centerByArray(Red_Lion, false, false);
cntMarker += Red_Lion.length;
map.addOverlays(Spring_Grove);
centerByArray(Spring_Grove, false, false);
cntMarker += Spring_Grove.length;
map.addOverlays(Stewartstown);
centerByArray(Stewartstown, false, false);
cntMarker += Stewartstown.length;
map.addOverlays(Thomasville);
centerByArray(Thomasville, false, false);
cntMarker += Thomasville.length;
map.addOverlays(Wellsville);
centerByArray(Wellsville, false, false);
cntMarker += Wellsville.length;
map.addOverlays(Windsor);
centerByArray(Windsor, false, false);
cntMarker += Windsor.length;
map.addOverlays(Wrightsville);
centerByArray(Wrightsville, false, false);
cntMarker += Wrightsville.length;
map.addOverlays(York);
centerByArray(York, false, false);
cntMarker += York.length;
map.addOverlays(York_Haven);
centerByArray(York_Haven, false, false);
cntMarker += York_Haven.length;
centerByArray(Hanover,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');
}
}