function GetDay(nDay)
{
	var Days = new Array("Sunday","Monday","Tuesday","Wednesday",
	                     "Thursday","Friday","Saturday");
	return Days[nDay]
}

function GetMonth(nMonth)
{
	var Months = new Array("January","February","March","April","May","June",
	                       "July","August","September","October","November","December");
	return Months[nMonth] 	  	 
}

function DateString()
{
	var Today = new Date();
	var suffix = "th";
	switch (Today.getDate())
	{
		case 1:
		case 21:
		case 31: 
			suffix = "st"; break;
		case 2:
		case 22:
			suffix = "nd"; break;
		case 3:
		case 23:
			suffix = "rd"; break;
	};

	var strDate = GetDay(Today.getDay()) + " " + Today.getDate();
	strDate += suffix + " " + GetMonth(Today.getMonth()) + ", " + Today.getYear();
	return strDate
}
function CheckForm () { 

	//Initialise variables
	var errorMsg = "";

	//Check for a first name
	if (document.frmContact.name.value == ""){
		errorMsg += "\n\tName \t- Enter your Name";	
}
	//Check for an e-mail address and that it is valid
	if ((document.frmContact.email.value == "") || (document.frmContact.email.value.length > 0 && (document.frmContact.email.value.indexOf("@",0) == - 1 || document.frmContact.email.value.indexOf(".",0) == - 1))) { 
		errorMsg += "\n\tE-mail Address \t- Enter your valid e-mail address";
		}
	//Check for an enquiry
	if (document.frmContact.question.value == ""){
		errorMsg += "\n\tQuestion \t- Enter your Question";	
}
	//If there is aproblem with the form then display an error
	if (errorMsg != ""){
		msg = "______________________________________________________________\n\n";
		msg += "Your enquiry has not been sent because there are problem(s) with the form.\n";
		msg += "Please correct the problem(s) and re-submit the form.\n";
		msg += "______________________________________________________________\n\n";
		msg += "The following field(s) need to be corrected: -\n";
		
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}
	
	return true;
}    
function CheckUser () { 

	//Initialise variables
	var errorMsg = "";

	//Check for a first name
	if (document.frmUser.Name.value == ""){
		errorMsg += "\n\tName \t- Enter your Name";	
}
	//Check for an e-mail address and that it is valid
	if ((document.frmUser.Email.value == "") || (document.frmUser.Email.value.length > 0 && (document.frmUser.Email.value.indexOf("@",0) == - 1 || document.frmUser.Email.value.indexOf(".",0) == - 1))) { 
		errorMsg += "\n\tE-mail Address \t- Enter your valid e-mail address";
		}
	//Check for an enquiry
	if (document.frmUser.Message.value == ""){
		errorMsg += "\n\tMessage \t- Enter your Message";	
}
	//If there is aproblem with the form then display an error
	if (errorMsg != ""){
		msg = "______________________________________________________________\n\n";
		msg += "Your enquiry has not been sent because there are problem(s) with the form.\n";
		msg += "Please correct the problem(s) and re-submit the form.\n";
		msg += "______________________________________________________________\n\n";
		msg += "The following field(s) need to be corrected: -\n";
		
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}
	
	return true;
}    