<!-- 

// function to check a form for blank entries in required fields
function checkBlankFields(fieldsArray) {
	
	var error = false;
	var error_msg = "";
	// enter the id's of the inputs you want to check in order of appearence
	if(fieldsArray) {
		var checkInputs = fieldsArray.split(",");
		// var checkInputs = ['field1','field2', ...];
		// reverse the array so that the the focus is always given to the first blank field (not the last)
		// checkInputs.reverse();
		
		// for each input in the array, check if a value is present and set class / focus
		checkInputs.each(function(input) {	
			if($(input)) {
				if(!$(input).present()) {
					input_name = input.gsub('-',' ');
					input_name = input_name.gsub('_','-');
					input_name = input_name.substr(0, 1).toUpperCase() + input_name.substr(1);
					error_msg = error_msg + input_name + "\n";
					error = true;
				}
			} else {
				alert(input);	
			}
			
		});
	} 
	
	if(error) {
		alert("Please fill in the following fields:\n\n"+error_msg);
		return true;
	} else {
		return false;	
	}
	
}

function checkEmail(input) {
	
	var error = "";
	var emailFilter = /^[^@]+@[^@.]+\.[^@]*\w\w$/;
	var illegalChars = /[\(\)\<\>\,\;\:\\\"\[\]]/;
	var email = $F(input).strip();
	
	if(email) {
		if(!emailFilter.test(email)) {
			error = "The email address you entered is invalid";
		} else if (email.match(illegalChars)) {
			error = "The email address contains illegal characters";
		} 
		
		if(error) {
			alert(error);
			return true;
		} else {
			return false;
		}					
	}
}

//-->