/**
 * @author Renaud
 */
(function($)
{
	$.fn.disable = function()
	{
		return this.each(function()
		{
			var oThis = $(this);
			if (oThis.hasClass('cheap_btn'))
				oThis.addClass('cheap_btn_disabled');
			oThis.addClass('disabled').attr('disabled', 'disabled');
		});
	};
	
	$.fn.enable = function(bCondition)
	{
		return this.each(function()
		{
			var oThis = $(this);
			if (bCondition == undefined || bCondition == true)
				oThis.removeClass('disabled cheap_btn_disabled').removeAttr('disabled');
			else
				oThis.disable();
		});
	};
})(jQuery);
