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 calhead052 =
		'<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 calstr052 =
		'<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++){
		calstr052 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr052 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==06)||(i==13)||(i==20)||(i==27)) {	// CLOSED
			if(i==date){
				calstr052 += defBTD(i,"close");
			}else{
				calstr052 += defTD(i,"close");
			}
		} else if ((i==15)) {	// EVENT
			if(i==date){
				calstr052 += defBTD(i,"event");
			}else{
				calstr052 += defTD(i,"event");
			}
		} else if(i==date){					// TODAY
			calstr052 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr052 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr052 += defTD(i,"saturday");
				calstr052 += "</tr>";
				break;
			default:					// Normal
				calstr052 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=7){
		calstr052 += "</TR>";
	}
	calstr052 += "</TABLE>";

	cals.push(calhead052 + calstr052);

	var calhead055 =
		'<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 calstr055 =
		'<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++){
		calstr055 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr055 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==06)||(i==13)||(i==20)||(i==27)) {	// CLOSED
			if(i==date){
				calstr055 += defBTD(i,"close");
			}else{
				calstr055 += defTD(i,"close");
			}
		} else if ((i==02)||(i==09)||(i==16)||(i==23)) {	// EVENT
			if(i==date){
				calstr055 += defBTD(i,"event");
			}else{
				calstr055 += defTD(i,"event");
			}
		} else if(i==date){					// TODAY
			calstr055 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr055 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr055 += defTD(i,"saturday");
				calstr055 += "</tr>";
				break;
			default:					// Normal
				calstr055 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=7){
		calstr055 += "</TR>";
	}
	calstr055 += "</TABLE>";

	cals.push(calhead055 + calstr055);

	var calhead051 =
		'<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 calstr051 =
		'<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++){
		calstr051 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr051 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==06)||(i==13)||(i==20)||(i==27)) {	// CLOSED
			if(i==date){
				calstr051 += defBTD(i,"close");
			}else{
				calstr051 += defTD(i,"close");
			}
		} else if ((i==01)||(i==08)||(i==08)||(i==10)||(i==15)||(i==22)||(i==22)||(i==29)) {	// EVENT
			if(i==date){
				calstr051 += defBTD(i,"event");
			}else{
				calstr051 += defTD(i,"event");
			}
		} else if(i==date){					// TODAY
			calstr051 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr051 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr051 += defTD(i,"saturday");
				calstr051 += "</tr>";
				break;
			default:					// Normal
				calstr051 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=7){
		calstr051 += "</TR>";
	}
	calstr051 += "</TABLE>";

	cals.push(calhead051 + calstr051);

	var calhead101 =
		'<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 calstr101 =
		'<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++){
		calstr101 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr101 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==01)||(i==02)||(i==03)||(i==06)||(i==13)||(i==20)||(i==27)) {	// CLOSED
			if(i==date){
				calstr101 += defBTD(i,"close");
			}else{
				calstr101 += defTD(i,"close");
			}
		} else if ((i==08)||(i==11)||(i==15)||(i==22)||(i==25)||(i==29)) {	// EVENT
			if(i==date){
				calstr101 += defBTD(i,"event");
			}else{
				calstr101 += defTD(i,"event");
			}
		} else if(i==date){					// TODAY
			calstr101 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr101 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr101 += defTD(i,"saturday");
				calstr101 += "</tr>";
				break;
			default:					// Normal
				calstr101 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=7){
		calstr101 += "</TR>";
	}
	calstr101 += "</TABLE>";

	cals.push(calhead101 + calstr101);

	var calhead102 =
		'<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 calstr102 =
		'<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++){
		calstr102 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr102 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==06)||(i==13)||(i==20)||(i==27)) {	// CLOSED
			if(i==date){
				calstr102 += defBTD(i,"close");
			}else{
				calstr102 += defTD(i,"close");
			}
		} else if ((i==04)||(i==09)||(i==18)||(i==23)||(i==25)) {	// EVENT
			if(i==date){
				calstr102 += defBTD(i,"event");
			}else{
				calstr102 += defTD(i,"event");
			}
		} else if(i==date){					// TODAY
			calstr102 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr102 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr102 += defTD(i,"saturday");
				calstr102 += "</tr>";
				break;
			default:					// Normal
				calstr102 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=7){
		calstr102 += "</TR>";
	}
	calstr102 += "</TABLE>";

	cals.push(calhead102 + calstr102);

	var calhead041 =
		'<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 calstr041 =
		'<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++){
		calstr041 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr041 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==06)||(i==13)||(i==20)||(i==27)) {	// CLOSED
			if(i==date){
				calstr041 += defBTD(i,"close");
			}else{
				calstr041 += defTD(i,"close");
			}
		} else if ((i==01)||(i==05)||(i==08)||(i==15)||(i==15)||(i==22)||(i==22)||(i==29)) {	// EVENT
			if(i==date){
				calstr041 += defBTD(i,"event");
			}else{
				calstr041 += defTD(i,"event");
			}
		} else if(i==date){					// TODAY
			calstr041 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr041 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr041 += defTD(i,"saturday");
				calstr041 += "</tr>";
				break;
			default:					// Normal
				calstr041 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=7){
		calstr041 += "</TR>";
	}
	calstr041 += "</TABLE>";

	cals.push(calhead041 + calstr041);

	var calhead042 =
		'<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 calstr042 =
		'<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++){
		calstr042 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr042 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==06)||(i==13)||(i==20)||(i==27)) {	// CLOSED
			if(i==date){
				calstr042 += defBTD(i,"close");
			}else{
				calstr042 += defTD(i,"close");
			}
		} else if ((i==29)) {	// EVENT
			if(i==date){
				calstr042 += defBTD(i,"event");
			}else{
				calstr042 += defTD(i,"event");
			}
		} else if(i==date){					// TODAY
			calstr042 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr042 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr042 += defTD(i,"saturday");
				calstr042 += "</tr>";
				break;
			default:					// Normal
				calstr042 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=7){
		calstr042 += "</TR>";
	}
	calstr042 += "</TABLE>";

	cals.push(calhead042 + calstr042);

	var calhead061 =
		'<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 calstr061 =
		'<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++){
		calstr061 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr061 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==06)||(i==13)||(i==14)||(i==15)||(i==16)||(i==17)||(i==20)||(i==27)) {	// CLOSED
			if(i==date){
				calstr061 += defBTD(i,"close");
			}else{
				calstr061 += defTD(i,"close");
			}
		} else if ((i==01)||(i==01)||(i==18)||(i==22)||(i==22)||(i==26)) {	// EVENT
			if(i==date){
				calstr061 += defBTD(i,"event");
			}else{
				calstr061 += defTD(i,"event");
			}
		} else if(i==date){					// TODAY
			calstr061 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr061 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr061 += defTD(i,"saturday");
				calstr061 += "</tr>";
				break;
			default:					// Normal
				calstr061 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=7){
		calstr061 += "</TR>";
	}
	calstr061 += "</TABLE>";

	cals.push(calhead061 + calstr061);

	var calhead062 =
		'<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 calstr062 =
		'<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++){
		calstr062 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr062 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==06)||(i==13)||(i==20)||(i==27)) {	// CLOSED
			if(i==date){
				calstr062 += defBTD(i,"close");
			}else{
				calstr062 += defTD(i,"close");
			}
		} else if ((i==09)||(i==23)) {	// EVENT
			if(i==date){
				calstr062 += defBTD(i,"event");
			}else{
				calstr062 += defTD(i,"event");
			}
		} else if(i==date){					// TODAY
			calstr062 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr062 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr062 += defTD(i,"saturday");
				calstr062 += "</tr>";
				break;
			default:					// Normal
				calstr062 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=7){
		calstr062 += "</TR>";
	}
	calstr062 += "</TABLE>";

	cals.push(calhead062 + calstr062);

	var calhead063 =
		'<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 calstr063 =
		'<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++){
		calstr063 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr063 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==06)||(i==13)||(i==20)||(i==27)) {	// CLOSED
			if(i==date){
				calstr063 += defBTD(i,"close");
			}else{
				calstr063 += defTD(i,"close");
			}
		} else if ((i==08)||(i==22)) {	// EVENT
			if(i==date){
				calstr063 += defBTD(i,"event");
			}else{
				calstr063 += defTD(i,"event");
			}
		} else if(i==date){					// TODAY
			calstr063 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr063 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr063 += defTD(i,"saturday");
				calstr063 += "</tr>";
				break;
			default:					// Normal
				calstr063 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=7){
		calstr063 += "</TR>";
	}
	calstr063 += "</TABLE>";

	cals.push(calhead063 + calstr063);

	var calhead064 =
		'<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 calstr064 =
		'<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++){
		calstr064 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr064 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==06)||(i==13)||(i==20)||(i==27)) {	// CLOSED
			if(i==date){
				calstr064 += defBTD(i,"close");
			}else{
				calstr064 += defTD(i,"close");
			}
		} else if ((i==01)||(i==08)||(i==15)) {	// EVENT
			if(i==date){
				calstr064 += defBTD(i,"event");
			}else{
				calstr064 += defTD(i,"event");
			}
		} else if(i==date){					// TODAY
			calstr064 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr064 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr064 += defTD(i,"saturday");
				calstr064 += "</tr>";
				break;
			default:					// Normal
				calstr064 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=7){
		calstr064 += "</TR>";
	}
	calstr064 += "</TABLE>";

	cals.push(calhead064 + calstr064);

	var calhead071 =
		'<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 calstr071 =
		'<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++){
		calstr071 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr071 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==06)||(i==13)||(i==20)||(i==27)||(i==28)||(i==29)) {	// CLOSED
			if(i==date){
				calstr071 += defBTD(i,"close");
			}else{
				calstr071 += defTD(i,"close");
			}
		} else if ((i==08)||(i==08)||(i==11)||(i==15)||(i==22)||(i==22)||(i==22)) {	// EVENT
			if(i==date){
				calstr071 += defBTD(i,"event");
			}else{
				calstr071 += defTD(i,"event");
			}
		} else if(i==date){					// TODAY
			calstr071 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr071 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr071 += defTD(i,"saturday");
				calstr071 += "</tr>";
				break;
			default:					// Normal
				calstr071 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=7){
		calstr071 += "</TR>";
	}
	calstr071 += "</TABLE>";

	cals.push(calhead071 + calstr071);

	var calhead072 =
		'<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 calstr072 =
		'<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++){
		calstr072 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr072 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==06)||(i==13)||(i==20)||(i==27)) {	// CLOSED
			if(i==date){
				calstr072 += defBTD(i,"close");
			}else{
				calstr072 += defTD(i,"close");
			}
		} else if ((i==15)||(i==18)) {	// EVENT
			if(i==date){
				calstr072 += defBTD(i,"event");
			}else{
				calstr072 += defTD(i,"event");
			}
		} else if(i==date){					// TODAY
			calstr072 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr072 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr072 += defTD(i,"saturday");
				calstr072 += "</tr>";
				break;
			default:					// Normal
				calstr072 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=7){
		calstr072 += "</TR>";
	}
	calstr072 += "</TABLE>";

	cals.push(calhead072 + calstr072);

	var calhead075 =
		'<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 calstr075 =
		'<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++){
		calstr075 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr075 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==06)||(i==07)||(i==08)||(i==13)||(i==20)||(i==27)) {	// CLOSED
			if(i==date){
				calstr075 += defBTD(i,"close");
			}else{
				calstr075 += defTD(i,"close");
			}
		} else if ((i==05)||(i==09)||(i==18)||(i==23)) {	// EVENT
			if(i==date){
				calstr075 += defBTD(i,"event");
			}else{
				calstr075 += defTD(i,"event");
			}
		} else if(i==date){					// TODAY
			calstr075 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr075 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr075 += defTD(i,"saturday");
				calstr075 += "</tr>";
				break;
			default:					// Normal
				calstr075 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=7){
		calstr075 += "</TR>";
	}
	calstr075 += "</TABLE>";

	cals.push(calhead075 + calstr075);

	var calhead091 =
		'<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 calstr091 =
		'<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++){
		calstr091 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr091 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==06)||(i==13)||(i==20)||(i==27)) {	// CLOSED
			if(i==date){
				calstr091 += defBTD(i,"close");
			}else{
				calstr091 += defTD(i,"close");
			}
		} else if ((i==01)||(i==04)||(i==08)||(i==08)||(i==15)||(i==18)||(i==22)||(i==22)||(i==29)) {	// EVENT
			if(i==date){
				calstr091 += defBTD(i,"event");
			}else{
				calstr091 += defTD(i,"event");
			}
		} else if(i==date){					// TODAY
			calstr091 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr091 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr091 += defTD(i,"saturday");
				calstr091 += "</tr>";
				break;
			default:					// Normal
				calstr091 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=7){
		calstr091 += "</TR>";
	}
	calstr091 += "</TABLE>";

	cals.push(calhead091 + calstr091);

	var calhead095 =
		'<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 calstr095 =
		'<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++){
		calstr095 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr095 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==06)||(i==13)||(i==20)||(i==27)) {	// CLOSED
			if(i==date){
				calstr095 += defBTD(i,"close");
			}else{
				calstr095 += defTD(i,"close");
			}
		} else if ((i==02)||(i==09)||(i==16)||(i==23)) {	// EVENT
			if(i==date){
				calstr095 += defBTD(i,"event");
			}else{
				calstr095 += defTD(i,"event");
			}
		} else if(i==date){					// TODAY
			calstr095 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr095 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr095 += defTD(i,"saturday");
				calstr095 += "</tr>";
				break;
			default:					// Normal
				calstr095 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=7){
		calstr095 += "</TR>";
	}
	calstr095 += "</TABLE>";

	cals.push(calhead095 + calstr095);

	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==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 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==06)||(i==13)||(i==20)||(i==21)||(i==22)||(i==23)||(i==24)||(i==27)) {	// CLOSED
			if(i==date){
				calstr021 += defBTD(i,"close");
			}else{
				calstr021 += defTD(i,"close");
			}
		} else if ((i==02)||(i==02)||(i==09)||(i==11)||(i==16)||(i==16)) {	// EVENT
			if(i==date){
				calstr021 += defBTD(i,"event");
			}else{
				calstr021 += defTD(i,"event");
			}
		} 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 calhead031 =
		'<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 calstr031 =
		'<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++){
		calstr031 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr031 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==06)||(i==13)||(i==20)||(i==27)) {	// CLOSED
			if(i==date){
				calstr031 += defBTD(i,"close");
			}else{
				calstr031 += defTD(i,"close");
			}
		} else if ((i==09)||(i==11)||(i==15)||(i==19)||(i==23)||(i==24)||(i==25)||(i==29)) {	// EVENT
			if(i==date){
				calstr031 += defBTD(i,"event");
			}else{
				calstr031 += defTD(i,"event");
			}
		} else if(i==date){					// TODAY
			calstr031 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr031 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr031 += defTD(i,"saturday");
				calstr031 += "</tr>";
				break;
			default:					// Normal
				calstr031 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=7){
		calstr031 += "</TR>";
	}
	calstr031 += "</TABLE>";

	cals.push(calhead031 + calstr031);

	var calhead081 =
		'<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 calstr081 =
		'<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++){
		calstr081 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr081 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==06)||(i==13)||(i==20)||(i==27)) {	// CLOSED
			if(i==date){
				calstr081 += defBTD(i,"close");
			}else{
				calstr081 += defTD(i,"close");
			}
		} else if ((i==10)||(i==16)||(i==18)||(i==24)) {	// EVENT
			if(i==date){
				calstr081 += defBTD(i,"event");
			}else{
				calstr081 += defTD(i,"event");
			}
		} else if(i==date){					// TODAY
			calstr081 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr081 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr081 += defTD(i,"saturday");
				calstr081 += "</tr>";
				break;
			default:					// Normal
				calstr081 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=7){
		calstr081 += "</TR>";
	}
	calstr081 += "</TABLE>";

	cals.push(calhead081 + calstr081);

	var calhead082 =
		'<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 calstr082 =
		'<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++){
		calstr082 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr082 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==06)||(i==13)||(i==20)||(i==27)) {	// CLOSED
			if(i==date){
				calstr082 += defBTD(i,"close");
			}else{
				calstr082 += defTD(i,"close");
			}
		} else if(i==date){					// TODAY
			calstr082 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr082 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr082 += defTD(i,"saturday");
				calstr082 += "</tr>";
				break;
			default:					// Normal
				calstr082 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=7){
		calstr082 += "</TR>";
	}
	calstr082 += "</TABLE>";

	cals.push(calhead082 + calstr082);

	var calhead083 =
		'<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 calstr083 =
		'<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++){
		calstr083 += defTD("","blank");
	}
	for(i=1; i<=last_date[month-1]; i++){
		if(i!=1 && dayIndex == 0){
			calstr083 += "<tr>";
		}
		if(i==""){
			
		} else if ((i==06)||(i==13)||(i==20)||(i==27)) {	// CLOSED
			if(i==date){
				calstr083 += defBTD(i,"close");
			}else{
				calstr083 += defTD(i,"close");
			}
		} else if ((i==16)) {	// EVENT
			if(i==date){
				calstr083 += defBTD(i,"event");
			}else{
				calstr083 += defTD(i,"event");
			}
		} else if(i==date){					// TODAY
			calstr083 += defBTD(i,"today");
		} else {
			switch(dayIndex){
			case 0:						// SUNDAY
				calstr083 += defTD(i,"sunday");
				break;
			case 6:						// SATURDAY
				calstr083 += defTD(i,"saturday");
				calstr083 += "</tr>";
				break;
			default:					// Normal
				calstr083 += defTD(i,"white");
				break;
			}
		}
		dayIndex++;
		dayIndex%=7;
	}

	if(dayIndex!=7){
		calstr083 += "</TR>";
	}
	calstr083 += "</TABLE>";

	cals.push(calhead083 + calstr083);

}

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="052">馬宮</option>' +
		'<option value="055">三橋</option>' +
		'<option value="051">大宮西部</option>' +
		'<option value="101">北図書館</option>' +
		'<option value="102">宮原</option>' +
		'<option value="041">大宮</option>' +
		'<option value="042">桜木</option>' +
		'<option value="061">春野</option>' +
		'<option value="062">大宮東</option>' +
		'<option value="063">七里</option>' +
		'<option value="064">片柳</option>' +
		'<option value="071">与野</option>' +
		'<option value="072">与野南</option>' +
		'<option value="075">西分館</option>' +
		'<option value="091">桜図書館</option>' +
		'<option value="095">大久保東</option>' +
		'<option value="011">北浦和</option>' +
		'<option value="021">南浦和</option>' +
		'<option value="031">東浦和</option>' +
		'<option value="081">岩槻</option>' +
		'<option value="082">岩槻駅</option>' +
		'<option value="083">岩槻東部</option>' +
		'</select>'
	);
}

calendar();
calendar_select();
writeCalendar(document.getElementById('selectLib').selectedIndex);

