	/*****************************************************************
	 * Validates the form to ensure all required fields were entered.
	 *****************************************************************/
	function validateForm(theForm,errMsg) {

		var required = new Array();
		required[0] = theForm.fn;
		required[1] = theForm.ln;
		required[2] = theForm.selCountry;
		required[3] = theForm.email;
		required[4] = theForm.cemail;
		required[5] = theForm.message;
		
		// Get the default color
		var oldColor = theForm.elements[1].style.color;
		
		// Check to see if any required fields were left blank
		for(var i=0; i<theForm.elements.length; i++) {
			theForm.elements[i].style.color = oldColor;
			for(var j=0; j<required.length; j++) {
				if(theForm.elements[i].name == required[j].name) {
					if((theForm.elements[i].type == "text" || theForm.elements[i].type == "textarea") && (required[j].value == "" || required[j].value == "***"+errMsg+"***")) {
						required[j].value = "***"+errMsg+"***";
						required[j].style.color = "#ff0000";
						required[j].focus();
						return false;
					}
					if(theForm.elements[i].type == "select-one" && required[j].value.length <= 0) {
						required[j].style.color = "#ff0000";
						required[j].focus();
						return false;
					}					
				}	
			}	
		}

		// Check to see if the email address matches the "confirmed" email address
		if(theForm.email.value != theForm.cemail.value) {
			alert("The email address entered does not match the confirmed email address. \n\nPlease check that the correct email was entered and try again.");
			return false;
		}

		// The following attempts to prevent multiple submits
		theForm.submitbutton.disabled = true;
		
		return true;
	}
