function formvalidation(thisform) {
	errs = '';
	with (thisform) {
		if (emptyvalidation(fromName,"")==false) {
			fromName.focus(); 
			errs += '-- Please enter your name.\n';
		}
		if (emailvalidation(fromAddress,"")==false) {
			if(errs == '') {
				fromAddress.focus(); 
			}
			errs += '-- Please enter a valid email address.\n';
		}
	}
	if(errs != '') {
		errs = 'The required information is incomplete or contains errors:\n'+errs;
		alert(errs);
		return false;
	}
	return true; 
} 

function emailvalidation(entered, alertbox) {
	with (entered) {
		rx=new RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-zA-Z]{2,4}$");
		if (!rx.test(value) || value == 'Email Address') {
			if (alertbox) {
				alert(alertbox);
			} 
			return false;
		}
		else {
			return true;
		}
	}
} 

function emptyvalidation(entered, alertbox) {
// Emptyfield Validation by Henrik Petersen / NetKontoret
// Explained at www.echoecho.com/jsforms.htm
// Please do not remove this line and the two lines above.
	with (entered) {
		if (value==null || value=="" || value == 'Name') {
			if (alertbox!="") {
				alert(alertbox);
			} 
			return false;
		}
		else {
			return true;
		}
	}
} 