function validate()
{
	var form = document.getElementById('myform');
	var business_name = form.business_name.value;
	var contact_name = form.contact_name.value;
	var street_address = form.street_address.value;
	var suburb = form.suburb.value;
	var postcode = form.postcode.value;
	var phone = form.phone.value;
	var fax = form.fax.value;
	var digitexp = new RegExp(/^\d+$/);
	var spacepattern = new RegExp(/\b \b/ig);
	var bracketpattern = new RegExp(/\b\)\b/ig);
	var bracketpattern2 = new RegExp(/\b\(\b/ig);
	
	phone = phone.replace(spacepattern,"");
	phone = phone.replace(bracketpattern,"");
	phone = phone.replace(bracketpattern2,"");
	fax = fax.replace(spacepattern,"");
	fax = fax.replace(bracketpattern,"");
	fax = fax.replace(bracketpattern2,"");
	
	if (business_name.length <= 0)
	{
		window.alert("You must enter a business name");
		return false;
	}
	
	else if (contact_name.length <= 0)
	{
		window.alert("You must enter a contact name");
		return false;
	}
	
	else if (street_address.length <= 0)
	{
		window.alert("You must enter a street address");
		return false;
	}
	
	else if (suburb.length <= 0)
	{
		window.alert("You must enter a suburb");
		return false;
	}
	
	else if (digitexp.test(postcode) != true)
	{
		window.alert("Postcode must be digits only");
		return false;
	}
	
	else if (postcode.length <= 3)
	{
		window.alert("Postcodes must be 4 digits long");
		return false;
	}
	
	else if (digitexp.test(phone) != true)
	{
		window.alert("Phone numbers must be digits only");
		return false;
	}
	
	else if (phone.length <= 7)
	{
		window.alert("Phone numbers must be at least 8 digits long");
		return false;
	}
	form.phone.value = phone;
	form.fax.value = fax;
}