/*
 * races - input the race date and a fudge factor for generating workout
 * schedules
 *
 * Instructions for adding another race are near the end of the file
 *
 * TODO (patrick): implement handler for weekdays other than Sunday in caller
 */

var months = {
    Jan : 0,  jan : 0,
    Feb : 1,  feb : 1,
    Mar : 2,  mar : 2,
    Apr : 3,  apr : 3,
    May : 4,  may : 4,
    Jun : 5,  jun : 5,
    Jul : 6,  jul : 6,
    Aug : 7,  aug : 7,
    Sep : 8,  sep : 8,
    Oct : 9,  oct : 9,
    Nov : 10, nov : 10,
    Dec : 11, dec : 11
};

var races = {
   "WhidbeyIsland2009" : {
      when: new Date(2009, months.Mar, 29),
      name: "Whidbey Island 2009",
      distances: {half:true, full:true},
      url: "http://www.whidbeyislandmarathon.com/"
   },
   "YakimaRiverCanyon2009" : {
      when: new Date(2009, months.Apr, 04),
      name: "Yakima River Canyon",
      distances: {full:true},
      url: "http://www.ontherunevents.com/yrcm/"
   },
   "Boston2009" : {
      when: new Date(2009, months.Apr, 20),
      name: "Boston",
      distances: {full:true},
      url: "http://www.bostonmarathon.org/"
   },
   "Eugene2009" : {
      when: new Date(2009, months.May, 03),
      name: "Eugene",
      distances: {half:true, full:true},
      url: "http://www.eugenemarathon.com/"
   },
   "Vancouver2009" : {
      when: new Date(2009, months.May, 03),
      name: "Vancouver 2009",
      distances: {half:true, full:true},
      url: "http://www.bmovanmarathon.ca/"
   },
   "CapitalCity2009" : {
      when: new Date(2009, months.May, 17),
      name: "Capital City",
      distances: {half:true, full:true},
      url: "http://www.capitalcitymarathon.org/"
   },
   "Madison2009" : {
      when: new Date(2009, months.May, 24),
      name: "Madison",
      distances: {half:true, full:true},
      url: "http://www.madisonfestivals.com/marathon/"
   },
   "Rocknroll2009" : {
      when: new Date(2009, months.May, 31),
      name: "Rock n Roll(San Diego)",
      distances: {half:true, full:true},
      url: "http://www.rnrmarathon.com/"
   },
   "RocknRollSEA2009" : {
      when: new Date(2009, months.Jun, 27),
      name: "Seattle Rock n Roll",
      distances: {half:true, full:true},
      url: "http://www.rnrseattle.com/"
   },
   "Superjocknjill2009" : {
      when: new Date(2009, months.Sep, 6),
      name: "Super Jock n Jill",
      distances: {half:true},
      url: "http://superjocknjill.com/superjockhalf2009/index.html"
   },
   "Skagit2009" : {
      when: new Date(2009, months.Sep, 13),
      name: "Skagit Flats",
      distances: {half:true, full:true},
      url: "http://www.skagitflatsmarathon.com/"
   },
   "Portland2009" : {
      when: new Date(2009, months.Oct, 4),
      name: "Portland",
      distances: {full:true},
      url: "http://www.portlandmarathon.org/"
   },
   "Twincities2009" : {
      when: new Date(2009, months.Oct, 4),
      name: "Twin Cities",
      distances: {full:true},
      url: "http://www.mtcmarathon.org/"
   },
   "Victoria2009" : {
      when: new Date(2009, months.Oct, 11),
      name: "Victoria",
      distances: {half:true, full:true},
      url: "http://www.royalvictoriamarathon.com/"
   },
   "Chicago2009" : {
      when: new Date(2009, months.Oct, 11),
      name: "Chicago",
      distances: {full:true},
      url: "http://www.chicagomarathon.com/"
   },
   "Nike2009" : {
      when: new Date(2009, months.Oct, 18),
      name: "Nike Women's",
      distances: {full:true},
      url: "http://insidenikerunning.nike.com/category/events/nike-womens-marathon/"
   },
   "Marine2009" : {
      when: new Date(2009, months.Oct, 25),
      name: "Marine Corps",
      distances: {full:true},
      url: "http://www.marinemarathon.com/"
   },
   "Tricities2009" : {
      when: new Date(2009, months.Oct, 25),
      name: "Tri Cities",
      distances: {full:true},
      url: "http://www.3rrr.org/marathon/"
   },
   "NewYork2009" : {
      when: new Date(2009, months.Nov, 1),
      name: "New York City",
      distances: {full:true},
      url: "http://www.nycmarathon.org/"
   },
   "Seattle2009" : {
      when: new Date(2009, months.Nov, 29),
      name: "Seattle",
      distances: {half:true, full:true},
      url: "http://www.seattlemarathon.org/"
   },
   "CalInternational2009" : {
      when: new Date(2009, months.Dec, 6),
      name: "Cal International",
      distances: {full:true},
      url: "http://www.runcim.org/"
   },
   "Tucson2009" : {
      when: new Date(2009, months.Dec, 13),
      name: "Tucson",
      distances: {half:true, full:true},
      url: "http://www.tucsonmarathon.com"
   },
   "Honolulu2009" : {
      when: new Date(2009, months.Dec, 13),
      name: "Honolulu",
      distances: {full:true},
      url: "http://www.honolulumarathon.org"
   },
   "Disney2010" : {
      when: new Date(2010, months.Jan, 10),
      name: "Disney",
      distances: {half:true, full:true},
      url: "http://disneyworldsports.disney.go.com/dwws/en_US/events/eventDetail/detail?name=WdwMarathonDetailPage"
   },
   "Nookachamps2010" : {
      when: new Date(2010, months.Jan, 17),
      name: "Nookachamps",
      distances: {half:true},
      url: "http://www.nookachamps.com/"
   },
   "Houston2010" : {
      when: new Date(2010, months.Jan, 17),
      name: "Houston",
      distances: {half:true, full:true},
      url: "http://www.chevronhoustonmarathon.com"
   },
   "ArizonaRnR2010" : {
      when: new Date(2010, months.Jan, 17),
      name: "Arizona Rock n Roll",
      distances: {half:true, full:true},
      url: "http://www.rnraz.com"
   },
   "NapaValley2010" : {
      when: new Date(2010, months.Mar, 7),
      name: "Napa Valley",
      distances: {full:true},
      url: "http://www.napavalleymarathon.org"
   },
   "YakimaRiverCanyon2010" : {
      when: new Date(2010, months.Mar, 27),
      name: "Yakima River Canyon",
      distances: {full:true},
      url: "http://www.ontherunevents.com/yrcm"
   },
   "EasterMarathon2010" : {
      when: new Date(2010, months.Mar, 11),
      name: "Easter",
      distances: {half:true, full:true},
      url: "http://www.ontherunevents.com/eastermarathon"
   },
   "MercerIsland2010" : {
      when: new Date(2010, months.Mar, 21),
      name: "Mercer Island",
      distances: {half:true},
      url: "http://www.mercerislandhalf.com/"
   },
   "WhidbeyIsland2010" : {
      when: new Date(2010, months.Apr, 11),
      name: "Whidbey Island",
      distances: {half:true, full:true},
      url: "http://www.whidbeyislandmarathon.com"
   },
   "Wenatchee2010" : {
      when: new Date(2010, months.Apr, 17),
      name: "Wenatchee",
      distances: {half:true, full:true},
      url: "http://www.wenatcheemarathon.com"
   },
   "Boston2010" : {
      when: new Date(2010, months.Apr, 18),
      name: "Boston",
      distances: {full:true},
      url: "http://www.bostonmarathon.org"
   },
   "BigSur2010" : {
      when: new Date(2010, months.Apr, 25),
      name: "Big Sur International",
      distances: {half:true, full:true},
      url: "http://bsim.org"
   },
   "AvenueoftheGiants2010" : {
      when: new Date(2010, months.May, 2),
      name: "Avenue of the Giants",
      distances: {half:true, full:true},
      url: "http://www.theave.org"
   },
   "Vancouver2010" : {
      when: new Date(2010, months.May, 2),
      name: "Vancouver",
      distances: {half:true, full:true},
      url: "http://www.bmovanmarathon.ca"
   },
   "Eugene2010" : {
      when: new Date(2010, months.May, 2),
      name: "Eugene",
      distances: {half:true, full:true},
      url: "http://www.eugenemarathon.com"
   },
   "Windermere2010" : {
      when: new Date(2010, months.May, 15),
      name: "Windermere",
      distances: {half:true, full:true},
      url: "http://www.windermeremarathon.com/site3.aspx"
   },
   "CapitalCity2010" : {
      when: new Date(2010, months.May, 16),
      name: "Capital City",
      distances: {half:true, full:true},
      url: "http://www.CapitalCityMarathon.org"
   },
   "CoeurdAlene2010" : {
      when: new Date(2010, months.May, 30),
      name: "Coeur d'Alene",
      distances: {half:true, full:true},
      url: "http://www.cdamarathon.com/"
   },
   "Newport2010" : {
      when: new Date(2010, months.Jun, 6),
      name: "Newport",
      distances: {half:true, full:true},
      url: "http://www.newportmarathon.org"
   },
   "GreenRiver2010" : {
      when: new Date(2010, months.Jun, 6),
      name: "Green River",
      distances: {full:true},
      url: "http://www.greenrivermarathon.com/"
   },
   "NorthOlympicDiscovery2010" : {
      when: new Date(2010, months.Jun, 6),
      name: "North Olympic Discovery",
      distances: {half:true, full:true},
      url: "http://www.nodm.com/"
   },
   "Grandmas2010" : {
      when: new Date(2010, months.Jun, 19),
      name: "Grandma's",
      distances: {half:true, full:true},
      url: "http://www.grandmasmarathon.com/"
   },
   "RnRSeattle2010" : {
      when: new Date(2010, months.Jun, 27),
      name: "Seattle Rock 'n' Roll",
      distances: {half:true, full:true},
      url: "http://www.rnrseattle.com"
   },
   "SanFran2010" : {
      when: new Date(2010, months.Jul, 25),
      name: "San Fransico",
      distances: {half:true, full:true},
      url: "http://www.runsfm.com"
   },
   "MarathonduMedoc2010" : {
      when: new Date(2010, months.Sep, 11),
      name: "Marathon du Medoc",
      distances: {full:true},
      url: "http://www.marathondumedoc.com/"
   },
   "SkagitFlats2010" : {
      when: new Date(2010, months.Sep, 12),
      name: "Skagit Flats",
      distances: {half:true, full:true},
      url: "http://www.skagitflatsmarathon.com"
   },
   "BellinghamBay2010" : {
      when: new Date(2010, months.Sep, 26),
      name: "Bellingham Bay",
      distances: {half:true, full:true},
      url: "http://www.bellinghambaymarathon.org"
   },
   "StGeorge 2010" : {
      when: new Date(2010, months.Oct, 3),
      name: "St. George ",
      distances: {full:true},
      url: "http://www.StGeorgeMarathon.com"
   },
   "TwinCities2010" : {
      when: new Date(2010, months.Oct, 3),
      name: "Twin Cities",
      distances: {full:true},
      url: "http://www.mtcmarathon.org"
   },
   "Chicago2010" : {
      when: new Date(2010, months.Oct, 10),
      name: "Chicago",
      distances: {full:true},
      url: "http://www.chicagomarathon.com"
   },
   "Portland2010" : {
      when: new Date(2010, months.Oct, 10),
      name: "Portland",
      distances: {half:true, full:true},
      url: "http://www.portlandmarathon.org"
   },
   "RoyalVictoria2010" : {
      when: new Date(2010, months.Oct, 10),
      name: "Royal Victoria",
      distances: {half:true, full:true},
      url: "http://www.RoyalVictoriaMarathon.com"
   },
   "SpokaneSeries2010" : {
      when: new Date(2010, months.Oct, 10),
      name: "Spokane Series",
      distances: {half:true, full:true},
      url: "http://www.spokanemarathon.us"
   },
   "NikeWomens2010" : {
      when: new Date(2010, months.Oct, 17),
      name: "Nike Women's",
      distances: {half:true, full:true},
      url: "http://www.nikemarathon.com"
   },
   "MarineCorps2010" : {
      when: new Date(2010, months.Oct, 31),
      name: "Marine Corps",
      distances: {full:true},
      url: "http://www.marinemarathon.com"
   },
   "TriCities2010" : {
      when: new Date(2010, months.Oct, 31),
      name: "Tri-Cities",
      distances: {full:true},
      url: "http://www.3rrr.org"
   },
   "NewYorkCity2010" : {
      when: new Date(2010, months.Nov, 7),
      name: "New York City",
      distances: {full:true},
      url: "http://www.ingnycmarathon.org"
   },
   "Malibu2010" : {
      when: new Date(2010, months.Nov, 14),
      name: "Malibu International",
      distances: {half:true, full:true},
      url: "http://www.malibuintmarathon.com"
   },
   "Seattle2010" : {
      when: new Date(2010, months.Nov, 28),
      name: "Seattle",
      distances: {half:true, full:true},
      url: "htthttp://www.seattlemarathon.org"
   },
   "Nookachamps2011" : {
      when: new Date(2011, months.Jan, 16),
      name: "Nookachamps",
      distances: {half:true},
      url: "http://nookachamps.com/"
   },
   "Houston2011" : {
      when: new Date(2011, months.Jan, 30),
      name: "Houston",
      distances: {half:true, full:true},
      url: "http://www.chevronhoustonmarathon.com"
   },
   "Napa2011" : {
      when: new Date(2011, months.Mar, 06),
      name: "Napa",
      distances: {full:true},
      url: "http://www.napavalleymarathon.org"
   },
   "LA2011" : {
      when: new Date(2011, months.Mar, 20),
      name: "Los Angeles",
      distances: {full:true},
      url: "http://www.LAMarathon.com"
   },
   "MercerIsland2011" : {
      when: new Date(2011, months.Mar, 20),
      name: "Mercer Island",
      distances: {half:true},
      url: "http://mercerislandhalf.com/"
   },
   "Yakima2011" : {
      when: new Date(2011, months.Apr, 02),
      name: "Yakima",
      distances: {full:true},
      url: "http://www.ontherunevents.com/yrcm"
   },
   "Boston2011" : {
      when: new Date(2011, months.Apr, 17),
      name: "Boston",
      distances: {full:true},
      url: "http://www.bostonmarathon.org"
   },
   "Avenue of the Giants2011" : {
      when: new Date(2011, months.May, 01),
      name: "Avenue of the Giants",
      distances: {half:true, full:true},
      url: "http://www.theave.org"
   },
   "BigSur2011" : {
      when: new Date(2011, months.May, 01),
      name: "Big Sur",
      distances: {half:true, full:true},
      url: "http://bsim.org"
   },
   "Eugene2011" : {
      when: new Date(2011, months.May, 01),
      name: "Eugene",
      distances: {half:true, full:true},
      url: "http://www.eugenemarathon.com"
   },
   "Vancouver2011" : {
      when: new Date(2011, months.May, 01),
      name: "Vancouver",
      distances: {half:true, full:true},
      url: "http://www.bmovanmarathon.ca"
   },
   "Tacoma2011" : {
      when: new Date(2011, months.May, 01),
      name: "Tacoma",
      distances: {half:true, full:true},
      url: "http://www.tacomacitymarathon.com"
   },
   "Windermere2011" : {
      when: new Date(2011, months.May, 15),
      name: "Windermere (Spokane)",
      distances: {half:true, full:true},
      url: "http://www.windermeremarathon.com"
   },
   "CapitalCity2011" : {
      when: new Date(2011, months.May, 15),
      name: "Capital City",
      distances: {half:true, full:true},
      url: "http://www.CapitalCityMarathon.org"
   },
   "NorthOlympicDiscovery2011" : {
      when: new Date(2011, months.Jun, 05),
      name: "North Olympic Discovery",
      distances: {half:true, full:true},
      url: "http://www.nodm.com"
   },
   "Newport2011" : {
      when: new Date(2011, months.Jun, 05),
      name: "Newport",
      distances: {half:true, full:true},
      url: "http://www.newportmarathon.org"
   },
   "SanJuan2011" : {
      when: new Date(2011, months.Jun, 05),
      name: "San Juan",
      distances: {half:true, full:true},
      url: "http://www.sjmarathon.org"
   },
   "SeattleRnR2011" : {
      when: new Date(2011, months.Jun, 25),
      name: "Seattle Rock n Roll",
      distances: {half:true, full:true},
      url: "http://seattle.competitor.com"
   },
   "SeeJaneRun2011" : {
      when: new Date(2011, months.Jul, 17),
      name: "See Jane Run",
      distances: {half:true},
      url: "http://www.seejanerun.com/t-See-Jane-Run-SEATTLE-Half-Marathon-and-5K.aspx"
   },
   "SanFran2011" : {
      when: new Date(2011, months.Jul, 31),
      name: "San Francisco",
      distances: {half:true, full:true},
      url: "http://www.thesfmarathon.com"
   },
   "Labordayhalf2011" : {
      when: new Date(2011, months.Sep, 04),
      name: "Labor Day",
      distances: {half:true},
      url: "http://www.labordayrun.com"
   },
   "SkagitFlats2011" : {
      when: new Date(2011, months.Sep, 11),
      name: "Skagit Flats",
      distances: {half:true, full:true},
      url: "http://www.skagitflatsmarathon.com/"
   },
   "BellinghamBay2011" : {
      when: new Date(2011, months.Sep, 25),
      name: "Bellingham Bay",
      distances: {half:true, full:true},
      url: "http://www.bellinghambaymarathon.org/"
   },
   "TwinCities2011" : {
      when: new Date(2011, months.Oct, 02),
      name: "Twin Cities",
      distances: {full:true},
      url: "http://www.chicagomarathon.com/cms400min/chicago_marathon/"
   },
   "Portland2011" : {
      when: new Date(2011, months.Oct, 09),
      name: "Portland",
      distances: {half:true, full:true},
      url: "http://www.portlandmarathon.org/"
   },
   "Victoria2011" : {
      when: new Date(2011, months.Oct, 09),
      name: "Victoria",
      distances: {half:true, full:true},
      url: "http://www.runvictoriamarathon.com/"
   },
   "Chicago2011" : {
      when: new Date(2011, months.Oct, 09),
      name: "Chicago",
      distances: {full:true},
      url: "http://www.chicagomarathon.com/cms400min/chicago_marathon/"
   },
   "Hartford2011" : {
      when: new Date(2011, months.Oct, 16),
      name: "Hartford",
      distances: {full:true},
      url: "http://www.hartfordmarathon.com/Events/ING_Hartford_Marathon.htm"
   },
   "MarineCorps2011" : {
      when: new Date(2011, months.Oct, 30),
      name: "Marine Corps",
      distances: {full:true},
      url: "http://www.marinemarathon.com/"
   },
   "NewYork2011" : {
      when: new Date(2011, months.Nov, 06),
      name: "New York",
      distances: {full:true},
      url: "http://www.nycmarathon.org/"
   },
   "Seattle2011" : {
      when: new Date(2011, months.Nov, 27),
      name: "Seattle",
      distances: {half:true, full:true},
      url: "http://www.seattlemarathon.org/"
   },
   "CaliforniaInternational2011" : {
      when: new Date(2011, months.Dec, 4),
      name: "California International",
      distances: {full:true},
      url: "http://www.runcim.org"
   },
   "LasVegas2011" : {
      when: new Date(2011, months.Dec, 4),
      name: "Las Vegas",
      distances: {half:true, full:true},
      url: "http://www.rnrvegas.com"
   },
   "Tucson2010" : {
      when: new Date(2011, months.Dec, 4),
      name: "Tucson",
      distances: {full:true},
      url: "http://www.tucsonmarathon.com"
   },
   "Disney2012" : {
      when: new Date(2012, months.Jan, 8),
      name: "Disney",
      distances: {half:true, full:true},
      url: "http://www.DisneyWorldMarathon.com"
   },
   "Arizona2012" : {
      when: new Date(2012, months.Jan, 15),
      name: "Arizona Rock n Roll",
      distances: {half:true, full:true},
      url: "http://arizona.competitor.com/"
   },
   "Houston2012" : {
      when: new Date(2012, months.Jan, 15),
      name: "Houston",
      distances: {half:true, full:true},
      url: "http://www.chevronhoustonmarathon.com"
   },
/* ---------- TEMPLATE TEMPLATE TEMPLATE -----------
To add a new race...

1) copy this template:

   "UNIQUERACESHORTNAME" : {
      when: new Date(2007, months.Dec, 9),
      name: "ANOTHERRACEFRIENDLYNAME",
      distances: {half:true, full:true},
      url: "http://WWW.HONOLULUMARATHON.ORG/"
   },

2) paste it ABOVE this comment block

3) edit it to give it a unique short name (you can't create another "Skagit2007"
   that would conflict with the one on just below here), fill in the race date,
   give the race some short friendly name, and add the URL to the race page.

In the above example, you should change the race date to whenever the race is
and change all of the CAPITALIZED strings to whatever you want. 

If a race does not indicate, e.g. "half:true" then the schedule generator will
not generate a ladder for that distance. So only set "half:true" or "full:true"
for as many race types as the race has.

To make this able to generate a workout schedule for a 1/2 marathon with a 3
month training program - also include a line like so:


---------- TEMPLATE TEMPLATE TEMPLATE ----------- */
   "Honolulu2009" : {
      when: new Date(2009, months.Dec, 13),
      name: "Honolulu",
      distances: {full:true},
      url: "http://www.honolulumarathon.org"
   }
}
