function calendar(month_field,day_field,year_field,what,form_name)
{
	win=window.open("/travel/calendar.aspx?month_field=" + month_field + "&day_field=" + day_field + "&year_field=" + year_field + "&what=" + what + "&form_name=" + form_name,"problem", "top=250,left=200,width=240,height=240,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=no");	  
}

function calendar2(month_field,day_field,year_field,what,form_name)
{
	win=window.open("/travel/calendar.aspx?ver=2&month_field=" + month_field + "&day_field=" + day_field + "&year_field=" + year_field + "&what=" + what + "&form_name=" + form_name,"problem", "top=250,left=200,width=240,height=240,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=no");	  
}


today = new Date();

function monthText (Month)
{
	var sMonth;
	Month = parseInt(Month);
	if (Month == 1) { sMonth = "January"} 
	if (Month == 2) { sMonth = "Febuary"}
	if (Month == 3) { sMonth = "March"}
	if (Month == 4) { sMonth = "April"}
	if (Month == 5) { sMonth = "May"}
	if (Month == 6) { sMonth = "June"}
	if (Month == 7) { sMonth = "July"}
	if (Month == 8) { sMonth = "August"}
	if (Month == 9) { sMonth = "September"}
	if (Month == 10) { sMonth = "October"}
	if (Month == 11) { sMonth = "November"}
	if (Month == 12) { sMonth = "December"}
return (sMonth);
}

monthTextArray = new Array (12);
for (n=0; n<13; n++)
{
	monthTextArray[n] = monthText(n+1);
}

monthShortArray = new Array ("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");

function showMonths()
{
	for (k=today.getMonth(); k<12; k++)
	{
		document.write ('<OPTION VALUE="' + monthShortArray[k] + '">' + monthTextArray[k]);	
	}
	for (m=0; m<today.getMonth(); m++)
	{
//		document.write ('<OPTION VALUE="' + monthShortArray[m] + '">' + monthTextArray[m] + ", " + eval(today.getYear()+1));
		document.write ('<OPTION VALUE="' + monthShortArray[m] + '">' + monthTextArray[m]);
	}
}

function showMonths_number()
{
	for (k=today.getMonth(); k<12; k++)
	{
		document.write ('<OPTION VALUE="' + eval(k+1) + '">' + monthTextArray[k]);	
	}
	for (m=0; m<today.getMonth(); m++)
	{
//		document.write ('<OPTION VALUE="' + monthShortArray[m] + '">' + monthTextArray[m] + ", " + eval(today.getYear()+1));
		document.write ('<OPTION VALUE="' + eval(m+1) + '">' + monthTextArray[m]);
	}
}

function showDate ()
{
	for (r=1; r<32; r++)
	{
		if (r == today.getDate())
			document.write ('<OPTION selected VALUE="' + r + '">' + r);
		else
			document.write ('<OPTION VALUE="' + r + '">' + r);
	}
}
function showDate2 ()
{
	for (r=1; r<32; r++)
	{
		if (r == (today.getDate() + 1))
			document.write ('<OPTION selected VALUE="' + r + '">' + r);
		else
			document.write ('<OPTION VALUE="' + r + '">' + r);
	}
}	
function showDate3 ()
{
	for (r=1; r<32; r++)
	{
		if (r == (today.getDate() + 2))
			document.write ('<OPTION selected VALUE="' + r + '">' + r);
		else
			document.write ('<OPTION VALUE="' + r + '">' + r);
	}
}

function showDate4 ()
{
	for (r=1; r<32; r++)
	{
		document.write ('<OPTION VALUE="' + r + '">' + r);
	}
}		

function showYear ()
{
	var y=today.getFullYear();
	document.write ('<OPTION selected VALUE="' + y + '">' + y);
	document.write ('<OPTION VALUE="' + (y+1) + '">' + (y+1));
}	

function adjustDates(myForm, myElement) 
{
//	alert ("myElement: " + myElement.name);
	var iDepMonthIndex = myForm.leaveMonth.selectedIndex;
	var iDepDayIndex = myForm.inp_dep_dt_dy_1.selectedIndex;
	var iDepTimeIndex = myForm.inp_dep_tm_1.selectedIndex;
	var iArrMonthIndex = myForm.returnMonth.selectedIndex;
	var iArrDayIndex = myForm.inp_ret_dep_dt_dy.selectedIndex;
	var iArrTimeIndex = myForm.inp_ret_dep_tm_1.selectedIndex;
	
	if (myElement.name == "SearchMethod")
	{
		var bff = myForm.SearchMethod[0].checked ? true : false
		var sbd = myForm.SearchMethod[1].checked ? true : false
		if( bff ) 
		{
			myForm.leaveMonth.selectedIndex = 0;
			myForm.inp_dep_dt_dy_1.selectedIndex = 0;
			myForm.inp_dep_tm_1.selectedIndex = 0;
			myForm.returnMonth.selectedIndex = 0;
			myForm.inp_ret_dep_dt_dy.selectedIndex = 0;
			myForm.inp_ret_dep_tm_1.selectedIndex = 0;
		}
		if( sbd ) 
		{
			myForm.leaveMonth.selectedIndex = 1;
			myForm.inp_dep_dt_dy_1.selectedIndex = today.getDate() + 2;
			myForm.inp_dep_tm_1.selectedIndex = 10;
			myForm.returnMonth.selectedIndex = 1;
			myForm.inp_ret_dep_dt_dy.selectedIndex = today.getDate() + 3;
			myForm.inp_ret_dep_tm_1.selectedIndex = 18;
		}
	}
	else
	{
		if (myElement.name.selectedIndex != 0)
		{
			myForm.SearchMethod[0].checked = false;
			myForm.SearchMethod[1].checked = true;
		}	
	}	
} // adjustDates