function Errors(id, args)
{
	this.ID = id;
	this.Args = args;
	this.parent = $get(id);

	var self = this;
	$("div.button", this.parent).click(function() { self.Filter(this, this.getAttribute('type')); });

	this.Filter = function(btn, type) {
		$(btn).toggleClass('buttonHidden');
		$('div.' + type, this.parent).toggleClass('hidden');
	}

	this.Add = function(type, message) {
		$(".messages", this.parent).append("<div class='" + type + "'><span>" + message + "</span></div>");
		this.ShowHide();
	}

	this.Clear = function(type) {
		$(".messages ." + type, this.parent).remove();
		this.ShowHide();
	}

	this.ShowHide = function(msg) {
		if ($(".messages div").length > 0)
			$(this.parent).show();
		else
			$(this.parent).hide();
	}
}
