/* ***********************************************************************
    The getYear method returns either a 2-digit or 4-digit year:
        * For years between and including 1900 and 1999, the value returned by
          getYear is the year minus 1900. For example, if the year is 1976, the
          value returned is 76.
        * For years less than 1900 or greater than 1999, the value returned by
          getYear is the four-digit year. For example, if the year is 1856, the
          value returned is 1856. If the year is 2026, the value returned is
          2026.

    This JavaScript displays the current date using arrays and is
    y2k compliant, using JavaScript 1.2 getFullYear() method that
    displays the year in 4 digits.

    This script works in Version 4+ browsers
********************************************************************** */


/* Detect Netscape browser version - We want the date to work in both version 3 and version 4+ browsers.  If browser is version 4+, then we will use the getFullYear() method.  getFullYear() also works in Explorer 4+. */

var dateLastModified = new Date(document.lastModified);
var monthNumber = dateLastModified.getMonth() + 1;
var dayOfMonth = dateLastModified.getDate();

/* Determine which browser is being used and associate the correct method to find the year that the file was last modifed.  Look for version 4 browsers and Netscape 3 */

var NN3, NN4, IE4

browser = navigator.appName;
version = parseInt(navigator.appVersion);

/* Detect version 4+ browsers */
if ((browser == "Microsoft Internet Explorer" && version >= 4) || (browser == "Netscape" && version >= 4)) {
   NN4 = true;
   IE4 = true;
   var year = dateLastModified.getFullYear();
}

/* Detect version 3 browsers */
if (browser == "Netscape" && version < 4) {
   NN3 = true;
   var year = (dateLastModified.getYear() < 1900) ? 1900 + dateLastModified.getYear() : dateLastModified.getYear();
}

/* Detect version 4.08 browsers */
if (browser == "Netscape" && navigator.appVersion.substring(0,4) == "4.08" ) {
   var dateUndefined= true;
}

/* This array lists all the months of the year, and the correct month will be selected by the variable monthNumber */

var month = new Array();
   month[0]  = 12;
   month[1]  = "01 ";
   month[2]  = "02";
   month[3]  = "03";
   month[4]  = "04";
   month[5]  = "05";
   month[6]  = "06";
   month[7]  = "07";
   month[8]  = "08";
   month[9]  = "09";
   month[10] = "10";
   month[11] = "11";
   month[12] = "12";


/*
 * The last modified date is not a required portion of the header, and 
 * some servers do not supply it. If the server does not return the last 
 * modified information, JavaScript receives a 0, which it displays as 
 * January 1, 1970 GMT. The following code checks the date returned by 
 * lastModified and prints out a value that corresponds to unknown. 
 * This problem can be seen when using dynamically generated files.
 */
if ((Date.parse(document.lastModified) == 0) || dateUndefined) {
   document.write("--/--/--");
} else {

   /* Show Current Date: */
   if (dayOfMonth < 10) {
      document.write(year + "-" + month[monthNumber] + "-" + "0" + dayOfMonth);
/****  The following line was commented out on Dec 5, 2000 to correct a JavaScript error message in IE5  ****/
/****      alert ("temp: " + testDayOfMonth + "\n");   ***/
   } else {
      document.write(year + "-" + month[monthNumber] + "-" + dayOfMonth);
   }

}

/* *********************** End of File *********************** */

