<!--var whitespace = " \t\n\r";validations = new Array();validations[0] = ["document.getElementById('joinform').fullname", "notname"];validations[1] = ["document.getElementById('joinform').address1", "notaddress"];
validations[2] = ["document.getElementById('joinform').suburb", "notsuburb"];validations[3] = ["document.getElementById('joinform').postcode", "validpost"];
validations[4] = ["document.getElementById('joinform').area", "validarea"];
validations[5] = ["document.getElementById('joinform').phone", "isnumber"];
validations[6] = ["document.getElementById('joinform').mobile", "validmobile"];validations[7] = ["document.getElementById('joinform').email", "validemail"];function isEmpty(s){	var i;	if((s == null) || (s.length == 0))	return true;	for (i = 0; i < s.length; i++)	{		var c = s.charAt(i);		if (whitespace.indexOf(c) == -1)			return false;	}	return true;}function isName(field){	var i, c;	var s = field.value;	if (isEmpty(s))	{		alert("Please enter your full name.");		field.focus();		return false;	}	for (i = 0; i < s.length; i++)	{		c = s.charAt(i);		if (isDigit(c))		{			alert("Name can not contain numbers.");			field.focus();			return false;		}	}	return true;}

function isSuburb(field){	var i, c;	var s = field.value;	if (isEmpty(s))	{		alert("Please enter your suburb.");		field.focus();		return false;	}	for (i = 0; i < s.length; i++)	{		c = s.charAt(i);		if (isDigit(c))		{			alert("Suburb can not contain numbers.");			field.focus();			return false;		}	}	return true;}function isPost(field){	var i, c;	var s = field.value;	if (isEmpty(s))	{		alert("Please enter your postcode.");		field.focus();		return false;	}	for (i = 0; i < s.length; i++)	{		c = s.charAt(i);		if (!isDigit(c))		{			alert("Postcode can only contain numbers.");			field.focus();			return false;		}	}		if (s.length < 4) 	{		alert("Please enter a valid postcode.");		return false;	}		return true;}function isEmail(field){	var x = document.getElementById("joinform").email.value;	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;	if (filter.test(x)) return true;	else alert("You have not entered a valid email address.");	//http://www.quirksmode.org/js/mailcheck.html}function isDigit(c){	return ((c >= "0") && (c <= "9"))}function isPhone(field){	var i, c;	var s = field.value;	if (isEmpty(s))	{		alert("Please enter your phone number.");		field.focus();		return false;	}	for (i = 0; i < s.length; i++)	{		c = s.charAt(i);		if (!isDigit(c))		{			alert("Phone number can only contain numbers.");			field.focus();			return false;		}	}	if (s.length > 10)	{		alert("The phone number you have supplied is too long.");		return false;	}	if (s.length < 8)	{		alert("The phone number you supplied is not long enough.");		return false;	}	return true;}

function isMobile(field){	var i, c;	var s = field.value;		for (i = 0; i < s.length; i++)	{		c = s.charAt(i);		if (!isDigit(c))		{			alert("Mobile number can only contain numbers.");			field.focus();			return false;		}	}			return true;}

function isArea(field){	var i, c;	var s = field.value;		for (i = 0; i < s.length; i++)	{		c = s.charAt(i);		if (!isDigit(c))		{			alert("Area code can only contain numbers.");			field.focus();			return false;		}	}			return true;}function validate(){	var i;	var checkToMake;	var field;	for (i = 0; i < validations.length; i++)	{		checkToMake = validations[i][1];		field = eval(validations[i][0]);		switch (checkToMake)		{			case 'notname': if (!isName(field))								return false;							break;
			case 'notaddress': if (isEmpty(field.value))								{									alert("Please enter your address.");									field.focus();									return false;								}
							break;
			case 'notsuburb': if (!isSuburb(field))								return false;							break;						case 'validpost' : if (!isPost(field))								return false;							break;
			case 'validarea' : if (!isArea(field))								return false;							break;
			case 'isnumber' : if (!isPhone(field))								return false;							break;			
			case 'validmobile' : if (!isMobile(field))								return false;
							break;			case 'validemail' : if (!isEmail(field))								return false;					}	}	return true;}//-->