function check ( form ) {

	var minLength = 3;

	if (form.txtContact.value == "") {

		alert("Please enter a contact name.");

		form.txtContact.focus();

		return false;

	}

	if (form.txtCompany.value == "") {

		alert("Please enter your company name.");

		form.txtCompany.focus();

		return false;

	}

	if (form.txtAddress.value == "") {

		alert("Please enter your address");

		form.txtAddress.focus();

		return false;

	}

	if (form.txtCity.value == "") {

		alert("Please enter you city.");

		form.txtCity.focus();

		return false;

	}

	if (form.txtCountry.value == 0) {

		alert("Please select your country.");

		form.txtCountry.focus();

		return false;

	}

	if (form.txtState.value == "None") {

		alert("Please select your state/province.");

		form.txtState.focus();

		return false;

	}

	if (form.txtZip.value == "") {

		alert("Please enter your zip/postal code.");

		form.txtZip.focus();

		return false;

	}

	if (form.txtTel.value == "") {

		alert("Please enter your telephone number.");

		form.txtTel.focus();

		return false;

	}

	if (form.txtEmail.value !== "") {

		if (!isEmailAddr(form.txtEmail.value)) {

			alert("Please enter a complete email address in the form: yourname@yourdomain.com");

			form.txtEmail.focus();

			return (false);

		}
		
	}


	if (form.txtSiteName.value == "") {

		alert("Please enter your Site Username.");

		form.txtSiteName.focus();

		return false;

	}

	if (form.txtPass.value.length < minLength) {

		alert ("Your password must be at least "+minLength+" characters.");

		form.txtPass.focus();

		return false;

	}

	if (form.txtPass.value == "") {

		alert("Please enter a password.");

		form.txtPass.focus();

		return false;

	}

	if (form.txtCpass.value == "") {

		alert("Please re-type your password.");

		form.txtCpass.focus();

		return false;

	}

	if (form.txtPass.value != form.txtCpass.value) {

		alert("Please re-enter your passwords they didn't match.");

		return false;

	}

	return true;
}

function isEmailAddr(email) {

	var result = false

	var theStr = new String(email)

	var index = theStr.indexOf("@");

	if (index > 0) {

		var pindex = theStr.indexOf(".",index);

		if ((pindex > index+1) && (theStr.length > pindex+1))

		result = true;

	}

	return result;

}


