//TheDate      (aucun param¸tre nˇcessaire)retourne la date en anglais
//LaDate       (aucun param¸tre nˇcessaire)retourne la date en fran¨ais
//QuelleHeure  (aucun param¸tre nˇcessaire)retourne l'heure
//*****************************************************************************
function TheDate()
	{
	var months        = new Array(13)
	months[1]="January";
	months[2]="February";
	months[3]="March";
	months[4]="April";
	months[5]="May";
	months[6]="June";
	months[7]="July";
	months[8]="August";
	months[9]="September";
	months[10]="October";
	months[11]="November";
	months[12]="December";
	var time   = new Date();
	var lmonth = months[time.getMonth() + 1];
	var date   = time.getDate();
	var year   = time.getYear();
	if (year < 2000)    
	year       = year + 1900; 
	thedate=lmonth+" "+date+", "+year;
	return thedate;
	}
	
//*****************************************************************************
function LaDate()
	{
	var months        = new Array(13)
	months[1]="janvier";
	months[2]="fˇvrier";
	months[3]="mars";
	months[4]="avril";
	months[5]="mai";
	months[6]="juin";
	months[7]="juillet";
	months[8]="ao˛t";
	months[9]="septembre";
	months[10]="octobre";
	months[11]="novembre";
	months[12]="dˇcembre";
	var time   = new Date();
	var lmonth = months[time.getMonth() + 1];
	var date   = time.getDate();
	var year   = time.getYear();
	if (year < 2000)    
	year       = year + 1900; 
	thedate=+date+" "+lmonth+" "+year;
	return thedate;
	}

//******************************************************************************
function QuelleHeure () 
	{
	var now = new Date();
	var hours = now.getHours();
	var minutes = now.getMinutes();
	var seconds = now.getSeconds()
	var timeValue = "" + ((hours >12) ? hours -12 :hours)
	if (timeValue == "0") timeValue = 12;
	timeValue += ((minutes < 10) ? ":0" : ":") + minutes
	timeValue += ((seconds < 10) ? ":0" : ":") + seconds
	timeValue += (hours >= 12) ? " P.M." : " A.M."
	return timeValue;
	}

//*****************************************************************************
// Function for displaying the next meeting date. It "should" check against the 
// current date. If we are within 1 day it will display the date in red. It should
// always show the next meeting date. Meaning if the meeting was yesterday, it should
// not be showing that old date.
function nextMeeting()
{
	var thedate = "None Scheduled!";
	// Enter new meeting dates here
	var meetings = []
	meetings[0] = new Date("3/3/2010");
	meetings[1] = new Date("4/7/2010");
	meetings[2] = new Date("5/5/2010");
	meetings[3] = new Date("6/2/2010");
	meetings[4] = new Date("7/7/2010");
	meetings[5] = new Date("8/4/2010");
	meetings[6] = new Date("9/1/2010");
	meetings[7] = new Date("10/6/2010");
	meetings[8] = new Date("11/3/2010");

	var months = []
	months[0]="January";
	months[1]="February";
	months[2]="March";
	months[3]="April";
	months[4]="May";
	months[5]="June";
	months[6]="July";
	months[7]="August";
	months[8]="September";
	months[9]="October";
	months[10]="November";
	months[11]="December";
	
	var today = new Date();
	var sToday = new Date( today.getFullYear(),today.getMonth(),today.getDate());
	var todayMillis = sToday.getTime();
	
	for (i=0; i<meetings.length; i++)
	{
		var tempDate = meetings[i];
		var tempDateMillis = tempDate.getTime()
		var tempDiff = tempDateMillis - todayMillis;
		var tempNumDays = tempDiff / (1000*60*60*24);

		if ( tempNumDays >= 0 )
		{
			var lmonth = months[tempDate.getMonth()];
			var date   = tempDate.getDate();
			var year   = tempDate.getFullYear();
			if ( tempNumDays < 1 )
			{
				thedate = "<span style=\"color: #f00\">" + lmonth + " " + date + ", " + year + " - Tonight!</span>";
			}
			else
			{
				thedate = lmonth + " " + date + ", " + year;
			}
			break;
		}
	} 
	
	return thedate;
}