<!--		
	var viewYear;
	var selHtlId;
	var textId;
	var isHidden = true;
	
	function initCalendarHotel() {
		initDateHotel();
		var c = this.changeCalendarHotel();
		
		var innerHtml = '<table summary="" cellspacing="0" id="calendar" style="width:162px">'+c+'</table>';
		$('calendar').innerHTML = innerHtml; 
	}
	
	function changeCalendarHotel(){
		var str = "";
			str += "<colgroup>";
			str += "	<col title=\"" + currentViewDate.getFullYear() + "\u5e74" + oneToTwo(addIgnoreType(currentViewDate.getMonth() ,1)) + "\u6708" + "\" />";
			str += "	<col title=\"" + currentViewDate.getFullYear() + "\u5e74" + oneToTwo(addIgnoreType(currentViewDate.getMonth() ,2)) + "\u6708" + "\" />";
			str += "	<col title=\"" + currentViewDate.getFullYear() + "\u5e74" + oneToTwo(addIgnoreType(currentViewDate.getMonth() ,3)) + "\u6708" + "\" />";
			str += "</colgroup>";
			str += "<tr>";
			var fDay = new Date(nowDate.getFullYear(), nowDate.getMonth(), nowDate.getDate());
			for(var row = 0; row < 3; row++){	
					if(row == 0){
						str += "<td class=\"first\">";					
					} else if(row == 1){
						str += "<td class=\"second\">";
					} else if(row == 2){
						str += "<td class=\"third\">";
					}
					str += "<table summary=\"\" cellspacing=\"0\" id = \"" + "table_" + row + "\">";
					str += "</table>";
					str += "</td>";
					currentViewDate.setMonth(currentViewDate.getMonth() + 1);
			}
			currentViewDate.setMonth(currentViewDate.getMonth() - 3);
			
			str += "</tr>";
			str += "<tr>";
			str += "<td colspan=\"3\" class=\"closed-area\"><p><a href=\"javascript:void(0);\" onclick=\"openPanelType01('js-panel-calendar',this,'close');return false;\">\u9589\u3058\u308b</a></p></td>";
			str += "</tr>";
			return str;
	}
	
	//  \u9069\u5f53\u4f4d\u7f6e\u306bCalendar\u30d1\u30cd\u30eb\u3092\u958b\u304f  
	function openCalendarHotel(pId,trg,disp,date,offsetFlg){
		onfocuCheckInText("checkOutDate");
		panelObj = document.getElementById(pId);
		panelObj.style.width = '504px';
		var targetPos = new Object();
		var targetH = trg.offsetHeight;
		var targetW = trg.offsetWidth;	
		// \u30ec\u30a4\u30a2\u30a6\u30c8\u306e\u5c64	
		if(dummyframe){
			objBody = document.getElementsByTagName("body").item(0);
			objBody.appendChild(dummyframe);
			
		}
		//  \u30d1\u30cd\u30eb\u3092\u958b\u304f
		if(disp == 'open'){
	
			panelObj.style.position = 'absolute';
			panelObj.style.display = 'block';
	
			var panelObjH = panelObj.offsetHeight;
			var panelObjW = panelObj.offsetWidth;
			if (offsetFlg == 1) {
				targetPos.x = document.body.scrollWidth - panelObjW;
			} else {
				targetPos.x = getElementPos(trg).x;
			}
			targetPos.y = getElementPos(trg).y;
			
			selHtlId = "";
			textId = date;
			selectDate($(date).value);
			if (selHtlId == "") {
				if (date == 'checkOutDate') {
					selectDate($('checkInDate').value, 1);
				} else if (date == 'checkOutDate01') {
					selectDate($('checkInDate01').value, 1);
				}
			}
			initDateHotel();
			changeDatePanelHotel(2);
			targetPos.y = targetPos.y - (panelObjH / 2);
			//  \u30ec\u30a4\u30a2\u30a6\u30c8\u306e\u5c64  
			if(dummyframe){
				dummyframe.style.position = "absolute";
				dummyframe.style.top =  targetPos.y + 'px';
				dummyframe.style.left = targetPos.x + 'px';
				dummyframe.style.width = panelObj.offsetWidth;
				dummyframe.style.height = panelObj.offsetHeight;
				dummyframe.style.zIndex = 998;
			}
			panelObj.style.top = targetPos.y + 'px';
			panelObj.style.left = targetPos.x + 'px';
			panelObj.style.zIndex = 999;
		}
	}
	
	// \u65e5\u4ed8\u521d\u5024  	
	function initDateHotel(){
		startDate = new Date(nowDate.getFullYear(), nowDate.getMonth(), nowDate.getDate());
		terminalDate = new Date(nowDate.getFullYear(), nowDate.getMonth(), nowDate.getDate());	
		startDate.setDate(startDate.getDate() + departure_BeforeDay);
		terminalDate.setDate(terminalDate.getDate() + departure_AfterDay);
		if(selHtlId != null && selHtlId != ""){
			viewStartDate = new Date(selHtlId.substr(0,4), addIgnoreType(selHtlId.substr(4,2), -1), 1);
			viewEndDate = new Date(selHtlId.substr(0,4), addIgnoreType(selHtlId.substr(4,2), -1), 1);
			currentViewDate = new Date(selHtlId.substr(0,4), addIgnoreType(selHtlId.substr(4,2), -1), 1);
		}else{
			viewStartDate = new Date(startDate.getFullYear(), startDate.getMonth(), 1);
			viewEndDate = new Date(startDate.getFullYear(), startDate.getMonth(), 1);
			currentViewDate = new Date(startDate.getFullYear(), startDate.getMonth(), 1);
		}		

		//viewEndDate.setMonth(viewEndDate.getMonth() + 2);
	}
	
	//  \u30ec\u30b3\u30fc\u30c9\u3092\u30af\u30ea\u30a8\u30fc\u30c8\u3057\u307e\u3059
	function idenHotel(i, strToAdd, flag, id, year, month, day){
		var str = "";
		var sid = startDate.getFullYear() + "" + oneToTwo(addIgnoreType(startDate.getMonth(),1)) +""+ oneToTwo(startDate.getDate());
		var eid = terminalDate.getFullYear() + "" + oneToTwo(addIgnoreType(terminalDate.getMonth() ,1)) +""+ oneToTwo(terminalDate.getDate());
		// \u3053\u306e\u4f4d\u7f6e\u306b\u306f\u65e5\u4ed8\u304c\u3042\u308a\u307e\u3059
		if(flag == 1){
			// \u9078\u629e\u7bc4\u56f2\u5185
			if(sid <= id + oneToTwo(strToAdd) && eid >= id + oneToTwo(strToAdd)){
				if(selHtlId == id + oneToTwo(strToAdd)){
					str += "<td class=\"selected\">";
				}
				else {
				 	str += "<td>";
				}
				// \u65e5\u66dc\u65e5
				if(i == 0 || isHoliday(year, month, day)){
					str += "<p class=\"sun\"><a href=\"javascript:void(0);\" id = \"" + id + oneToTwo(strToAdd) + "\" onclick=\"calendarClickHotel(this.id);openPanelType01('js-panel-calendar',this,'close');return false;\">" + strToAdd + "</a></p></td>";
				}
				// \u571f\u66dc\u65e5
				else if(i == 6){
					str += "<p class=\"sat\"><a href=\"javascript:void(0);\" id = \"" + id + oneToTwo(strToAdd) + "\" onclick=\"calendarClickHotel(this.id);openPanelType01('js-panel-calendar',this,'close');return false;\">" + strToAdd + "</a></p></td>";
				}
				// \u65e5\u66dc\u65e5\u3068\u571f\u66dc\u65e5\u306e\u5916
				else {
					str += "<p><a href=\"javascript:void(0);\" id = \"" + id + oneToTwo(strToAdd) + "\" onclick=\"calendarClickHotel(this.id);openPanelType01('js-panel-calendar',this,'close');return false;\">" + strToAdd + "</a></p></td>";
				}
			}
			// \u9078\u629e\u7bc4\u56f2\u306e\u5916
			else{
					str += "<td class=\"passed\"><p>" + strToAdd + "</p></td>";
			}
		}
		//  \u3053\u306e\u4f4d\u7f6e\u306b\u306f\u65e5\u4ed8\u304c\u3042\u308a\u307e\u305b\u3093  
		else {
			// \u65e5\u66dc\u65e5  
			if(i == 0 || isHoliday(year, month, day)){
				str += "<td class=\"blank\"><p class=\"sun\">" + strToAdd + "</p></td>";
			}
			//  \u571f\u66dc\u65e5
			else if(i == 6){
				str += "<td class=\"blank\"><p class=\"sat\">" + strToAdd + "</p></td>";
			}
			//  \u65e5\u66dc\u65e5\u3068\u571f\u66dc\u65e5\u306e\u5916
			else {
				str += "<td class=\"blank\"><p>" + strToAdd + "</p></td>";
			}
		}
		return str;
	}
	
	//  1\u6708\u9593\u65e5\u4ed8\u3092\u30af\u30ea\u30a8\u30fc\u30c8\u3057\u307e\u3059  	
	function reDrawHotel(currentViewDate){
		var str = "";
		str += "<caption>" + currentViewDate.getFullYear() + "\u5e74" + addIgnoreType(currentViewDate.getMonth() ,1) + "\u6708" + "</caption>";
		str += "<colgroup>";
		str += "<col title=\"\u65e5\u66dc\u65e5\" style=\"width:15%;\" />";
		str += "<col title=\"\u6708\u66dc\u65e5\" style=\"width:14%;\" />";
		str += "<col title=\"\u706b\u66dc\u65e5\" style=\"width:14%;\" />";
		str += "<col title=\"\u6c34\u66dc\u65e5\" style=\"width:14%;\" />";
		str += "<col title=\"\u6728\u66dc\u65e5\" style=\"width:14%;\" />";
		str += "<col title=\"\u91d1\u66dc\u65e5\" style=\"width:14%;\" />";
		str += "<col title=\"\u571f\u66dc\u65e5\" style=\"width:15%;\" />";
		str += "</colgroup>";
		str += "<tr>";
		str += "<th scope=\"col\" class=\"sun\"><p>\u65e5</p></th>";
		str += "<th scope=\"col\"><p>\u6708</p></th>";
		str += "<th scope=\"col\"><p>\u706b</p></th>";
		str += "<th scope=\"col\"><p>\u6c34</p></th>";
		str += "<th scope=\"col\"><p>\u6728</p></th>";
		str += "<th scope=\"col\"><p>\u91d1</p></th>";
		str += "<th scope=\"col\" class=\"sat\"><p>\u571f</p></th>";
		str += "</tr>";
		
		var fDay = new Date(currentViewDate.getFullYear(),currentViewDate.getMonth(),1);
		var day1 = fDay.getDay();
		str += "<tr>";
		for(var i = 0; i < day1; i++){
			str += idenHotel(i, "&nbsp;",0,currentViewDate.getFullYear() + "" + oneToTwo(addIgnoreType(currentViewDate.getMonth() ,1)),fDay.getFullYear(), fDay.getMonth()+1, fDay.getDate());
		}
		for(var i = day1; i < 7; i++){
			str += idenHotel(i, fDay.getDate(),1,currentViewDate.getFullYear() + "" + oneToTwo(addIgnoreType(currentViewDate.getMonth() ,1)),fDay.getFullYear(), fDay.getMonth()+1, fDay.getDate());
			fDay.setDate(fDay.getDate() + 1);
		}
		str += "</tr>";
		
		var nextMonth = (new Date(currentViewDate.getFullYear(),addIgnoreType(currentViewDate.getMonth() ,1),1)).getMonth();
		var line = 1;
		while (fDay.getMonth() != nextMonth){
			str += "<tr>";
			var j = 0;
			while(j < 7 && fDay.getMonth() != nextMonth){
				str += idenHotel(j, fDay.getDate(),1,currentViewDate.getFullYear() + "" + oneToTwo(addIgnoreType(currentViewDate.getMonth() ,1)),fDay.getFullYear(), fDay.getMonth()+1, fDay.getDate());
				fDay.setDate(fDay.getDate() + 1);
				j++;
			}
			while(j < 7){
				str += idenHotel(j, "&nbsp;",0,currentViewDate.getFullYear() + "" + oneToTwo(addIgnoreType(currentViewDate.getMonth() ,1)),fDay.getFullYear(), fDay.getMonth()+1, fDay.getDate());
				j++;
			}
			str += "</tr>";
			line++;
		}
		while(line < 6){
			str += "<tr>";
			var j = 0;
			while(j < 7){
				str += idenHotel(j, "&nbsp;",0,currentViewDate.getFullYear() + "" + oneToTwo(addIgnoreType(currentViewDate.getMonth() ,1)),fDay.getFullYear(), fDay.getMonth()+1, fDay.getDate());
				j++;
			}
			str += "</tr>";
			line++;
		}
		return str;
	}
	
	// \u6708\u306b\u5f93\u306bREDRAW  	
	function changeDatePanelHotel(flag){
		var varDate = new Date(nowDate.getFullYear(), nowDate.getMonth(), nowDate.getDate());
		var str = "";
		//  \u6708\u3092\u5897\u3048\u308b
		if(flag == 1){
			if(!(terminalDate.getFullYear() == viewEndDate.getFullYear() && terminalDate.getMonth() == viewEndDate.getMonth())){
				currentViewDate.setMonth(currentViewDate.getMonth() + 1);
				for(var row = 0; row < 3; row++){	
					str = "<table summary=\"\" cellspacing=\"0\" id = \"" + "table_" + row + "\">";
					str += reDrawHotel(currentViewDate);
					str += "</table>";
					document.getElementById("table_" + row).outerHTML = str;
					currentViewDate.setMonth(currentViewDate.getMonth() + 1);
				}
				currentViewDate.setMonth(currentViewDate.getMonth() - 3);
				viewStartDate.setMonth(viewStartDate.getMonth() + 1);
				viewEndDate.setMonth(viewEndDate.getMonth() + 1);
			}
		}
		// \u6708\u3092\u6e1b\u5c11\u3059\u308b
		else if(flag == 0){
			if(!(startDate.getFullYear() == viewStartDate.getFullYear() && startDate.getMonth() == viewStartDate.getMonth())){
				currentViewDate.setMonth(currentViewDate.getMonth() - 1);
				for(var row = 0; row < 3; row++){	
					str = "<table summary=\"\" cellspacing=\"0\" id = \"" + "table_" + row + "\">";
					str += reDrawHotel(currentViewDate);
					str += "</table>";
					document.getElementById("table_" + row).outerHTML = str;
					currentViewDate.setMonth(currentViewDate.getMonth() + 1);
				}
				currentViewDate.setMonth(currentViewDate.getMonth() - 3);
				viewStartDate.setMonth(viewStartDate.getMonth() - 1);
				viewEndDate.setMonth(viewEndDate.getMonth() - 1);	
			}
		}
		//  \u4ee5\u4e0a\u306e\u60c5\u6cc1\u306e\u5916  
		else {
			for(var row = 0; row < 3; row++){	
				str = "<table summary=\"\" cellspacing=\"0\" id = \"" + "table_" + row + "\">";
				str += reDrawHotel(currentViewDate);
				str += "</table>";
				document.getElementById("table_" + row).outerHTML = str;
				currentViewDate.setMonth(currentViewDate.getMonth() + 1);
			}
			currentViewDate.setMonth(currentViewDate.getMonth() - 3);
		}
		
	}
	
	function selectDate(value, flag) {
		var reg = /[^0-9/]/;
		if(value != null && value != "" && value.search(reg) == -1) {
			reg = /^\d{1,4}[/]\d{1,2}[/]\d{1,2}$/;
			if(value.search(reg) == 0) {
				var str = new String(value.match(reg));
				var date = str.split("/");
				if (date[0].length <= 4 && date[2].length < 3) {
					var year = date[0];
					var month = oneToTwo(date[1]);
					var day = oneToTwo(date[2])
					viewYear = new String(startDate.getFullYear());
					switch (year.length) {
						case 1 : year = viewYear.substr(0,3) + year; break;
						case 2 : year = viewYear.substr(0,2) + year; break;
						case 3 : year = viewYear.substr(0,1) + year; break;
					}
					var textDate = year + month + day;
					if (validateDate(textDate)) {
						if (flag == 1) {
							var CheckinDateHtl = new Date(year, addIgnoreType(month, -1), day);
							CheckinDateHtl.setDate(CheckinDateHtl.getDate() + lodge_num);
							textDate = CheckinDateHtl.getFullYear() + "" + oneToTwo(addIgnoreType(CheckinDateHtl.getMonth(), 1)) + "" + oneToTwo(CheckinDateHtl.getDate());
						}
						var sid = startDate.getFullYear() + "" + oneToTwo(addIgnoreType(startDate.getMonth(), 1)) + "" + oneToTwo(startDate.getDate());
						var eid = terminalDate.getFullYear() + "" + oneToTwo(addIgnoreType(terminalDate.getMonth() ,1)) + "" + oneToTwo(terminalDate.getDate());
						if (sid <= textDate && eid >= textDate) {
							selHtlId = textDate;
						}
					}
				}
			}
		}
	}
	
	function calendarClickHotel(id){
		$(textId).value = id.substr(0,4) + "/" + id.substr(4,2) + "/" + id.substr(6,2);
		$(textId).style.color = "#333333";
		syncCheckOutText($(textId));
	}
	
 
	function validateDate(strValue) {
		if (strValue.length != 8) {
			return false;
		}
		var intMonth = parseInt(strValue.substr(4,2), 10);
		if (intMonth > 12 || intMonth < 1) {
			return false;
		}
		var intYear = parseInt(strValue.substr(0,4), 10);
		var intDay = parseInt(strValue.substr(6,2), 10);
		var arrayMonthDay = {'1' : 31, '3' : 31, '4' : 30, '5' : 31, '6' : 30, '7' : 31, '8' : 31, '9' : 30, '10' : 31, '11' : 30, '12' : 31};
		if (arrayMonthDay[intMonth] != null) {
			if (intDay <= arrayMonthDay[intMonth] && intDay != 0) {
				return true;
			}
		}
		if (intMonth == 2) {
			var isLeapYear = intYear % 4 == 0 && (intYear % 100 != 0 || intYear % 400 == 0);
			if (((isLeapYear && intDay <= 29) || (!isLeapYear && intDay <= 28)) && intDay != 0) {
				return true;
			}
		}
		return false;
	}
	
	function initCalendarText() {
		initDateHotel();
		var c = this.changeCalendarText();
		
		var innerHtml = '<table summary="" cellspacing="0" id="calendar" style="width:162px">'+c+'</table>';
		$('calendar').innerHTML = innerHtml; 
	}
	
	function changeCalendarText(){
			var str = "";
			str += "<colgroup>";
			str += "	<col title=\"" + currentViewDate.getFullYear() + "\u5e74" + oneToTwo(addIgnoreType(currentViewDate.getMonth() ,1)) + "\u6708" + "\" />";
			str += "</colgroup>";
			str += "<tr>";
			str += "<td class=\"first\">";					
			str += "<table summary=\"\" cellspacing=\"0\" id = \"table_text\">";
			str += "</table>";
			str += "</td>";
			str += "</tr>";
			str += "<tr>";
			str += "<td colspan=\"3\" class=\"closed-area\"><p><a href=\"javascript:void(0);\" onclick=\"openPanelType01('js-panel-calendar',this,'close');return false;\">\u9589\u3058\u308b</a></p></td>";
			str += "</tr>";
			return str;
	}
	
	// \u6708\u306b\u5f93\u306bREDRAW  	
	function changeDatePanelText(flag){
		if ($('table_text')) {
			var str = "<table summary=\"\" cellspacing=\"0\" id = \"table_text\">";
			//  \u6708\u3092\u5897\u3048\u308b
			if(flag == 1){
				if(!(terminalDate.getFullYear() == viewEndDate.getFullYear() && terminalDate.getMonth() == viewEndDate.getMonth())){
					viewStartDate.setMonth(currentViewDate.getMonth() + 1);
					viewEndDate.setMonth(currentViewDate.getMonth() + 1);
					currentViewDate.setMonth(currentViewDate.getMonth() + 1);			
					str += reDrawHotel(currentViewDate);
					str += "</table>";
					document.getElementById("table_text").outerHTML = str;
				}
			}
			// \u6708\u3092\u6e1b\u5c11\u3059\u308b
			else if(flag == 0){
				if(!(startDate.getFullYear() == viewStartDate.getFullYear() && startDate.getMonth() == viewStartDate.getMonth())){
					viewStartDate.setMonth(currentViewDate.getMonth() - 1);
					viewEndDate.setMonth(currentViewDate.getMonth() - 1);	
					currentViewDate.setMonth(currentViewDate.getMonth() - 1);					
					str += reDrawHotel(currentViewDate);
					str += "</table>";
					document.getElementById("table_text").outerHTML = str;
					
				}
			}
			//  \u4ee5\u4e0a\u306e\u60c5\u6cc1\u306e\u5916  
			else {
				str += reDrawHotel(currentViewDate);
				str += "</table>";
				document.getElementById("table_text").outerHTML = str;
			}
		} else {
			changeDatePanelHotel(flag);
		}
	}
	
	//  \u9069\u5f53\u4f4d\u7f6e\u306bCalendar\u30d1\u30cd\u30eb\u3092\u958b\u304f  
	function openCalendarText(pId,trg,disp,date){
	    
		panelObj = document.getElementById(pId);
		panelObj.style.width = '172px';
		var targetPos = new Object();
		var targetH = trg.offsetHeight;
		var targetW = trg.offsetWidth;	
		// \u30ec\u30a4\u30a2\u30a6\u30c8\u306e\u5c64	
		if(dummyframe){
			objBody = document.getElementsByTagName("body").item(0);
			objBody.appendChild(dummyframe);
		}
		//  \u30d1\u30cd\u30eb\u3092\u958b\u304f
		if(disp == 'open'){
	
			targetPos.x = getElementPos(trg).x;
			targetPos.y = getElementPos(trg).y;
	
			panelObj.style.position = 'absolute';
			panelObj.style.display = 'block';
	
			var panelObjH = panelObj.offsetHeight;
			var panelObjW = panelObj.offsetWidth;
			var panelObjH = panelObj.offsetHeight;
			var panelObjW = panelObj.offsetWidth;
			
			selHtlId = "";
			textId = date;
			selectDate(trg.value);
			
			if (selHtlId == "") {
				if (date == 'checkOutDate') {
					selectDate($('checkInDate').value, 1);
				} else if (date == 'checkOutDate01') {
					selectDate($('checkInDate01').value, 1);
				}
			}
			initDateHotel();
			changeDatePanelText(2);
			targetPos.y = targetPos.y + targetH;
			//  \u30ec\u30a4\u30a2\u30a6\u30c8\u306e\u5c64  
			if(dummyframe){
				dummyframe.style.position = "absolute";
				dummyframe.style.top =  targetPos.y + 'px';
				dummyframe.style.left = targetPos.x + 'px';
				dummyframe.style.width = panelObj.offsetWidth;
				dummyframe.style.height = panelObj.offsetHeight;
				dummyframe.style.zIndex = 998;
			}
	
			panelObj.style.top = targetPos.y + 'px';
			panelObj.style.left = targetPos.x + 'px';
			panelObj.style.zIndex = 999;
			
			
		}
	}
	
	function closePanelTypeText() {
		if(!isHidden) {
			return;
		}
		panelObj.style.display = 'none';
		if(dummyframe) {
			objBody.removeChild(dummyframe);
		}
	}
	
	var syncCheckOutId = "";
	function syncCheckOutText(trg){
		
		var checkInValue = trg.value;
		if(null == checkInValue || syncCheckOutId == "") {
			return;
		}
		if(trg.id == syncCheckOutId || trg.id.indexOf(syncCheckOutId) == 0){
			return ;
		}
		checkInValue = checkInValue.replaceAll("/","");
		if(validateDate(checkInValue)) {
			var checkInDate = new Date(checkInValue.substr(0,4), addIgnoreType(checkInValue.substr(4,2), -1), parseInt(checkInValue.substr(6,2), 10));
			checkInDate.setDate(checkInDate.getDate() + lodge_num);
			var textDate = checkInDate.getFullYear() + "/" + oneToTwo(addIgnoreType(checkInDate.getMonth(), 1)) + "/" + oneToTwo(checkInDate.getDate());
			$(syncCheckOutId).value =textDate;
			$(syncCheckOutId).style.color = "#333333";
		}
	}
	String.prototype.replaceAll  = function(s1,s2){    
		return this.replace(new RegExp(s1,"gm"),s2);    
	}  
	function onfocuCheckInText(id){
		syncCheckOutId =  id;
	}

//-->

