function CheckForm () 
{ 

	//Initialise variables
	var errorMsg = "";

	//Check for a visitors name
	if (document.frmEnquiry.name.value == ""){
		errorMsg += "\n\tYour Name \t\t- Enter your Name";	
	}
		 	
	//Check for a visitors e-mail address and that it is valid
	if ((document.frmEnquiry.sender.value == "") || (document.frmEnquiry.sender.value.length > 0 && (document.frmEnquiry.sender.value.indexOf("@",0) == - 1 || document.frmEnquiry.sender.value.indexOf(".",0) == - 1))) { 
		errorMsg += "\n\tYour E-mail Address \t- Enter your valid e-mail address";
	}
	
	//Check for a friends e-mail address and that it is valid
	if ((document.frmEnquiry.recipient.value == "") || (document.frmEnquiry.recipient.value.length > 0 && (document.frmEnquiry.recipient.value.indexOf("@",0) == - 1 || document.frmEnquiry.recipient.value.indexOf(".",0) == - 1))) { 
		errorMsg += "\n\tFriends E-mail Address \t- Enter friends valid e-mail address";
	}
	
	//Check for a subject
	if (document.frmEnquiry.subject.value == ""){
		errorMsg += "\n\tSubject \t\t\t- Enter a Subject for the e-mail";
	}
			
	//Check for an message
	if (document.frmEnquiry.sendermsg.value == "") { 
 		errorMsg += "\n\tMessage \t\t\t- Enter a message";
	}
		
	//If there is aproblem with the form then display an error
	if (errorMsg != ""){
		msg = "______________________________________________________________\n\n";
		msg += "Your inquiry 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;
}
