jQuery.fn.isValidForm = function() {
	var isValid = true;
	
	this.find(":text").each(function() {
		if (!isValid) {
			return;
		}
		
		var fieldType = $(this).attr("alt");
		var notNull = false;
		
		if ($(this).attr("class") == "notNull") {
			notNull = true;
		} 
		
		if (!$(this).isValidInput({type: fieldType, notEmpty: notNull})) {
			$(this).css("background-color", "red");
			isValid = false;
			return;
		}
		$(this).css("background-color", "white");
	});
	
	if (isValid) {
		this.find("textarea").each(function() {
			if (!isValid) {
				return;
			}
			
			var fieldType = $(this).attr("alt");
			var notNull = false;
			
			if ($(this).attr("class") == "notNull") {
				notNull = true;
			} 
			
			if (!$(this).isValidInput({type: fieldType, notEmpty: notNull})) {
				$(this).css("background-color", "red");
				isValid = false;
				return;
			}
			$(this).css("background-color", "white");		
		});
	}
	
	return isValid;
}
