
/*calendario*/
var calIn =new CalendarPopup("in_divcld");
calIn.setCssPrefix("TEST");
calIn.setReturnFunction("setMultipleValuesIn");
function popupCalendarIn(){
    calIn.showCalendar('anchorIn',getDateString(document.forms[0].check_in_a,document.forms[0].check_in_m,document.forms[0].check_in_g));
}
var calOut =new CalendarPopup("out_divcld");
calOut.setCssPrefix("TEST");
calOut.setReturnFunction("setMultipleValuesOut");
function popupCalendarOut(){
    calOut.showCalendar('anchorOut',getDateString(document.forms[0].check_out_a,document.forms[0].check_out_m,document.forms[0].check_out_g));
}
function setMultipleValuesOut(y,m,d) {
	document.forms[0].check_out_a.value=y;
	document.forms[0].check_out_m.selectedIndex=m-1;
	for (var i=0; i<document.forms[0].check_out_g.options.length; i++) {
		if (document.forms[0].check_out_g.options[i].value==d) {
			document.forms[0].check_out_g.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;
}
function setMultipleValuesIn(y,m,d) {
	document.forms[0].check_in_a.value=y;
	document.forms[0].check_in_m.selectedIndex=m-1;
	for (var i=0; i<document.forms[0].check_in_g.options.length; i++) {
		if (document.forms[0].check_in_g.options[i].value==d) {
			document.forms[0].check_in_g.selectedIndex=i;
			}
		}
}// JavaScript Document
