//--検索の日付をデフォルトセット
function yearIndex(yearIdx){
	var now = new Date(year);
	y = now.getFullYear();
	if (yearIdx == y) {
		ry = 0;
	}
	else if (yearIdx == (y+1)) {
		ry = 1;
	}
/*
    if (yearIdx == 2009) { ry = 0;}
    else if (yearIdx == 2010) { ry = 1;}
    else if (yearIdx == 2011) { ry = 2;}
	else if (yearIdx == 2012) { ry = 3;}
	else if (yearIdx == 2013) { ry = 4;}
 */
   return(ry);
}
function addDate(year, month, date, n){
    var leisure_number = n * 1000 * 60 * 60 * 24;
	var targetDate = new Date(year, month, date);
	var DateInMS = targetDate.getTime();
	DateInMS += leisure_number;
	targetDate.setTime(DateInMS);
	var theYear = targetDate.getFullYear();
	var theMonth = targetDate.getMonth();
	var theDate = targetDate.getDate();
    rdt  = new Date(theYear, theMonth, theDate);
    return(rdt);
}
function setDates(){
    leisure_nd = new Date();
    y = leisure_nd.getFullYear();
    m = leisure_nd.getMonth();
    d = leisure_nd.getDate();
    dt = addDate(y, m ,d, 0);
	//document.formName.paramName
	document.quick.ciDateY.selectedIndex = yearIndex(dt.getFullYear());
	document.quick.ciDateM.selectedIndex = dt.getMonth();
	document.quick.ciDateD.selectedIndex = dt.getDate()-1;
    dt2 = addDate(y, m ,d, 1);
	document.quick.coDateY.selectedIndex = yearIndex(dt2.getFullYear());
	document.quick.coDateM.selectedIndex = dt2.getMonth();
	document.quick.coDateD.selectedIndex = dt2.getDate()-1;
}
window.onload = setDates;

