function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}

function validateForm(){
	theForm = document.frmCapsule;
	
	//check all fields are entered
	if (trim(theForm.comments.value) == ''){
		alert('Capsule suggestion is required.');
		return false;
	}
	//comments must be less then 8000 characters
	if (theForm.comments.value.length > 8000){
		alert('Capsule suggestion must be less then 8000 characters. Character count ' + theForm.comments.value.length);
		return false;
	}

	return true;
}