﻿var tbl = '';
var days = new Array();
var tickerDates = new Array();
var monthly = new Array();


var offical = "\<img src='../favicon.ico' title='Official Activity by NWMO Model A Club' \>";

var strMonthly = "";
strMonthly += "$" + "Monthly Meetings || Club meetings are the 1st Monday of the Month and held at the \<a href='../nwmo/meetinglocations.aspx' \>American Legion\</a\> at 7pm";
strMonthly += "$" + "Breakfast Club || Meets every Wednesday at \<a href='http://maps.google.com/maps?q=207+Northeast+Englewood+Road,Kansas+City,MO,64118&spn=0.029718,0.061626&hl=en' target='_blank'\>HyVee\</a\> at 6:30am";
strMonthly += "$" + "Ice Cream || and Burgers every Saturday at \<a href='http://www.google.com/maps?q=4700+NE+Vivion+Rd,+Kansas+City,+MO+64119&sa=X&oi=map&ct=title' target='_blank'\>Big Burger\</a\> at 6pm";

monthly = strMonthly.split("$");
var strDaily = ""; 

function getDatesByYear(y) {

    strDaily = ""; //  DATE || DURATION minus 1 || MESSAGE AND LINKS
    if (y < 2008) {
        strDaily += "$" + "1926/07/20 || || The order was given to start work on a new ford, the \'Model A\', although that name had not been picked yet.";
        strDaily += "$" + "1927/10/20 || || Model A No. 1 rolled off the production line.";
        strDaily += "$" + "1927/12/02 || || First public showing of the Model A.";
        strDaily += "$" + "2006/12/04 || || First meeting of the new Northwest Missouri Model A Club.  \<a href='../nwmo/history.aspx' target='_blank'\>Here\'s the Story\</a\> on how it all began.";
        strDaily += "$" + "2007/02/02 ||1|| Sunflower Swap Meet";
        strDaily += "$" + "2007/02/05 ||1|| Monthly Meeting at Lowman\'s 7pm";
        strDaily += "$" + "2007/03/01 || || Board Meeting at Boardwalk Branch Library, 8656 N Ambassador Dr. 7pm";
        strDaily += "$" + "2007/03/05 || || Monthly Meeting at Lowman\'s 7pm";
        strDaily += "$" + "2007/04/02 || || Monthly Meeting at Lowman\'s  7pm";
        strDaily += "$" + "2007/04/14 ||1|| Ararat Shrine Swap Meep at the Woodlands";
        strDaily += "$" + "2007/04/22 || || Moila Car Show - Registration at noon, show from 1-4pm, 701 North Noyes, St. Joe, MO.";
        strDaily += "$" + "2007/04/27 ||1|| Lathrop Antique Club Swap Meet";
        strDaily += "$" + "2007/05/04 ||2|| Antique Auto Swap Meet";
        strDaily += "$" + "2007/05/19 || || Show and Shine sponsored by Vatterott College - Free hot dogs and drinks!";
        strDaily += "$" + "2007/05/20 || || Free Car Show in St. Joseph. No entry fee, Dash Plaques and Tee shirts to first 100 entrys. ";
        strDaily += "$" + "2007/06/11 ||4|| Model A Ford Club Regional Meet sponsored by \<a href='http://www.wichitaas.com/' target='_blank'\>Wichita A\'s\</a\>";
        strDaily += "$" + "2007/06/14 ||3|| Lathrop Antique Club presents the 16th National Ford/Fordson Collectors Association Show";
        strDaily += "$" + "2007/07/22 || || Ararat Shrine 38th Annual Showing of the Antique, Classic and Special Interest Car Display";
        strDaily += "$" + "2007/08/11 ||1|| Ararat Shrine Swap Meep at the Woodlands";
        strDaily += "$" + "2007/09/29 || || Running with Bonnie and Clyde sponsored by Heart of America Ford Model A Club.";
        strDaily += "$" + "2007/10/14 || || Moila Country Tour in St. Joseph at 11am. 701 North Noyes";

        //2007 Monthly Meetings
        strDaily += "$" + "2007/07/21 || || Monthly Meeting and Annual Picnic will be held at the Little Platte picinic shelter #2 at 11am in Smithville lake.";
    } else if (y == 2008) {


        //2008
        strDaily += "$" + "2008/02/01 ||1|| \<a href='http://www.wichitaas.com' target='_blank'\>Sunflower Swap Meet\</a\>";
        strDaily += "$" + "2008/02/23 || || Overdrive Seminar - 10:00am at Grandpa's Garage in DeSoto, KS sponsored by the \<a href='http://plainolas.com' target='_blank'\>Plain Ol A's\</a\>";
        strDaily += "$" + "2008/04/12 ||1|| \<a href='http://www.araratshrine.com/swap/' target='_blank'\>Ararat Shrine Swap Meep\</a\> at the Woodlands";
        strDaily += "$" + "2008/05/03 ||1|| Lawrence Antique Auto Swap Meet, Douglas Fairgrounds, Lawrence, KS Trade, sell or swap antique autos and antique parts. Sat 6:30am-4pm Sun 7am-2pm";
        strDaily += "$" + "2008/05/24 || || Atchison Fly-In Vintage & experimental aviation event in the hometown of Amelia Earhart";
        strDaily += "$" + "2008/06/19 ||3|| \<a href='http://www.lathropantique.com/' target='_blank'\>Lathrop Antique Club\</a\> presents the 30th Annual Antique Car, Tractor and Engine Show";
        strDaily += "$" + "2008/06/22 ||5||  3rd MAFCA MARC World Meet National Convention.";
        strDaily += "$" + "2008/07/12 || || 22nd Annual Car Show Leavenworth Cruisers 20th and Cherokee, Leavenworth KS Registration 9-11:00 am, Contact 913-682-6981";
        strDaily += "$" + "2008/07/19 || || Vineyard Grand Classic  12300 NW Arrowhead Trafficway, KC, Mo. 64165, Inexpensive food, 50s music, family friendly Gates open at 8am ";
        strDaily += "$" + "2008/08/22 || || Hot August Nights + Smithville, MO + Classic Car night – free hot dogs and drinks, live Music, bring your lawn chairs";
        strDaily += "$" + "2008/09/13 ||1|| \<a href='http://www.araratshrine.com/swap/' target='_blank'\>Ararat Shrine Swap Meep\</a\> at the  Woodlands ";
        strDaily += "$" + "2008/09/15 ||4|| \<a href='http://www.kcmodela.com/2008/Regional1' target='_blank'\>Kansas City Model A Tour Regional Meet\</a\>";
        strDaily += "$" + "2008/10/04 || || \<a href='http://www.flykci.com/_FileLibrary/PressRelease/221/Cruise%20Night%20Flyer%20&%20Map%20II%20REVISED.pdf' target='_blank'\>KCI Cruise Night\</a\>  4-8pm New location by Runway 1R/19L!  Paris Street near Conoco Station - follow signs.";
        strDaily += "$" + "2008/10/05 || || \<a href='http://www.gladstonechamber.com/gladfest.aspx' target='_blank'\>Gladfest parade\</a\> 10:00am Gladstone, MO";
        strDaily += "$" + "2008/10/05 || || \<a href='http://www.aaca.org/Calendar/Default.aspx' target='_blank'\>36th Annual Antique Car Show\</a\> Douglas County 4-H Fairgrounds. Lawrence, KS";

        //Kruisin Kearney
        strDaily += "$" + "2008/06/15 || || Kruisin Kearney, Downtown Kearney MO 12:00 until whenever! Contact 816-903-3603";
        strDaily += "$" + "2008/07/20 || || Kruisin Kearney, Downtown Kearney MO 12:00 until whenever! Contact 816-903-3603";
        strDaily += "$" + "2008/08/17 || || Kruisin Kearney, Downtown Kearney MO 12:00 until whenever! Contact 816-903-3603";
        strDaily += "$" + "2008/09/21 || || Kruisin Kearney, Downtown Kearney MO 12:00 until whenever! Contact 816-903-3603";
        strDaily += "$" + "2008/10/19 || || Kruisin Kearney, Downtown Kearney MO 12:00 until whenever! Contact 816-903-3603";

        //Liberty
        strDaily += "$" + "2008/07/26 || || Liberty Cruise on the square,  Kansas and Main streets downtown 5-9pm";
        strDaily += "$" + "2008/08/30 || || Liberty Cruise on the square,  Kansas and Main streets downtown 5-9pm";
        strDaily += "$" + "2008/09/27 || || Liberty Cruise on the square,  Kansas and Main streets downtown 5-9pm";

        //Leavenworth
        strDaily += "$" + "2008/07/25 || || Leavenworth Cruisers -  Held in Lansing Kansas at Burger King - 6 p.m";
        strDaily += "$" + "2008/08/22 || || Leavenworth Cruisers -  Held in Lansing Kansas at Burger King - 6 p.m";
        strDaily += "$" + "2008/09/26 || || Leavenworth Cruisers -  Held in Lansing Kansas at Burger King - 6 p.m";

        //St Joe
        strDaily += "$" + "2008/07/12 || || St. Joseph Cruise - East Hills Mall parking lot - south side of Ground Round - sponsored by Northwest Missouri Street Rod Club - 5 p.m. - ?";
        strDaily += "$" + "2008/08/09 || || St. Joseph Cruise - East Hills Mall parking lot - south side of Ground Round - sponsored by Northwest Missouri Street Rod Club - 5 p.m. - ?";
        strDaily += "$" + "2008/09/13 || || St. Joseph Cruise - East Hills Mall parking lot - south side of Ground Round - sponsored by Northwest Missouri Street Rod Club - 5 p.m. - ?";


    } else if (y == 2009) {

        //2009
        strDaily += "$" + "2009/02/06 ||1|| Sunflower Swap Meet";
        strDaily += "$" + "2009/02/21 || || Engine Seminar - 9:00am at Grandpa's Garage in DeSoto, KS sponsored by the \<a href='http://plainolas.com' target='_blank'\>Plain Ol A's\</a\>";
        strDaily += "$" + "2009/05/01 ||2|| Lawrence Antique Auto Swap Meet, Douglas Fairgrounds, Lawrence, KS. Trade, sell or swap antique autos and antique parts. Fri 1pm-Dark Sat 6:30am Sun 7am-2pm";

        strDaily += "$" + "2009/05/23 || || Atchison Fly-In - Displays of vintage aircraft at Amelia Earhart Airport";
        strDaily += "$" + "2009/07/18 || || Vineyard Grand Classic Car Show - 8:30am till the picnic at 1pm.";

        strDaily += "$" + "2009/07/18 || || Cruisin' Lathrop - 3:00pm.";
        strDaily += "$" + "2009/07/18 || || Parkville Cruise Night Downtown 4pm-9pm";

        strDaily += "$" + "2009/08/20 ||3|| 14th Great Annual Model A Run around Iowa, Des Moines IA.  Info Joe Lamb, 515-289-4437. Sponsored by the \<a href='http://www.CentralIowaModelAClub.com' target='_blank'\>Central Iowa Model A Club\</a\>";
        strDaily += "$" + "2009/08/25 || || Burgers, Brats and Old Cars! 11am – 2pm  Hosted by JB and Anne Hodgdon’s. ";




        strDaily += "$" + "2009/09/19 || || \<a href='../uploads/files/GSCarShow.09.LR.pdf' target='_blank'\>Antique and Classic Car Show\</a\> 10am - 3pm. In the Northland at the Corner of 96th Street & N. Oak Trafficway";
        strDaily += "$" + "2009/02/27 ||1|| World of Wheels";
        strDaily += "$" + "2009/09/20 ||3|| \<a href='http://www.modelarestorers.org/main/index.php?option=com_content&task=view&id=158&Itemid=375' target='_blank'\>MARC National Tour - Charlottesville, Virginia\</a\> contact Woody Williams, 703-858-1192 or vamodela@verizon.net";
        strDaily += "$" + "2009/09/27 || || Carolyn’s 3rd annual antique & classic car show 10am to 5pm arrive at 9:30 816-781-9196";
        strDaily += "$" + "2009/10/04 || || Gladstone Gladfest Car Show 9am to 3pm, 69th & N Holmes Proceeds go to scholarships for area students Contact: 816-436-4523 Or larry@gladstonechamber.com";
        strDaily += "$" + "2009/10/07 ||3|| \<a href='http://local.aaca.org/hershey/fallmeet.html' target='_blank'\>Hersheys Antique Auto Convention\</a\>";


        //Northland Cruise Nights 2008
        strDaily += "$" + "2009/04/11 || || \<a href='http://www.northlandfestivals.com/carhome/index.html' target='_blank'\>NKC Cruise Night\</a\> 5pm-9pm, held across from NKC Bowl at 18th and Fayette Street. Attractions include: Dash Plaques, DJ, and 50/50 Pot.";
        strDaily += "$" + "2009/05/09 || || \<a href='http://www.northlandfestivals.com/carhome/index.html' target='_blank'\>NKC Cruise Night\</a\> 5pm-9pm, held across from NKC Bowl at 18th and Fayette Street. Attractions include: Dash Plaques, DJ, and 50/50 Pot.";
        strDaily += "$" + "2009/06/13 || || \<a href='http://www.northlandfestivals.com/carhome/index.html' target='_blank'\>NKC Cruise Night\</a\> 5pm-9pm, held across from NKC Bowl at 18th and Fayette Street. Attractions include: Dash Plaques, DJ, and 50/50 Pot.";
        strDaily += "$" + "2009/07/11 || || \<a href='http://www.northlandfestivals.com/carhome/index.html' target='_blank'\>NKC Cruise Night\</a\> 5pm-9pm, held across from NKC Bowl at 18th and Fayette Street. Attractions include: Dash Plaques, DJ, and 50/50 Pot.";
        strDaily += "$" + "2009/08/08 || || \<a href='http://www.northlandfestivals.com/carhome/index.html' target='_blank'\>NKC Cruise Night\</a\> 5pm-9pm, held across from NKC Bowl at 18th and Fayette Street. Attractions include: Dash Plaques, DJ, and 50/50 Pot.";
        strDaily += "$" + "2009/09/12 || || \<a href='http://www.northlandfestivals.com/carhome/index.html' target='_blank'\>NKC Cruise Night\</a\> 5pm-9pm, held across from NKC Bowl at 18th and Fayette Street. Attractions include: Dash Plaques, DJ, and 50/50 Pot.";


        //Platte City
        strDaily += "$" + "2009/04/18 || || \<a href='http://www.righteousrides.us/page.php?4/' target='_blank'\>Platte City Cruise Nights\</a\> -  5-9pm 2400 NW Prairie View Road in the Pizza Shoppe / Mr. Goodcents parking lot. ";
        strDaily += "$" + "2009/05/16 || || \<a href='http://www.righteousrides.us/page.php?4/' target='_blank'\>Platte City Cruise Nights\</a\> -  5-9pm 2400 NW Prairie View Road in the Pizza Shoppe / Mr. Goodcents parking lot. ";
        strDaily += "$" + "2009/06/06 || || \<a href='http://www.righteousrides.us/page.php?4/' target='_blank'\>Platte City Cruise Nights\</a\> -  * Downtown Cruise Night *";
        strDaily += "$" + "2009/06/20 || || \<a href='http://www.righteousrides.us/page.php?4/' target='_blank'\>Platte City Cruise Nights\</a\> -  5-9pm 2400 NW Prairie View Road in the Pizza Shoppe / Mr. Goodcents parking lot. ";
        strDaily += "$" + "2009/07/18 || || \<a href='http://www.righteousrides.us/page.php?4/' target='_blank'\>Platte City Cruise Nights\</a\> -  5-9pm 2400 NW Prairie View Road in the Pizza Shoppe / Mr. Goodcents parking lot. ";
        strDaily += "$" + "2009/08/15 || || \<a href='http://www.righteousrides.us/page.php?4/' target='_blank'\>Platte City Cruise Nights\</a\> -  5-9pm 2400 NW Prairie View Road in the Pizza Shoppe / Mr. Goodcents parking lot. ";
        strDaily += "$" + "2009/09/19 || || \<a href='http://www.righteousrides.us/page.php?4/' target='_blank'\>Platte City Cruise Nights\</a\> -  5-9pm 2400 NW Prairie View Road in the Pizza Shoppe / Mr. Goodcents parking lot. ";




        //2009 Monthly Meetings
        strDaily += "$" + "2009/01/05 || || Ladies Night Out and Monthly Meeting at the  \<a href='http://www.nwmomodela.com/Meeting_Locations.html' \>American Legion\</a\> 7pm.  Please join us for dinner at 6pm.";
        strDaily += "$" + "2009/02/02 || || Ladies Night Out and Monthly Meeting at the  \<a href='http://www.nwmomodela.com/Meeting_Locations.html' \>American Legion\</a\> 7pm.  Please join us for dinner at 6pm.";
        strDaily += "$" + "2009/03/02 || || Ladies Night Out and Monthly Meeting at the  \<a href='http://www.nwmomodela.com/Meeting_Locations.html' \>American Legion\</a\> 7pm.  Please join us for dinner at 6pm.";
        strDaily += "$" + "2009/04/06 || || Ladies Night Out and Monthly Meeting at the  \<a href='http://www.nwmomodela.com/Meeting_Locations.html' \>American Legion\</a\> 7pm.  Please join us for dinner at 6pm.";
        strDaily += "$" + "2009/05/04 || || Ladies Night Out and Monthly Meeting at the  \<a href='http://www.nwmomodela.com/Meeting_Locations.html' \>American Legion\</a\> 7pm.  Please join us for dinner at 6pm.";
        strDaily += "$" + "2009/06/01 || || Ladies Night Out and Monthly Meeting at the  \<a href='http://www.nwmomodela.com/Meeting_Locations.html' \>American Legion\</a\> 7pm.  Please join us for dinner at 6pm.";
        strDaily += "$" + "2009/07/06 || || Ladies Night Out and Monthly Meeting at the  \<a href='http://www.nwmomodela.com/Meeting_Locations.html' \>American Legion\</a\> 7pm.  Please join us for dinner at 6pm.";
        strDaily += "$" + "2009/08/03 || || Ladies Night Out and Monthly Meeting at the  \<a href='http://www.nwmomodela.com/Meeting_Locations.html' \>American Legion\</a\> 7pm.  Please join us for dinner at 6pm.";
        strDaily += "$" + "2009/09/07 || || Ladies Night Out and Monthly Meeting at the  \<a href='http://www.nwmomodela.com/Meeting_Locations.html' \>American Legion\</a\> 7pm.  Please join us for dinner at 6pm.";
//        strDaily += "$" + "2009/10/05 || || Ladies Night Out and Monthly Meeting at the  \<a href='http://www.nwmomodela.com/Meeting_Locations.html' \>American Legion\</a\> 7pm.  Please join us for dinner at 6pm.";
//        strDaily += "$" + "2009/11/02 || || Ladies Night Out and Monthly Meeting at the  \<a href='http://www.nwmomodela.com/Meeting_Locations.html' \>American Legion\</a\> 7pm.  Please join us for dinner at 6pm.";
//        strDaily += "$" + "2009/12/07 || || Ladies Night Out and Monthly Meeting at the  \<a href='http://www.nwmomodela.com/Meeting_Locations.html' \>American Legion\</a\> 7pm.  Please join us for dinner at 6pm.";

        strDaily += "$" + "2009/01/22 || || Board Meeting 7pm at the \<a href='http://www.mcpl.lib.mo.us/branch/bw/' target='_blank'\>Boardwalk Branch Library\</a\>";
        strDaily += "$" + "2009/02/19 || || Board Meeting 7pm at the \<a href='http://www.mcpl.lib.mo.us/branch/bw/' target='_blank'\>Boardwalk Branch Library\</a\>";
        strDaily += "$" + "2009/03/19 || || Board Meeting 7pm at the \<a href='http://www.mcpl.lib.mo.us/branch/bw/' target='_blank'\>Boardwalk Branch Library\</a\>";
        strDaily += "$" + "2009/04/16 || || Board Meeting 7pm - Alternate Location this week, two doors down from \<a href='http://maps.google.com/maps?q=207+Northeast+Englewood+Road,Kansas+City,MO,64118&spn=0.029718,0.061626&hl=en' target='_blank'\>HyVee\</a\>.";
        strDaily += "$" + "2009/05/21 || || Board Meeting 7pm at the \<a href='http://www.mcpl.lib.mo.us/branch/bw/' target='_blank'\>Boardwalk Branch Library\</a\>";
        strDaily += "$" + "2009/06/18 || || Cancelled - Board Meeting due to the High Country Tour";
        strDaily += "$" + "2009/07/16 || || Board Meeting 7pm at the \<a href='http://www.mcpl.lib.mo.us/branch/bw/' target='_blank'\>Boardwalk Branch Library\</a\>";
        strDaily += "$" + "2009/08/20 || || Board Meeting 7pm at the \<a href='http://www.mcpl.lib.mo.us/branch/bw/' target='_blank'\>Boardwalk Branch Library\</a\>";
        strDaily += "$" + "2009/09/17 || || Board Meeting 7pm at the \<a href='http://www.mcpl.lib.mo.us/branch/bw/' target='_blank'\>Boardwalk Branch Library\</a\>";
//        strDaily += "$" + "2009/10/15 || || Board Meeting 7pm at the \<a href='http://www.mcpl.lib.mo.us/branch/bw/' target='_blank'\>Boardwalk Branch Library\</a\>";
//        strDaily += "$" + "2009/11/19 || || Board Meeting 7pm at the \<a href='http://www.mcpl.lib.mo.us/branch/bw/' target='_blank'\>Boardwalk Branch Library\</a\>";   
//        strDaily += "$" + "2009/12/17 || || Board Meeting 7pm at the \<a href='http://www.mcpl.lib.mo.us/branch/bw/' target='_blank'\>Boardwalk Branch Library\</a\>";
    }
    else if (y == 2010) {
    
    strDaily += "$" + "2010/09/18||1|| \<a href='http://www.araratshrine.com/swap/' target='_blank'\>Ararat Shrine Swap Meep\</a\> ";
    strDaily += "$" + "2010/09/30|| || Path2Victory, Frederick Blvd. Baptist Church, St Joseph \<br\>\<br\> We have been invited to show our cars at the NASCAR related car rally at the Frederick Blvd. Baptist Church in St Joseph. ";
    }
    else if (y == 2011) {

    strDaily += "$" + "2011/01/21|| || \<a href='http://www.lindsayauctions.com/calendar.htm' target='_blank'\>Ralph Wheeler Estate Auction \</a\>- Model As selling at 12:30pm ";
    strDaily += "$" + "2011/05/21|| || \<a href='http://www.metrofreestuff.com/larsonscruise#!__larsonscruise' target='_blank'\>Larson's Cruise For The Cause!\</a\>";

    strDaily += "$" + "2011/09/17|| || Smithville United Methodist Church and Smithville Community Car Show \<br\>All Proceeds for Tornado recovery in Joplin Missouri and Smithville Mississippi.\<br\> \<a href='http://www.smithvilleumc.com/carshow'  target='_blank'\>More Information\</a\> and \<a href='../uploads/files/SUMC Car Show 2 Rev C.pdf' target='_blank'\>Car Show Flyer\</a\>";


     



    //strDaily += "$" + "2011/09/30|| || Path2Victory, Frederick Blvd. Baptist Church, St Joseph \<br\>\<br\> We have been invited to show our cars at the NASCAR related car rally at the Frederick Blvd. Baptist Church in St Joseph. ";
    }

    

//Tours
getTours();
for (i = 0; i < gTours2.length - 1; i++) {
    var tourParts = new Array();
    tourParts = gTours2[i].split('||');
    strDaily += "$" + tourParts[0] + " ||" + tourParts[1] + "|| " + offical + " \<a href='../nwmo/tours.aspx#" + tourParts[4] + "'\>" + tourParts[5] + "\</a\>" ;
}

////Activities
//getActivities();
//for (i = 0; i < gActs.length - 1; i++) {
//    var tourParts = new Array();
//    tourParts = gActs[i].split('||');
//    strDaily += "$" + tourParts[0] + " ||" + tourParts[1] + "|| " + offical + " \<a href='../nwmo/activities.aspx#" + tourParts[4] + "'\>" + tourParts[5] + "\</a\>";
//}

//Meetings
getMeetings();
for (i = 0; i < gMeetings.length - 1; i++) {
    var tourParts = new Array();
    tourParts = gMeetings[i].split('||');
    strDaily += "$" + tourParts[0] + " ||" + tourParts[1] + "|| " + tourParts[5] + " " + tourParts[6] + " ";
}


days = strDaily.split("$");
days.sort();
}

/***   ***    BUILD ENTRY HERE ***   ***   ***   ***   ***   ***   ***


strDaily += "$" + "2008/10/05 || || ";


\<a href='urlGoesHere' target='_blank'\>Google\</a\>
\<a href='urlGoesHere' target='_blank'\>Google\</a\>
\<a href='urlGoesHere' target='_blank'\>Google\</a\>


***   ***   ***   ***   ***   ***   ***   ***   ***   ***   ***   ***/

var today = new Date(); // today
var months = new Array("", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
var mon = months[today.getMonth() + 1]; // month
var day = today.getDate(); // day
var selectedYear = getTheYear(today);


function getTheYear(dt) {
	var thisYear = dt.getFullYear(); //(new Date()).getYear();
	thisYear = (thisYear < 100) ? thisYear + 1900 : thisYear;
	return Number(thisYear);
}

function main(){

    setYear();
    getDatesByYear(selectedYear);
	monthlyActivities();
	dailyActivities();
}

function setYear(){
	document.getElementById('spYear').innerHTML = selectedYear;
}

function changeYear(direction) {
   if (direction == 'back'){
   		selectedYear = selectedYear - 1;
   		main();
   }
   else
   {	selectedYear = selectedYear + 1;
		main();
   }
}

function monthlyActivities(){

	tbl = "<table id='monthly' cellPadding=3>";

	for (i = 1; i < monthly.length; i++) {
		var monthParts = new Array();
		monthParts = monthly[i].split('||');
		tbl = tbl + "<tr><td><b>" + monthParts[0] + "</b></td><td>" +  monthParts[1] + "</td></tr>"
	}
	tbl += "</table>";
	document.getElementById('divMonthly').innerHTML = tbl;
}

function dailyActivities() {

	    var tempdate = new Date(days[0]);
		var thisMonth = -1;
		var testFlag = '';
		var x = 0
		var hitToday = 0;

		tbl = "<table cellPadding=3><col width='80' />";
		for (i = 1; i < days.length; i++) {

			var daysParts = new Array();
			daysParts = days[i].split('||');

			tempdate = new Date(daysParts[0]);
			tempmonth = months[tempdate.getMonth() + 1];
			tempday = tempdate.getDate();
			tempyear = getTheYear(tempdate);

			// ONLY SHOW SELECTED YEAR
			if (tempyear == selectedYear ) {


				 // IF THE ACTIVITY IS WITHIN THE NEXT TO WEEKS ADD TO TICKER
//				 var diff = tempdate.getTime() - today.getTime();
//				 var num = Math.floor(diff / (1000 * 60 * 60 * 24));
//				 if (num >= 15 && num <= 22){
//					tickerDates[x] = i;
//					x += 1;
//				 }

				// IF ITS THE START OF A MONTH ADD THE MONTH NAME AND ANCHOR
				if ((tempdate.getMonth()) == thisMonth){

				}else{
			 if (hitToday == 0
					 	&& getTheYear(today) == tempyear
					 	&& (tempdate.getTime() > today.getTime())
					 	&& today.getMonth() == thisMonth)
					{
						tbl = tbl + "<tr><td>" + String(today).substring(0, 3) + " " +  today.getDate() + "</td><td><img  src='http://www.nwmomodela.com/uploads/redDot.jpg' >  YOU ARE HERE</td>"
						hitToday = 1;
					}

					tbl = tbl + "<tr><td></td><td></td></tr>"
					tbl = tbl + "<tr><td><a name='" + tempmonth + "'>&nbsp</a></td><td></td></tr>"
					tbl = tbl + "<th colspan=2 align='left'>" + tempmonth + "</th>"
					thisMonth = tempdate.getMonth()
				}

			    // SHOW YOU ARE HERE curYear
				if (hitToday == 0 && getTheYear(today) == tempyear && (tempdate.getTime() > today.getTime())) {
					tbl = tbl + "<tr><td>" + String(today).substring(0, 3) + " " +  today.getDate() + "</td><td><img  src='http://www.nwmomodela.com/uploads/redDot.jpg' >  YOU ARE HERE</td>"
					hitToday = 1;
				}

				//CHECK FOR MULTIPLE DAYS
				if (daysParts[1] > 0) {
                    //Add days to cover the end of the month 4/30 - 5/2
                    var myDate=new Date(); 
    				myDate.setDate(tempdate.getDate() + Number(daysParts[1]));

    				//Show second month if the date range crosses to the second month
    				var nextMonth2 = "";
//    				alert(tempmonth + "/" + tempday + "\n" + thisMonth + " : " + Number(myDate.getMonth() + 1) + "\nmyDate: " + myDate);
//    				if (thisMonth != myDate.getMonth()) {
//    				    nextMonth2 = " " + months[myDate.getMonth() + 1] + " ";
//    				    alert(nextMonth2);
//    				}
    				tbl = tbl + "<tr valign='top'><td>" + String(tempdate).substring(0, 3) + " " + tempday + "-" + nextMonth2 + myDate.getDate() + "</td><td>" + daysParts[2] + "</td></tr>"
				}else
				{
					tbl = tbl + "<tr valign='top'><td>" + String(tempdate).substring(0, 3) + " " + tempday + "</td><td>" +  daysParts[2] + "</td></tr>"
				}



			}//end Only show selected year
		}//end days for loop

		tbl += "</table>";
		document.getElementById('divCal').innerHTML = tbl;
}

// IT ALL STARTS HERE
var t = setTimeout('main()', 250);



