/*2007年営業カレンダー

/* $Id: jscript_calendar.js,v 2.0 2006/12/06 14:19 therese Exp $ */



function checkholidayName(){

	var holiday=new Array();

	//祝日の設定　開始

	//holidayとholidayNameは必ず対応させる事

	holiday[0]="1/1"

	holiday[1]="1/9"

	holiday[2]="2/11"

	holiday[3]="3/21"

	holiday[4]="4/29"

	holiday[5]="5/3"

	holiday[6]="5/4"

	holiday[7]="5/5"

	holiday[8]="7/18"

	holiday[9]="9/19"

	holiday[10]="9/23"

	holiday[11]="10/10"

	holiday[12]="11/3"

	holiday[13]="11/23"

	holiday[14]="12/23"





	var holidayName=new Array();

	holidayName[0]="元旦"

	holidayName[1]="成人の日"

	holidayName[2]="建国記念の日"

	holidayName[3]="春分の日"

	holidayName[4]="昭和の日"

	holidayName[5]="憲法記念日"

	holidayName[6]="みどりの日"

	holidayName[7]="こどもの日"

	holidayName[8]="海の日"

	holidayName[9]="敬老の日"

	holidayName[10]="秋分の日"

	holidayName[11]="体育の日"

	holidayName[12]="文化の日"

	holidayName[13]="勤労感謝の日"

	holidayName[14]="天皇誕生日"



	//祝日の設定　終了

	var flag=false;

	var check=today_tmp.getMonth()+1+"/"+today_tmp.getDate();

	for(var i=0;i<holiday.length;i++){

		if(check==holiday[i]){

			flag=holidayName[i];

		}

	}

	return flag

}



function checktemporarycloseddayName(){

	var temporaryclosedday=new Array();

	//臨時休業日の設定　開始

	//temporarycloseddayとtemporarycloseddayName は必ず対応させる事

	// ********************* 土曜日定休日の設定 [bof]*********************
	temporaryclosedday[0]="1/7"
	temporaryclosedday[1]="1/14"
	temporaryclosedday[2]="1/21"
	temporaryclosedday[3]="1/28"
	temporaryclosedday[4]="2/4"
	temporaryclosedday[5]="2/11"
	temporaryclosedday[6]="2/18"
	temporaryclosedday[7]="2/25"
	temporaryclosedday[8]="3/3"
	temporaryclosedday[9]="3/10"
	temporaryclosedday[10]="3/17"
	temporaryclosedday[11]="3/24"
	temporaryclosedday[12]="3/31"
	temporaryclosedday[13]="4/7"
	temporaryclosedday[14]="4/14"
	temporaryclosedday[15]="4/21"
	temporaryclosedday[16]="4/28"
	temporaryclosedday[17]="5/5"
	temporaryclosedday[18]="5/12"
	temporaryclosedday[19]="5/19"
	temporaryclosedday[20]="6/2"
	temporaryclosedday[21]="6/9"
	temporaryclosedday[22]="6/16"
	temporaryclosedday[23]="6/23"
	temporaryclosedday[24]="6/30"
	temporaryclosedday[25]="6/2"
	temporaryclosedday[26]="6/9"
	temporaryclosedday[27]="6/16"
	temporaryclosedday[28]="6/23"
	temporaryclosedday[29]="6/30"
	temporaryclosedday[30]="7/7"
	temporaryclosedday[31]="7/14"
	temporaryclosedday[32]="7/21"
	temporaryclosedday[33]="7/28"
	temporaryclosedday[34]="8/4"
	temporaryclosedday[35]="8/11"
	temporaryclosedday[36]="8/18"
	temporaryclosedday[37]="8/25"
	temporaryclosedday[38]="9/1"
	temporaryclosedday[39]="9/8"
	temporaryclosedday[40]="9/15"
	temporaryclosedday[41]="9/22"
	temporaryclosedday[42]="9/29"
	temporaryclosedday[43]="10/6"
	temporaryclosedday[44]="10/13"
	temporaryclosedday[45]="10/20"
	temporaryclosedday[46]="10/27"
	temporaryclosedday[47]="11/3"
	temporaryclosedday[48]="11/10"
	temporaryclosedday[49]="11/17"
	temporaryclosedday[50]="11/24"
	temporaryclosedday[51]="12/3"
	temporaryclosedday[52]="12/10"
	temporaryclosedday[53]="12/17"
	temporaryclosedday[54]="12/24"
	temporaryclosedday[55]="12/31"

	// ********************* 土曜日定休日の設定 [eof]*********************

	// ********************* その他の休み設定 [bof]*********************

	temporaryclosedday[56]="1/1"
	temporaryclosedday[57]="1/2"
	temporaryclosedday[58]="1/3"
	temporaryclosedday[59]="1/4"

	temporaryclosedday[60]="12/30"
	temporaryclosedday[61]="12/31"



	// ********************* その他の休み設定 [eof]*********************

	var temporarycloseddayName=new Array();

	// ********************* 土曜日定休日の設定 [bof]*********************
	
	temporarycloseddayName[0]="定休日"

	temporarycloseddayName[1]="定休日"

	temporarycloseddayName[2]="定休日"

	temporarycloseddayName[3]="定休日"

	temporarycloseddayName[4]="定休日"

	temporarycloseddayName[5]="定休日"

	temporarycloseddayName[6]="定休日"

	temporarycloseddayName[7]="定休日"

	temporarycloseddayName[8]="定休日"

	temporarycloseddayName[9]="定休日"

	temporarycloseddayName[10]="定休日"

	temporarycloseddayName[11]="定休日"

	temporarycloseddayName[12]="定休日"

	temporarycloseddayName[13]="定休日"

	temporarycloseddayName[14]="定休日"

	temporarycloseddayName[15]="定休日"

	temporarycloseddayName[16]="定休日"

	temporarycloseddayName[17]="定休日"

	temporarycloseddayName[18]="定休日"

	temporarycloseddayName[19]="定休日"

	temporarycloseddayName[20]="定休日"

	temporarycloseddayName[21]="定休日"

	temporarycloseddayName[22]="定休日"

	temporarycloseddayName[23]="定休日"

	temporarycloseddayName[24]="定休日"

	temporarycloseddayName[25]="定休日"

	temporarycloseddayName[26]="定休日"

	temporarycloseddayName[27]="定休日"

	temporarycloseddayName[28]="定休日"

	temporarycloseddayName[29]="定休日"

	temporarycloseddayName[30]="定休日"

	temporarycloseddayName[31]="定休日"

	temporarycloseddayName[32]="定休日"

	temporarycloseddayName[33]="定休日"

	temporarycloseddayName[34]="定休日"

	temporarycloseddayName[35]="定休日"

	temporarycloseddayName[36]="定休日"

	temporarycloseddayName[37]="定休日"

	temporarycloseddayName[38]="定休日"

	temporarycloseddayName[39]="定休日"

	temporarycloseddayName[40]="定休日"

	temporarycloseddayName[41]="定休日"

	temporarycloseddayName[42]="定休日"

	temporarycloseddayName[43]="定休日"

	temporarycloseddayName[44]="定休日"

	temporarycloseddayName[45]="定休日"

	temporarycloseddayName[46]="定休日"

	temporarycloseddayName[47]="定休日"

	temporarycloseddayName[48]="定休日"

	temporarycloseddayName[49]="定休日"

	temporarycloseddayName[50]="定休日"

	temporarycloseddayName[51]="定休日"

	temporarycloseddayName[52]="定休日"

	temporarycloseddayName[53]="定休日"

	temporarycloseddayName[54]="定休日"

	temporarycloseddayName[55]="定休日"

	// ********************* 土曜日定休日の設定 [eof]*********************
	
	// ********************* その他の休みの設定 [bof]*********************

	temporarycloseddayName[56]="年末年始休業"
	temporarycloseddayName[57]="年末年始休業"
	temporarycloseddayName[58]="年末年始休業"
	temporarycloseddayName[59]="年末年始休業"
	temporarycloseddayName[60]="年末年始休業"
	temporarycloseddayName[61]="年末年始休業"

	// ********************* その他の休みの設定 [eof]*********************

	//臨時休業日の設定　終了

	var flag=false;

	var check=today_tmp.getMonth()+1+"/"+today_tmp.getDate();

	for(var i=0;i<temporaryclosedday.length;i++){

		if(check==temporaryclosedday[i]){

			flag=temporarycloseddayName[i];

		}

	}

	return flag

}



function checkholidayName2(){

	var holiday=new Array();

	//祝日の設定　開始

	//holidayとholidayNameは必ず対応させる事

	holiday[0]="1/1"

	holiday[1]="1/9"

	holiday[2]="2/11"

	holiday[3]="3/21"

	holiday[4]="4/29"

	holiday[5]="5/3"

	holiday[6]="5/4"

	holiday[7]="5/5"

	holiday[8]="7/18"

	holiday[9]="9/19"

	holiday[10]="9/23"

	holiday[11]="10/10"

	holiday[12]="11/3"

	holiday[13]="11/23"

	holiday[14]="12/23"





	var holidayName=new Array();

	holidayName[0]="元旦"

	holidayName[1]="成人の日"

	holidayName[2]="建国記念の日"

	holidayName[3]="春分の日"

	holidayName[4]="昭和の日"

	holidayName[5]="憲法記念日"

	holidayName[6]="みどりの日"

	holidayName[7]="こどもの日"

	holidayName[8]="海の日"

	holidayName[9]="敬老の日"

	holidayName[10]="秋分の日"

	holidayName[11]="体育の日"

	holidayName[12]="文化の日"

	holidayName[13]="勤労感謝の日"

	holidayName[14]="天皇誕生日"



	//祝日の設定　終了

	var flag=false;

	var check=today_tmp2.getMonth()+1+"/"+today_tmp2.getDate();

	for(var i=0;i<holiday.length;i++){

		if(check==holiday[i]){

			flag=holidayName[i];

		}

	}

	return flag

}



function checktemporarycloseddayName2(){

	var temporaryclosedday=new Array();

	//臨時休業日の設定　開始

	//temporarycloseddayとtemporarycloseddayName は必ず対応させる事

	// ********************* 土曜日定休日の設定 [bof]*********************
	temporaryclosedday[0]="1/7"
	temporaryclosedday[1]="1/14"
	temporaryclosedday[2]="1/21"
	temporaryclosedday[3]="1/28"
	temporaryclosedday[4]="2/4"
	temporaryclosedday[5]="2/11"
	temporaryclosedday[6]="2/18"
	temporaryclosedday[7]="2/25"
	temporaryclosedday[8]="3/3"
	temporaryclosedday[9]="3/10"
	temporaryclosedday[10]="3/17"
	temporaryclosedday[11]="3/24"
	temporaryclosedday[12]="3/31"
	temporaryclosedday[13]="4/7"
	temporaryclosedday[14]="4/14"
	temporaryclosedday[15]="4/21"
	temporaryclosedday[16]="4/28"
	temporaryclosedday[17]="5/5"
	temporaryclosedday[18]="5/12"
	temporaryclosedday[19]="5/19"
	temporaryclosedday[20]="6/2"
	temporaryclosedday[21]="6/9"
	temporaryclosedday[22]="6/16"
	temporaryclosedday[23]="6/23"
	temporaryclosedday[24]="6/30"
	temporaryclosedday[25]="6/2"
	temporaryclosedday[26]="6/9"
	temporaryclosedday[27]="6/16"
	temporaryclosedday[28]="6/23"
	temporaryclosedday[29]="6/30"
	temporaryclosedday[30]="7/7"
	temporaryclosedday[31]="7/14"
	temporaryclosedday[32]="7/21"
	temporaryclosedday[33]="7/28"
	temporaryclosedday[34]="8/4"
	temporaryclosedday[35]="8/11"
	temporaryclosedday[36]="8/18"
	temporaryclosedday[37]="8/25"
	temporaryclosedday[38]="9/1"
	temporaryclosedday[39]="9/8"
	temporaryclosedday[40]="9/15"
	temporaryclosedday[41]="9/22"
	temporaryclosedday[42]="9/29"
	temporaryclosedday[43]="10/6"
	temporaryclosedday[44]="10/13"
	temporaryclosedday[45]="10/20"
	temporaryclosedday[46]="10/27"
	temporaryclosedday[47]="11/3"
	temporaryclosedday[48]="11/10"
	temporaryclosedday[49]="11/17"
	temporaryclosedday[50]="11/24"
	temporaryclosedday[51]="12/3"
	temporaryclosedday[52]="12/10"
	temporaryclosedday[53]="12/17"
	temporaryclosedday[54]="12/24"
	temporaryclosedday[55]="12/31"

	// ********************* 土曜日定休日の設定 [eof]*********************

	// ********************* その他の休み設定 [bof]*********************

	temporaryclosedday[56]="1/1"
	temporaryclosedday[57]="1/2"
	temporaryclosedday[58]="1/3"
	temporaryclosedday[59]="1/4"

	temporaryclosedday[60]="12/30"
	temporaryclosedday[61]="12/31"



	// ********************* その他の休み設定 [eof]*********************

	var temporarycloseddayName=new Array();

	// ********************* 土曜日定休日の設定 [bof]*********************
	
	temporarycloseddayName[0]="定休日"

	temporarycloseddayName[1]="定休日"

	temporarycloseddayName[2]="定休日"

	temporarycloseddayName[3]="定休日"

	temporarycloseddayName[4]="定休日"

	temporarycloseddayName[5]="定休日"

	temporarycloseddayName[6]="定休日"

	temporarycloseddayName[7]="定休日"

	temporarycloseddayName[8]="定休日"

	temporarycloseddayName[9]="定休日"

	temporarycloseddayName[10]="定休日"

	temporarycloseddayName[11]="定休日"

	temporarycloseddayName[12]="定休日"

	temporarycloseddayName[13]="定休日"

	temporarycloseddayName[14]="定休日"

	temporarycloseddayName[15]="定休日"

	temporarycloseddayName[16]="定休日"

	temporarycloseddayName[17]="定休日"

	temporarycloseddayName[18]="定休日"

	temporarycloseddayName[19]="定休日"

	temporarycloseddayName[20]="定休日"

	temporarycloseddayName[21]="定休日"

	temporarycloseddayName[22]="定休日"

	temporarycloseddayName[23]="定休日"

	temporarycloseddayName[24]="定休日"

	temporarycloseddayName[25]="定休日"

	temporarycloseddayName[26]="定休日"

	temporarycloseddayName[27]="定休日"

	temporarycloseddayName[28]="定休日"

	temporarycloseddayName[29]="定休日"

	temporarycloseddayName[30]="定休日"

	temporarycloseddayName[31]="定休日"

	temporarycloseddayName[32]="定休日"

	temporarycloseddayName[33]="定休日"

	temporarycloseddayName[34]="定休日"

	temporarycloseddayName[35]="定休日"

	temporarycloseddayName[36]="定休日"

	temporarycloseddayName[37]="定休日"

	temporarycloseddayName[38]="定休日"

	temporarycloseddayName[39]="定休日"

	temporarycloseddayName[40]="定休日"

	temporarycloseddayName[41]="定休日"

	temporarycloseddayName[42]="定休日"

	temporarycloseddayName[43]="定休日"

	temporarycloseddayName[44]="定休日"

	temporarycloseddayName[45]="定休日"

	temporarycloseddayName[46]="定休日"

	temporarycloseddayName[47]="定休日"

	temporarycloseddayName[48]="定休日"

	temporarycloseddayName[49]="定休日"

	temporarycloseddayName[50]="定休日"

	temporarycloseddayName[51]="定休日"

	temporarycloseddayName[52]="定休日"

	temporarycloseddayName[53]="定休日"

	temporarycloseddayName[54]="定休日"

	temporarycloseddayName[55]="定休日"

	// ********************* 土曜日定休日の設定 [eof]*********************
	
	// ********************* その他の休みの設定 [bof]*********************

	temporarycloseddayName[56]="年末年始休業"
	temporarycloseddayName[57]="年末年始休業"
	temporarycloseddayName[58]="年末年始休業"
	temporarycloseddayName[59]="年末年始休業"
	temporarycloseddayName[60]="年末年始休業"
	temporarycloseddayName[61]="年末年始休業"

	// ********************* その他の休みの設定 [eof]*********************

	//臨時休業日の設定　終了

	var flag=false;

	var check=today_tmp2.getMonth()+1+"/"+today_tmp2.getDate();

	for(var i=0;i<temporaryclosedday.length;i++){

		if(check==temporaryclosedday[i]){

			flag=temporarycloseddayName[i];

		}

	}

	return flag

}







function makeCalendar(){

	makeCalendar1();

	document.write("<br>");

	makeCalendar2();

}



function makeCalendar1(){

	var monthDays=new Array(31,28,31,30,31,30,31,31,30,31,30,31);



	today_tmp=new Date();

	today=new Date();



	var year=today_tmp.getFullYear();

	if(((year%4==0)&&(year%100!=0))||(year%400==0)){

		monthDays[1]=29;

	}

	var nowDays=monthDays[today_tmp.getMonth()];

	var thisDay=today_tmp.getDate();

	var nowMonth=today_tmp.getMonth()+1;



	var day_date=new Array;

	var day_day=new Array;

	var day_holiday=new Array;

	var day_temporaryclosedday=new Array;

	for(var i=1;i<=nowDays;i++){

		today_tmp.setDate(i);

		day_date[i]=today_tmp.getDate();

		day_day[i]=today_tmp.getDay();

		day_holiday[i]=checkholidayName();

		day_temporaryclosedday[i]=checktemporarycloseddayName();

	}



	var content="<TABLE cellpadding='0' cellspacing='3' class='calendartable'><TR><TD colspan='7' class='year'>"+year+"年&#32;"+nowMonth+"月</TD></TR>";content+="<TR>";

	content+="<TD class='sunday'>日</TD>";

	content+="<TD class='monday'>月</TD>";

	content+="<TD class='tuesday' >火</TD>";

	content+="<TD class='wednesday'>水</TD>";

	content+="<TD class='thursday'>木</TD>";

	content+="<TD class='friday'>金</TD>";

	content+="<TD class='saturday'>土</TD>";

	content+="</TR>";

	content+="<TR align='right'>";

	var column=0;

	for(var i=0;i<day_day[1];i++){

		content+="<TD>&nbsp;</TD>";

		column++

	}



	for(var i=1;i<=nowDays;i++){



		if(today.getDate()==i){

			if(day_temporaryclosedday[i]==false){

				if(day_holiday[i]==false){

					if(column==6){content+="<TD class='t_saturday' >"+i+"</TD></TR>";column++}

					else if(column==1){content+="<TD class='t_monday' >"+i+"</TD>";column++}

					else if(column==2){content+="<TD class='t_tuesday' >"+i+"</TD>";column++}

					else if(column==3){content+="<TD class='t_wednesday' >"+i+"</TD>";column++}

					else if(column==4){content+="<TD class='t_thursday' >"+i+"</TD>";column++}

					else if(column==5){content+="<TD class='t_friday' >"+i+"</TD>";column++}

					else{content+="<TD class='t_sunday'>"+i+"</TD>";column++}

				}

				else{

					if(column==6){content+="<TD class='t_H_saturday' >"+i+"</TD></TR>";column++}

					else if(column==1){content+="<TD class='t_H_monday' >"+i+"</TD>";column++}

					else if(column==2){content+="<TD class='t_H_tuesday' >"+i+"</TD>";column++}

					else if(column==3){content+="<TD class='t_H_wednesday' >"+i+"</TD>";column++}

					else if(column==4){content+="<TD class='t_H_thursday' >"+i+"</TD>";column++}

					else if(column==5){content+="<TD class='t_H_friday' >"+i+"</TD>";column++}

					else{content+="<TD class='t_H_sunday' >"+i+"</TD>";column++}

				}

			}

			else{

				if(day_holiday[i]==false){

					if(column==6){content+="<TD class='t_TC_saturday' >"+i+"</TD></TR>";column++}

					else if(column==1){content+="<TD class='t_TC_monday' >"+i+"</TD>";column++}

					else if(column==2){content+="<TD class='t_TC_tuesday' >"+i+"</TD>";column++}

					else if(column==3){content+="<TD class='t_TC_wednesday' >"+i+"</TD>";column++}

					else if(column==4){content+="<TD class='t_TC_thursday' >"+i+"</TD>";column++}

					else if(column==5){content+="<TD class='t_TC_friday' >"+i+"</TD>";column++}

					else{content+="<TD class='t_TC_sunday' >"+i+"</TD>";column++}

				}

				else{

					if(column==6){content+="<TD class='t_TC_H_saturday' >"+i+"</TD></TR>";column++}

					else if(column==1){content+="<TD class='t_TC_H_monday' >"+i+"</TD>";column++}

					else if(column==2){content+="<TD class='t_TC_H_tuesday' >"+i+"</TD>";column++}

					else if(column==3){content+="<TD class='t_TC_H_wednesday' >"+i+"</TD>";column++}

					else if(column==4){content+="<TD class='t_TC_H_thursday' >"+i+"</TD>";column++}

					else if(column==5){content+="<TD class='t_TC_H_friday' >"+i+"</TD>";column++}

					else{content+="<TD class='t_TC_H_sunday' >"+i+"</TD>";column++}

				}

			}

		}

		else{

			if(day_temporaryclosedday[i]==false){

				if(day_holiday[i]==false){

					if(column==6){content+="<TD class='saturday' >"+i+"</TD></TR>";column++}

					else if(column==1){content+="<TD class='monday' >"+i+"</TD>";column++}

					else if(column==2){content+="<TD class='tuesday' >"+i+"</TD>";column++}

					else if(column==3){content+="<TD class='wednesday' >"+i+"</TD>";column++}

					else if(column==4){content+="<TD class='thursday' >"+i+"</TD>";column++}

					else if(column==5){content+="<TD class='friday' >"+i+"</TD>";column++}

					else{content+="<TD class='sunday' >"+i+"</TD>";column++}

				}

				else{

					if(column==6){content+="<TD class='H_saturday' >"+i+"</TD></TR>";column++}

					else if(column==1){content+="<TD class='H_monday' >"+i+"</TD>";column++}

					else if(column==2){content+="<TD class='H_tuesday' >"+i+"</TD>";column++}

					else if(column==3){content+="<TD class='H_wednesday' >"+i+"</TD>";column++}

					else if(column==4){content+="<TD class='H_thursday' >"+i+"</TD>";column++}

					else if(column==5){content+="<TD class='H_friday' >"+i+"</TD>";column++}

					else{content+="<TD class='H_sunday' >"+i+"</TD>";column++}

				}

			}

			else{

				if(day_holiday[i]==false){

					if(column==6){content+="<TD class='TC_saturday' >"+i+"</TD></TR>";column++}

					else if(column==1){content+="<TD class='TC_monday' >"+i+"</TD>";column++}

					else if(column==2){content+="<TD class='TC_tuesday' >"+i+"</TD>";column++}

					else if(column==3){content+="<TD class='TC_wednesday' >"+i+"</TD>";column++}

					else if(column==4){content+="<TD class='TC_thursday' >"+i+"</TD>";column++}

					else if(column==5){content+="<TD class='TC_friday' >"+i+"</TD>";column++}

					else{content+="<TD class='TC_sunday' >"+i+"</TD>";column++}

				}

				else{

					if(column==6){content+="<TD class='TC_H_saturday' >"+i+"</TD></TR>";column++}

					else if(column==1){content+="<TD class='TC_H_monday' >"+i+"</TD>";column++}

					else if(column==2){content+="<TD class='TC_H_tuesday' >"+i+"</TD>";column++}

					else if(column==3){content+="<TD class='TC_H_wednesday' >"+i+"</TD>";column++}

					else if(column==4){content+="<TD class='TC_H_thursday' >"+i+"</TD>";column++}

					else if(column==5){content+="<TD class='TC_H_friday' >"+i+"</TD>";column++}

					else{content+="<TD class='TC_H_sunday' >"+i+"</TD>";column++}

				}

			}

		}

		if(column==7){

			content+="</TR><TR align='right'>";

			column=0;

		}

	}

	content+="</TR></TABLE>";

	document.write(content);

}



function makeCalendar2(){

	var monthDays=new Array(31,28,31,30,31,30,31,31,30,31,30,31);

	today_tmp2=new Date(DateAdd('m',1,'','yyyy/mm/dd'));

	var year2=today_tmp2.getFullYear();

	if(((year2%4==0)&&(year2%100!=0))||(year2%400==0)){

		monthDays[1]=29;

	}

	var nowDays2=monthDays[today_tmp2.getMonth()];

	var thisDay2=today_tmp2.getDate();

	var nowMonth2=today_tmp2.getMonth()+1;



	var day_date=new Array;

	var day_day=new Array;

	var day_holiday=new Array;

	var day_temporaryclosedday=new Array;



	for(var i=1;i<=nowDays2;i++){

		today_tmp2.setDate(i);

		day_date[i]=today_tmp2.getDate();

		day_day[i]=today_tmp2.getDay();

		day_holiday[i]=checkholidayName2();

		day_temporaryclosedday[i]=checktemporarycloseddayName2();



	}

	var content="<TABLE cellpadding='0' cellspacing='3' class='calendartable'><TR><TD colspan='7' class='year'>"+year2+"年&#32;"+nowMonth2+"月</TD></TR>";

	content+="<TR>";

	content+="<TD class='sunday'>日</TD>";

	content+="<TD class='monday'>月</TD>";

	content+="<TD class='tuesday' >火</TD>";

	content+="<TD class='wednesday'>水</TD>";

	content+="<TD class='thursday'>木</TD>";

	content+="<TD class='friday'>金</TD>";

	content+="<TD class='saturday'>土</TD>";

	content+="</TR>";

	content+="<TR align='right'>";

	var column=0;

	for(var i=0;i<day_day[1];i++){

		content+="<TD>&nbsp;</TD>";

		column++

	}

	for(var i=1;i<=nowDays2;i++){



		if(day_temporaryclosedday[i]==false){

			if(day_holiday[i]==false){

				if(column==6){content+="<TD class='saturday' >"+i+"</TD></TR>";column++}

				else if(column==1){content+="<TD class='monday' >"+i+"</TD>";column++}

				else if(column==2){content+="<TD class='tuesday' >"+i+"</TD>";column++}

				else if(column==3){content+="<TD class='wednesday' >"+i+"</TD>";column++}

				else if(column==4){content+="<TD class='thursday' >"+i+"</TD>";column++}

				else if(column==5){content+="<TD class='friday' >"+i+"</TD>";column++}

				else{content+="<TD class='sunday' >"+i+"</TD>";column++}

			}

			else{

				if(column==6){content+="<TD class='H_saturday' >"+i+"</TD></TR>";column++}

				else if(column==1){content+="<TD class='H_monday' >"+i+"</TD>";column++}

				else if(column==2){content+="<TD class='H_tuesday' >"+i+"</TD>";column++}

				else if(column==3){content+="<TD class='H_wednesday' >"+i+"</TD>";column++}

				else if(column==4){content+="<TD class='H_thursday' >"+i+"</TD>";column++}

				else if(column==5){content+="<TD class='H_friday' >"+i+"</TD>";column++}

				else{content+="<TD class='H_sunday' >"+i+"</TD>";column++}

			}

		}

		else{

			if(day_holiday[i]==false){

				if(column==6){content+="<TD class='TC_saturday' >"+i+"</TD></TR>";column++}

				else if(column==1){content+="<TD class='TC_monday' >"+i+"</TD>";column++}

				else if(column==2){content+="<TD class='TC_tuesday' >"+i+"</TD>";column++}

				else if(column==3){content+="<TD class='TC_wednesday' >"+i+"</TD>";column++}

				else if(column==4){content+="<TD class='TC_thursday' >"+i+"</TD>";column++}

				else if(column==5){content+="<TD class='TC_friday' >"+i+"</TD>";column++}

				else{content+="<TD class='TC_sunday' >"+i+"</TD>";column++}

			}

			else{

				if(column==6){content+="<TD class='TC_H_saturday' >"+i+"</TD></TR>";column++}

				else if(column==1){content+="<TD class='TC_H_monday' >"+i+"</TD>";column++}

				else if(column==2){content+="<TD class='TC_H_tuesday' >"+i+"</TD>";column++}

				else if(column==3){content+="<TD class='TC_H_wednesday' >"+i+"</TD>";column++}

				else if(column==4){content+="<TD class='TC_H_thursday' >"+i+"</TD>";column++}

				else if(column==5){content+="<TD class='TC_H_friday' >"+i+"</TD>";column++}

				else{content+="<TD class='TC_H_sunday' >"+i+"</TD>";column++}

			}

		}

		if(column==7){

			content+="</TR><TR align='right'>";

			column=0;

		}

	}

	content+="</TR></TABLE>";

	document.write(content);

}



function DateAdd(flg,n,nDate,fmt){

	//  機能　　　　：指定日の過去または未来の日を求める関数

	//  関数名　　　：DateAdd()

	//  引数　　　　：flg     "y","m","d"      加算単位（文字属性）

	//  　　　　　　：n      ｎ日後またはｎ日前（数値属性）前の時は−値とする

	//  　　　　　　：nDate  指定日（文字属性：yyyy/m/d or yyyy/mm/dd）

	//	　　　　：fmt    戻り値の形式 "yyyy/m/d" "yyyy/mm/dd" "yyyymmdd"

	//  戻り値　　　：日付形式（yyyy/m/d）

	//

	//  呼出例　　　：DatedAdd("d",100,"","yyyy/m/d")  当日の10日後の日付を求める

	//  　　　　　　：DatedAdd("d",-25,"2003/1/20","yyyymmdd") 2003/1/20の25日前の日付を求める

	//

	//  2005/07/20 12月の月末を求める処理修正

	//



	if (nDate == ""){

		var wDate = new Date();

	}else{

		var wymd = nDate.split("/");

		if (wymd[1].length == 1){wymd[1] = "0" + wymd[1]};

		if (wymd[2].length == 1){wymd[2] = "0" + wymd[2]};

		if (ValidDate(wymd[0] + "/" + wymd[1] + "/" + wymd[2])){

			var wDate = new Date(nDate);

		}else{

			return "<FONT COLOR='red'>日付形式エラー(" + nDate + ")</FONT>";

		}

	}

	if (isNaN(n)){

		return "<FONT COLOR='red'>加算数値エラー(" + n + ")</FONT>";

	}

	if (fmt == "yyyy/m/d" || fmt == "yyyy/mm/dd" || fmt == "yyyymmdd"){

		wfmt = fmt;

	}else{

		wfmt = "yyyy/m/d";

	}

	switch (flg.toLowerCase()){

		case "d":

		var wY = wDate.getFullYear();

		var wM = wDate.getMonth() + 1;

		var wD = wDate.getDate();

		return DateDAdd(n,wY + "/" + wM + "/" + wD,wfmt);

		break;



		case "m":

		var tYear = wDate.getFullYear();

		var tMonth = wDate.getMonth() + 1 + n;

		if (tMonth >= 13){

			var value = Math.floor(parseFloat(tMonth / 12));

			tYear += value;

			if(tMonth == value * 12){

				tYear -= 1;

				tMonth = 12;

			}else{

				tMonth -= (12 * value);

			}

		}else{

			if (tMonth <= 0) {

				var value = Math.ceil(parseFloat(tMonth / 12)) - 1;

				tYear += value;

				tMonth += (12 * Math.abs(value));

			}

		}

		var tDate = wDate.getDate();

		if (tMonth == 2){

			if (tDate > 28){

				return DateDAdd(-1,tYear + "/3/1",wfmt)

			}else{

				if (wfmt == "yyyy/m/d"){

					return tYear + "/" + tMonth + "/" + tDate;

				}else{

					if (tMonth < 10){tMonth = "0" + tMonth};

					if (tDate < 10){tDate = "0" + tDate};

					if(wfmt == "yyyy/mm/dd"){

						return tYear + "/" + tMonth + "/" + tDate;

					}else{

						return tYear + "" + tMonth + "" + tDate;

					}

				}

			}

		}else{

			if (tMonth == 4 || tMonth == 6 || tMonth == 9 || tMonth == 11){

				if (tDate == 31){

					tDate = 30;

				}

			}else{

				if (tMonth >= 13){

					tYear += 1;

					tMonth -= 12;

				}

			}

			if (wfmt == "yyyy/m/d"){

				return (tYear + "/" + tMonth + "/" + tDate);

			}else{

				if (tMonth < 10){tMonth = "0" + tMonth};

				if (tDate < 10){tDate = "0" + tDate};

				if (wfmt == "yyyy/mm/dd"){

					return (tYear + "/" + tMonth + "/" + tDate);

				}else{

					return (tYear + "" + tMonth * "" + tDate);

				}

			}

		}

		break;



		case "y":

		var tYear = wDate.getFullYear()+n;

		var tMonth = wDate.getMonth()+1;

		var tDate = wDate.getDate();

		if (tMonth == 2){

			if (tDate > 28){

				return DateDAdd(-1,tYear + "/3/1",wfmt)

			}else{

				if (wfmt == "yyyy/m/d"){

					return (tYear + "/" + tMonth + "/" + tDate);

				}else{

					if (tMonth < 10){tMonth = "0" + tMonth};

					if (tDate < 10){tDate = "0" + tDate};

					if (wfmt == "yyyy/mm/dd"){

						return (tYear + "/" + tMonth + "/" + tDate);

					}else{

						return (tYear + "" + tMonth + "" + tDate);

					}

				}

			}

		}else{

			if (wfmt == "yyyy/m/d"){

				return (tYear + "/" + tMonth + "/" + tDate);

			}else{

				if (tMonth < 10){tMonth = "0" + tMonth};

				if (tDate < 10){tDate = "0" + tDate};

				if (wfmt == "yyyy/mm/dd"){

					return (tYear + "/" + tMonth + "/" + tDate);

				}else{

					return (tYear + "" + tMonth + "" + tDate);

				}

			}

		}

		break;



		default:

		return "<FONT COLOR='red'>加算単位エラー（" + flg + ")</FONT>";

		break;

	}

}
