  // This script puts a link on the page if there is an event on the current day
  // the date of the event is stored in the appropriate months array
  // Copyright Dylan Ryall, all rights reserved
  // script created May 22, 2000

  //  monthName: an array of month names used in creating html file name string for href
  monthName = new Array("jan","feb","march","april","may","june","july", "aug","sept","oct","nov",                         "dec")

  //  monName:  month names for date display
  monName = new Array("January","February","March","April","May","June","July","August","September","October","November","December")

  //  dayName
  dayName = new Array ("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")

 
  // arrays of the dates in each month that there is a link for 
  // each must have zero or two plus entries (if there is only one date for a month,
  // enter it twice)
  td = new Array(12)
  //  january
  td[0] = new Array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31)
  //  february
  td[1] = new Array()
  //  march
  td[2] = new Array()
  //  april
  td[3] = new Array()
  //  may
  td[4] = new Array()
  //  june
  td[5] = new Array()
  //  july
  td[6] = new Array()
  //  august
  td[7] = new Array()
  //  september
  td[8] = new Array()
  //  october
  td[9] = new Array()
  //  november
  td[10] = new Array()
  //  december
  td[11] = new Array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,26,27,28,29,30)
 
  
  // get today's date
  today = new Date

  // get current month (number from 0 to 11)
  month = today.getMonth()
  // get current day of the month (number from 1 to 31)
  day = today.getDate()


  //  initialize show, if show is true, the link will show on the page
  show = false;
  //  initialize counter
  j = 0;

  //  loop to discover whether today's date is listed  
  while ((j < td[month].length) && (!show))
  {
    // test current date against current element of array for current month
    if (day == td[month][j])
    {
      // if match found, set show to true
      show = true
    }
    // increment j
    j++
  }


  //  function to load today's events or a message if there are no events today
  function loadToday()
  {
    //  if there is an event today
    if (show)
    {
      //  load today's event
      window.location.href = monthName[month] + ".html#" + monthName[month] + day
    }
    //  if there isn't an event today
    else
    {
      //  load no event message
      window.location.href = "noevent.html"
    }
  }
  
  //  function to load this week's events
  function loadWeek()
  {
    if (show)
    {
      window.location.href = monthName[month] + ".html#" + monthName[month] + day
    }
    else
    {
      target = day; 
      tmon = month;
      found = false;
      while (!found)
      {
        i = 0;
        target = target + 1;
        switch (tmon)
          {
            case 1 :
              if (target > 28)
              {
                target = target - 28;
                tmon = tmon + 1
              }
              break;
            case 3,5,8,10 :
              if (target > 30)
              {
                target = target - 30;
                tmon = tmon + 1
              }
              break;
            default :
              if (target > 31)
              {
                target = target - 31;
                tmon = tmon +1
              }
              break;
          }
        if (tmon > 11)
        {
          tmon = 1
        }
        while ((i < td[tmon].length) && (!found))
        {
          if (target == td[tmon][i])
          {
            found = true
          }
          i++
        }
      }
      window.location.href = monthName[tmon] + ".html#" + monthName[tmon] + target
    }  
  }  
 
  if (document.all) {
    docObj = "document.all."
    styleObj = ".style"
  }
  else {
    docObj = "document."
    styleObj = ""
  }

  