//var eventArray = new Array(); var x = 0;
// first 8 characters in ccyymmdd format for single date events
// first 8 characters in 0000mmdd format for recurring annual events
//eventArray[x++] = "20081122 Rehearsal @UTA (9a-7p)";
//eventArray[x++] = "20081213 Rehearsal @UTA (9a-7p)";
//eventArray[x++] = "20090110 Rehearsal @UTA (9a-7p)";
//eventArray[x++] = "20090119 Brass/Guard Rehearsal @Park Cities Baptist Church (6p-9p)";
//eventArray[x++] = "20090124 Rehearsal @UTA (9a-7p)";
//eventArray[x++] = "20090203 Brass/Guard Rehearsal @1st Baptist-Richardson (6p-9p)";
//eventArray[x++] = "20090207 Rehearsal @Warren Sports Complex (9a-7p)";
//eventArray[x++] = "20090223 Brass/Guard Rehearsal @Park Cities Baptist Church (6p-9p)";
//eventArray[x++] = "20090228 Rehearsal @Warren Sports Complex (9a-7p)";
//eventArray[x++] = "20090309 Brass/Guard Rehearsal @Park Cities Baptist Church (6p-9p)";
//eventArray[x++] = "20090314 Rehearsal @The Sportsplex at Valley View (9a-7p)";
//eventArray[x++] = "20090314 Fundraiser @Pizza Hut Park - FC Dallas (5:30p)";
//eventArray[x++] = "20090321 D/FW Drum Corps Party @Main Street Liquid Company (7p)";
//eventArray[x++] = "20090323 Brass/Guard Rehearsal @Park Cities Baptist Church (6p-9p)";
//eventArray[x++] = "20090328 Rehearsal @Liberty HS - Frisco (9a-7p)";
//eventArray[x++] = "20090329 Fundraiser @Pizza Hut Park - FC Dallas (12p)";
//eventArray[x++] = "20090330 Brass/Guard Rehearsal @Park Cities Baptist Church (6p-9p)";
//eventArray[x++] = "20090404 Rehearsal @Shawnee Trail Sports Complex (9a-7p)";
//eventArray[x++] = "20090418 Fundraiser @Pizza Hut Park - Jimmy Buffett concert (4:30p)";
//eventArray[x++] = "20090419 Fundraiser @Pizza Hut Park - FC Dallas (4p)";
//eventArray[x++] = "20090420 Brass/Guard Rehearsal @Park Cities Baptist Church (6p-9p)";
//eventArray[x++] = "20090425 Rehearsal @Ponder HS, Denton (9a-Dark)";
//eventArray[x++] = "20090426 Rehearsal @Ponder HS, Denton (9a-3p)";
//eventArray[x++] = "20090426 Denton Jazz Fest performance (6:30p)";
//eventArray[x++] = "20090502 Fundraiser @Pizza Hut Park - Kenny Chesney concert (3p)";
//eventArray[x++] = "20090504 Brass/Guard Rehearsal @Park Cities Baptist Church (6p-9p)";
//eventArray[x++] = "20090509 Percussion Rehearsal @UNT Music Annex (10a-5:30p)";
//eventArray[x++] = "20090509 Fundraiser @Pizza Hut Park - Edgefest concert (TBD)";
//eventArray[x++] = "20090511 Brass/Guard Rehearsal @Park Cities Baptist Church (6p-9p)";
//eventArray[x++] = "20090516 Rehearsal @Shawnee Trail Sports Complex (9a-1p)";
//eventArray[x++] = "20090516 Richardson Wildflower Arts & Music Festival performance (3:30p & 5:30p)";
//eventArray[x++] = "20090518 Brass/Guard Rehearsal @Park Cities Baptist Church (6p-9p)";
//eventArray[x++] = "20090523 Rehearsal @Richardson (9a-Dark)";
//eventArray[x++] = "20090524 Rehearsal @Richardson (9a-Dark)";
//eventArray[x++] = "20090525 Rehearsal / Memorial Day performance (TBD)";
//eventArray[x++] = "20090528 Fundraiser @Anime Convention (TBD)";
//eventArray[x++] = "20090529 Fundraiser @Anime Convention (TBD)";
//eventArray[x++] = "20090530 Fundraiser @Anime Convention (TBD)";
//eventArray[x++] = "20090531 Fundraiser @Anime Convention (TBD)";
//eventArray[x++] = "20090601 Brass/Guard Rehearsal @Park Cities Baptist Church (6p-9p)";
//eventArray[x++] = "20090606 Rehearsal @Guyer HS, Denton (9a-Dark)";
//eventArray[x++] = "20090607 Fundraiser @Pizza Hut Park - FC Dallas (12p)";
//eventArray[x++] = "20090608 Brass/Guard Rehearsal @Park Cities Baptist Church (6p-9p)";
//eventArray[x++] = "20090613 Rehearsal @Guyer HS, Denton (9a-5p)";
//eventArray[x++] = "20090613 Fundraiser @Pizza Hut Park - FC Dallas (5:30p)";
//eventArray[x++] = "20090614 Rehearsal @Guyer HS, Denton (9a-5p)";
//eventArray[x++] = "20090620 Texas Drum Corps Preview - Austin, TX (10a rehearse, 8:20p - perform)";
//eventArray[x++] = "20090622 Brass/Guard Rehearsal @Park Cities Baptist Church (6p-9p)";
//eventArray[x++] = "20090627 Rehearsal @Richardson (9a-Dark)";
//eventArray[x++] = "20090628 Rehearsal @Richardson (9a-Dark)";
//eventArray[x++] = "20090629 Brass/Guard Rehearsal @Park Cities Baptist Church (6p-9p)";
//eventArray[x++] = "20090704 Rehearsal @Richardson (1p-4:30p)";
//eventArray[x++] = "20090704 Richardson Family Fourth Celebration performance (6:30p)";
//eventArray[x++] = "20090706 Brass/Guard Rehearsal @Park Cities Baptist Church (6p-9p)";
//eventArray[x++] = "20090711 Rehearsal @Richardson (9a-Dark)";
//eventArray[x++] = "20090712 Rehearsal @Richardson (9a-Dark)";
//eventArray[x++] = "20090713 Brass/Guard Rehearsal @Guyer HS, Denton (7p-10p)";
//eventArray[x++] = "20090714 Guard Rehearsal @Guyer HS, Denton (7p-10p)";
//eventArray[x++] = "20090715 Full Corps Rehearsal @Guyer HS, Denton (7p-10p)";
//eventArray[x++] = "20090716 Percussion Rehearsal @Guyer HS, Denton (7p-10p)";
//eventArray[x++] = "20090717 DCI - Dallas performance (7pm)";
//eventArray[x++] = "20090718 Rehearsal @Richardson (9a-Dark)";
//eventArray[x++] = "20090719 Full Corps Rehearsal @CH Collins Athletic Complex, Denton (1p)";
//eventArray[x++] = "20090719 DCI - Denton performance (6pm)";
//eventArray[x++] = "20090727 Brass/Guard Rehearsal @Guyer HS, Denton (7p-10p)";
//eventArray[x++] = "20090801 Rehearsal @Guyer HS, Denton (9a-5p)";
//eventArray[x++] = "20090801 Fundraiser @Pizza Hut Park - FC Dallas (5:30p)";
//eventArray[x++] = "20090802 Rehearsal @Guyer HS, Denton (9a-9p)";
//eventArray[x++] = "20090810 Brass/Guard Rehearsal @Guyer HS, Denton (7p-10p)";
//eventArray[x++] = "20090815 Rehearsal @Guyer HS, Denton (9a-7p)";
//eventArray[x++] = "20090816 Rehearsal @Guyer HS, Denton (9a-1p)";
//eventArray[x++] = "20090817 Brass/Guard Rehearsal @Park Cities Baptist Church (6p-9p)";
//eventArray[x++] = "20090822 DCA - S. St. Paul, MN competition (TBA)";
//eventArray[x++] = "20090823 DCA - St. Peter, MN competition (TBA)";
//eventArray[x++] = "20090829 Rehearsal @Guyer HS, Denton (9a-10p)";
//eventArray[x++] = "20090830 Rehearsal @Richardson (10a-1p)";
//eventArray[x++] = "20090830 Send-off Performance @Eagle-Mustang Stadium, Richardson (3p-5p)";
//eventArray[x++] = "20090901 Full Corps Rehearsal @Guyer HS, Denton (7p-10p)";
//eventArray[x++] = "20090904 DCA World Championships - Rochester, NY (TBA)";
//eventArray[x++] = "20090905 DCA World Championships - Rochester, NY (TBA)";
//eventArray[x++] = "20090906 DCA World Championships - Rochester, NY (TBA)";
//eventArray[x++] = "20090926 Fundraiser @Pizza Hut Park - FC Dallas (5:30p)";
//eventArray[x++] = "20090930 Fundraiser @Pizza Hut Park - FC Dallas (5:30p)";
//eventArray[x++] = "20091017 Fundraiser @Pizza Hut Park - FC Dallas (5:30p)";

//eventArray[x++] = "20090926 Recruitment Booth - Plano Drumline Competition";
//eventArray[x++] = "20091003 Recruitment Booth - Golden Triangle Marching Festival";
//eventArray[x++] = "20091003 Recruitment Booth - Birdville ISD Marching Contest";
//eventArray[x++] = "20091017 Recruitment Booth - Pennington Field (Area Bands)";
//eventArray[x++] = "20091020 Recruitment Booth - Pennington Field (4A UIL Region)";
//eventArray[x++] = "20091024 Recruitment Booth - Pennington Field (4A UIL Area)";
//eventArray[x++] = "20091107 Open House - Krum Masonic Lodge #1453 (12p-5p)";
//eventArray[x++] = "20091107 2009 Banquet - Oakmont Country Club (7:30p)";
//eventArray[x++] = "20091121 Rehearsal @Krum HS, Krum (9a-5p)";
//eventArray[x++] = "20091212 Rehearsal @Krum HS, Krum (9a-5p)";
//eventArray[x++] = "20100109 Rehearsal @Krum HS, Krum (9a-5p)";
//eventArray[x++] = "20100123 Rehearsal @Krum HS, Krum (9a-5p)";
//eventArray[x++] = "20100213 Rehearsal @Krum HS, Krum (9a-6p)";
//eventArray[x++] = "20100227 Rehearsal @Krum HS, Krum (9a-6p)";
//eventArray[x++] = "20100313 Rehearsal @Krum HS, Krum (9a-6p)";
//eventArray[x++] = "20100327 Rehearsal @Krum HS, Krum (9a-6p)";
//eventArray[x++] = "20100327 Fundraiser @Pizza Hut Park - FC Dallas (TBA)";
//eventArray[x++] = "20100410 Rehearsal @Krum HS, Krum (9a-6p)";
//eventArray[x++] = "20100422 Fundraiser @Pizza Hut Park - FC Dallas (TBA)";
//eventArray[x++] = "20100424 Rehearsal @Krum HS, Krum (9a-6p)";
//eventArray[x++] = "20100425 Rehearsal @Krum HS, Krum (10a-5p)";
//eventArray[x++] = "20100425 Denton Jazz Fest performance - Festival Stage (4p)";
//eventArray[x++] = "20100501 Fundraiser @Pizza Hut Park - Edgefest concert (TBA)";
//eventArray[x++] = "20100508 Rehearsal @Krum HS, Krum (9a-6p)";
//eventArray[x++] = "20100520 Fundraiser @Pizza Hut Park - FC Dallas (TBA)";
//eventArray[x++] = "20100522 Fundraiser @Pizza Hut Park - Jimmy Buffett concert (TBA)";
//eventArray[x++] = "20100529 Rehearsal @Krum HS, Krum (9a-7p)";
//eventArray[x++] = "20100530 Rehearsal @Krum HS, Krum (9a-4p)";
//eventArray[x++] = "20100603 Fundraiser @Anime Convention (4p-11p)";
//eventArray[x++] = "20100604 Fundraiser @Anime Convention (11a-7p)";
//eventArray[x++] = "20100605 Fundraiser @Anime Convention (10a-6p)";
//eventArray[x++] = "20100606 Fundraiser @Anime Convention (10a-6p)";
//eventArray[x++] = "20100612 Rehearsal @Krum HS, Krum (9a-7p)";
//eventArray[x++] = "20100613 Rehearsal @Krum HS, Krum (9a-4p)";
//eventArray[x++] = "20100619 Texas Drum Corps Preview - Austin, TX (TBA)";
//eventArray[x++] = "20100626 Rehearsal @Krum HS, Krum (9a-7p)";
//eventArray[x++] = "20100703 Rehearsal @Krum HS, Krum (9a-7p)";
//eventArray[x++] = "20100703 Fundraiser @Pizza Hut Park - FC Dallas (TBA)";
//eventArray[x++] = "20100704 Rehearsal @Krum HS, Krum (9a-4p)";
//eventArray[x++] = "20100704 Plano Symphony performance - Eisemann Center (TBA)";
//eventArray[x++] = "20100710 DCA - Houston competition (TBA)";
//eventArray[x++] = "20100717 Rehearsal @Krum HS, Krum (9a-7p)";
//eventArray[x++] = "20100718 Rehearsal @Krum HS, Krum (9a-4p)";
//eventArray[x++] = "20100722 DCI - Dallas performance (TBA)";
//eventArray[x++] = "20100724 Rehearsal @Krum HS, Krum (9a-7p)";
//eventArray[x++] = "20100726 DCI - Denton (Red River Thunder) performance (TBA)";
//eventArray[x++] = "20100807 Rehearsal @Krum HS, Krum (9a-7p)";
//eventArray[x++] = "20100808 Rehearsal @Krum HS, Krum (9a-4p)";
//eventArray[x++] = "20100821 DCA - St. Peter, MN (Drum Corps Expo) competition (TBA)";
//eventArray[x++] = "20100822 DCA - S. St. Paul, MN (Sounds of Minnesota) competition (TBA)";
//eventArray[x++] = "20100828 Rehearsal @Krum HS, Krum (9a-7p)";
//eventArray[x++] = "20100829 Rehearsal @Krum HS, Krum (9a-4p)";
//eventArray[x++] = "20100903 DCA World Championships - Rochester, NY (TBA)";
//eventArray[x++] = "20100904 DCA World Championships - Rochester, NY (TBA)";
//eventArray[x++] = "20100905 DCA World Championships - Rochester, NY (TBA)";
//eventArray[x++] = "20100918 Fundraiser @Pizza Hut Park - FC Dallas (TBA)";
//eventArray[x++] = "20100922 Fundraiser @Pizza Hut Park - FC Dallas (TBA)";
//eventArray[x++] = "20101002 Fundraiser @Pizza Hut Park - FC Dallas (TBA)";
//eventArray[x++] = "20101009 Fundraiser @Pizza Hut Park - FC Dallas (TBA)";

// permission is granted to use this javascript provided that the below code is not altered
var pageLoaded = 0;
window.onload = function() {pageLoaded = 1;}

/*'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Name       :  loaded
' Purpose    :  
' Parameters :  i - 
'               startFunction - 
' Return val :  n/a
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''*/
function loaded(i, startFunction)
{
    if (document.getElementById && document.getElementById(i) != null)
        startFunction();
    else if (!pageLoaded)
        setTimeout('loaded(\'' + i + '\',' + startFunction + ')', 100);
}

/*'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Name       :  monthLength
' Purpose    :  
' Parameters :  month - 
'               year - 
' Return val :  n/a
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''*/
function monthLength(month, year)
{
    var dd = new Date(year, month, 0);
    return dd.getDate();
}

var monthOfYear = ['January','February','March','April','May','June','July','August','September','October','November','December'];
var today = new Date();
var selDate = today.getFullYear() + getmmdd(today.getMonth() + 1, today.getDate());
//alert("selDate = '" + selDate + "'");

/*'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Name       :  displayCalendar
' Purpose    :  
' Parameters :  yy - 
'               mm - 
' Return val :  n/a
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''*/
function displayCalendar(yy, mm)
{
    if (mm < 0 || mm > 12)
    {
        alert('month must be between 1 and 12');
        return false;
    }
    if (yy != 0 && (yy < 1901 || yy > 2100))
    {
        alert('year must be after 1900 and before 2101');
        return false;
    }
    var dayOfWeek = ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];
    var calendar = new Date();
    var today = calendar.getDate();
    calendar.setDate(1);
    if (yy > 1900) calendar.setFullYear(yy);
    if (mm > 0) calendar.setMonth(mm - 1);
    yy = year = calendar.getFullYear();
    var month = calendar.getMonth();
    calendar.setDate(today);
    var weekday = calendar.getDay();
    var daysInMonth = monthLength(month + 1, year);
    var hilite_start = '<td style="background:#BDA36A;font-size:11px;border:1pt solid #000000" align="center" width="20px"><b>';
    var td_start = '<td style="font-size:11px" align="center" width="20px">';
    
    // Build the month header for the calendar
    var cal = buildHeader(yy, mm, month);

    cal += '<tr>';
    for (dex = 0; dex < 7; dex++)
    {
        cal += '<td style="background-image:url(\'images/calendarDark-bg.gif\');background-color:#CCCCCC;font-size:11px" align="center" width="20px">' + dayOfWeek[dex] + '</td>';
    }
    cal += '</tr><tr>';
    var day2 = today;
    for (dex = today; dex > 6; dex -=7)
        day2 = dex;
    weekday -= day2 - 1;
    while (weekday < 0) weekday += 7;
    for (dex = 0; dex < weekday; dex++)
        cal += td_start + ' </td>';
    for (dex = 1; dex <= daysInMonth; dex++)
    {
        if (weekday == 7)
        {
            cal += '</tr><tr>';
            weekday = 0;
        }
        if (selDate == year + getmmdd(month + 1, dex))
            cal += hilite_start +'<span' + clickDate(dex, month, year) + '>'+ dex + '<\/span><\/b><\/td>';
        else
            cal += td_start + '<span ' + clickDate(dex, month, year) + '>' + dex + '<\/span><\/td>';
        weekday += 1;
    }
    for (dex = weekday; dex < 7; dex++)
        cal += td_start + ' </td>';
    cal += '</tr></table></div></div>';

//alert("cal = '" + cal + "'");

    return cal;
}


/*'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Name       :  startCalendar
' Purpose    :  
' Parameters :  n/a
' Return val :  n/a
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''*/
function startCalendar()
{
//alert("begin startCalendar()...");
    //Define division for event listing below calendar
    var x = '<div id="event" style="background-image:url(\'images/calendarNormal-bg.gif\');background-color:#FFFFFF;border:1pt solid #CCCCCC;width:175px;text-align:left;"><\/div>';

    document.getElementById('calendar').innerHTML = displayCalendar(0, 0) + x;

//alert("x = '" + x + "'");

    displayEvent();
}

loaded('calendar', startCalendar);

/*'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Name       :  buildHeader
' Purpose    :  
' Parameters :  day - 
'               month - 
'               year - 
' Return val :  n/a
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''*/
function buildHeader(yy, mm, month)
{
//alert("begin buildHeader()...");
    var header = '<div id="cal"><div style="background-image:url(\'images/calendarNormal-bg.gif\');background-color:#FFFFFF;border:1pt solid #CCCCCC;height:150px;width:175px"><table align="center" cellpadding="2" cellspacing="0" border="0"><tr><td colspan="7"><table cellpadding="3" cellspacing="0" border="0"><tr>';

    if (document.getElementById)
    {
        var mmb = month;
        mm = month + 1;

        var yya = yyb = yy;
        if (mmb <1)
        {
            mmb += 12; yyb--;
        }

        var mma = month + 2;
        if (mma > 12)
        {
            mma -= 12; yya++;
        }

        var yb = yy -1;
        var ya = yy +1;

        // Code for previous year & previous month buttons
        //header += '<td><a style="font-size:13px;color:#000000;text-decoration:none;" alt="previous year" href="#" onclick="if (cala = displayCalendar(' + yb + ',' + mm + ')) {document.getElementById(\'cal\').innerHTML = cala; return false;}"><<</a></td><td><a style="font-size:13px;color:#000000;text-decoration:none;" href="#" onclick="if (cala = displayCalendar(' + yyb + ',' + mmb + ')) {document.getElementById(\'cal\').innerHTML = cala; return false;}"><</a></td>';
        // Code for previous month button
        header += '<td><a style="font-size:13px;color:#000000;text-decoration:none;" href="#" onclick="if (cala = displayCalendar(' + yyb + ',' + mmb + ')) {document.getElementById(\'cal\').innerHTML = cala; return false;}"><img src="images/iconPrevious.gif" alt="previous month" width="10px" height="11px" border="0" /></a></td>';
        // Code for month / year title
        header += '<td style="font-size:11px;white-space: nowrap;" align="center" width="100%"><b>' + monthOfYear[month]  + ' ' + year + '</b></td>';
        // Code for next month button
        header += '<td align="right"><a style="font-size:13px;color:#000000;text-decoration:none;" href="#" onclick="if (cala = displayCalendar(' + yya + ',' + mma + ')) {document.getElementById(\'cal\').innerHTML = cala; return false;}"><img src="images/iconNext.gif" alt="next month" width="10px" height="11px" border="0" /></a></td>';
        // Code for next month & next year buttons
        //header += '<td align="right"><a style="font-size:13px;color:#000000;text-decoration:none;" href="#" onclick="if (cala = displayCalendar(' + yya + ',' + mma + ')) {document.getElementById(\'cal\').innerHTML = cala; return false;}">></a></td><td align="right"><a style="font-size:13px;color:#000000;text-decoration:none;" href="#" onclick="if (cala = displayCalendar(' + ya + ',' + mm + ')) {document.getElementById(\'cal\').innerHTML = cala; return false;}">>></a></td>';
    }
    else
    {
        header += '<div> </div>';
        header += '<td style="font-size:11px;white-space: nowrap;" align="center" width="100%"><b>' + monthOfYear[month]  + ' ' + year + '</b></td>';
        header += '<div> </div>';
    }

    header += '</tr></table></td></tr>';

    return header;
}

/*'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Name       :  clickDate
' Purpose    :  
' Parameters :  day - 
'               month - 
'               year - 
' Return val :  n/a
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''*/
function clickDate(day, month, year)
{
    var events = nextDate(year + getmmdd(month + 1, day));

    if (events == '')
        events = nextDate('0000' + getmmdd(month + 1, day));
    if (events == '')
        return 'style="color:#000000"';
    else
        return 'style="cursor:pointer;color:#C11B17" onclick="selDate = ' + year + getmmdd(month + 1, day)+'; isDate(' + day + ',' + month + ',' + year + '); return false;"';
}

/*'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Name       :  isDate
' Purpose    :  
' Parameters :  dayVal - 
'               monthVal - 
'               yearVal - 
' Return val :  n/a
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''*/
function isDate(dayVal, monthVal, yearVal)
{
    var events = nextDate(yearVal + getmmdd(monthVal + 1, dayVal));

    if (events == '')
        events = nextDate('0000' + getmmdd(monthVal + 1, dayVal));
    if (events == '')
        events = '<tr><td valign="top"><img src="images/white_dot.gif" width="10px" height="10px" border="0" /></td><td style="font-size:9px;" valign="top">No scheduled events today.</td></tr>';

    document.getElementById('event').innerHTML = '<table cellpadding="3" cellspacing="0" border="0"><tr><td style="font-size:9px;" valign="top">' + selDate + ':</td><td valign="top"><table cellpadding="0" cellspacing="0" border="0">' + events + '</table></td></tr></table>';

    return false;
}

/*'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Name       :  getmmdd
' Purpose    :  
' Parameters :  mm - 
'               dd - 
' Return val :  n/a
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''*/
function getmmdd(mm, dd)
{
    return (mm > 9 ? '' + mm : '0' + mm) + (dd > 9 ? dd : '0' + dd);
}

/*'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Name       :  displayEvent
' Purpose    :  
' Parameters :  n/a
' Return val :  n/a
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''*/
function displayEvent()
{
//alert("begin displayEvent()...");
    var events = nextDate(selDate);

    if (events == '')
        events = nextDate('0000' + selDate.substr(4));
    if (events == '')
        events = '<tr><td valign="top"><img src="images/white_dot.gif" width="10px" height="10px" border="0" /></td><td style="font-size:9px;" valign="top">No scheduled events today.</td></tr>';

    document.getElementById('event').innerHTML = '<table cellpadding="3" cellspacing="0" border="0"><tr><td style="font-size:9px;" valign="top">' + selDate + ':</td><td valign="top"><table cellpadding="0" cellspacing="0" border="0">' + events + '</table></td></tr></table>';
}

/*'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Name       :  nextDate
' Purpose    :  
' Parameters :  yymmdd -
' Return val :  n/a
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''*/
function nextDate(yymmdd)
{
    var eventList;
    eventList = '';

    for (var i = 0; i < eventArray.length; i++)
    {
        if (eventArray[i].substr(0,8) == yymmdd)
            eventList += '<tr><td valign="top"><img src="images/black_dot.gif" width="10px" height="10px" border="0" /></td><td style="font-size:9px;" valign="top">' + eventArray[i].substr(8) + '</td></tr>';
    }

    return eventList;
}
