function validateFields()
	{
	var Why = "Some of the fields had errors\n\n";
	
	var Name 	= document.form1.Name.value;
	var Phone	= document.form1.Phone.value;
	var Fax		= document.form1.Fax.value;
	var Email	= document.form1.Email.value;
		
	// Check for missing required information.
	if ((Name	== "") ||	(Phone == "") || (Email == ""))
		{
		// At least one of the contact parameters was missing.
		Why += "- Some required fields were missing\n";
		}
	// Validate telephone number
	if (Phone != "")
		{
		var ValidPhone = /^((\()?(\d{3}))(\))?[ -_\.]*(\d{3})[ -_\.]*(\d{4})/;
		if (!(ValidPhone.test(Phone)))
			{
			Why += "- Telephone number is not correct\n" ;
			}
		}
		
	// Validate fax number
	if (Fax != "")
		{
		var ValidFax = /^((\()?(\d{3}))(\))?[ -_\.]*(\d{3})[ -_\.]*(\d{4})$/;
		if (!(ValidPhone.test(Fax)))
			{
			Why += "- Fax number is not correct\n" ;
			}
		}
		
	// Validate Email address
	if (Email != "")
		{
		var ValidEmail = /^\w[\w\d\.\-_]+\@[\w\d\.\-_]+\.\w{2,3}(\.\w{2,3})?$/;
		if (!(ValidEmail.test(Email)))
			{
			Why += "- Email address is not correct\n" ;
			}		
		}

	
	
	if (Why != "Some of the fields had errors\n\n")
		{
		alert(Why);
		return false;
		}
		
	return true;
	}
