// JavaScript Document
var now = new Date();
var calh1 = new CalendarPopup();

calh1.setReturnFunction("setMultipleValues4");
calh1.addDisabledDates(null,formatDate(now,"yyyy-MM-dd"));
function setMultipleValues4(y,m,d) {
	document.fn.check_in_y.value=y;
	document.fn.check_in_m.selectedIndex=m-1;
	for (var i=0; i<document.fn.check_in_d.options.length; i++) {
		if (document.fn.check_in_d.options[i].value==d) {
			document.fn.check_in_d.selectedIndex=i;
			}
		}
	}
var calh2 = new CalendarPopup();
calh2.setReturnFunction("setMultipleValues5");
calh2.addDisabledDates(null,formatDate(now,"yyyy-MM-dd"));
function setMultipleValues5(y,m,d) {
	document.fn.check_out_y.value=y;
	document.fn.check_out_m.selectedIndex=m-1;
	for (var i=0; i<document.fn.check_out_d.options.length; i++) {
		if (document.fn.check_out_d.options[i].value==d) {
			document.fn.check_out_d.selectedIndex=i;
			}
		}
	}
function getDateString(y_obj,m_obj,d_obj) {
	var y = y_obj.options[y_obj.selectedIndex].value;
	var m = m_obj.options[m_obj.selectedIndex].value;
	var d = d_obj.options[d_obj.selectedIndex].value;
	if (y=="" || m=="") { return null; }
	if (d=="") { d=1; }
	return str= y+'-'+m+'-'+d;
	}