(function($) {
	/**
	 *  reset
	 *
	 *  Alfredo Cuellar - alfedo@i2we.com
	 *
	 *  $(selector_form).reset();
	 */
	$.fn.reset = function(){
		return this.each(function(){
			var type = this.type, tag = this.tagName.toLowerCase();
			if (tag == 'form')
				return $(':input',this).reset();
			if (type == 'text' || type == 'password' || tag == 'textarea')
				this.value = '';
			else if (type == 'checkbox' || type == 'radio')
				this.checked = false;
			else if (tag == 'select')
				this.selectedIndex = -1;
		});
	};

	/**
	 *  enable
	 *
	 *  Alfredo Cuellar - alfedo@i2we.com
	 *
	 *  $(selector).enable();
	 */
	$.fn.enable = function() {
		return this.each(function() {
			$(this).css({'opacity': 1});
			$(this).removeAttr("disabled");
		});
	};

	/**
	 *  disable
	 *
	 *  Alfredo Cuellar - alfedo@i2we.com
	 *
	 *  $(selector).disable();
	 */
	$.fn.disable = function() {
		return this.each(function() {
			$(this).css({'opacity': 0.7});
			$(this).attr("disabled", "disabled");
		});
	};

	/**
	 *  isDisabled
	 *
	 *  Alfredo Cuellar - alfedo@i2we.com
	 *
	 *  $(selector).isDisabled();
	 */
	$.fn.isDisabled = function() {
		return this.each(function() {
			if($(this).attr("disabled"))
				return true;
			else
				return false;
		});
	};

})(jQuery);

