//$cmignore
/*
Sherwin extensions of the jQuery JavaScript Library
Dependencies: jQuery 1.1.3.1+
*/

jQuery.fn.extend ({
	hoverize : function (hoverClass) {
		return this.hover (
			function () { this.className = !hoverClass ? 'hover' : hoverClass },
			function () { this.className = '' });
	},
	isRequired : function () {
		return this.is('.required');
	},
	isEmpty : function () {
		var empty = false;
		var values = this.fieldValue();
		
		$.each($.map(values, function(el) {
			return !!el.match(/^ *$/)
		}), function (i, bool) {
			empty = empty || bool;
		});
		
		return (values.length == 0) || empty;
	}
});
//$/cmignore
