// JavaScript Document
	function validateSubscriptionForm()
	{
	// Create a reference to the firstname textbox
	var formField = document.frmSubscribe.firstname;
	
	// See if the user typed anything in the firstname text box
	if (formField.value == '')
		{
		 // If not, display error message and exit
		  alert ('Please enter your first name');
		  formField.focus();
		  return false;
		}
	
	// Create a reference to the lastname textbox
	var formField = document.frmSubscribe.lastname;
	
	// See if the user typed anything in the lastname text box
	if (formField.value == '')
		{
		 // If not, display error message and exit
		  alert ('Please enter your last name');
		  formField.focus();
		  return false;
		}
	
	// Create a reference to the email textbox
	var formField = document.frmSubscribe.email;
	
	// See if the user typed anything in the email text box
	if (formField.value == '')
		{
		 // If not, display error message and exit
		  alert ('Please enter your email address');
		  formField.focus();
		  return false;
		}
	
	// var validRegExp = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/i; - old regex
		// regex now allows apostrophes in the first half of the email address
	var validRegExp = /^\w+([\'\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/i;
	if (!validRegExp.test(formField.value))
		{
		  alert ('Email address is not valid - Please enter a valid address')
		  formField.focus();
		  return false;
		}

	
	// Create a reference to the experience text area
	var formField = document.frmSubscribe.experience;
	
	// See if the user typed anything in the experience text area
	if (formField.value == 'What experience do you have with systems modelling?')
		{
		 // If not, display error message and exit
		  alert ('Please indicate your level of experience with systems modelling?');
		  formField.focus();
		  return false;
		}

	if (formField.value == '')
		{
		 // If not, display error message and exit
		  alert ('Please indicate your level of experience with systems modelling?');
		  formField.focus();
		  return false;
		}

	// Create a reference to the experience text area
	var formField = document.frmSubscribe.benefits;
	
	// See if the user typed anything in the experience text area
	if (formField.value == 'What benefits are you expecting to derive from the network?')
		{
		 // If not, display error message and exit
		  alert ('Please indicate what benefits are you expecting to derive from the network');
		  formField.focus();
		  return false;
		}
	
	// See if the user typed anything in the experience text area
	if (formField.value == '')
		{
		 // If not, display error message and exit
		  alert ('Please indicate what benefits are you expecting to derive from the network');
		  formField.focus();
		  return false;
		}
	

	// Create a reference to the password textbox
	// var formField = document.frmSubscribe.status;
	
	// If the user selected individual membership check that either a billing address or a promo code has been entered
	if (formField = document.frmSubscribe.status[1].checked == true)
	  {
		if (document.frmSubscribe.address.value == '' && document.frmSubscribe.subscription_number.value == '')
		  {		  
		  alert ('Please enter either a valid promotional code or your billing address');
		  document.frmSubscribe.address.focus();
		  return false;
		  }
		}

	// If the user selected partner membership check that a partnership number has been entered
	if (document.frmSubscribe.status[2].checked == true)
	  {
		if (document.frmSubscribe.part_num.value == '')
		  {		  
		  alert ('Please enter your organisations partnership number');
		  document.frmSubscribe.part_num.focus();
		  return false;
		  }
		}

	
	// Create a reference to the username textbox
	var formField = document.frmSubscribe.username;
	
	// See if the user typed anything in the password text box
	if (formField.value == '')
		{
		 // If not, display error message and exit
		  alert ('Please enter a username');
		  formField.focus();
		  return false;
		}

	// Create a reference to the password textbox
	var formField = document.frmSubscribe.password;
	
	// See if the user typed anything in the password text box
	if (formField.value == '')
		{
		 // If not, display error message and exit
		  alert ('Please enter a password');
		  formField.focus();
		  return false;
		}
	
	var confirmPassword = document.frmSubscribe.confirm_password;
	
	// See if the user typed anything in the confirm_password text box
	if (confirmPassword.value == '')
		{
		 // If not, display error message and exit
		  alert ('Please re-type your password');
		  formField.focus();
		  return false;
		}
	
	// See if the password text box matches the confirm_password text box
	if (formField.value != confirmPassword.value)
		{
		 // If not, display error message and exit
		  alert ('Your passwords do not match - please try again');
		  confirmPassword.focus();
		  return false;
		}
	
	// Create a reference to the terms checkbox
	var formField = document.frmSubscribe.terms;

	// See if the terms checkbox has been clicked
	if (document.frmSubscribe.terms.checked == false)
		{
		 // If not, display error message and exit
		  alert ('You must agree to the terms and conditions to continue');
		  formField.focus();
		  return false;
		}



	// If there are no errors we can submit the form
	return true;
	}
