/*******************************************************************************/
/*                                                                             */
/* kx_date - Various Date Routines                                             */
/*                                                                             */
/* (C) Copyright 2003, Keropac.  All right reserved.                           */
/* Last updated: 5th December 2003                                             */
/*                                                                             */
/* Provides various date routines.  The showDate function outputs the current  */
/* date.  It one optional boolean value parameter that controls whether or not */
/* the day of the week name is output.  The output consists of the day number, */
/* followed by the name of the month, and finally the year.  The dateValue     */
/* functions returns the numeric value of the current date in year, month      */
/* and day format.                                                             */
/*                                                                             */
/*******************************************************************************/

<!-- Begin

// ---------------------------------------------------------------------------
// Output the date.
// ---------------------------------------------------------------------------

function showDate(showDayName)

{
  today = new Date();

  dayName = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday",
     "Saturday");

  monthName = new Array(" ", "January", "February", "March", "April", "May", "June",
     "July", "August", "September", "October", "November", "December");

  dow = today.getDay();
  month = today.getMonth() + 1;

  if (showDate.arguments.length == 0)
    showDayName = true;

  if (showDayName)
    document.write(dayName[dow], ", ");

  document.write(today.getDate(), " ");
  document.write(monthName[month], " ");
  document.write(today.getFullYear());
}

// ---------------------------------------------------------------------------
// Calculate the numeric value of the current date.
// ---------------------------------------------------------------------------

function dateValue()

{
  today = new Date();

  year = today.getFullYear();
  month = today.getMonth() + 1;
  day = today.getDate();

  dateVal = (year * 10000) + (month * 100) + day;

  return dateVal;
}

// End -->