
//各社通常料金
function nextLink( urltarget, typename ){
	document.forms[0].file.value = urltarget;
	document.forms[0].type.value = typename;
	document.forms[0].submit();
}

//マツダ通常　ジャパレン通常　バジェット通常
function nextLink1( urltarget, classname ){
	document.forms[0].file.value = urltarget;
	document.forms[0].car_class.value = classname;
	document.forms[0].submit();
}

//各プラン
function nextLink2( urltarget ){
	document.forms[0].file.value = urltarget;
	document.forms[0].submit();
}

//マツダウイークエンド（インバウンド）　ジャパレン初夏
function nextLinkP( urltarget, planname ){
	document.forms[0].file.value = urltarget;
	document.forms[0].plan.value = planname;
	document.forms[0].submit();
}

function nextLink3( urltarget, shopname, airport ){
	document.forms[0].file.value = urltarget;
	document.forms[0].shop.value = shopname;
	document.forms[0].air.value = airport;
	document.forms[0].submit();
}

function nextLink4( urltarget, shopname ){
	document.forms[0].file.value = urltarget;
	document.forms[0].shop.value = shopname;
	document.forms[0].submit();
}

function nextLink5( urltarget, shopname){
	document.forms[0].file.value = urltarget;
	document.forms[0].shop.value = shopname;
//	document.forms[0].prefecture.value = prefecturename;
	document.forms[0].submit();
}


//ポップアップ
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


//料金シミュレーション　乗車日・返車日
function AfterDay(){
	afterday = new Date();
	day = 24 * 60 * 60 * 1000;
	afterday.setTime(afterday.getTime() + day * 1);

	return afterday;
};

function AfterMonth(){
	aftermonth = AfterDay();
	day = 24 * 60 * 60 * 1000;
	aftermonth.setTime(aftermonth.getTime() + day * 92);

	return aftermonth;
};

function setyear(){
	today = AfterDay();
	current_year = today.getYear();
	if (current_year<2000) {
		current_year = current_year + 1900;
	}

	aftermonth = AfterMonth();
	next_year = aftermonth.getYear();
	if (next_year<2000) {
		next_year = next_year + 1900;
	}
	if (current_year == next_year) {
		document.write("<option value=" + current_year + " selected>"+ current_year + "</option><option value=" + [current_year +1] + " >"+ [current_year +1] + "</option>");
	} else {
		for (var tmp_year = current_year; tmp_year <= current_year+1; tmp_year++) {
			document.write("<option value=" + tmp_year);
			if (tmp_year == current_year)
				document.write(" selected ");
				document.write(">");
				document.write(tmp_year + "</option>");
		}
	}
};

function setmonth(){
	oday = AfterDay();
	current_month = today.getMonth()+1;
	month_array=new Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12");
	for (var tmp_month = 1; tmp_month <= 12; tmp_month++) {
		document.write("<option value=" + month_array[tmp_month-1]);
		if (tmp_month == current_month)
			document.write(" selected ");
			document.write(">");
			document.write(month_array[tmp_month-1] + "</option>");
	}
};

function setmonth2(){
	today = AfterDay();
	current_month = today.getMonth()+1;
	month_array=new Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12");
	for (var tmp_month = 1; tmp_month <= 12; tmp_month++) {
		document.write("<option value=" + month_array[tmp_month-1]);
		if (tmp_month == current_month)
			document.write(" selected ");
			document.write(">");
			document.write(month_array[tmp_month-1] + "</option>");
	}
};

function setday(){
	today = AfterDay();
	current_month = today.getMonth()+1;
	current_year = today.getYear();
	thisday = today.getDate();
	for (var current_day = 1; current_day <= 31; current_day++) {
		var current_day = "" + current_day;
		if (current_day.length == 1) {
			current_day = current_day;
		}
		document.write("<option value=" + current_day);
		if (current_day == thisday)
			document.write(" selected");
			document.write(">");
			document.write(current_day + "</option>");
	}
};

