function checkformat(address) {
	regex=/^([_~a-z0-9-]+[._a-z0-9-]*)@(([a-z0-9-]+\.)*([a-z0-9-]+)(\.[a-z]{2,4}))$/i
// Validate email address
	if (address !='' && (! address.match(regex))) {
		alert("We could not verify your email address.\nPlease check you have typed it correctly");
		return false;
	}
return true;
}

function checkfields() {
	df=document.forms["enquiry"];
	if (! validateComplete(df)) {
		return false;
	}
	ev=false;
	for (i=0;i<df.elements.length;i++) {
		n=df[i].name.substr(0,1); t=df[i].type.substr(0,4);
		if (n=='_') {
			if (t=='text' && df[i].value=='') {
				ev=true;
			}
			if (t=='sele' && df[i][df[i].selectedIndex].value=='') {
		  		ev=true;
			}
			if (ev) {
				alert(df[i].name.substr(1,df[i].name.length-1)+' is required information');	
				return false;
			}
			if (df[i].name.indexOf('email') !=-1) {
				if (! checkformat(df[i].value)) {
					return false;
				}
			}				
		}
	}

	return true;
}