// JavaScript Document
var now = new Date();
var cxi = new CalendarPopup("caldiv");

cxi.offsetX = 30;
cxi.offsetY = 0;
cxi.setCssPrefix("CAL");
cxi.showNavigationDropdowns();
cxi.addDisabledDates(null,formatDate(now,"yyyy-MM-dd"));
cxi.setReturnFunction("setMultipleValues1");
function setMultipleValues1(y,m,d) {
	document.forms[0].cxi_year.value=y;
	document.forms[0].cxi_month.selectedIndex=m;
	for (var i=0; i<document.forms[0].cxi_day.options.length; i++) {
		if (document.forms[0].cxi_day.options[i].value==d) {
			document.forms[0].cxi_day.selectedIndex=i;
		}
	}
}
	
var cxo = new CalendarPopup("caldiv");

cxo.offsetX = 30;
cxo.offsetY = 0;
cxo.setCssPrefix("CAL");
cxo.showNavigationDropdowns();
cxo.addDisabledDates(null,formatDate(now,"yyyy-MM-dd"));
cxo.setReturnFunction("setMultipleValues2");
function setMultipleValues2(y,m,d) {
	document.forms[0].cxo_year.value=y;
	document.forms[0].cxo_month.selectedIndex=m;
	for (var i=0; i<document.forms[0].cxo_day.options.length; i++) {
		if (document.forms[0].cxo_day.options[i].value==d) {
			document.forms[0].cxo_day.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;
}