<!--

function trunc(val)
{
  if (val >= 0)
  {
    return Math.floor(val);
  }
  else
  {
    return Math.ceil(val);
  }
}

// Division function which works for non-integers. 
function div(a, b)
{
    return Math.floor(a / b);
}

// Modulus function which works for non-integers. 
function mod(a, b)
{
    return a - (b * Math.floor(a / b));
}

// Modulus function which returns numerator if modulus is zero
function amod(a, b)
{
    return mod(a - 1, b) + 1;
}

function DateStruct()
{
  this.year     = 0;
  this.month    = 0;
  this.day      = 0;
  
  this.monthStr = "not set";
  this.dayStr   = "not set";
}

// return the day of the week
function dow(jdn)
{
    return mod(Math.floor((jdn + 1.5)), 7);
}

function isGregorianLeapYear(year)
{
    return ((year % 4) == 0) && (!(((year % 100) == 0) && ((year % 400) != 0)));
}

function isJulianLeapYear(year)
{
    return (year % 4) == ((year > 0) ? 0 : 3);
}

var DAYS   = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
var MONTHS = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");

//-->