
function errorString_display ()  /*This function shows the validation layer and writes to it */
{
	validation_layer.style.display = 'block';											
	valText = '';
	valText = valText + "<span class='header1'>Some&nbsp;information is&nbsp;incomplete...</span>";
	valText = valText + "<span style='text-align: left; ' class='normaltext' >";
	valText = valText + error_string;
	valText = valText + "</span>";
	// validation_layer.innerHTML = valText;
	alert("Some of the information is incomplete:\n" + error_string);	
	return (false) ; 
	/*This returns FALSE to the validate function, which in turn passes FALSE back to root and cancels the submit.*/
}

function contact_validate(myForm)
{	

	error_string = ""
		
		if (   eval(myForm + ".email.value" ) == '' 
		&&  eval(myForm + ".phone.value" ) == '' )  
			{
				error_string = error_string + "<br /><br />Enter your email address or phone number." 
			}
		
		if (error_string != "")	 { if (errorString_display() == false )  {return (false);}	 }
	
		
	
} /* End of function */

function login_validate(myForm)
{
	error_string = ""
		
		if (   eval(myForm + ".email.value" ) == ''  )  
			{
				error_string = "<br /><br />Please enter your email address" 
			}
			

		if (   eval(myForm + ".password.value" ) == '' &&  eval(myForm + ".send_email.checked" ) == ''
		 )  
			{
				error_string = error_string + "<br /><br />Please enter a password, or click to be reminded by email" 
			}
		
		if (error_string != "")	 { if (errorString_display() == false )  {return (false);}	 }
} /* End of function */

function register_validate(myForm)
{
	error_string = ""
	
		if (   eval(myForm + ".firstname.value" ) == ''  )  
			{
				error_string = error_string +  "<br /><br />Please enter your first name"
			} 
			
		if (   eval(myForm + ".lastname.value" ) == ''  )  
			{
				error_string = error_string +  "<br /><br />Please enter your last name"
			}
			
					if (   eval(myForm + ".email.value" ) == ''  )  
			{
				error_string = error_string +  "<br /><br />Please enter your email address"
			}
			
					if (   eval(myForm + ".postcode.value" ) == ''  )  
			{
				error_string = error_string +  "<br /><br />Please enter your post code"
			}
			
					if (   eval(myForm + ".password.value" ) == ''  )  
			{
				error_string = error_string + "<br /><br />Please enter your password"
			}
		
		if (error_string != "")	 { if (errorString_display() == false )  {return (false);}	 }

} /* End of function */
