function getResponse_calendar(xmlHttp, cy, cm)
{
	if (xmlHttp.readyState == 4) {
		if (xmlHttp.status == 200) {
			var result = xmlHttp.responseText;
			var fcm = parseInt(cm) - 1;
			var bcm = parseInt(cm) + 1;
			var fcy = bcy = cy;
			if(cm == 1){
				fcy = parseInt(cy) - 1;
				fcm = 12;
			}
			if(cm == 12){
				bcy = parseInt(cy) + 1;
				bcm = 1;
			}
			var c_link = (g4_is_admin == 'super')?'<a href="' + g4_path + '/bbs/board.php?bo_table=' + table + '" onfocus="this.blur()">' + cy + '年 ' + cm + '月</a>':cy + '年 ' + cm + '月';
			var title_text = '<a href="javascript:get_calendar(' + fcy + ', ' + fcm + ');" target="_self" onfocus="this.blur()"><img src="' + latest_skin_path + '/img/month_prev.gif" class="absmiddle"></a> ' + c_link + ' <a href="javascript:get_calendar(' + bcy + ', ' + bcm + ');" target="_self" onfocus="this.blur()"><img src="' + latest_skin_path + '/img/month_next.gif" class="absmiddle"></a>';
			document.getElementById("in_title").innerHTML = title_text;
			document.getElementById("in_day").innerHTML = result;
		}
		
	}
}

function get_calendar(cy, cm)
{
	var url = latest_skin_path + '/in_calendar.php';
	
	var data = 'bo_table=' + encodeURIComponent(bo_table) + '&year=' + cy + '&month=' + cm;
	
	var xmlHttp = createXMLHTTP();
	if(!xmlHttp){ return };
	
	xmlHttp.onreadystatechange = function(){
		getResponse_calendar(xmlHttp, cy, cm);
	}
	
	xmlHttp.open('POST', url, true);
	
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
	
	xmlHttp.send(data);
}
