function validate() {
   
	if ( document.theForm.first_name.value == "" ){
		alert("Please enter your First name.");
		document.theForm.first_name.focus();
		return false;
	}	
	
	if ( document.theForm.last_name.value == "" ){
		alert("Please enter your Last name.");
		document.theForm.last_name.focus();
		return false;
	}	
	
	// email address
	if ( (document.theForm.email_address.value == "") || (document.theForm.email_address.value.indexOf("@") == -1) || (document.theForm.email_address.value.indexOf(".") == -1)) {
		alert("Please provide valid Email address.");
		document.theForm.email_address.focus();
		return false;
	}
	
	// email address
	if ( document.theForm.email_address.value != document.theForm.confirm_email_address.value ) {
		alert("Confirmation Email Address does not match. Please re-enter.");
		document.theForm.confirm_email_address.focus();
		return false;
	}
	document.theForm.submit();
}

function validate2(rand_num) {
   
	if ( document.theForm.first_name.value == "" ){
		alert("Please enter your First name.");
		document.theForm.first_name.focus();
		return false;
	}	
	
	if ( document.theForm.last_name.value == "" ){
		alert("Please enter your Last name.");
		document.theForm.last_name.focus();
		return false;
	}	
	
	// email address
	if ( (document.theForm.email_address.value == "") || (document.theForm.email_address.value.indexOf("@") == -1) || (document.theForm.email_address.value.indexOf(".") == -1)) {
		alert("Please provide valid Email address.");
		document.theForm.email_address.focus();
		return false;
	}
	
	// email address
	if ( document.theForm.email_address.value != document.theForm.confirm_email_address.value ) {
		alert("Confirmation Email Address does not match. Please re-enter.");
		return false;
	}

	if (document.theForm.reg_code.value == '')
	{
		alert('Please enter the 4-digit code as shown next to the code box in the form.');
		document.theForm.reg_code.focus();
		return false;
	}
	if (document.theForm.reg_code.value != rand_num)
	{
		alert('The 4-digit registration code was not entered correctly.  Please verify.');
		document.theForm.reg_code.focus();
		return false;
	}


	document.theForm.submit();
}
