/* Functions from http://www.merlyn.demon.co.uk/
   and other functions derived from ideas at that site.

   Why ? : Need to get all browsers to display a date/time in the same format.
           Using a simple thng like document.write( document.lastModified )
           does the job in Netscape 7, but MSIE 6.0.2800.1106 displays
           11/30/2004 21:35:09 (for example).  Note the use of mm/dd !
*/
function LZ(x) {
    return (x < 0 || x >= 10 ? "" : "0") + x;
}
function AndSuffix(Num) { // For Num  >= 0
   var suffx = ["th", "st", "nd", "rd"];
   var N = Num % 100;
   return Num + suffx[N % 10 > 3 || Math.floor(N / 10) == 1 ? 0 : N % 10];
}

function fmt_date(arg)
{
   var dayname=new Array(
      "Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
   var monthname=new Array("January","Febuary","March","April",
           "May","June","July","August",
           "September","October","November","December")
   with ( arg ) { // 'with' provides a shorthand for arg.getFullYear(), etc.
      return dayname[getDay()] + ", " + AndSuffix(getDate()) + " " +
             monthname[getMonth()] + " " + getFullYear() + " " +
             LZ(getHours()) + ":" + LZ(getMinutes()) + ":" + LZ(getSeconds())
   }
}

