// Copyright 2001 Wired Destinations Co., Ltd.
// Inquiry Date Adjustment 2.0

myDate = new Date()
myDay = myDate.getDate()
myMonth = myDate.getMonth()
theYear = new Date()
myYear = theYear.getYear()

function Day_adjust(form) { document.forms[0].Day_departure.selectedIndex = document.forms[0].Day_arrival.selectedIndex+1 }
function Month_adjust(form) { document.forms[0].Month_departure.selectedIndex = document.forms[0].Month_arrival.selectedIndex }
function Year_adjust(form) { document.forms[0].Year_departure.selectedIndex = document.forms[0].Year_arrival.selectedIndex }

function setDay() { document.forms[0].Day_arrival.selectedIndex = myDay }
function setMonth() { document.forms[0].Month_arrival.selectedIndex = myMonth }
function setYear() {
	if (myYear == 100 || myYear == 2000) { document.forms[0].Year_arrival.selectedIndex = 1 }
	else if (myYear == 99 || myYear == 1999) { document.forms[0].Year_arrival.selectedIndex = 0 }
}


function Date_adjust() {

	setDay()
	setMonth()
	setYear()

	if (myDay >= 27) {
		if (myMonth==11) {
			document.forms[0].Month_arrival.selectedIndex = 0
			document.forms[0].Year_arrival.selectedIndex = 1
			document.forms[0].Day_arrival.selectedIndex = 1
        }
        else if(myMonth!=11) {
        	document.forms[0].Day_arrival.selectedIndex = 1
        	document.forms[0].Month_arrival.selectedIndex = myMonth+1
        }
	}
	else if(myDay < 27) {
			document.forms[0].Day_arrival.selectedIndex = myDay+2
			document.forms[0].Month_arrival.selectedIndex = myMonth
	}
  
	Day_adjust()
	Month_adjust()
	Year_adjust()

}

//Usage:
//<style>
//	td.table-inquirytop
//		{ font-family: verdana, sans-serif; font-size: 10pt; color: #FFFFFF; font-weight: bold; background: #000000; }
//	td.table-inquiryleft
//		{ font-family: verdana, sans-serif; font-size: 10pt; color: #000000; font-weight: bold; background: #003366; }
//	td.table-inquiryright
//		{ font-family: verdana, sans-serif; font-size: 10pt; color: #000000; font-weight: normal; background: #003366; }
//</style>
//<body onLoad="set_Form()">