<!--
// Create CalendarPopup object
var cal = new CalendarPopup();


function SetInitDate(Control)
{
	if (navigator.appVersion.indexOf("Mac") != -1)
		{return;}
	dateObj = new Date(parseInt(document.DateForm.ArvYY.value), parseInt(document.DateForm.ArvMM.selectedIndex), parseInt(document.DateForm.ArvDD.value));
	
	cal.currentDate = dateObj;
}


// Function to get input back from calendar popup 
function SetADate(y,m,d) 
{

	if (navigator.appVersion.indexOf("Mac") != -1)
		{return;}
	document.DateForm.ArvMM.selectedIndex = (m - 1); 
	document.DateForm.ArvDD.value = d;
	document.DateForm.ArvYY.value = y;

}

function ChgADate(intDays)
{
	if (navigator.appVersion.indexOf("Mac") != -1)
		{return;}
        DateObj = new Date(parseInt(document.DateForm.ArvYY.value), parseInt(document.DateForm.ArvMM.selectedIndex), parseInt(document.DateForm.ArvDD.value));
	DateObj.setDate(DateObj.getDate() + intDays);

	document.DateForm.ArvMM.selectedIndex = DateObj.getMonth();
	document.DateForm.ArvDD.value = DateObj.getDate();
	document.DateForm.ArvYY.value=DateObj.getFullYear();
}

function SetTodaysDate(intDays)
{
	if (navigator.appVersion.indexOf("Mac") != -1)
		{return;}
	DateObj = new Date();
	DateObj.setDate(DateObj.getDate() + intDays);

	var selectId = document.DateForm.ArvYY;
	for (i = 0; i <= 2; i++)
	{
		// this doesn't work in IE anymore... stupid IE
		// var oOption = document.createElement("option");
		// oOption.text = (DateObj.getFullYear() + i);	
		// oOption.value = (DateObj.getFullYear() + i);
		// document.DateForm.ArvYY.appendChild(oOption);
		var theYear = DateObj.getFullYear() + i;
		selectId.options[selectId.options.length] = new Option(theYear, theYear);
	}

	document.DateForm.ArvMM.selectedIndex = DateObj.getMonth();
	document.DateForm.ArvDD.value = DateObj.getDate();
	document.DateForm.ArvYY.value = DateObj.getFullYear();
	
}

//-->