// Copyright (c) 2004-2006 koikikukan All Rights Reserved.// http://www.koikikukan.com/// License is granted if and only if this entire// copyright notice is included. By Yujiro ARAKI.// Ver1.00en 2006.04.11 for England and Wales.// Ver1.01en 2006.04.15 fix bug.// Ver1.02en 2006.04.16 fix bug.// Ver1.03en 2006.08.03 fix bug.//以上のファイルをUS版に変更してみる。2007.02.21 BY GASPARD// fix bug. 2008.05.23 BY GASPARDvar currentYear;var currentMonth;var currentDay;function setCurrentDate() {    data = new Date();    currentYear = data.getYear();    currentYear = (currentYear < 2000) ? currentYear + 1900 : currentYear;    currentMonth = data.getMonth() + 1;    currentDay = data.getDate();}function isToday(year, month, day) {    if (year == currentYear && parseInt(month,10) == currentMonth && day == currentDay) {        return true;    }    return false;}function isSaturday(year, month, day) {    var week = new Date(year, month - 1, day).getDay();    if (week == 6) {        return true;    }    return false;}function isHoliday(year, month, day) {    var week = new Date(year, month - 1, day).getDay();    if (week == 0) {        return true;    }    switch(parseInt(month,10)) {    case 1:	//1月1日 New Year's Day 振替休日あり。日曜日の場合1/2、土曜日の場合12/31が祝日となる（12月参照）。        if (day == 1) {            return true;        }        if (day == 2 && isSunday(year, month, 1)) {            return true;        }	//1月第3月曜日 Birthday of Martin Luther King, Jr., or Martin Luther King Day			if (day ==(getFirstMonday(year, month) +14)) {            return true;				}	//1月20日　Inauguration Day. 4年に1度のみ。次期大統領選。振替休日なし。2005〜2021まで設定。			if ((year == 2005 || year == 2009 || year == 2013 || year == 2017 || year == 2021) && day ==20) {            return true;		}		        break;    case 2:	//2月第3月曜日　Washington's Birthday        if (day == (getFirstMonday(year, month) +14)) {            return true;        }        break;    case 5:	//5月最終月曜日　Memorial Day        if (day == (getFirstMonday(year, month) +21) && ((getFirstMonday(year, month) +28) > 31)) {            return true;        }        if (day == (getFirstMonday(year, month) +28)) {            return true;        }        break;    case 7:	//7月4日　Independence Day. usually called the Fourth of July. 振替休日あり。        if (day == 3 && isSaturday(year, month, 4)) {            return true;        }        if (day == 4) {            return true;        }        if (day == 5 && isSunday(year, month, 4)) {            return true;        }        break;    case 9:	//9月第1月曜日　Labor Day.         if (day == (getFirstMonday(year, month))) {            return true;        }		break;    case 10:	//10月第2月曜日　Columbus Day.        if (day == (getFirstMonday(year, month) +7)) {            return true;        }		break;	case 11:	//11月11日　Veterans Day.        if (day == 10 && isSaturday(year, month, 11)) {            return true;        }		if (day == 11) {			return true;		}		if (day == 12 && isSunday(year, month, 11)) {			return true;		}	//11月第4木曜日　Thanksgiving Day.				if (day == (getFirstMonday(year, month) + 17) && 		    ((getFirstMonday(year, month) + 24) > 28)) {			return true;		}		if (day == (getFirstMonday(year, month) + 24) && 		    ((getFirstMonday(year, month) + 17) < 22)) {			return true;		}		break;		    case 12:	//12月25日　Christmas Day.		if (day == 24 && isSaturday(year, month, 25)) {			return true;		}	        if (day == 25) {            return true;        }        if (day == 26 && isSunday(year, month, 25)) {            return true;        }	//12月31日　翌日の元旦が土曜日の場合のみ。	        if (day == 31 && isSaturday(year+1, month+1, 1)) {            return true;        }        break;    }    return false;}function isSunday(year, month, day) {    var week = new Date(year, month - 1, day).getDay();    if (week == 0) {        return true;    }    return false;}function getFirstMonday(year, month) {    var monday;    for(monday = 1; monday < 8; monday++) {        if(new Date(year, month - 1, monday).getDay() == 1) {            break;        }    }    return monday;}