<!--
	// THIS FUNCTION VALIDATES THE USER'S ENTRY FOR REGISTRATION.
	function validateform(f) {
		// declare all objects used for validation on this page.
		var name = document.getElementById('txtName');
		var email = document.getElementById('txtEmailAddress');
		var address = document.getElementById('txtAddress');
		var country = document.getElementById('txtCountry');
		var telephone = document.getElementById('txtTelephone');
		
		// check to see if all the required data was supplied.
		if (isWhitespace(name.value)) {
			alert("Your name is required.  Please try again.");
			name.focus();
			return false;
		}
		
		if (isWhitespace(email.value)) {
			alert("Your e-mail address is required.  Please try again.");
			email.focus();
			return false;
		}

		if (!isValidEmail(email.value)) {
			alert("The e-mail address entered is invalid. Please enter a valid e-mail address and try again.");
			email.focus();
			return false;
		}
		
		if (isWhitespace(address.value)) {
			alert("Your address is required.  Please try again.");
			address.focus();
			return false;
		}
		
		if (isWhitespace(country.value)) {
			alert("The country is required.  Please try again.");
			country.focus();
			return false;
		}
		
		if (isWhitespace(telephone.value)) {
			alert("Your telephone number is required.  Please try again.");
			telephone.focus();
			return false;
		}
		
		// loop through the radio button to see if an option was selected.
		var found = false;
		
		for (var i = 0; i < f.optCourse.length; i++) {
			if (f.optCourse[i].checked) {
				found = true;
				break;
			}
		}
		
		if (!found) {
			alert("A course selection is required.  Please try again.");
			return false;
		}
		
		return true;
	}
	
	// THIS FUNCTION VALIDATES THE USER'S ENTRY TO BE ADDED TO THE NEWSLETTER MAILING LIST.
	function validatenewsletterform(f) {
		// declare all objects used for validation on this page.
		var name = document.getElementById('txtName');
		var email = document.getElementById('txtEmailAddress');
		
		// check to see if all the required data was supplied.
		if (isWhitespace(name.value)) {
			alert("Your name is required.  Please try again.");
			name.focus();
			return false;
		}
		
		if (isWhitespace(email.value)) {
			alert("Your e-mail address is required.  Please try again.");
			email.focus();
			return false;
		}
		
		if (!isValidEmail(email.value)) {
			alert("The e-mail address entered is invalid. Please enter a valid e-mail address and try again.");
			email.focus();
			return false;
		}
		
		return true;
	}
	
	// THIS FUNCTION DETERMINS IF THE STRING VALUE PASSED IN IS A VALID E-MAIL ADDRESS OR NOT AND RETURNS TRUE IF SO, FALSE OTHERWISE.
	function isValidEmail(strEmail) {
  		// set the regular expression to search for against the string passed in.
		var validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;

   		// search email text for regular exp matches
    	if (strEmail.search(validRegExp) == -1) {
      		return false;
    	} 
    
		return true; 
	}
	
	// THIS FUNCTION DETERMINES IF THE STRING PASSED IN IS WHITESPACE AND RETURNS TRUE IF SO AND RETURNS TRUE IF STRING IS EMPTY OR WHITESPACE CHARACTERS ONLY.
	function isWhitespace (s){ 
		var whitespace = " \t\n\r";
		var i;

		// Is s empty?
		if (isEmpty(s)) return true;

		// Search through string's characters one by one
		// until we find a non-whitespace character.
		// When we do, return false; if we don't, return true.
		
		for (i = 0; i < s.length; i++) { 
			// Check that current character isn't whitespace.
			var c = s.charAt(i);

			if (whitespace.indexOf(c) == -1) return false;
		}

		// All characters are whitespace.
		return true;
	}
	
	// THIS FUNCTION CHECKS TO SEE IF THE VALUE PASSED IN IS EMPTY AND RETURNS TRUE IF SO, FALSE OTHERWISE.
	function isEmpty(s)	{
		return ((s == null) || (s.length == 0));
	}
//-->