function addMarkers()
{
mySelect = document.getElementById('selection');
Salem = [];Aumsville = [];Silverton = [];Brooks = [];Turner = [];Keizer = [];Gervais = [];Woodburn = [];Jefferson = [];Mt_Angel = [];Aurora = [];Scotts_Mills = [];St_Paul = [];Stayton = [];Sublimity = [];mySelect.options[mySelect.options.length] = new Option("Aumsville schools",'all=Aumsville');
mySelect.options[mySelect.options.length] = new Option("Aurora schools",'all=Aurora');
mySelect.options[mySelect.options.length] = new Option("Brooks schools",'all=Brooks');
mySelect.options[mySelect.options.length] = new Option("Gervais schools",'all=Gervais');
mySelect.options[mySelect.options.length] = new Option("Jefferson schools",'all=Jefferson');
mySelect.options[mySelect.options.length] = new Option("Keizer schools",'all=Keizer');
mySelect.options[mySelect.options.length] = new Option("Mt Angel schools",'all=Mt_Angel');
mySelect.options[mySelect.options.length] = new Option("Salem schools",'all=Salem');
mySelect.options[mySelect.options.length] = new Option("Scotts Mills schools",'all=Scotts_Mills');
mySelect.options[mySelect.options.length] = new Option("Silverton schools",'all=Silverton');
mySelect.options[mySelect.options.length] = new Option("St Paul schools",'all=St_Paul');
mySelect.options[mySelect.options.length] = new Option("Stayton schools",'all=Stayton');
mySelect.options[mySelect.options.length] = new Option("Sublimity schools",'all=Sublimity');
mySelect.options[mySelect.options.length] = new Option("Turner schools",'all=Turner');
mySelect.options[mySelect.options.length] = new Option("Woodburn schools",'all=Woodburn');
mySelect.options[mySelect.options.length] = new Option("---------------------------",'');
Salem[Salem.length] = createMarker(new GPoint(-122.97760010,44.92269897),"
",iconGr);
mySelect.options[mySelect.options.length] = new Option("21st Century Community Schoolhouse High School",'Salem=' + Salem.length);
Salem[Salem.length] = createMarker(new GPoint(-122.97068787,44.93626404),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Auburn Elementary School",'Salem=' + Salem.length);
Aumsville[Aumsville.length] = createMarker(new GPoint(-122.87778473,44.84752655),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Aumsville Elementary School",'Aumsville=' + Aumsville.length);
Salem[Salem.length] = createMarker(new GPoint(-123.04601288,44.92596054),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Baker Elementary School",'Salem=' + Salem.length);
Salem[Salem.length] = createMarker(new GPoint(-123.02033234,44.96438980),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Barbara Roberts High School And Secondary Programs",'Salem=' + Salem.length);
Silverton[Silverton.length] = createMarker(new GPoint(-122.81882477,45.01196289),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Bethany Elementary School",'Silverton=' + Silverton.length);
Salem[Salem.length] = createMarker(new GPoint(-122.92671967,44.92673111),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Bethel Elementary School",'Salem=' + Salem.length);
Brooks[Brooks.length] = createMarker(new GPoint(-122.96450043,44.98830032),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Brooks Elementary School",'Brooks=' + Brooks.length);
Salem[Salem.length] = createMarker(new GPoint(-123.03185272,44.93086624),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Bush Elementary School",'Salem=' + Salem.length);
Salem[Salem.length] = createMarker(new GPoint(-123.05814362,44.91233826),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Candalaria Elementary School",'Salem=' + Salem.length);
Turner[Turner.length] = createMarker(new GPoint(-122.91842651,44.80840683),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Cascade Junior High School",'Turner=' + Turner.length);
Turner[Turner.length] = createMarker(new GPoint(-122.91842651,44.80840683),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Cascade Senior High School",'Turner=' + Turner.length);
Silverton[Silverton.length] = createMarker(new GPoint(-122.87931824,44.99126434),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Central Howell Elementary School",'Silverton=' + Silverton.length);
Salem[Salem.length] = createMarker(new GPoint(-122.98502350,45.00437927),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Chemawa Indian School",'Salem=' + Salem.length);
Keizer[Keizer.length] = createMarker(new GPoint(-123.01039886,44.98588943),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Claggett Creek Middle School",'Keizer=' + Keizer.length);
Keizer[Keizer.length] = createMarker(new GPoint(-123.01789093,45.02637100),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Clear Lake Elementary School",'Keizer=' + Keizer.length);
Turner[Turner.length] = createMarker(new GPoint(-122.97047424,44.81492615),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Cloverdale Elementary School",'Turner=' + Turner.length);
Salem[Salem.length] = createMarker(new GPoint(-123.06398773,44.87326431),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Crossler Middle School",'Salem=' + Salem.length);
Keizer[Keizer.length] = createMarker(new GPoint(-123.03417969,44.98983765),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Cummings Elementary School",'Keizer=' + Keizer.length);
Gervais[Gervais.length] = createMarker(new GPoint(-122.91699982,45.10710144),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Douglas Avenue Charter School",'Gervais=' + Gervais.length);
Brooks[Brooks.length] = createMarker(new GPoint(-122.96450043,44.98830032),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Eldriedge Elementary School",'Brooks=' + Brooks.length);
Salem[Salem.length] = createMarker(new GPoint(-123.01196289,44.94569778),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Englewood Elementary School",'Salem=' + Salem.length);
Silverton[Silverton.length] = createMarker(new GPoint(-122.78428650,45.00706863),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Eugene Field Elementary School",'Silverton=' + Silverton.length);
Silverton[Silverton.length] = createMarker(new GPoint(-122.80959320,44.97939682),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Evergreen Elementary School",'Silverton=' + Silverton.length);
Salem[Salem.length] = createMarker(new GPoint(-123.04830170,44.89635086),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Faye Wright Elementary School",'Salem=' + Salem.length);
Salem[Salem.length] = createMarker(new GPoint(-122.97791290,44.92295837),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Four Corners Elementary School",'Salem=' + Salem.length);
Woodburn[Woodburn.length] = createMarker(new GPoint(-122.85942078,45.15062714),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("French Prairie Middle School",'Woodburn=' + Woodburn.length);
Salem[Salem.length] = createMarker(new GPoint(-122.92887115,44.94090271),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Fruitland Elementary School",'Salem=' + Salem.length);
Gervais[Gervais.length] = createMarker(new GPoint(-122.90799713,45.10729980),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Gervais High School",'Gervais=' + Gervais.length);
Gervais[Gervais.length] = createMarker(new GPoint(-122.90799713,45.10729980),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Gervais Middle School",'Gervais=' + Gervais.length);
Salem[Salem.length] = createMarker(new GPoint(-123.02722931,44.95019531),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Grant Community Middle School",'Salem=' + Salem.length);
Salem[Salem.length] = createMarker(new GPoint(-123.02722931,44.95019531),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Grant Community School",'Salem=' + Salem.length);
Keizer[Keizer.length] = createMarker(new GPoint(-123.01330566,45.01524353),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Gubser Elementary School",'Keizer=' + Keizer.length);
Salem[Salem.length] = createMarker(new GPoint(-122.99520874,44.97703552),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hallman Elementary School",'Salem=' + Salem.length);
Salem[Salem.length] = createMarker(new GPoint(-122.95670319,44.99603653),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hammond Elementary School",'Salem=' + Salem.length);
Salem[Salem.length] = createMarker(new GPoint(-122.97209930,44.98294067),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hayesville Elementary School",'Salem=' + Salem.length);
Salem[Salem.length] = createMarker(new GPoint(-122.94257355,45.00709534),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hazel Green Elementary School",'Salem=' + Salem.length);
Woodburn[Woodburn.length] = createMarker(new GPoint(-122.86790466,45.13576126),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Heritage Elementary School",'Woodburn=' + Woodburn.length);
Salem[Salem.length] = createMarker(new GPoint(-123.02803040,44.96035004),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Highland Elementary School",'Salem=' + Salem.length);
Salem[Salem.length] = createMarker(new GPoint(-122.99600220,44.94443512),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hoover Elementary School",'Salem=' + Salem.length);
Salem[Salem.length] = createMarker(new GPoint(-122.97069550,44.91547775),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Houck Middle School",'Salem=' + Salem.length);
Salem[Salem.length] = createMarker(new GPoint(-123.03884125,44.92336273),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Howard Street School",'Salem=' + Salem.length);
Salem[Salem.length] = createMarker(new GPoint(-123.01985400,44.99687000),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Jane Goodall Environmental Charter",'Salem=' + Salem.length);
Jefferson[Jefferson.length] = createMarker(new GPoint(-123.01006317,44.72317886),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Jefferson Elementary School",'Jefferson=' + Jefferson.length);
Jefferson[Jefferson.length] = createMarker(new GPoint(-123.04727936,44.75724411),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Jefferson High School",'Jefferson=' + Jefferson.length);
Jefferson[Jefferson.length] = createMarker(new GPoint(-123.01049042,44.73196411),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Jefferson Middle School",'Jefferson=' + Jefferson.length);
Mt_Angel[Mt_Angel.length] = createMarker(new GPoint(-122.78916931,45.07134628),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("John F Kennedy High School",'Mt_Angel=' + Mt_Angel.length);
Salem[Salem.length] = createMarker(new GPoint(-123.04537964,44.88940811),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Judson Middle School",'Salem=' + Salem.length);
Keizer[Keizer.length] = createMarker(new GPoint(-123.03790283,45.00403595),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Keizer Elementary School",'Keizer=' + Keizer.length);
Keizer[Keizer.length] = createMarker(new GPoint(-123.00810242,44.99612427),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Kennedy Elementary School",'Keizer=' + Keizer.length);
Salem[Salem.length] = createMarker(new GPoint(-122.97261810,45.02780151),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lake Labish Elementary School",'Salem=' + Salem.length);
Salem[Salem.length] = createMarker(new GPoint(-122.95968628,44.97682190),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lamb Elementary School",'Salem=' + Salem.length);
Salem[Salem.length] = createMarker(new GPoint(-123.00425720,44.87372589),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lee Elementary School",'Salem=' + Salem.length);
Salem[Salem.length] = createMarker(new GPoint(-123.02580261,44.89993286),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Leslie Middle School",'Salem=' + Salem.length);
Salem[Salem.length] = createMarker(new GPoint(-123.06114960,44.88726425),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Liberty Elementary School",'Salem=' + Salem.length);
Woodburn[Woodburn.length] = createMarker(new GPoint(-122.85938263,45.15074921),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lincoln Elementary School",'Woodburn=' + Woodburn.length);
Turner[Turner.length] = createMarker(new GPoint(-122.94989777,44.80749893),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Marion Elementary School",'Turner=' + Turner.length);
Salem[Salem.length] = createMarker(new GPoint(-122.96700287,44.91054153),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Marion Miller Elementary School",'Salem=' + Salem.length);
Silverton[Silverton.length] = createMarker(new GPoint(-122.77749634,45.01221848),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Mark Twain Middle School",'Silverton=' + Silverton.length);
Salem[Salem.length] = createMarker(new GPoint(-122.96216583,44.91834641),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mary Eyre Elementary School",'Salem=' + Salem.length);
Salem[Salem.length] = createMarker(new GPoint(-122.98341370,44.95787430),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Mckay High School",'Salem=' + Salem.length);
Salem[Salem.length] = createMarker(new GPoint(-123.04229736,44.91736221),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mckinley Elementary School",'Salem=' + Salem.length);
Keizer[Keizer.length] = createMarker(new GPoint(-123.03336334,44.99713516),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Mcnary High School",'Keizer=' + Keizer.length);
Salem[Salem.length] = createMarker(new GPoint(-122.96004486,44.97036362),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Middle Grove Primary",'Salem=' + Salem.length);
Mt_Angel[Mt_Angel.length] = createMarker(new GPoint(-122.74823761,45.09939957),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Monitor Elementary School",'Mt_Angel=' + Mt_Angel.length);
Salem[Salem.length] = createMarker(new GPoint(-123.03099060,44.90449905),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Morningside Elementary School",'Salem=' + Salem.length);
Mt_Angel[Mt_Angel.length] = createMarker(new GPoint(-122.79357147,45.07143784),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Mt Angel Middle School",'Mt_Angel=' + Mt_Angel.length);
Woodburn[Woodburn.length] = createMarker(new GPoint(-122.86953735,45.14603806),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Nellie Muir Elementary School",'Woodburn=' + Woodburn.length);
Silverton[Silverton.length] = createMarker(new GPoint(-122.87002563,45.04586411),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("North Howell Elementary School",'Silverton=' + Silverton.length);
Aurora[Aurora.length] = createMarker(new GPoint(-122.79551697,45.21149063),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("North Marion High School",'Aurora=' + Aurora.length);
Aurora[Aurora.length] = createMarker(new GPoint(-122.79603577,45.21221161),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("North Marion Intermediate School",'Aurora=' + Aurora.length);
Aurora[Aurora.length] = createMarker(new GPoint(-122.79575348,45.21243286),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("North Marion Middle School",'Aurora=' + Aurora.length);
Aurora[Aurora.length] = createMarker(new GPoint(-122.79618073,45.21242142),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("North Marion Primary School",'Aurora=' + Aurora.length);
Salem[Salem.length] = createMarker(new GPoint(-123.02066803,44.94391251),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("North Salem High School",'Salem=' + Salem.length);
Keizer[Keizer.length] = createMarker(new GPoint(-123.02008057,45.03506470),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Optimum Learning Environments Charter School",'Keizer=' + Keizer.length);
Salem[Salem.length] = createMarker(new GPoint(-123.03849030,44.93292236),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Oregon School For Blind",'Salem=' + Salem.length);
Salem[Salem.length] = createMarker(new GPoint(-123.02033234,44.96438980),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Oregon School For Deaf",'Salem=' + Salem.length);
Salem[Salem.length] = createMarker(new GPoint(-123.02494049,44.94520187),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Parrish Middle School",'Salem=' + Salem.length);
Salem[Salem.length] = createMarker(new GPoint(-122.87682343,44.95843887),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Pratum Elementary School",'Salem=' + Salem.length);
Salem[Salem.length] = createMarker(new GPoint(-123.01680756,44.87644577),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Pringle Elementary School",'Salem=' + Salem.length);
Salem[Salem.length] = createMarker(new GPoint(-123.01316833,44.92993164),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Richmond Elementary School",'Salem=' + Salem.length);
Silverton[Silverton.length] = createMarker(new GPoint(-122.79249573,45.00145340),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Robert Frost Elementary School",'Silverton=' + Silverton.length);
Salem[Salem.length] = createMarker(new GPoint(-123.01080322,44.89723969),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Robert S Farrell High School",'Salem=' + Salem.length);
Salem[Salem.length] = createMarker(new GPoint(-123.06389618,44.85446167),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Rosedale Elementary School",'Salem=' + Salem.length);
Salem[Salem.length] = createMarker(new GPoint(-123.05043030,44.90505219),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Salem Heights Elementary School",'Salem=' + Salem.length);
Salem[Salem.length] = createMarker(new GPoint(-123.07298279,44.88557816),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Schirle Elementary School",'Salem=' + Salem.length);
Salem[Salem.length] = createMarker(new GPoint(-122.96969604,44.96706390),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Scott Elementary School",'Salem=' + Salem.length);
Scotts_Mills[Scotts_Mills.length] = createMarker(new GPoint(-122.63089752,45.00139999),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Scotts Mills Elementary School",'Scotts_Mills=' + Scotts_Mills.length);
Silverton[Silverton.length] = createMarker(new GPoint(-122.66669464,44.92456055),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Silver Crest Elementary School",'Silverton=' + Silverton.length);
Silverton[Silverton.length] = createMarker(new GPoint(-122.78897095,45.01213837),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Silverton High School (Schoolador St Campus)",'Silverton=' + Silverton.length);
Salem[Salem.length] = createMarker(new GPoint(-123.04020691,44.92179871),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("South Salem High School",'Salem=' + Salem.length);
Salem[Salem.length] = createMarker(new GPoint(-123.08018494,44.88343811),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Sprague High School",'Salem=' + Salem.length);
Mt_Angel[Mt_Angel.length] = createMarker(new GPoint(-79.79161600,34.18719800),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("St Mary's Public School",'Mt_Angel=' + Mt_Angel.length);
St_Paul[St_Paul.length] = createMarker(new GPoint(-122.97461700,45.21407318),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("St Paul Elementary School",'St_Paul=' + St_Paul.length);
St_Paul[St_Paul.length] = createMarker(new GPoint(-122.97461700,45.21407318),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St Paul High School",'St_Paul=' + St_Paul.length);
Stayton[Stayton.length] = createMarker(new GPoint(-122.79249573,44.80126190),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Stayton Elementary School",'Stayton=' + Stayton.length);
Stayton[Stayton.length] = createMarker(new GPoint(-122.79988098,44.80273819),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Stayton High School",'Stayton=' + Stayton.length);
Stayton[Stayton.length] = createMarker(new GPoint(-122.80326843,44.80993652),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Stayton Middle School",'Stayton=' + Stayton.length);
Salem[Salem.length] = createMarker(new GPoint(-122.96044922,44.99103928),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Stephens Middle School",'Salem=' + Salem.length);
Sublimity[Sublimity.length] = createMarker(new GPoint(-122.79785156,44.83006287),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Sublimity Elementary School",'Sublimity=' + Sublimity.length);
Salem[Salem.length] = createMarker(new GPoint(-123.04761505,44.87717438),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Sumpter Elementary School",'Salem=' + Salem.length);
Salem[Salem.length] = createMarker(new GPoint(-122.97390747,44.95033646),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Swegle Elementary School",'Salem=' + Salem.length);
Turner[Turner.length] = createMarker(new GPoint(-122.94989777,44.80749893),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Turner Elementary School",'Turner=' + Turner.length);
Woodburn[Woodburn.length] = createMarker(new GPoint(-122.86795044,45.13576126),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Valor Middle School",'Woodburn=' + Woodburn.length);
Silverton[Silverton.length] = createMarker(new GPoint(-122.75579071,44.91662216),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Victor Point Elementary School",'Silverton=' + Silverton.length);
Salem[Salem.length] = createMarker(new GPoint(-122.99779510,44.96139145),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Waldo Middle School",'Salem=' + Salem.length);
Woodburn[Woodburn.length] = createMarker(new GPoint(-122.83170319,45.14355850),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Washington Elementary School",'Woodburn=' + Woodburn.length);
Salem[Salem.length] = createMarker(new GPoint(-122.99769592,44.96574020),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Washington Elementary School",'Salem=' + Salem.length);
Keizer[Keizer.length] = createMarker(new GPoint(-123.01069641,44.98617172),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Weddle Elementary School",'Keizer=' + Keizer.length);
Salem[Salem.length] = createMarker(new GPoint(-123.08528137,44.96042633),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("West Salem High School",'Salem=' + Salem.length);
Salem[Salem.length] = createMarker(new GPoint(-123.00910187,44.92530060),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("West Salem Language Academy",'Salem=' + Salem.length);
Aumsville[Aumsville.length] = createMarker(new GPoint(-122.87509155,44.79138184),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("West Stayton Elementary School",'Aumsville=' + Aumsville.length);
Keizer[Keizer.length] = createMarker(new GPoint(-123.01073456,45.00613785),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Whiteaker Middle School",'Keizer=' + Keizer.length);
Woodburn[Woodburn.length] = createMarker(new GPoint(-122.82775879,45.15501785),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("William P Lord High School",'Woodburn=' + Woodburn.length);
Woodburn[Woodburn.length] = createMarker(new GPoint(-122.85962000,45.14948900),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Woodburn Arthur Academy",'Woodburn=' + Woodburn.length);
Woodburn[Woodburn.length] = createMarker(new GPoint(-122.84613037,45.15103531),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Woodburn High School",'Woodburn=' + Woodburn.length);
Salem[Salem.length] = createMarker(new GPoint(-122.96250153,44.98576355),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Yoshikai Elementary School",'Salem=' + Salem.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(Aumsville);
map.removeOverlays(Aurora);
map.removeOverlays(Brooks);
map.removeOverlays(Gervais);
map.removeOverlays(Jefferson);
map.removeOverlays(Keizer);
map.removeOverlays(Mt_Angel);
map.removeOverlays(Salem);
map.removeOverlays(Scotts_Mills);
map.removeOverlays(Silverton);
map.removeOverlays(St_Paul);
map.removeOverlays(Stayton);
map.removeOverlays(Sublimity);
map.removeOverlays(Turner);
map.removeOverlays(Woodburn);
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(Salem);map.removeOverlays(Aumsville);
map.removeOverlays(Aurora);
map.removeOverlays(Brooks);
map.removeOverlays(Gervais);
map.removeOverlays(Jefferson);
map.removeOverlays(Keizer);
map.removeOverlays(Mt_Angel);
map.removeOverlays(Salem);
map.removeOverlays(Scotts_Mills);
map.removeOverlays(Silverton);
map.removeOverlays(St_Paul);
map.removeOverlays(Stayton);
map.removeOverlays(Sublimity);
map.removeOverlays(Turner);
map.removeOverlays(Woodburn);
map.addOverlays(Aumsville);
centerByArray(Aumsville, false, false);
cntMarker += Aumsville.length;
map.addOverlays(Aurora);
centerByArray(Aurora, false, false);
cntMarker += Aurora.length;
map.addOverlays(Brooks);
centerByArray(Brooks, false, false);
cntMarker += Brooks.length;
map.addOverlays(Gervais);
centerByArray(Gervais, false, false);
cntMarker += Gervais.length;
map.addOverlays(Jefferson);
centerByArray(Jefferson, false, false);
cntMarker += Jefferson.length;
map.addOverlays(Keizer);
centerByArray(Keizer, false, false);
cntMarker += Keizer.length;
map.addOverlays(Mt_Angel);
centerByArray(Mt_Angel, false, false);
cntMarker += Mt_Angel.length;
map.addOverlays(Salem);
centerByArray(Salem, false, false);
cntMarker += Salem.length;
map.addOverlays(Scotts_Mills);
centerByArray(Scotts_Mills, false, false);
cntMarker += Scotts_Mills.length;
map.addOverlays(Silverton);
centerByArray(Silverton, false, false);
cntMarker += Silverton.length;
map.addOverlays(St_Paul);
centerByArray(St_Paul, false, false);
cntMarker += St_Paul.length;
map.addOverlays(Stayton);
centerByArray(Stayton, false, false);
cntMarker += Stayton.length;
map.addOverlays(Sublimity);
centerByArray(Sublimity, false, false);
cntMarker += Sublimity.length;
map.addOverlays(Turner);
centerByArray(Turner, false, false);
cntMarker += Turner.length;
map.addOverlays(Woodburn);
centerByArray(Woodburn, false, false);
cntMarker += Woodburn.length;
centerByArray(Salem,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');
}
}