<!--
function DayName(i)
{
	var arrDays= new Array("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat")
	return arrDays[i];
}

function MonthName(i, blnShort)
{
	var arrMonths = new Array("January", "February", "March", "April", "May",  "June",  "July",  "August", "September", "October", "November", "December")
	if (!blnShort)
		return arrMonths[i];
	else
	{
		var strName = arrMonths[i];
		return strName.substring(0, 3)
	}
}

function SetValue(value, ctrl)
{
	var objTextBox = document.getElementById(ctrl);
	objTextBox.value = value;
	display.innerHTML = "";
	display.style.visibility = "hidden";
}

//Modified F Alessio April 2005 (intTop line)to make calendar appear on visible screen
//Modified F Alessio May 2005   (whole function)to make calendar appear on visible screen in Firefox
//
function Position(objToMove)
{
	display.style.top = document.body.scrollTop;
	display.style.left = 550;
	objToMove.style.visibility = 'visible';	
}

//Added F Alessio May 2005 added function to set date to null/erase date
function RemoveDate(fieldName)
{
	var objTextBox = document.getElementById(fieldName);
	objTextBox.value  = "";
	display.innerHTML = "";
	display.style.visibility = "hidden";
}

function MakeCalendar(Year, Month, Day, ctrl)
{
	if (Year == -1 || Month == -1 || Day == -1)
	{
		var objDate = new Date();
		Year = objDate.getFullYear();
		Month = objDate.getMonth();
		Day = objDate.getDate();
	}
	else
	{
		var objDate = new Date(Year,Month,Day)
	}
		
	var strDay = "";
	var strMonth = "";
	var strYear = "";
	var strOutHTML = "";
	var strTemp = "";
	var i,j, intMaxDays = 0;
	var strPostValue = "";
	var strPrevious, strNext = "";

	// Get last day of month:
	objDate.setMonth(Month+1)
	objDate.setDate(0)
	intMaxDays = objDate.getDate()
	objDate.setMonth(Month)
	objDate.setDate(1)

	strOutHTML += "<TABLE border=1 cellspacing=1 cellpadding=2>"
	
	strDay = objDate.getDate();
	strMonth = objDate.getMonth()+1;
	strYear = objDate.getFullYear();
	if (strYear<2000) {
		strYear = strYear;
	}
			
	if (objDate.getMonth() != 0)
	{
		if (objDate.getMonth() == 11)
		{
			strPrevious = strYear + "," + (parseInt(objDate.getMonth()) - 1) + ",1"
			strNext = (parseInt(strYear) + 1) + ",0,1"
		}
		else
		{
			strPrevious = strYear + "," + (parseInt(objDate.getMonth()) - 1) + ",1"
			strNext = strYear + "," + (parseInt(objDate.getMonth()) + 1) + ",1"
		}
	}
	else if (objDate.getMonth() == 0)
	{
		strPrevious = (parseInt(strYear) - 1) + ",11,1"
		strNext = strYear + "," + (parseInt(objDate.getMonth()) + 1) + ",1"
	}
	
	strPrevious += "," + String.fromCharCode(34) + ctrl + String.fromCharCode(34)   
	strNext += "," + String.fromCharCode(34) + ctrl + String.fromCharCode(34)
		
	strOutHTML += "<TR>"
	strOutHTML += "<TD bgcolor=\"#a9a9a9\" style=" + String.fromCharCode(34) + "cursor:pointer" + String.fromCharCode(34) + " onMouseOver=" + String.fromCharCode(34) + "this.style.backgroundColor = 'DarkSeaGreen'" + String.fromCharCode(34) + " onMouseOut=" + String.fromCharCode(34) + "this.style.backgroundColor = '#a9a9a9'" + String.fromCharCode(34) + " align='center' onClick='MakeCalendar(" + strPrevious + ");'><<</TD>"
		
	strTemp = objDate.getMonth() + ",1," + String.fromCharCode(34) + ctrl + String.fromCharCode(34)
	strOutHTML += "<TD colspan=5 align=center bgcolor='gray'><SELECT id=selectYear name=selectYear id=selectYear onChange='MakeCalendar(this.value," + strTemp + ");'>"
	
	for (i=2020; i>=1994; i--)
	{
		strOutHTML += "<OPTION "
		strTemp = Year.toString();	
		
		if (strTemp.length == 2)
		{
			Year = parseInt("19" + strTemp);
		}
		
		if (Year == i)
		{
			strOutHTML += " selected"
		}
		strOutHTML += " value='" + i + "'>" + i + "</OPTION>"
	}
		
	strOutHTML += "</SELECT>&nbsp;"
	strTemp = "1," + String.fromCharCode(34) + ctrl + String.fromCharCode(34)
	strOutHTML += "<SELECT id=selectMonth name=selectMonth  onChange='MakeCalendar(" + strYear + ",this.selectedIndex," + strTemp + ");'>"
	
	var arrMonths = new Array("January", "February", "March", "April", "May",  "June",  "July",  "August", "September", "October", "November", "December")
		
	for (i=0; i<arrMonths.length; i++)
	{
		strOutHTML += "<OPTION "
		
		if (Month == i)
		{
			strOutHTML += " selected "
		}
		strOutHTML += " value=" + i + ">" + arrMonths[i] + "</OPTION>"
	}
	strOutHTML += "</SELECT></TD>"
	strOutHTML += "<TD  bgcolor='#a9a9a9' style=" + String.fromCharCode(34) + "cursor:pointer" + String.fromCharCode(34) + " onMouseOver=" + String.fromCharCode(34) + "this.style.backgroundColor = 'DarkSeaGreen'" + String.fromCharCode(34)
	strOutHTML += " onMouseOut=" + String.fromCharCode(34) + "this.style.backgroundColor = '#a9a9a9'" + String.fromCharCode(34) + " align='center' onClick='MakeCalendar(" + strNext + ");'>>></TD>"
	strOutHTML += "</TR>"
	/*
	// TO DISPLAY THE DATE IN SHORT FORMAT:
	strOutHTML += "<TR>"
	strOutHTML += "<TD colspan=7>" + strYear + "/" + strMonth + "/" + strDay + "</TD>"
	strOutHTML += "</TR>"
	*/
	
	strOutHTML += "<TR>"
	strOutHTML += "<TD align=center bgcolor='gray'><B>Sun</TD>"
	strOutHTML += "<TD align=center bgcolor='gray'><B>Mon</TD>"
	strOutHTML += "<TD align=center bgcolor='gray'><B>Tue</TD>"
	strOutHTML += "<TD align=center bgcolor='gray'><B>Wed</TD>"
	strOutHTML += "<TD align=center bgcolor='gray'><B>Thu</TD>"
	strOutHTML += "<TD align=center bgcolor='gray'><B>Fri</TD>"
	strOutHTML += "<TD align=center bgcolor='gray'><B>Sat</TD>"
	strOutHTML += "</TR>"

	strOutHTML += "<TR>"
	if (objDate.getDay() != 0)
	{
		strOutHTML += "<TD align=center colspan=" + objDate.getDay() + ">&nbsp;</TD>";
	}
	i = objDate.getDay();
// x lines inserted by F Alessio to make today print in red	
    myToday = new Date();
    myDay = myToday.getDate();
    myMonth = myToday.getMonth();
    myYear = myToday.getFullYear();
	for (j=1;j<=intMaxDays; j++)
	{
		if (i == 7)
		{
			strOutHTML += "</TR><TR>"
			i = 1
		}
		else
		{
			i++
		}
		strPostValue = j + " " + MonthName(strMonth-1, true) + " " + strYear
		//next 6 lines inserted by  F Alessio  to make today show red April 2005
		if ((myDay == j) && (myMonth == Month) && (myYear == Year))
		{
		   strOutHTML += "<TD bgcolor='#d3d3d3' align=center style=" + String.fromCharCode(34) + "cursor:pointer;color:red" + String.fromCharCode(34) + " onMouseOver=" + String.fromCharCode(34) + "this.style.backgroundColor = 'DarkSeaGreen'" + String.fromCharCode(34) + " onMouseOut=" + String.fromCharCode(34) + "this.style.backgroundColor = '#d3d3d3'" + String.fromCharCode(34) + " onClick='SetValue(" + String.fromCharCode(34) + strPostValue + String.fromCharCode(34) + "," + String.fromCharCode(34) + ctrl + String.fromCharCode(34) + ");'>" + j + "</TD>"
		}
		else
		{
		   strOutHTML += "<TD bgcolor='#d3d3d3' align=center style=" + String.fromCharCode(34) + "cursor:pointer" + String.fromCharCode(34) + " onMouseOver=" + String.fromCharCode(34) + "this.style.backgroundColor = 'DarkSeaGreen'" + String.fromCharCode(34) + " onMouseOut=" + String.fromCharCode(34) + "this.style.backgroundColor = '#d3d3d3'" + String.fromCharCode(34) + " onClick='SetValue(" + String.fromCharCode(34) + strPostValue + String.fromCharCode(34) + "," + String.fromCharCode(34) + ctrl + String.fromCharCode(34) + ");'>" + j + "</TD>"
		}
	}
	if (i != 7)
	{
		strOutHTML += "<TD colspan=" + (7 - i) + ">&nbsp;</TD>"
	}

	strOutHTML += "<TR><TD colspan=7 align=center bgcolor=white><A HREF=" + String.fromCharCode(34) + "#" + ctrl + String.fromCharCode(34) + " onClick=" + String.fromCharCode(34) + "display.style.visibility='hidden';display.style.innerHTML='';" + String.fromCharCode(34) + ">Close</A></TD></TR></TABLE>"
	display.innerHTML = strOutHTML
	//toppos = (screen.height/2) - (250/2);
	//leftpos = (screen.width/2) - (600/2);
	//display.style.top = (screen.height/2) - (display.offsetHeight);
	//display.style.left = (screen.width/2) - (display.offsetWidth);
	//display.style.visibility = "visible"	
	Position(display);
}

//YIKES!  A whole A4 page of code accidentally deleted from here to end
//I don't . . .think . . . it was utilized.  F Alessio  April 2005
 
-->