// Date Modified: 02/17/09 Add club to getEventCalendar argument list
// Date Modified: 09/04/08 Alter displayIT to write table definition with correct background color for IT_Class 'All-Day'
// Date Modified: 08/07/08 Alter displayIT to write table definition with correct background color for daily Deadline and Holiday displays
// Date Modified: 07/08/08 Alter displayIT to write table definition with correct background color and id (added 6th argument)
// Date Modified: 02/01/07 Alter sender to accept link class as 5th parameter called class
// Date Modified: 01/10/07 Alter sender to pass W3C xhtml-strict validation
// Date Modified: 12/31/06 Alter getBoardMessage to display monthly file MM.htm
// Date Modified: 11/10/06 Alter displayIT to pass W3C xhtml validation
function sender (ID, which, who, what, classID)
  {
   //alert (ID + ", " + which + ", " + who + ", " + what + ", " + classID);
   var connector = "@";
   if (sender.arguments.length < 5)
      {var fv1 = ""; var fv2 = "</a>"; var wb="";} 
      else
          if ( isNaN(classID))
             {var fv1 = ""; var fv2 = "</a>"; var wb=" class=\"" + classID + "\" ";} 
             else 
                if (classID == 1) {var fv1 = "<span class=\"small b\">"; var fv2 = "</span></a>"; var wb=" class=\"webmaster\" ";}
                         else {var fv1 = "<span class=\"small b\">"; var fv2 = "</span></a>"; var wb=" class=\"photo\" ";}
   document.write("<a " + wb + "href=\"mail" + "to:" + ID + connector + which + "?" + "subject=" + what + "\">" + fv1 +  who + fv2);
   //alert ("<a " + wb + "href=\"mail" + "to:" + ID + connector + which + "?" + "subject=" + what + "\">" + fv1 +  who + fv2);
   }

function getEventCalendar(club,dir,eventName)
{
  var today = new Date();
  var thisMonth = today.getMonth() + 1;
  if (thisMonth < 10) thisMonth = '0' + thisMonth;
  var thisYear = today.getFullYear();
  document.write ('<a href="' + dir + 'calendar/' + club + '_Events_' + thisYear + '_' + thisMonth + '.htm">' + eventName + '</a>');
  }
function getBoardMessage(dir,eventName)
{
  var today = new Date();
  var thisMonth = today.getMonth() + 1;
  if (thisMonth < 10) thisMonth = '0' + thisMonth;
  var thisYear = today.getFullYear() - 2000;
  if (thisYear < 10) thisYear = '0' + thisYear;
  document.write ('<a href="' + dir + 'messages/' + thisMonth + '.htm">' + eventName + '</a>');
  }

function displayIT(IT_year,IT_month, IT_day, IT_class, IT_type, IT_id)
{  
  var today = new Date();
  if (displayIT.arguments.length == 0) {document.write ('</span>'); return; }
  var ITs_date = new Date(IT_year,IT_month-1,IT_day,23,59,59);
  if (IT_type == 'd' && IT_class != 'Deadline' && IT_class != 'Holiday' && IT_class != 'All-Day'){if (ITs_date < today) { IT_class = "After";}
                                    else  { IT_class = "Before";}
                      }
  //alert ('IT_class=' + IT_class + ' ' + ITs_date + ' today=' + today); 
//For daily displays, keep it visible for the month it happens

  if (IT_type == 'd') {today.setDate(1);} //Set day of month to 1 for daily displays
  //alert ('Today: ' + today + ' ITs_date: ' + ITs_date);
  if (ITs_date < today) { document.write ('<span style="width: 100%;visibility:hidden;display:none;">');}
     else               { document.write ('<span style="width: 100%;visibility:visible;display:table;">');}
  if (displayIT.arguments.length > 5) { 
                                       document.write ('<table id="' + IT_id + '" class="' + IT_class + '">');
                                       //alert ('<table id="' + IT_id + '" class="' + IT_class + '">');
                                        }
  }