var cals = new Array();

function writeCalendar(num){
	if(obj = document.getElementById("calObj")){
		obj.innerHTML = cals[num];
	}
}

function changeCalender(sel){
	var index = sel.selectedIndex
	if(index >= 0){
		writeCalendar(index);
	}
}

function calendar(){
	var now = new Date();
	var year = 2010;
	var month = 08;
	var date = now.getDate();
	var day = now.getDay();
	var last_date = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
	if(month==2){
		if(year%4==0){
			if((year%100==0) && (year%400!=0)){
			}else{
				last_date[1] = 29;
			}
		}
	}

	var calhead001 =
		'<table class="cal" id="cal0" cellpadding="0" cellspacing="0" border="0" summary="図書館カレンダー">' +
		'<caption>中央館：' + year + '年' + month + '月</caption>' +
		'<colgroup>' +
		'<col width="14%" span="7">' +
		'</colgroup>' +
		'<thead>'
	;
	var calstr001 =
		'<tr><th scope="col" abbr="日">日</th><th scope="col" abbr="月">月</th><th scope="col" abbr="火">火</th><th scope="col" abbr="水">水</th><th scope="col" abbr="木">木</th><th scope="col" abbr="金">金</th><th scope="col" abbr="土">土</th></tr>' +
		'</thead>' +
		'<tbody><tr>'
	;
	for(dayIndex=0; dayIndex<(new Date(year,month-1,1)).getDay(); dayIndex++){
		calstr001 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr001 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==02)||(i==09)||(i==16)||(i==23)||(i==27)||(i==30)) {	// CLOSED
			if(i==date){
				calstr001 += defBTD(i,"close");
			}else{
				calstr001 += defTD(i,"close");
			}
		} else if(i==date){					// TODAY
			calstr001 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr001 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr001 += defTD(i,"saturday");
				calstr001 += "</tr>";
				break;
			default:					// Normal
				calstr001 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=0){
		for(i=dayIndex; i<=6; i++){
			calstr001 += defTD("","blank");
		}
		calstr001 += "</TR>";
	}
	calstr001 += "</TABLE>";

	cals.push(calhead001 + calstr001);

	var calhead002 =
		'<table class="cal" id="cal0" cellpadding="0" cellspacing="0" border="0" summary="図書館カレンダー">' +
		'<caption>高橋CC：' + year + '年' + month + '月</caption>' +
		'<colgroup>' +
		'<col width="14%" span="7">' +
		'</colgroup>' +
		'<thead>'
	;
	var calstr002 =
		'<tr><th scope="col" abbr="日">日</th><th scope="col" abbr="月">月</th><th scope="col" abbr="火">火</th><th scope="col" abbr="水">水</th><th scope="col" abbr="木">木</th><th scope="col" abbr="金">金</th><th scope="col" abbr="土">土</th></tr>' +
		'</thead>' +
		'<tbody><tr>'
	;
	for(dayIndex=0; dayIndex<(new Date(year,month-1,1)).getDay(); dayIndex++){
		calstr002 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr002 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==02)||(i==09)||(i==16)||(i==23)||(i==30)) {	// CLOSED
			if(i==date){
				calstr002 += defBTD(i,"close");
			}else{
				calstr002 += defTD(i,"close");
			}
		} else if(i==date){					// TODAY
			calstr002 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr002 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr002 += defTD(i,"saturday");
				calstr002 += "</tr>";
				break;
			default:					// Normal
				calstr002 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=0){
		for(i=dayIndex; i<=6; i++){
			calstr002 += defTD("","blank");
		}
		calstr002 += "</TR>";
	}
	calstr002 += "</TABLE>";

	cals.push(calhead002 + calstr002);

	var calhead003 =
		'<table class="cal" id="cal0" cellpadding="0" cellspacing="0" border="0" summary="図書館カレンダー">' +
		'<caption>猿投CC：' + year + '年' + month + '月</caption>' +
		'<colgroup>' +
		'<col width="14%" span="7">' +
		'</colgroup>' +
		'<thead>'
	;
	var calstr003 =
		'<tr><th scope="col" abbr="日">日</th><th scope="col" abbr="月">月</th><th scope="col" abbr="火">火</th><th scope="col" abbr="水">水</th><th scope="col" abbr="木">木</th><th scope="col" abbr="金">金</th><th scope="col" abbr="土">土</th></tr>' +
		'</thead>' +
		'<tbody><tr>'
	;
	for(dayIndex=0; dayIndex<(new Date(year,month-1,1)).getDay(); dayIndex++){
		calstr003 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr003 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==02)||(i==09)||(i==16)||(i==23)||(i==30)) {	// CLOSED
			if(i==date){
				calstr003 += defBTD(i,"close");
			}else{
				calstr003 += defTD(i,"close");
			}
		} else if(i==date){					// TODAY
			calstr003 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr003 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr003 += defTD(i,"saturday");
				calstr003 += "</tr>";
				break;
			default:					// Normal
				calstr003 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=0){
		for(i=dayIndex; i<=6; i++){
			calstr003 += defTD("","blank");
		}
		calstr003 += "</TR>";
	}
	calstr003 += "</TABLE>";

	cals.push(calhead003 + calstr003);

	var calhead004 =
		'<table class="cal" id="cal0" cellpadding="0" cellspacing="0" border="0" summary="図書館カレンダー">' +
		'<caption>松平CC：' + year + '年' + month + '月</caption>' +
		'<colgroup>' +
		'<col width="14%" span="7">' +
		'</colgroup>' +
		'<thead>'
	;
	var calstr004 =
		'<tr><th scope="col" abbr="日">日</th><th scope="col" abbr="月">月</th><th scope="col" abbr="火">火</th><th scope="col" abbr="水">水</th><th scope="col" abbr="木">木</th><th scope="col" abbr="金">金</th><th scope="col" abbr="土">土</th></tr>' +
		'</thead>' +
		'<tbody><tr>'
	;
	for(dayIndex=0; dayIndex<(new Date(year,month-1,1)).getDay(); dayIndex++){
		calstr004 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr004 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==02)||(i==09)||(i==16)||(i==23)||(i==30)) {	// CLOSED
			if(i==date){
				calstr004 += defBTD(i,"close");
			}else{
				calstr004 += defTD(i,"close");
			}
		} else if(i==date){					// TODAY
			calstr004 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr004 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr004 += defTD(i,"saturday");
				calstr004 += "</tr>";
				break;
			default:					// Normal
				calstr004 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=0){
		for(i=dayIndex; i<=6; i++){
			calstr004 += defTD("","blank");
		}
		calstr004 += "</TR>";
	}
	calstr004 += "</TABLE>";

	cals.push(calhead004 + calstr004);

	var calhead005 =
		'<table class="cal" id="cal0" cellpadding="0" cellspacing="0" border="0" summary="図書館カレンダー">' +
		'<caption>上郷CC：' + year + '年' + month + '月</caption>' +
		'<colgroup>' +
		'<col width="14%" span="7">' +
		'</colgroup>' +
		'<thead>'
	;
	var calstr005 =
		'<tr><th scope="col" abbr="日">日</th><th scope="col" abbr="月">月</th><th scope="col" abbr="火">火</th><th scope="col" abbr="水">水</th><th scope="col" abbr="木">木</th><th scope="col" abbr="金">金</th><th scope="col" abbr="土">土</th></tr>' +
		'</thead>' +
		'<tbody><tr>'
	;
	for(dayIndex=0; dayIndex<(new Date(year,month-1,1)).getDay(); dayIndex++){
		calstr005 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr005 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==02)||(i==09)||(i==16)||(i==23)||(i==30)) {	// CLOSED
			if(i==date){
				calstr005 += defBTD(i,"close");
			}else{
				calstr005 += defTD(i,"close");
			}
		} else if(i==date){					// TODAY
			calstr005 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr005 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr005 += defTD(i,"saturday");
				calstr005 += "</tr>";
				break;
			default:					// Normal
				calstr005 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=0){
		for(i=dayIndex; i<=6; i++){
			calstr005 += defTD("","blank");
		}
		calstr005 += "</TR>";
	}
	calstr005 += "</TABLE>";

	cals.push(calhead005 + calstr005);

	var calhead006 =
		'<table class="cal" id="cal0" cellpadding="0" cellspacing="0" border="0" summary="図書館カレンダー">' +
		'<caption>高岡CC：' + year + '年' + month + '月</caption>' +
		'<colgroup>' +
		'<col width="14%" span="7">' +
		'</colgroup>' +
		'<thead>'
	;
	var calstr006 =
		'<tr><th scope="col" abbr="日">日</th><th scope="col" abbr="月">月</th><th scope="col" abbr="火">火</th><th scope="col" abbr="水">水</th><th scope="col" abbr="木">木</th><th scope="col" abbr="金">金</th><th scope="col" abbr="土">土</th></tr>' +
		'</thead>' +
		'<tbody><tr>'
	;
	for(dayIndex=0; dayIndex<(new Date(year,month-1,1)).getDay(); dayIndex++){
		calstr006 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr006 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==02)||(i==09)||(i==16)||(i==23)||(i==30)) {	// CLOSED
			if(i==date){
				calstr006 += defBTD(i,"close");
			}else{
				calstr006 += defTD(i,"close");
			}
		} else if(i==date){					// TODAY
			calstr006 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr006 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr006 += defTD(i,"saturday");
				calstr006 += "</tr>";
				break;
			default:					// Normal
				calstr006 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=0){
		for(i=dayIndex; i<=6; i++){
			calstr006 += defTD("","blank");
		}
		calstr006 += "</TR>";
	}
	calstr006 += "</TABLE>";

	cals.push(calhead006 + calstr006);

	var calhead009 =
		'<table class="cal" id="cal0" cellpadding="0" cellspacing="0" border="0" summary="図書館カレンダー">' +
		'<caption>西部CC：' + year + '年' + month + '月</caption>' +
		'<colgroup>' +
		'<col width="14%" span="7">' +
		'</colgroup>' +
		'<thead>'
	;
	var calstr009 =
		'<tr><th scope="col" abbr="日">日</th><th scope="col" abbr="月">月</th><th scope="col" abbr="火">火</th><th scope="col" abbr="水">水</th><th scope="col" abbr="木">木</th><th scope="col" abbr="金">金</th><th scope="col" abbr="土">土</th></tr>' +
		'</thead>' +
		'<tbody><tr>'
	;
	for(dayIndex=0; dayIndex<(new Date(year,month-1,1)).getDay(); dayIndex++){
		calstr009 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr009 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==02)||(i==09)||(i==16)||(i==23)||(i==30)) {	// CLOSED
			if(i==date){
				calstr009 += defBTD(i,"close");
			}else{
				calstr009 += defTD(i,"close");
			}
		} else if(i==date){					// TODAY
			calstr009 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr009 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr009 += defTD(i,"saturday");
				calstr009 += "</tr>";
				break;
			default:					// Normal
				calstr009 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=0){
		for(i=dayIndex; i<=6; i++){
			calstr009 += defTD("","blank");
		}
		calstr009 += "</TR>";
	}
	calstr009 += "</TABLE>";

	cals.push(calhead009 + calstr009);

	var calhead011 =
		'<table class="cal" id="cal0" cellpadding="0" cellspacing="0" border="0" summary="図書館カレンダー">' +
		'<caption>逢　妻：' + year + '年' + month + '月</caption>' +
		'<colgroup>' +
		'<col width="14%" span="7">' +
		'</colgroup>' +
		'<thead>'
	;
	var calstr011 =
		'<tr><th scope="col" abbr="日">日</th><th scope="col" abbr="月">月</th><th scope="col" abbr="火">火</th><th scope="col" abbr="水">水</th><th scope="col" abbr="木">木</th><th scope="col" abbr="金">金</th><th scope="col" abbr="土">土</th></tr>' +
		'</thead>' +
		'<tbody><tr>'
	;
	for(dayIndex=0; dayIndex<(new Date(year,month-1,1)).getDay(); dayIndex++){
		calstr011 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr011 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==02)||(i==09)||(i==16)||(i==23)||(i==30)) {	// CLOSED
			if(i==date){
				calstr011 += defBTD(i,"close");
			}else{
				calstr011 += defTD(i,"close");
			}
		} else if(i==date){					// TODAY
			calstr011 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr011 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr011 += defTD(i,"saturday");
				calstr011 += "</tr>";
				break;
			default:					// Normal
				calstr011 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=0){
		for(i=dayIndex; i<=6; i++){
			calstr011 += defTD("","blank");
		}
		calstr011 += "</TR>";
	}
	calstr011 += "</TABLE>";

	cals.push(calhead011 + calstr011);

	var calhead012 =
		'<table class="cal" id="cal0" cellpadding="0" cellspacing="0" border="0" summary="図書館カレンダー">' +
		'<caption>朝日丘：' + year + '年' + month + '月</caption>' +
		'<colgroup>' +
		'<col width="14%" span="7">' +
		'</colgroup>' +
		'<thead>'
	;
	var calstr012 =
		'<tr><th scope="col" abbr="日">日</th><th scope="col" abbr="月">月</th><th scope="col" abbr="火">火</th><th scope="col" abbr="水">水</th><th scope="col" abbr="木">木</th><th scope="col" abbr="金">金</th><th scope="col" abbr="土">土</th></tr>' +
		'</thead>' +
		'<tbody><tr>'
	;
	for(dayIndex=0; dayIndex<(new Date(year,month-1,1)).getDay(); dayIndex++){
		calstr012 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr012 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==02)||(i==09)||(i==16)||(i==23)||(i==30)) {	// CLOSED
			if(i==date){
				calstr012 += defBTD(i,"close");
			}else{
				calstr012 += defTD(i,"close");
			}
		} else if(i==date){					// TODAY
			calstr012 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr012 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr012 += defTD(i,"saturday");
				calstr012 += "</tr>";
				break;
			default:					// Normal
				calstr012 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=0){
		for(i=dayIndex; i<=6; i++){
			calstr012 += defTD("","blank");
		}
		calstr012 += "</TR>";
	}
	calstr012 += "</TABLE>";

	cals.push(calhead012 + calstr012);

	var calhead013 =
		'<table class="cal" id="cal0" cellpadding="0" cellspacing="0" border="0" summary="図書館カレンダー">' +
		'<caption>石　野：' + year + '年' + month + '月</caption>' +
		'<colgroup>' +
		'<col width="14%" span="7">' +
		'</colgroup>' +
		'<thead>'
	;
	var calstr013 =
		'<tr><th scope="col" abbr="日">日</th><th scope="col" abbr="月">月</th><th scope="col" abbr="火">火</th><th scope="col" abbr="水">水</th><th scope="col" abbr="木">木</th><th scope="col" abbr="金">金</th><th scope="col" abbr="土">土</th></tr>' +
		'</thead>' +
		'<tbody><tr>'
	;
	for(dayIndex=0; dayIndex<(new Date(year,month-1,1)).getDay(); dayIndex++){
		calstr013 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr013 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==02)||(i==09)||(i==16)||(i==23)||(i==30)) {	// CLOSED
			if(i==date){
				calstr013 += defBTD(i,"close");
			}else{
				calstr013 += defTD(i,"close");
			}
		} else if(i==date){					// TODAY
			calstr013 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr013 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr013 += defTD(i,"saturday");
				calstr013 += "</tr>";
				break;
			default:					// Normal
				calstr013 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=0){
		for(i=dayIndex; i<=6; i++){
			calstr013 += defTD("","blank");
		}
		calstr013 += "</TR>";
	}
	calstr013 += "</TABLE>";

	cals.push(calhead013 + calstr013);

	var calhead014 =
		'<table class="cal" id="cal0" cellpadding="0" cellspacing="0" border="0" summary="図書館カレンダー">' +
		'<caption>梅坪台：' + year + '年' + month + '月</caption>' +
		'<colgroup>' +
		'<col width="14%" span="7">' +
		'</colgroup>' +
		'<thead>'
	;
	var calstr014 =
		'<tr><th scope="col" abbr="日">日</th><th scope="col" abbr="月">月</th><th scope="col" abbr="火">火</th><th scope="col" abbr="水">水</th><th scope="col" abbr="木">木</th><th scope="col" abbr="金">金</th><th scope="col" abbr="土">土</th></tr>' +
		'</thead>' +
		'<tbody><tr>'
	;
	for(dayIndex=0; dayIndex<(new Date(year,month-1,1)).getDay(); dayIndex++){
		calstr014 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr014 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==02)||(i==09)||(i==16)||(i==23)||(i==30)) {	// CLOSED
			if(i==date){
				calstr014 += defBTD(i,"close");
			}else{
				calstr014 += defTD(i,"close");
			}
		} else if(i==date){					// TODAY
			calstr014 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr014 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr014 += defTD(i,"saturday");
				calstr014 += "</tr>";
				break;
			default:					// Normal
				calstr014 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=0){
		for(i=dayIndex; i<=6; i++){
			calstr014 += defTD("","blank");
		}
		calstr014 += "</TR>";
	}
	calstr014 += "</TABLE>";

	cals.push(calhead014 + calstr014);

	var calhead015 =
		'<table class="cal" id="cal0" cellpadding="0" cellspacing="0" border="0" summary="図書館カレンダー">' +
		'<caption>猿投北：' + year + '年' + month + '月</caption>' +
		'<colgroup>' +
		'<col width="14%" span="7">' +
		'</colgroup>' +
		'<thead>'
	;
	var calstr015 =
		'<tr><th scope="col" abbr="日">日</th><th scope="col" abbr="月">月</th><th scope="col" abbr="火">火</th><th scope="col" abbr="水">水</th><th scope="col" abbr="木">木</th><th scope="col" abbr="金">金</th><th scope="col" abbr="土">土</th></tr>' +
		'</thead>' +
		'<tbody><tr>'
	;
	for(dayIndex=0; dayIndex<(new Date(year,month-1,1)).getDay(); dayIndex++){
		calstr015 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr015 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==02)||(i==09)||(i==16)||(i==23)||(i==30)) {	// CLOSED
			if(i==date){
				calstr015 += defBTD(i,"close");
			}else{
				calstr015 += defTD(i,"close");
			}
		} else if(i==date){					// TODAY
			calstr015 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr015 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr015 += defTD(i,"saturday");
				calstr015 += "</tr>";
				break;
			default:					// Normal
				calstr015 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=0){
		for(i=dayIndex; i<=6; i++){
			calstr015 += defTD("","blank");
		}
		calstr015 += "</TR>";
	}
	calstr015 += "</TABLE>";

	cals.push(calhead015 + calstr015);

	var calhead016 =
		'<table class="cal" id="cal0" cellpadding="0" cellspacing="0" border="0" summary="図書館カレンダー">' +
		'<caption>猿投台：' + year + '年' + month + '月</caption>' +
		'<colgroup>' +
		'<col width="14%" span="7">' +
		'</colgroup>' +
		'<thead>'
	;
	var calstr016 =
		'<tr><th scope="col" abbr="日">日</th><th scope="col" abbr="月">月</th><th scope="col" abbr="火">火</th><th scope="col" abbr="水">水</th><th scope="col" abbr="木">木</th><th scope="col" abbr="金">金</th><th scope="col" abbr="土">土</th></tr>' +
		'</thead>' +
		'<tbody><tr>'
	;
	for(dayIndex=0; dayIndex<(new Date(year,month-1,1)).getDay(); dayIndex++){
		calstr016 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr016 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==02)||(i==09)||(i==16)||(i==23)||(i==30)) {	// CLOSED
			if(i==date){
				calstr016 += defBTD(i,"close");
			}else{
				calstr016 += defTD(i,"close");
			}
		} else if(i==date){					// TODAY
			calstr016 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr016 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr016 += defTD(i,"saturday");
				calstr016 += "</tr>";
				break;
			default:					// Normal
				calstr016 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=0){
		for(i=dayIndex; i<=6; i++){
			calstr016 += defTD("","blank");
		}
		calstr016 += "</TR>";
	}
	calstr016 += "</TABLE>";

	cals.push(calhead016 + calstr016);

	var calhead017 =
		'<table class="cal" id="cal0" cellpadding="0" cellspacing="0" border="0" summary="図書館カレンダー">' +
		'<caption>末野原：' + year + '年' + month + '月</caption>' +
		'<colgroup>' +
		'<col width="14%" span="7">' +
		'</colgroup>' +
		'<thead>'
	;
	var calstr017 =
		'<tr><th scope="col" abbr="日">日</th><th scope="col" abbr="月">月</th><th scope="col" abbr="火">火</th><th scope="col" abbr="水">水</th><th scope="col" abbr="木">木</th><th scope="col" abbr="金">金</th><th scope="col" abbr="土">土</th></tr>' +
		'</thead>' +
		'<tbody><tr>'
	;
	for(dayIndex=0; dayIndex<(new Date(year,month-1,1)).getDay(); dayIndex++){
		calstr017 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr017 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==02)||(i==09)||(i==16)||(i==23)||(i==30)) {	// CLOSED
			if(i==date){
				calstr017 += defBTD(i,"close");
			}else{
				calstr017 += defTD(i,"close");
			}
		} else if(i==date){					// TODAY
			calstr017 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr017 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr017 += defTD(i,"saturday");
				calstr017 += "</tr>";
				break;
			default:					// Normal
				calstr017 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=0){
		for(i=dayIndex; i<=6; i++){
			calstr017 += defTD("","blank");
		}
		calstr017 += "</TR>";
	}
	calstr017 += "</TABLE>";

	cals.push(calhead017 + calstr017);

	var calhead018 =
		'<table class="cal" id="cal0" cellpadding="0" cellspacing="0" border="0" summary="図書館カレンダー">' +
		'<caption>崇化館：' + year + '年' + month + '月</caption>' +
		'<colgroup>' +
		'<col width="14%" span="7">' +
		'</colgroup>' +
		'<thead>'
	;
	var calstr018 =
		'<tr><th scope="col" abbr="日">日</th><th scope="col" abbr="月">月</th><th scope="col" abbr="火">火</th><th scope="col" abbr="水">水</th><th scope="col" abbr="木">木</th><th scope="col" abbr="金">金</th><th scope="col" abbr="土">土</th></tr>' +
		'</thead>' +
		'<tbody><tr>'
	;
	for(dayIndex=0; dayIndex<(new Date(year,month-1,1)).getDay(); dayIndex++){
		calstr018 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr018 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==02)||(i==09)||(i==16)||(i==23)||(i==30)) {	// CLOSED
			if(i==date){
				calstr018 += defBTD(i,"close");
			}else{
				calstr018 += defTD(i,"close");
			}
		} else if(i==date){					// TODAY
			calstr018 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr018 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr018 += defTD(i,"saturday");
				calstr018 += "</tr>";
				break;
			default:					// Normal
				calstr018 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=0){
		for(i=dayIndex; i<=6; i++){
			calstr018 += defTD("","blank");
		}
		calstr018 += "</TR>";
	}
	calstr018 += "</TABLE>";

	cals.push(calhead018 + calstr018);

	var calhead019 =
		'<table class="cal" id="cal0" cellpadding="0" cellspacing="0" border="0" summary="図書館カレンダー">' +
		'<caption>若　林：' + year + '年' + month + '月</caption>' +
		'<colgroup>' +
		'<col width="14%" span="7">' +
		'</colgroup>' +
		'<thead>'
	;
	var calstr019 =
		'<tr><th scope="col" abbr="日">日</th><th scope="col" abbr="月">月</th><th scope="col" abbr="火">火</th><th scope="col" abbr="水">水</th><th scope="col" abbr="木">木</th><th scope="col" abbr="金">金</th><th scope="col" abbr="土">土</th></tr>' +
		'</thead>' +
		'<tbody><tr>'
	;
	for(dayIndex=0; dayIndex<(new Date(year,month-1,1)).getDay(); dayIndex++){
		calstr019 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr019 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==02)||(i==09)||(i==16)||(i==23)||(i==30)) {	// CLOSED
			if(i==date){
				calstr019 += defBTD(i,"close");
			}else{
				calstr019 += defTD(i,"close");
			}
		} else if(i==date){					// TODAY
			calstr019 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr019 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr019 += defTD(i,"saturday");
				calstr019 += "</tr>";
				break;
			default:					// Normal
				calstr019 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=0){
		for(i=dayIndex; i<=6; i++){
			calstr019 += defTD("","blank");
		}
		calstr019 += "</TR>";
	}
	calstr019 += "</TABLE>";

	cals.push(calhead019 + calstr019);

	var calhead020 =
		'<table class="cal" id="cal0" cellpadding="0" cellspacing="0" border="0" summary="図書館カレンダー">' +
		'<caption>高橋交：' + year + '年' + month + '月</caption>' +
		'<colgroup>' +
		'<col width="14%" span="7">' +
		'</colgroup>' +
		'<thead>'
	;
	var calstr020 =
		'<tr><th scope="col" abbr="日">日</th><th scope="col" abbr="月">月</th><th scope="col" abbr="火">火</th><th scope="col" abbr="水">水</th><th scope="col" abbr="木">木</th><th scope="col" abbr="金">金</th><th scope="col" abbr="土">土</th></tr>' +
		'</thead>' +
		'<tbody><tr>'
	;
	for(dayIndex=0; dayIndex<(new Date(year,month-1,1)).getDay(); dayIndex++){
		calstr020 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr020 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==02)||(i==09)||(i==16)||(i==23)||(i==30)) {	// CLOSED
			if(i==date){
				calstr020 += defBTD(i,"close");
			}else{
				calstr020 += defTD(i,"close");
			}
		} else if(i==date){					// TODAY
			calstr020 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr020 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr020 += defTD(i,"saturday");
				calstr020 += "</tr>";
				break;
			default:					// Normal
				calstr020 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=0){
		for(i=dayIndex; i<=6; i++){
			calstr020 += defTD("","blank");
		}
		calstr020 += "</TR>";
	}
	calstr020 += "</TABLE>";

	cals.push(calhead020 + calstr020);

	var calhead021 =
		'<table class="cal" id="cal0" cellpadding="0" cellspacing="0" border="0" summary="図書館カレンダー">' +
		'<caption>豊　南：' + year + '年' + month + '月</caption>' +
		'<colgroup>' +
		'<col width="14%" span="7">' +
		'</colgroup>' +
		'<thead>'
	;
	var calstr021 =
		'<tr><th scope="col" abbr="日">日</th><th scope="col" abbr="月">月</th><th scope="col" abbr="火">火</th><th scope="col" abbr="水">水</th><th scope="col" abbr="木">木</th><th scope="col" abbr="金">金</th><th scope="col" abbr="土">土</th></tr>' +
		'</thead>' +
		'<tbody><tr>'
	;
	for(dayIndex=0; dayIndex<(new Date(year,month-1,1)).getDay(); dayIndex++){
		calstr021 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr021 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==02)||(i==09)||(i==16)||(i==23)||(i==30)) {	// CLOSED
			if(i==date){
				calstr021 += defBTD(i,"close");
			}else{
				calstr021 += defTD(i,"close");
			}
		} else if(i==date){					// TODAY
			calstr021 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr021 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr021 += defTD(i,"saturday");
				calstr021 += "</tr>";
				break;
			default:					// Normal
				calstr021 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=0){
		for(i=dayIndex; i<=6; i++){
			calstr021 += defTD("","blank");
		}
		calstr021 += "</TR>";
	}
	calstr021 += "</TABLE>";

	cals.push(calhead021 + calstr021);

	var calhead022 =
		'<table class="cal" id="cal0" cellpadding="0" cellspacing="0" border="0" summary="図書館カレンダー">' +
		'<caption>保　見：' + year + '年' + month + '月</caption>' +
		'<colgroup>' +
		'<col width="14%" span="7">' +
		'</colgroup>' +
		'<thead>'
	;
	var calstr022 =
		'<tr><th scope="col" abbr="日">日</th><th scope="col" abbr="月">月</th><th scope="col" abbr="火">火</th><th scope="col" abbr="水">水</th><th scope="col" abbr="木">木</th><th scope="col" abbr="金">金</th><th scope="col" abbr="土">土</th></tr>' +
		'</thead>' +
		'<tbody><tr>'
	;
	for(dayIndex=0; dayIndex<(new Date(year,month-1,1)).getDay(); dayIndex++){
		calstr022 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr022 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==02)||(i==09)||(i==16)||(i==23)||(i==30)) {	// CLOSED
			if(i==date){
				calstr022 += defBTD(i,"close");
			}else{
				calstr022 += defTD(i,"close");
			}
		} else if(i==date){					// TODAY
			calstr022 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr022 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr022 += defTD(i,"saturday");
				calstr022 += "</tr>";
				break;
			default:					// Normal
				calstr022 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=0){
		for(i=dayIndex; i<=6; i++){
			calstr022 += defTD("","blank");
		}
		calstr022 += "</TR>";
	}
	calstr022 += "</TABLE>";

	cals.push(calhead022 + calstr022);

	var calhead023 =
		'<table class="cal" id="cal0" cellpadding="0" cellspacing="0" border="0" summary="図書館カレンダー">' +
		'<caption>前　林：' + year + '年' + month + '月</caption>' +
		'<colgroup>' +
		'<col width="14%" span="7">' +
		'</colgroup>' +
		'<thead>'
	;
	var calstr023 =
		'<tr><th scope="col" abbr="日">日</th><th scope="col" abbr="月">月</th><th scope="col" abbr="火">火</th><th scope="col" abbr="水">水</th><th scope="col" abbr="木">木</th><th scope="col" abbr="金">金</th><th scope="col" abbr="土">土</th></tr>' +
		'</thead>' +
		'<tbody><tr>'
	;
	for(dayIndex=0; dayIndex<(new Date(year,month-1,1)).getDay(); dayIndex++){
		calstr023 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr023 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==02)||(i==09)||(i==16)||(i==23)||(i==30)) {	// CLOSED
			if(i==date){
				calstr023 += defBTD(i,"close");
			}else{
				calstr023 += defTD(i,"close");
			}
		} else if(i==date){					// TODAY
			calstr023 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr023 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr023 += defTD(i,"saturday");
				calstr023 += "</tr>";
				break;
			default:					// Normal
				calstr023 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=0){
		for(i=dayIndex; i<=6; i++){
			calstr023 += defTD("","blank");
		}
		calstr023 += "</TR>";
	}
	calstr023 += "</TABLE>";

	cals.push(calhead023 + calstr023);

	var calhead024 =
		'<table class="cal" id="cal0" cellpadding="0" cellspacing="0" border="0" summary="図書館カレンダー">' +
		'<caption>益　富：' + year + '年' + month + '月</caption>' +
		'<colgroup>' +
		'<col width="14%" span="7">' +
		'</colgroup>' +
		'<thead>'
	;
	var calstr024 =
		'<tr><th scope="col" abbr="日">日</th><th scope="col" abbr="月">月</th><th scope="col" abbr="火">火</th><th scope="col" abbr="水">水</th><th scope="col" abbr="木">木</th><th scope="col" abbr="金">金</th><th scope="col" abbr="土">土</th></tr>' +
		'</thead>' +
		'<tbody><tr>'
	;
	for(dayIndex=0; dayIndex<(new Date(year,month-1,1)).getDay(); dayIndex++){
		calstr024 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr024 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==02)||(i==09)||(i==16)||(i==23)||(i==30)) {	// CLOSED
			if(i==date){
				calstr024 += defBTD(i,"close");
			}else{
				calstr024 += defTD(i,"close");
			}
		} else if(i==date){					// TODAY
			calstr024 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr024 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr024 += defTD(i,"saturday");
				calstr024 += "</tr>";
				break;
			default:					// Normal
				calstr024 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=0){
		for(i=dayIndex; i<=6; i++){
			calstr024 += defTD("","blank");
		}
		calstr024 += "</TR>";
	}
	calstr024 += "</TABLE>";

	cals.push(calhead024 + calstr024);

	var calhead025 =
		'<table class="cal" id="cal0" cellpadding="0" cellspacing="0" border="0" summary="図書館カレンダー">' +
		'<caption>美　里：' + year + '年' + month + '月</caption>' +
		'<colgroup>' +
		'<col width="14%" span="7">' +
		'</colgroup>' +
		'<thead>'
	;
	var calstr025 =
		'<tr><th scope="col" abbr="日">日</th><th scope="col" abbr="月">月</th><th scope="col" abbr="火">火</th><th scope="col" abbr="水">水</th><th scope="col" abbr="木">木</th><th scope="col" abbr="金">金</th><th scope="col" abbr="土">土</th></tr>' +
		'</thead>' +
		'<tbody><tr>'
	;
	for(dayIndex=0; dayIndex<(new Date(year,month-1,1)).getDay(); dayIndex++){
		calstr025 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr025 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==02)||(i==09)||(i==16)||(i==23)||(i==30)) {	// CLOSED
			if(i==date){
				calstr025 += defBTD(i,"close");
			}else{
				calstr025 += defTD(i,"close");
			}
		} else if(i==date){					// TODAY
			calstr025 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr025 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr025 += defTD(i,"saturday");
				calstr025 += "</tr>";
				break;
			default:					// Normal
				calstr025 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=0){
		for(i=dayIndex; i<=6; i++){
			calstr025 += defTD("","blank");
		}
		calstr025 += "</TR>";
	}
	calstr025 += "</TABLE>";

	cals.push(calhead025 + calstr025);

	var calhead026 =
		'<table class="cal" id="cal0" cellpadding="0" cellspacing="0" border="0" summary="図書館カレンダー">' +
		'<caption>竜　神：' + year + '年' + month + '月</caption>' +
		'<colgroup>' +
		'<col width="14%" span="7">' +
		'</colgroup>' +
		'<thead>'
	;
	var calstr026 =
		'<tr><th scope="col" abbr="日">日</th><th scope="col" abbr="月">月</th><th scope="col" abbr="火">火</th><th scope="col" abbr="水">水</th><th scope="col" abbr="木">木</th><th scope="col" abbr="金">金</th><th scope="col" abbr="土">土</th></tr>' +
		'</thead>' +
		'<tbody><tr>'
	;
	for(dayIndex=0; dayIndex<(new Date(year,month-1,1)).getDay(); dayIndex++){
		calstr026 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr026 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==02)||(i==09)||(i==16)||(i==23)||(i==30)) {	// CLOSED
			if(i==date){
				calstr026 += defBTD(i,"close");
			}else{
				calstr026 += defTD(i,"close");
			}
		} else if(i==date){					// TODAY
			calstr026 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr026 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr026 += defTD(i,"saturday");
				calstr026 += "</tr>";
				break;
			default:					// Normal
				calstr026 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=0){
		for(i=dayIndex; i<=6; i++){
			calstr026 += defTD("","blank");
		}
		calstr026 += "</TR>";
	}
	calstr026 += "</TABLE>";

	cals.push(calhead026 + calstr026);

	var calhead027 =
		'<table class="cal" id="cal0" cellpadding="0" cellspacing="0" border="0" summary="図書館カレンダー">' +
		'<caption>若　園：' + year + '年' + month + '月</caption>' +
		'<colgroup>' +
		'<col width="14%" span="7">' +
		'</colgroup>' +
		'<thead>'
	;
	var calstr027 =
		'<tr><th scope="col" abbr="日">日</th><th scope="col" abbr="月">月</th><th scope="col" abbr="火">火</th><th scope="col" abbr="水">水</th><th scope="col" abbr="木">木</th><th scope="col" abbr="金">金</th><th scope="col" abbr="土">土</th></tr>' +
		'</thead>' +
		'<tbody><tr>'
	;
	for(dayIndex=0; dayIndex<(new Date(year,month-1,1)).getDay(); dayIndex++){
		calstr027 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr027 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==02)||(i==09)||(i==16)||(i==23)||(i==30)) {	// CLOSED
			if(i==date){
				calstr027 += defBTD(i,"close");
			}else{
				calstr027 += defTD(i,"close");
			}
		} else if(i==date){					// TODAY
			calstr027 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr027 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr027 += defTD(i,"saturday");
				calstr027 += "</tr>";
				break;
			default:					// Normal
				calstr027 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=0){
		for(i=dayIndex; i<=6; i++){
			calstr027 += defTD("","blank");
		}
		calstr027 += "</TR>";
	}
	calstr027 += "</TABLE>";

	cals.push(calhead027 + calstr027);

	var calhead033 =
		'<table class="cal" id="cal0" cellpadding="0" cellspacing="0" border="0" summary="図書館カレンダー">' +
		'<caption>藤　岡：' + year + '年' + month + '月</caption>' +
		'<colgroup>' +
		'<col width="14%" span="7">' +
		'</colgroup>' +
		'<thead>'
	;
	var calstr033 =
		'<tr><th scope="col" abbr="日">日</th><th scope="col" abbr="月">月</th><th scope="col" abbr="火">火</th><th scope="col" abbr="水">水</th><th scope="col" abbr="木">木</th><th scope="col" abbr="金">金</th><th scope="col" abbr="土">土</th></tr>' +
		'</thead>' +
		'<tbody><tr>'
	;
	for(dayIndex=0; dayIndex<(new Date(year,month-1,1)).getDay(); dayIndex++){
		calstr033 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr033 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==02)||(i==09)||(i==16)||(i==23)||(i==30)) {	// CLOSED
			if(i==date){
				calstr033 += defBTD(i,"close");
			}else{
				calstr033 += defTD(i,"close");
			}
		} else if(i==date){					// TODAY
			calstr033 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr033 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr033 += defTD(i,"saturday");
				calstr033 += "</tr>";
				break;
			default:					// Normal
				calstr033 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=0){
		for(i=dayIndex; i<=6; i++){
			calstr033 += defTD("","blank");
		}
		calstr033 += "</TR>";
	}
	calstr033 += "</TABLE>";

	cals.push(calhead033 + calstr033);

	var calhead034 =
		'<table class="cal" id="cal0" cellpadding="0" cellspacing="0" border="0" summary="図書館カレンダー">' +
		'<caption>小　原：' + year + '年' + month + '月</caption>' +
		'<colgroup>' +
		'<col width="14%" span="7">' +
		'</colgroup>' +
		'<thead>'
	;
	var calstr034 =
		'<tr><th scope="col" abbr="日">日</th><th scope="col" abbr="月">月</th><th scope="col" abbr="火">火</th><th scope="col" abbr="水">水</th><th scope="col" abbr="木">木</th><th scope="col" abbr="金">金</th><th scope="col" abbr="土">土</th></tr>' +
		'</thead>' +
		'<tbody><tr>'
	;
	for(dayIndex=0; dayIndex<(new Date(year,month-1,1)).getDay(); dayIndex++){
		calstr034 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr034 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==02)||(i==09)||(i==16)||(i==23)||(i==30)) {	// CLOSED
			if(i==date){
				calstr034 += defBTD(i,"close");
			}else{
				calstr034 += defTD(i,"close");
			}
		} else if(i==date){					// TODAY
			calstr034 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr034 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr034 += defTD(i,"saturday");
				calstr034 += "</tr>";
				break;
			default:					// Normal
				calstr034 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=0){
		for(i=dayIndex; i<=6; i++){
			calstr034 += defTD("","blank");
		}
		calstr034 += "</TR>";
	}
	calstr034 += "</TABLE>";

	cals.push(calhead034 + calstr034);

	var calhead035 =
		'<table class="cal" id="cal0" cellpadding="0" cellspacing="0" border="0" summary="図書館カレンダー">' +
		'<caption>足　助：' + year + '年' + month + '月</caption>' +
		'<colgroup>' +
		'<col width="14%" span="7">' +
		'</colgroup>' +
		'<thead>'
	;
	var calstr035 =
		'<tr><th scope="col" abbr="日">日</th><th scope="col" abbr="月">月</th><th scope="col" abbr="火">火</th><th scope="col" abbr="水">水</th><th scope="col" abbr="木">木</th><th scope="col" abbr="金">金</th><th scope="col" abbr="土">土</th></tr>' +
		'</thead>' +
		'<tbody><tr>'
	;
	for(dayIndex=0; dayIndex<(new Date(year,month-1,1)).getDay(); dayIndex++){
		calstr035 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr035 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==02)||(i==09)||(i==16)||(i==23)||(i==30)) {	// CLOSED
			if(i==date){
				calstr035 += defBTD(i,"close");
			}else{
				calstr035 += defTD(i,"close");
			}
		} else if(i==date){					// TODAY
			calstr035 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr035 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr035 += defTD(i,"saturday");
				calstr035 += "</tr>";
				break;
			default:					// Normal
				calstr035 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=0){
		for(i=dayIndex; i<=6; i++){
			calstr035 += defTD("","blank");
		}
		calstr035 += "</TR>";
	}
	calstr035 += "</TABLE>";

	cals.push(calhead035 + calstr035);

	var calhead036 =
		'<table class="cal" id="cal0" cellpadding="0" cellspacing="0" border="0" summary="図書館カレンダー">' +
		'<caption>下　山：' + year + '年' + month + '月</caption>' +
		'<colgroup>' +
		'<col width="14%" span="7">' +
		'</colgroup>' +
		'<thead>'
	;
	var calstr036 =
		'<tr><th scope="col" abbr="日">日</th><th scope="col" abbr="月">月</th><th scope="col" abbr="火">火</th><th scope="col" abbr="水">水</th><th scope="col" abbr="木">木</th><th scope="col" abbr="金">金</th><th scope="col" abbr="土">土</th></tr>' +
		'</thead>' +
		'<tbody><tr>'
	;
	for(dayIndex=0; dayIndex<(new Date(year,month-1,1)).getDay(); dayIndex++){
		calstr036 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr036 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==02)||(i==09)||(i==16)||(i==23)||(i==30)) {	// CLOSED
			if(i==date){
				calstr036 += defBTD(i,"close");
			}else{
				calstr036 += defTD(i,"close");
			}
		} else if(i==date){					// TODAY
			calstr036 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr036 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr036 += defTD(i,"saturday");
				calstr036 += "</tr>";
				break;
			default:					// Normal
				calstr036 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=0){
		for(i=dayIndex; i<=6; i++){
			calstr036 += defTD("","blank");
		}
		calstr036 += "</TR>";
	}
	calstr036 += "</TABLE>";

	cals.push(calhead036 + calstr036);

	var calhead037 =
		'<table class="cal" id="cal0" cellpadding="0" cellspacing="0" border="0" summary="図書館カレンダー">' +
		'<caption>旭：' + year + '年' + month + '月</caption>' +
		'<colgroup>' +
		'<col width="14%" span="7">' +
		'</colgroup>' +
		'<thead>'
	;
	var calstr037 =
		'<tr><th scope="col" abbr="日">日</th><th scope="col" abbr="月">月</th><th scope="col" abbr="火">火</th><th scope="col" abbr="水">水</th><th scope="col" abbr="木">木</th><th scope="col" abbr="金">金</th><th scope="col" abbr="土">土</th></tr>' +
		'</thead>' +
		'<tbody><tr>'
	;
	for(dayIndex=0; dayIndex<(new Date(year,month-1,1)).getDay(); dayIndex++){
		calstr037 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr037 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==02)||(i==09)||(i==16)||(i==23)||(i==30)) {	// CLOSED
			if(i==date){
				calstr037 += defBTD(i,"close");
			}else{
				calstr037 += defTD(i,"close");
			}
		} else if(i==date){					// TODAY
			calstr037 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr037 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr037 += defTD(i,"saturday");
				calstr037 += "</tr>";
				break;
			default:					// Normal
				calstr037 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=0){
		for(i=dayIndex; i<=6; i++){
			calstr037 += defTD("","blank");
		}
		calstr037 += "</TR>";
	}
	calstr037 += "</TABLE>";

	cals.push(calhead037 + calstr037);

	var calhead038 =
		'<table class="cal" id="cal0" cellpadding="0" cellspacing="0" border="0" summary="図書館カレンダー">' +
		'<caption>稲　武：' + year + '年' + month + '月</caption>' +
		'<colgroup>' +
		'<col width="14%" span="7">' +
		'</colgroup>' +
		'<thead>'
	;
	var calstr038 =
		'<tr><th scope="col" abbr="日">日</th><th scope="col" abbr="月">月</th><th scope="col" abbr="火">火</th><th scope="col" abbr="水">水</th><th scope="col" abbr="木">木</th><th scope="col" abbr="金">金</th><th scope="col" abbr="土">土</th></tr>' +
		'</thead>' +
		'<tbody><tr>'
	;
	for(dayIndex=0; dayIndex<(new Date(year,month-1,1)).getDay(); dayIndex++){
		calstr038 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr038 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==02)||(i==09)||(i==16)||(i==23)||(i==30)) {	// CLOSED
			if(i==date){
				calstr038 += defBTD(i,"close");
			}else{
				calstr038 += defTD(i,"close");
			}
		} else if(i==date){					// TODAY
			calstr038 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr038 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr038 += defTD(i,"saturday");
				calstr038 += "</tr>";
				break;
			default:					// Normal
				calstr038 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=0){
		for(i=dayIndex; i<=6; i++){
			calstr038 += defTD("","blank");
		}
		calstr038 += "</TR>";
	}
	calstr038 += "</TABLE>";

	cals.push(calhead038 + calstr038);

}

function defTD(str, iro){
	return "<td class='" + iro + "'>" + str + "</td>";
}

function defBTD(str, iro){
	return "<td class='" + iro + "'><B>" + str + "</B></td>";
}

function calendar_select(){
	document.write(
		'<div id="calObj"></div>' +
		'切替<select tabindex="30" name="selectLib" id="selectLib" onchange="changeCalender(this);" style="width:75px;">' +
		'<option value="001">中央館</option>' +
		'<option value="002">高橋CC</option>' +
		'<option value="003">猿投CC</option>' +
		'<option value="004">松平CC</option>' +
		'<option value="005">上郷CC</option>' +
		'<option value="006">高岡CC</option>' +
		'<option value="009">西部CC</option>' +
		'<option value="011">逢　妻</option>' +
		'<option value="012">朝日丘</option>' +
		'<option value="013">石　野</option>' +
		'<option value="014">梅坪台</option>' +
		'<option value="015">猿投北</option>' +
		'<option value="016">猿投台</option>' +
		'<option value="017">末野原</option>' +
		'<option value="018">崇化館</option>' +
		'<option value="019">若　林</option>' +
		'<option value="020">高橋交</option>' +
		'<option value="021">豊　南</option>' +
		'<option value="022">保　見</option>' +
		'<option value="023">前　林</option>' +
		'<option value="024">益　富</option>' +
		'<option value="025">美　里</option>' +
		'<option value="026">竜　神</option>' +
		'<option value="027">若　園</option>' +
		'<option value="033">藤　岡</option>' +
		'<option value="034">小　原</option>' +
		'<option value="035">足　助</option>' +
		'<option value="036">下　山</option>' +
		'<option value="037">旭</option>' +
		'<option value="038">稲　武</option>' +
		'</select>'
	);
}

calendar();
calendar_select();
writeCalendar(0);
