<!--
var event_array = new Array();

function DayName(i)
{
	var arrDays= new Array("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat")
	return arrDays[i];
}

function HasEvent(datestr) {
	for(var i=0;i<event_array.length;i++){
		if (datestr==event_array[i]) {
		 return true
		 }
	}
	return false
}

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)
{
  findContent('/dedet/eventsForDay1.asp?dt='+value);
}

//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 = 680; /* Nelson changed this value from 550 to 680 to move the display away from the fields */ 
	objToMove.style.visibility = 'visible';	
}

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 class=\"main\" border=0 cellspacing=0 cellpadding=0>"
	
	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 class=\"month\"  align='center' onClick='MakeCalendar(" + strPrevious + ");'><<</TD>";
		
	strTemp = objDate.getMonth() + ",1," + String.fromCharCode(34) + ctrl + String.fromCharCode(34)
	strOutHTML += "<TD colspan=5 align=center class=\"month\">&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 class=\"month\""
	strOutHTML += " 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 class=\"month\"><B>Sun</TD>"
	strOutHTML += "<TD align=center class=\"month\"><B>Mon</TD>"
	strOutHTML += "<TD align=center class=\"month\"><B>Tue</TD>"
	strOutHTML += "<TD align=center class=\"month\"><B>Wed</TD>"
	strOutHTML += "<TD align=center class=\"month\"><B>Thu</TD>"
	strOutHTML += "<TD align=center class=\"month\"><B>Fri</TD>"
	strOutHTML += "<TD align=center class=\"month\"><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
		bold = HasEvent(strPostValue);
		//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 = '#EF9E28'" + String.fromCharCode(34) + " onMouseOut=" + String.fromCharCode(34) + "this.style.backgroundColor = '#d3d3d3'" + String.fromCharCode(34) + " onClick='SetValue(" + String.fromCharCode(34) + strPostValue + String.fromCharCode(34) + ");'>";
		}
		else
		{
		   strOutHTML += "<TD bgcolor='#d3d3d3' align=center style=" + String.fromCharCode(34) + "cursor:pointer" + String.fromCharCode(34) + " onMouseOver=" + String.fromCharCode(34) + "this.style.backgroundColor = '#EF9E28'" + String.fromCharCode(34) + " onMouseOut=" + String.fromCharCode(34) + "this.style.backgroundColor = '#d3d3d3'" + String.fromCharCode(34) + " onClick='SetValue(" + String.fromCharCode(34) + strPostValue + String.fromCharCode(34) + ");'>";
		}
		if(bold) 
			strOutHTML += "<b><span style='background-color: #EF9E28'><font color='white'>"+ j + "</font></span></b></TD>";
		else
			strOutHTML += j + "</TD>";
	}
	if (i != 7)
	{
		strOutHTML += "<TD colspan=" + (7 - i) + ">&nbsp;</TD>"
	}

	strOutHTML += "</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
 
-->
