function checkEmail(theEmail) {
	if (theEmail.indexOf('.')==-1) return false;
	if (theEmail.indexOf('@')==-1) return false;
	if (theEmail.length<6) return false;
	return true;
}

function checkCatForm() {
	theForm = document.catalogueForm;
	for (i=0;i<theForm.elements.length;i++) {
		if (theForm.elements[i].value) {
			theForm.elements[i].value = theForm.elements[i].value.replace(/'/gi,"`");
		}
	}

	if (theForm.fname.value.length<1) {alert("Please enter your first name.");return false;}
	if (theForm.lname.value.length<1) {alert("Please enter your last name.");return false;}
	if (theForm.org.value.length<1) {alert("Please enter your business name.");return false;}
	if (theForm.street.value.length<1) {alert("Please enter your street address.");return false;}
	if (theForm.suburb.value.length<1) {alert("Please enter your city or suburb.");return false;}
	if (theForm.postcode.value.length<1) {alert("Please enter your postcode.");return false;}
	if (theForm.state.value.length<1) {alert("Please enter your state or region.");return false;}
	if (theForm.phone1.value.length<1) {alert("Please enter a contact phone number.");return false;}
	if (theForm.email.value.length<1) {alert("Please enter your email address.");return false;}
	if (checkEmail(theForm.email.value)==false) {alert("The email address you have entered does not seem to be valid.");return false;}

	return true;
}