// dateFunctions.js
// Author: Todd M. Reith
// Version 1.0.1
// Date: Monday, May 22, 2000 2:20:38 PM


  //Global arrays for Month and Weekday names
  var monthNames = new Array ("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
  var dayNames = new Array ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");

  // Displays the current day of the week and time
  // Format display : 'Monday, May 22 2000 11:05 am'
  function writeDate()
  {
    var now  = new Date();
    var amPm = (now.getHours() < 12) ? "am" : "pm";
    var hour = (now.getHours() > 12) ? (now.getHours() - 12) : (hour == 0) ? "12" : now.getHours();
    var min  = (now.getMinutes() < 10) ? ("0" + now.getMinutes()) : (now.getMinutes());
    var year = now.getFullYear();
    
    document.write ("<b>" + dayNames[now.getDay()] + "</b>, " + monthNames[now.getMonth()] + " " + now.getDate() + " " + year);
    
    return;
  }
  
  // Displays the modification date of the HTML document
  // Format display : 'Last Modified: Monday, May 22, 2000'  
  function writeDocumentLastMod()
  {
    if (Date.parse(document.lastModified) != 0)
    {  
      var dateObj = new Date(document.lastModified)
      var wday    = dayNames[dateObj.getDay()]
      var month   = monthNames[dateObj.getMonth()]
      var date    = dateObj.getDate()
      var year    = dateObj.getFullYear();
  
      document.write(wday + ", " + month + " " + date + ", " + year);
     }
     
     return;  
  }
  
