<!--

/* -------------------------------------------------------------------
  oΧϊvZJavaScriptuoΧϊcΏαρvver 1.01 (c) tanaka-chan
-------------------------------------------------------------------- */

thisDay = new Date();
timeStamp = thisDay.getTime();
myMonth = thisDay.getMonth() + 1;
myDate  = thisDay.getDate();
myHours = thisDay.getHours();
myDay   = thisDay.getDay();
myWeekTbl = new Array( "ϊ","","Ξ","","Ψ","ΰ","y" );

function isHoliday (year, month, date, nday) {
  nofw    = Math.floor((date - 1) / 7) + 1;
  shunbun = Math.floor(20.8431+0.242194*(year-1980)-Math.floor((year-1980)/4));
  syubun  = Math.floor(23.2488+0.242194*(year-1980)-Math.floor((year-1980)/4));
  if (month ==  1 && date ==  1)               { return 1; } // ³U
  return 0;
}

function dispDateW () {
  return dispDate(1);
}

function dispDate1W (h) {
  return dispDate1(h, 1);
}

function dispDate2W (n, h) {
  return dispDate2(n, h, 1);
}

function dispDate (w) {
  return dateFormat(myMonth,myDate,myDay,w);
}

function dispDate1 (h, w) {
  return dispDate2(0, h, w);
}

function dispDate2 (n, h, w) {
  var i = 0;
  while (i <= n) {
    thisDay.setTime(timeStamp + (1000*60*60*24 * i));
    myYear2  = thisDay.getFullYear();
    myMonth2 = thisDay.getMonth() + 1;
    myDate2  = thisDay.getDate();
    myDay2   = thisDay.getDay();
    if (isHoliday(myYear2,myMonth2,myDate2,myDay2) == 0 && i == 0 && h <= myHours) { n++; }  // ϊ΅’
    if (isHoliday(myYear2,myMonth2,myDate2,myDay2) >= 1){ n++; }  // xϊ
    if (isHoliday(myYear2,myMonth2,myDate2,myDay2) == 1 && myDay2 == 0){ n++; }  // UΦxϊ
    i++;
  }
  return dateFormat(myMonth2,myDate2,myDay2,w);
}

function dateFormat (month, date, week, w) {
  if (w == 1) { return month+""+date+"ϊi"+myWeekTbl[week]+"j"; }
  else { return month+""+date+"ϊ"; }
}

// -->
