<!-- ************************************ 共通 JavaScript ************************************ -->
//--検索の日付をデフォルトセットする
function getDates(){
	dd = new Date();
	year = dd.getFullYear();
	mon = dd.getMonth();
	date = dd.getDate() - 1;

// -- 2010/05/15までを固定日付とし、それ以降はTODAYを取得する
	hikakuyear = new String(year);
	hikakumon = new String(mon + 1);
	hikakudate = new String(date + 1);
	
	if(hikakudate < 10){
		hikakudate = 0 + hikakudate;
	}
	if(hikakumon < 10){
		hikakumon = 0 + hikakumon;
	}
	now_hikaku = hikakuyear + hikakumon + hikakudate;
	if(now_hikaku > 20100515 || hikakuyear > 2010){
		year = year - 2010; 
		document.quick.chkin_yy.selectedIndex = year;
		document.quick.chkin_mm.selectedIndex = mon;
		document.quick.chkin_dd.selectedIndex = date;
		dd2 = new Date();
		outyear = dd2.getFullYear();
		outmon = dd2.getMonth();
		outdate = dd2.getDate();
		outyear = outyear - 2010;

		if(outmon == 0 && outdate == 31){
	//1月
			outdate = 0;
			outmon =  1;
		}else if(outmon == 1 && outdate == 28){
	//2月
			outdate = 0;
			outmon =  2;
		}else if(outmon == 2 && outdate == 31){
	//3月
			outdate = 0;
			outmon =  3;
		}else if(outmon == 3 && outdate == 30){
	//4月
			outdate = 0;
			outmon =  4;
		}else if(outmon == 4 && outdate == 31){
	//5月
			outdate = 0;
			outmon =  5;
		}else if(outmon == 5 && outdate == 30){
	//6月
			outdate = 0;
			outmon =  6;
		}else if(outmon == 6 && outdate == 31){
	//7月
			outdate = 0;
			outmon =  7;
		}else if(outmon == 7 && outdate == 31){
	//8月
			outdate = 0;
			outmon =  8;
		}else if(outmon == 8 && outdate == 30){
	//9月
			outdate = 0;
			outmon =  9;
		}else if(outmon == 9 && outdate == 31){
	//10月
			outdate = 0;
			outmon =  10;
		}else if(outmon == 10 && outdate == 30){
	//11月
			outdate = 0;
			outmon =  11;
		}else if(outmon == 11 && outdate == 31){
	//12月
			outdate = 0;
			outmon =  0;
			outyear = outyear + 1;
		}
		document.quick.chkout_yy.selectedIndex = outyear;
		document.quick.chkout_mm.selectedIndex = outmon;
		document.quick.chkout_dd.selectedIndex = outdate;
	}else{
//-- 2008年10月01日以前の場合は2008年10月01日を指定
		document.quick.chkin_yy.selectedIndex = 0;
		document.quick.chkin_mm.selectedIndex = 4;
		document.quick.chkin_dd.selectedIndex = 14;
		document.quick.chkout_yy.selectedIndex = 0;
		document.quick.chkout_mm.selectedIndex = 4;
		document.quick.chkout_dd.selectedIndex = 15;
	}
}

window.onload = getDates;
<!-- ************************************ 共通 JavaScript ************************************ -->
