// Extend jQuery to include functions for disabling, enabling, and unchecking groups of objects.
jQuery.fn.extend({
	/**
	 * disable
	 *
	 * Disable the specified element(s)
	 */
	disable: function() {
		return this.each(function() {this.disabled = true;})
	},
	/**
	 * enable
	 *
	 * Enable the specified element(s)
	 * @param boolean enable - default = true
	 */
	enable: function(enable) {
		return this.each(function() {
			enable = typeof(enable) == 'undefined' ? true : enable;
			this.disabled = !enable;
		});
	},
	/**
	 * uncheck
	 *
	 * Uncheck the specified element(s)
	 */
	uncheck: function() {
		return this.each(function() {this.checked = false;});
	},
	/**
	 * check
	 *
	 * Check the specified element(s)
	 * @param boolean check - default = true
	 */
	check: function(check) {
		return this.each(function() {
			this.checked = typeof(check) == 'undefined' ? true : check;
		});
	},
	/**
	 * display
	 *
	 * Display or hide selected object(s) based on a boolean value
	 * @param boolean display - default true
	 */
	display: function(display) {
		return this.each(function() {
			if (typeof(display) == 'undefined' || display) {
				$(this).show()
			}
			else {
				$(this).hide()
			}
		}
	)}
});

// Extend javascript prototypes to include useful functions
String.prototype.ucFirst = function () {
	return this.substr(0,1).toUpperCase() + this.substr(1,this.length);
};
