
function validateForm() {
	// Email List Subscribe Form:
	// check the form for required fields and for valid email
	var f = emailform;
	var node = f.elements[ "emailaddress" ];
	if ( node != null ) {
		var isValid = checkValidEmail( node );
		if ( isValid == true ) {
			f.submit(); 
		} else { 
			alert( "Please verify your email address. The one entered does not appear valid." );
			return false;
		}
	} else {
		alert( "Page error: unable to locate email form field." );
	}
}

function checkValidEmail( node ) {
	if ( node != null ) {
		var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
		if ( filter.test( node.value ) ) {
			return true;
		} else {
			return false;
		}
	}
}

function calcBA() {
	var av = parseFloat( calcform.avalue.value );
	var tax = ( parseFloat( av ) / 1000 ) * 0.31;
	var results = isNaN( tax ) ? "Error!" : tax.toFixed( 2 );
	calcform.cvalue.value = results;
}
