<!--
var Days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');

// Create CalendarPopup object
var cal = new CalendarPopup();


function SetInitDate(Control)
{
	if (navigator.appVersion.indexOf("Mac") != -1)
		{return;}
	if (Control == 'ADate')
		{
		dateObj = new Date(document.DateForm.ARVDate.value);
		}
	else
		{
		dateObj = new Date(document.DateForm.DEPDate.value);
		}
	cal.currentDate = dateObj;
}


// Function to get input back from calendar popup 
function SetADate(y,m,d) 
{

	if (navigator.appVersion.indexOf("Mac") != -1)
		{return;}
	MINDateObj = new Date(document.DateForm.MINDate.value);
	MAXADateObj = new Date(document.DateForm.MAXADate.value);
        DateObj = new Date(y, (m - 1), d);
	if (DateObj < MINDateObj || DateObj > MAXADateObj)
		{return;} 
	document.DateForm.ArvMM.selectedIndex = (m - 1); 
	document.DateForm.ArvDD.value = d;
	document.DateForm.ArvYY.value = y;
	ChgDate(document.DateForm.ARVDate, document.DateForm.ArvMM, document.DateForm.ArvDD, document.DateForm.ArvYY, 

document.DateForm.ArvWD, 0);

}


// Function to get input back from calendar popup
function SetADate2(y,m,d) 
{
	if (navigator.appVersion.indexOf("Mac") != -1)
		{return;}
	MINDateObj = new Date(document.DateForm.MINDate.value);
	MAXADateObj = new Date(document.DateForm.MAXADate.value);
        DateObj = new Date(y, (m - 1), d);
	if (DateObj < MINDateObj || DateObj > MAXADateObj)
		{return;} 
	document.DateForm.ArvMM.selectedIndex = (m - 1); 
	document.DateForm.ArvDD.value = d;
	document.DateForm.ArvYY.value = y;

	ChgADate(document.DateForm.ARVDate, document.DateForm.ArvMM, document.DateForm.ArvDD, document.DateForm.ArvYY, 
document.DateForm.ArvWD, 0);
}

// Function to get input back from calendar popup
function SetDDate(y,m,d) 
{
	if (navigator.appVersion.indexOf("Mac") != -1)
		{return;}
	MINDateObj = new Date(document.DateForm.MINDate.value);
	MAXDateObj = new Date(document.DateForm.MAXDate.value);
        DateObj = new Date(y, (m - 1), d);
	if (DateObj < MINDateObj || DateObj > MAXDateObj)
		{return;} 
	document.DateForm.DepMM.selectedIndex = (m - 1); 
	document.DateForm.DepDD.value = d;
	document.DateForm.DepYY.value = y;
	ChgDate(document.DateForm.DEPDate, document.DateForm.DepMM, document.DateForm.DepDD, document.DateForm.DepYY, 

document.DateForm.DepWD, 0);
}


function ChgDate(DateFlg, fldMM, fldDD, fldYY, fldWD, intDays)
{
	if (navigator.appVersion.indexOf("Mac") != -1)
		{return;}
	MINDateObj = new Date(document.DateForm.MINDate.value);
	MAXDateObj = new Date(document.DateForm.MAXDate.value);
	MAXADateObj = new Date(document.DateForm.MAXADate.value);
        DateObj = new Date(parseInt(fldYY.value), parseInt(fldMM.selectedIndex), parseInt(fldDD.selectedIndex + 1));
	DateObj.setDate(DateObj.getDate() + intDays);
	if (DateFlg.name == "ARVDate")
		{
		if (DateObj < MINDateObj || DateObj > MAXADateObj)
			{return;} 
		}
	else
		{
		if (DateObj < MINDateObj || DateObj > MAXDateObj)
			{return;} 
		}
	fldMM.selectedIndex = DateObj.getMonth();
	fldDD.value = DateObj.getDate();
	fldYY.value=DateObj.getFullYear();
	fldWD.value = Days[DateObj.getDay()];
	DateFlg.value = DateObj.getMonth() + 1 + "/" + DateObj.getDate() + "/" + DateObj.getFullYear();

}

function ChgADate(DateFlg, fldMM, fldDD, fldYY, fldWD, intDays)
{
	if (navigator.appVersion.indexOf("Mac") != -1)
		{return;}
	MINDateObj = new Date(document.DateForm.MINDate.value);
	MAXDateObj = new Date(document.DateForm.MAXDate.value);
	MAXADateObj = new Date(document.DateForm.MAXADate.value);
        DateObj = new Date(parseInt(fldYY.value), parseInt(fldMM.selectedIndex), parseInt(fldDD.value));
	DateObj.setDate(DateObj.getDate() + intDays);
	DDateObj = new Date(DateObj);
	DDateObj.setDate(DDateObj.getDate() + parseInt(document.DateForm.iNgts.value));

	fldMM.selectedIndex = DateObj.getMonth();
	fldDD.value = DateObj.getDate();
	fldYY.value=DateObj.getFullYear();
	fldWD.value = Days[DateObj.getDay()];
	DateFlg.value = DateObj.getMonth() + 1 + "/" + DateObj.getDate() + "/" + DateObj.getFullYear();
	document.DateForm.DEPDate.value = DDateObj.getMonth() + 1 + "/" + DDateObj.getDate() + "/" + DDateObj.getFullYear();
}

function ChgDDate (DateFlg, intNights)
{
	if (navigator.appVersion.indexOf("Mac") != -1)
		{return;}
	MINDateObj = new Date(document.DateForm.MINDate.value);
	MAXDateObj = new Date(document.DateForm.MAXDate.value);
        DateObj = new Date(document.DateForm.ARVDate.value);
	DateObj.setDate(DateObj.getDate() + parseInt(intNights.value));
	if (DateObj <= MAXDateObj)
		DateFlg.value = DateObj.getMonth() + 1 + "/" + DateObj.getDate() + "/" + DateObj.getFullYear();
}

function DateDiff(date1,date2) 
{
	if (navigator.appVersion.indexOf("Mac") != -1)
		{return;}
	return (Math.round((date2 - date1) / 86400000));
}


function InitDate(DateFlg, fldMM, fldDD, fldYY, fldWD)
{
	if (navigator.appVersion.indexOf("Mac") != -1)
		{return;}
	datestr = new Date(DateFlg.value);
	fldMM.selectedIndex = datestr.getMonth();
	fldDD.value = datestr.getDate();
	fldYY.value = datestr.getFullYear();
	fldWD.value = Days[datestr.getDay()];
}


function ScreenInit()
{
	if (navigator.appVersion.indexOf("Mac") != -1)
		{return;}
	InitDate(document.DateForm.ARVDate, document.DateForm.ArvMM, document.DateForm.ArvDD, document.DateForm.ArvYY, 

document.DateForm.ArvWD);
	InitDate(document.DateForm.DEPDate, document.DateForm.DepMM, document.DateForm.DepDD, document.DateForm.DepYY, 

document.DateForm.DepWD);
	document.DateForm.ArvMM.focus;
}

function ScreenInit2()
{
	if (navigator.appVersion.indexOf("Mac") != -1)
		{return;}
	InitDate(document.DateForm.ARVDate, document.DateForm.ArvMM, document.DateForm.ArvDD, document.DateForm.ArvYY, 

document.DateForm.ArvWD);
	dteARV = new Date(document.DateForm.ARVDate.value);
	dteDEP = new Date(document.DateForm.DEPDate.value);
	document.DateForm.iNgts.value = DateDiff(dteARV, dteDEP);
	document.DateForm.ArvMM.focus;
}

//-->