function emailvalidation(entered, alertbox) {
	// E-mail-Validation (c) Henrik Petersen / NetKontoret
	// Explained at www.echoecho.com/jsforms.htm
	// Please do not remove the this line and the two lines above.
	with (entered) {
		apos=value.indexOf("@");
		dotpos=value.lastIndexOf(".");
		lastpos=value.length-1;
		if (apos<1 || dotpos-apos<2 || lastpos-dotpos>3 || lastpos-dotpos<2) {
			if (alertbox) {alert(alertbox);} 
			return false;
		} else {
			return true;
		}
	}
}

function emptyvalidation(entered, alertbox) {
	// Emptyfield-Validation (c) Henrik Petersen / NetKontoret
	// Explained at www.echoecho.com/jsforms.htm
	// Please do not remove the this line and the two lines above.
	with (entered) {
		if (value==null || value=="") {
			if (alertbox!="") {alert(alertbox);} 
			return false;
		} else {
			return true;
		}
	}
}

function formvalidation(thisform) {
	with (thisform) {
		if (emptyvalidation(name,"The NAME is blank")==false) {name.focus(); return false;};
		if (emptyvalidation(address,"The ADDRESS is blank")==false) {address.focus(); return false;};
		if (emptyvalidation(city,"The CITY is blank")==false) {city.focus(); return false;};
		if (emptyvalidation(zip,"The ZIP is blank")==false) {zip.focus(); return false;};
		if (emptyvalidation(phoneNum,"The PHONE NUMBER is blank")==false) {phone.focus(); return false;};
		if (emailvalidation(email,"Illegal E-mail address")==false) {email.focus();  return false;};
	}
	document.forms[0].submit();
}
addLoadEvent( function () { document.getElementById('name').focus(); });