jQuery.fn.htmlToggle = function(arg1, arg2) { 

	if(this.html()==arg2)
	{
		this.html(arg1);
		return '2';
	}
	else
	{
		this.html(arg2);
		return '1';
	}
}; 

jQuery.fn.htmlAddChange = function(element, value) { 

	if(!this.element)
	this.prepend('<div class="'+element+'"></div>');
	
	this.children('.'+element).html(value);
};


jQuery.fn.backgroundToggle = function() { 

	if(this.css('backgroundPosition')=='0px 100%')
	return this.css('backgroundPosition','0px 0px');
	else
	return this.css('backgroundPosition','0px 100%');
	
}; 

jQuery.fn.showError = function(text, button, Error) { 

	if(this.children().hasClass('.DeseoSelectContainer'))
	object = this.children('.DeseoSelectContainer').children('.DeseoSelectSpan');
	else
	object = this.parent();

	if(button==undefined) button = false;

	if(Error==false)
	{
		if(button==false)
		{
			this.parent().stop().prepend('<div class="error_text">' + text + '</div>').children('.error_text').animate({'opacity':'1.00'}, 6000).fadeOut('fast', function(){$(this).remove()});
		}
		else
		this.after('<div class="error_text">' + text + '</div>').next().animate({'opacity':'1.00'}, 4000).fadeOut('fast', function(){$(this).remove()});
		

		if(text.length > 55)
		{
			this.parent().children('.error_text').css('lineHeight', '16px');
		}
	}
	
	if(button==false)
	object.addClass('error');
}; 

jQuery.fn.hideError = function() { 
	this.parent().removeClass('error');
	this.parent().children('.error_text').stop().fadeOut('fast', function(){$(this).remove()});
}