// JavaScript Document

// check second form values
function checkForm()
{
	// instantiate object
	fv = new formValidator();
	
	// perform checks
	// check for empty name field
	if (fv.isEmpty(document.form.client_name.value))
	{
		fv.raiseError("Please enter the client name");
	}
		
	// check for empty org field
	if (fv.isEmpty(document.form.client_company.value))
	{
		fv.raiseError("Please enter the client company");
	}
		
		// check for tel number
	if (fv.isEmpty(document.form.client_phone1.value))
	{
		fv.raiseError("Please enter a client telephone number");
	}
	
	// check for empty email address
	if (fv.isEmpty(document.form.client_email.value))
	{
		fv.raiseError("Please enter a client email address");
	}
	
	// check for valid email address format
	if (!fv.isEmpty(document.form.client_email.value) && !fv.isEmailAddress(document.form.client_email.value))
	{
		fv.raiseError("Please enter a valid email address");
	}
	
	
	// all done
	
	// if errors, display, else proceed
	if (fv.numErrors() > 0)
	{
		fv.displayErrors();
		return false;
	}
	else
	{
		
		return true;
	}
	
}

