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 = 2012;
	var month = 02;
	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 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==13)||(i==20)||(i==21)||(i==22)||(i==23)||(i==24)||(i==25)||(i==26)||(i==27)||(i==28)||(i==29)) {	// CLOSED
			if(i==date){
				calstr012 += defBTD(i,"close");
			}else{
				calstr012 += defTD(i,"close");
			}
		} else if ((i==03)||(i==05)||(i==10)||(i==11)||(i==12)||(i==17)||(i==19)) {	// EVENT
			if(i==date){
				calstr012 += defBTD(i,"event");
			}else{
				calstr012 += defTD(i,"event");
			}
		} 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!=7){
		calstr012 += "</TR>";
	}
	calstr012 += "</TABLE>";

	cals.push(calhead012 + calstr012);

	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==06)||(i==07)||(i==08)||(i==09)||(i==10)||(i==13)||(i==29)) {	// CLOSED
			if(i==date){
				calstr001 += defBTD(i,"close");
			}else{
				calstr001 += defTD(i,"close");
			}
		} else if ((i==15)) {	// EVENT
			if(i==date){
				calstr001 += defBTD(i,"event");
			}else{
				calstr001 += defTD(i,"event");
			}
		} 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!=7){
		calstr001 += "</TR>";
	}
	calstr001 += "</TABLE>";

	cals.push(calhead001 + calstr001);

	var calhead002 =
		'<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 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==20)||(i==29)) {	// CLOSED
			if(i==date){
				calstr002 += defBTD(i,"close");
			}else{
				calstr002 += defTD(i,"close");
			}
		} else if ((i==04)||(i==08)||(i==15)||(i==22)) {	// EVENT
			if(i==date){
				calstr002 += defBTD(i,"event");
			}else{
				calstr002 += defTD(i,"event");
			}
		} 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!=7){
		calstr002 += "</TR>";
	}
	calstr002 += "</TABLE>";

	cals.push(calhead002 + calstr002);

	var calhead003 =
		'<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 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==13)||(i==14)||(i==15)||(i==16)||(i==17)||(i==18)||(i==29)) {	// CLOSED
			if(i==date){
				calstr003 += defBTD(i,"close");
			}else{
				calstr003 += defTD(i,"close");
			}
		} else if ((i==01)||(i==08)||(i==22)) {	// EVENT
			if(i==date){
				calstr003 += defBTD(i,"event");
			}else{
				calstr003 += defTD(i,"event");
			}
		} 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!=7){
		calstr003 += "</TR>";
	}
	calstr003 += "</TABLE>";

	cals.push(calhead003 + calstr003);

	var calhead004 =
		'<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 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==20)||(i==29)) {	// CLOSED
			if(i==date){
				calstr004 += defBTD(i,"close");
			}else{
				calstr004 += defTD(i,"close");
			}
		} else if ((i==01)||(i==01)||(i==02)||(i==04)||(i==08)||(i==09)||(i==15)||(i==15)||(i==16)||(i==18)||(i==22)||(i==23)||(i==25)) {	// EVENT
			if(i==date){
				calstr004 += defBTD(i,"event");
			}else{
				calstr004 += defTD(i,"event");
			}
		} 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!=7){
		calstr004 += "</TR>";
	}
	calstr004 += "</TABLE>";

	cals.push(calhead004 + calstr004);

	var calhead005 =
		'<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 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==13)||(i==29)) {	// CLOSED
			if(i==date){
				calstr005 += defBTD(i,"close");
			}else{
				calstr005 += defTD(i,"close");
			}
		} else if ((i==08)||(i==15)||(i==22)) {	// EVENT
			if(i==date){
				calstr005 += defBTD(i,"event");
			}else{
				calstr005 += defTD(i,"event");
			}
		} 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!=7){
		calstr005 += "</TR>";
	}
	calstr005 += "</TABLE>";

	cals.push(calhead005 + calstr005);

	var calhead006 =
		'<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 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==20)||(i==29)) {	// CLOSED
			if(i==date){
				calstr006 += defBTD(i,"close");
			}else{
				calstr006 += defTD(i,"close");
			}
		} else if ((i==01)||(i==08)||(i==12)||(i==14)||(i==15)||(i==18)||(i==22)||(i==28)) {	// EVENT
			if(i==date){
				calstr006 += defBTD(i,"event");
			}else{
				calstr006 += defTD(i,"event");
			}
		} 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!=7){
		calstr006 += "</TR>";
	}
	calstr006 += "</TABLE>";

	cals.push(calhead006 + calstr006);

	var calhead007 =
		'<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 calstr007 =
		'<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++){
		calstr007 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr007 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==20)||(i==29)) {	// CLOSED
			if(i==date){
				calstr007 += defBTD(i,"close");
			}else{
				calstr007 += defTD(i,"close");
			}
		} else if ((i==01)||(i==08)||(i==15)||(i==22)||(i==25)) {	// EVENT
			if(i==date){
				calstr007 += defBTD(i,"event");
			}else{
				calstr007 += defTD(i,"event");
			}
		} else if(i==date){					// TODAY
			calstr007 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr007 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr007 += defTD(i,"saturday");
				calstr007 += "</tr>";
				break;
			default:					// Normal
				calstr007 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=7){
		calstr007 += "</TR>";
	}
	calstr007 += "</TABLE>";

	cals.push(calhead007 + calstr007);

	var calhead008 =
		'<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 calstr008 =
		'<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++){
		calstr008 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr008 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==13)||(i==29)) {	// CLOSED
			if(i==date){
				calstr008 += defBTD(i,"close");
			}else{
				calstr008 += defTD(i,"close");
			}
		} else if ((i==01)||(i==08)||(i==15)||(i==16)||(i==22)) {	// EVENT
			if(i==date){
				calstr008 += defBTD(i,"event");
			}else{
				calstr008 += defTD(i,"event");
			}
		} else if(i==date){					// TODAY
			calstr008 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr008 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr008 += defTD(i,"saturday");
				calstr008 += "</tr>";
				break;
			default:					// Normal
				calstr008 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=7){
		calstr008 += "</TR>";
	}
	calstr008 += "</TABLE>";

	cals.push(calhead008 + calstr008);

	var calhead009 =
		'<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 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==13)||(i==29)) {	// CLOSED
			if(i==date){
				calstr009 += defBTD(i,"close");
			}else{
				calstr009 += defTD(i,"close");
			}
		} else if ((i==04)||(i==05)||(i==09)||(i==11)||(i==11)||(i==18)||(i==25)||(i==26)) {	// EVENT
			if(i==date){
				calstr009 += defBTD(i,"event");
			}else{
				calstr009 += defTD(i,"event");
			}
		} 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!=7){
		calstr009 += "</TR>";
	}
	calstr009 += "</TABLE>";

	cals.push(calhead009 + calstr009);

	var calhead010 =
		'<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 calstr010 =
		'<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++){
		calstr010 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr010 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==20)||(i==29)) {	// CLOSED
			if(i==date){
				calstr010 += defBTD(i,"close");
			}else{
				calstr010 += defTD(i,"close");
			}
		} else if ((i==01)||(i==07)||(i==08)||(i==15)||(i==18)||(i==21)||(i==22)||(i==26)) {	// EVENT
			if(i==date){
				calstr010 += defBTD(i,"event");
			}else{
				calstr010 += defTD(i,"event");
			}
		} else if(i==date){					// TODAY
			calstr010 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr010 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr010 += defTD(i,"saturday");
				calstr010 += "</tr>";
				break;
			default:					// Normal
				calstr010 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=7){
		calstr010 += "</TR>";
	}
	calstr010 += "</TABLE>";

	cals.push(calhead010 + calstr010);

	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==01)||(i==02)||(i==03)||(i==04)||(i==05)||(i==20)||(i==29)) {	// CLOSED
			if(i==date){
				calstr011 += defBTD(i,"close");
			}else{
				calstr011 += defTD(i,"close");
			}
		} else if ((i==08)||(i==15)||(i==16)||(i==18)||(i==22)) {	// EVENT
			if(i==date){
				calstr011 += defBTD(i,"event");
			}else{
				calstr011 += defTD(i,"event");
			}
		} 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!=7){
		calstr011 += "</TR>";
	}
	calstr011 += "</TABLE>";

	cals.push(calhead011 + calstr011);

	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==20)||(i==29)) {	// CLOSED
			if(i==date){
				calstr013 += defBTD(i,"close");
			}else{
				calstr013 += defTD(i,"close");
			}
		} else if ((i==01)||(i==08)||(i==15)||(i==18)||(i==22)||(i==24)) {	// EVENT
			if(i==date){
				calstr013 += defBTD(i,"event");
			}else{
				calstr013 += defTD(i,"event");
			}
		} 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!=7){
		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==06)||(i==11)||(i==13)||(i==20)||(i==27)||(i==29)) {	// CLOSED
			if(i==date){
				calstr014 += defBTD(i,"close");
			}else{
				calstr014 += defTD(i,"close");
			}
		} else if ((i==23)) {	// EVENT
			if(i==date){
				calstr014 += defBTD(i,"event");
			}else{
				calstr014 += defTD(i,"event");
			}
		} 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!=7){
		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==06)||(i==13)||(i==20)||(i==27)||(i==29)) {	// CLOSED
			if(i==date){
				calstr015 += defBTD(i,"close");
			}else{
				calstr015 += defTD(i,"close");
			}
		} else if ((i==01)||(i==15)) {	// EVENT
			if(i==date){
				calstr015 += defBTD(i,"event");
			}else{
				calstr015 += defTD(i,"event");
			}
		} 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!=7){
		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==13)||(i==29)) {	// CLOSED
			if(i==date){
				calstr016 += defBTD(i,"close");
			}else{
				calstr016 += defTD(i,"close");
			}
		} else if ((i==04)||(i==08)||(i==11)||(i==18)||(i==25)||(i==26)) {	// EVENT
			if(i==date){
				calstr016 += defBTD(i,"event");
			}else{
				calstr016 += defTD(i,"event");
			}
		} 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!=7){
		calstr016 += "</TR>";
	}
	calstr016 += "</TABLE>";

	cals.push(calhead016 + calstr016);

	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==29)) {	// 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!=7){
		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==05)||(i==06)||(i==07)||(i==08)||(i==09)||(i==10)||(i==11)||(i==12)||(i==19)||(i==26)||(i==29)) {	// 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!=7){
		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==05)||(i==06)||(i==07)||(i==08)||(i==09)||(i==10)||(i==11)||(i==12)||(i==19)||(i==26)||(i==29)) {	// 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!=7){
		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==04)||(i==05)||(i==11)||(i==12)||(i==18)||(i==19)||(i==25)||(i==26)||(i==29)) {	// 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!=7){
		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==29)) {	// 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!=7){
		calstr024 += "</TR>";
	}
	calstr024 += "</TABLE>";

	cals.push(calhead024 + calstr024);

}

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:120px;">' +
		'<option value="012">中央</option>' +
		'<option value="001">竹の塚</option>' +
		'<option value="002">東和</option>' +
		'<option value="003">佐野</option>' +
		'<option value="004">舎人</option>' +
		'<option value="005">保塚</option>' +
		'<option value="006">江北</option>' +
		'<option value="007">花畑</option>' +
		'<option value="008">やよい</option>' +
		'<option value="009">鹿浜</option>' +
		'<option value="010">興本</option>' +
		'<option value="011">伊興</option>' +
		'<option value="013">梅田</option>' +
		'<option value="014">常東</option>' +
		'<option value="015">宮城</option>' +
		'<option value="016">新田</option>' +
		'<option value="020">勤福</option>' +
		'<option value="021">消費セ</option>' +
		'<option value="022">男女参</option>' +
		'<option value="023">区政資</option>' +
		'<option value="024">産業情</option>' +
		'</select>'
	);
}

calendar();
calendar_select();
writeCalendar(0);

