  <!--

  /* Written by: Mark Woodward (June, 2000)
     Woody's JavaScripts at: woody.cowpi.com/javascripts.html

     The function weekDaysUntil is a WEEKDAY countdown counter. Weekends are
     not included in the count. It calculates the number of weekdays from a
     given date, chkDate, to another date, targetDate. A list of holidays or
     non-working weekdays can be created to subtract from the count.   */


  // List any non-working weekdays here (DO NOT include any weekend dates)
  var dayOff = new Array();
  dayOff[0] = new myDate(1999, 12, 25);   // Old Xmas date for demo


  function myDate(y, m, d) {

    /* y: 4 digit year, m: month (range: 1-12), d: day (range: 1-?)
       If no parameters are passed, then current date is used.
       myDate object has two properties:
         jDate  - javascript Date object
         dayNum - adjusted javascript representation of day number
                  (counts milliseconds from 1970/1/1)   */

    if (y != null) this.jDate = new Date(y, m-1, d);
      else this.jDate = new Date();
    this.dayNum = Math.floor(this.jDate.getTime() / 86400000);
    }

  function weekDaysUntil(chkDate, targetDate) {

    /* chkDate and targetDate are myDate objects.
       targetDate MUST be a weekday! (Erroneous results for weekend dates.)
       chkDate can be ANY date before the targetDate.  */

    var dowT = targetDate.jDate.getDay();
    var dowC = chkDate.jDate.getDay();
    var numDays = targetDate.dayNum - chkDate.dayNum;
    var numWks = Math.floor((numDays + 5 - dowT) / 7);
    var remainder = ((6 - dowC) % 6);
    var wkDays = 5 * (numWks - 1) + remainder + dowT - 1;
    if (remainder == 0) wkDays += 6;
    for (var i = 0; i < dayOff.length; i++)
      if ((targetDate.dayNum > dayOff[i].dayNum) && (dayOff[i].dayNum > chkDate.dayNum)) wkDays--;
    return wkDays
    }

  // -->