/*	clarocom.js	*/

/* this will be set when script is loaded */
events = new Array;
events[ 10 ] = "Claro Training interviews";
events[ 13 ] = "Final date for Claro Learning consultants to sign on to forum";
events[ 25 ] = "Claro directors to meet at Stamford Bridge";
events[ 28 ] = "Webmaster to claim dinner in Girona";

function show_event( dofm )
{
	document.eventbox.event.value = events[ dofm ];
}

function make_sure()
{
	if ( confirm( "The Enablers site is under construction. Do you still want to go there?" ))
		window.location = "#";
}

/*	function to colour month calendar	*/
function colour_cal()
{
	var today = new Date();
	var dofm = today.getDate();
	var cells = document.body.getElementsByTagName( "td" );
	var numcells = cells.length;
	var i, curr, val;
	for ( i = 0; i < numcells; i++ )	{	// must be '<': counting starts at 0!
		curr = cells[ i ].innerHTML;
		val = parseInt( curr );
		if ( val > 0 && val < dofm )
			cells[ i ].style.color = "silver" ;
		else if ( val == dofm )
			cells[ i ].style.fontWeight = "bold";
	}
}

/*	This function returns the day, month and year that the file it appears in was
	last modified. 'document.lastModified' is itself a string, but includes seconds,
	and varies in form from browser to browser.	*/
function date_modified()	{
	var month_name = new Array( "January", "February", "March", "April", "May",
		"June", "July", "August", "September", "October", "November", "December" );
	var fdate = new Date( document.lastModified );
	var fday = fdate.getDate();
	var suffix = "th ";
	switch ( fday )	{
		case 1:
		case 21:
		case 31: 
			suffix = "st ";
			break;
		case 2:
		case 22:
			suffix = "nd ";
			break;
		case 3:
		case 23:
			suffix = "rd ";
			break;
	}
	var fmonth = month_name[ fdate.getMonth() ];
	var fyear = fdate.getFullYear();
	return fday + suffix + fmonth + " " + fyear;
}

