function Disclosure(parentElement)
{
	this.ParentElement = parentElement;
	this.TitleElement = this.ParentElement.children[0];
	this.TitleElement.NativeObject = this;
	this.TitleElement.addEventListener("click", function(e)
	{
		this.NativeObject.toggleExpanded();
		e.preventDefault();
		e.stopPropagation();
		return false;
	});
	
	this.getExpanded = function()
	{
		return System.ClassList.Contains(this.ParentElement, "uwt-expanded");
	};
	this.setExpanded = function(value)
	{
		if (value)
		{
			System.ClassList.Add(this.ParentElement, "uwt-expanded");
		}
		else
		{
			System.ClassList.Remove(this.ParentElement, "uwt-expanded");
		}
	};
	this.toggleExpanded = function()
	{
		this.setExpanded(!this.getExpanded());
	};
}
window.addEventListener("load", function(e)
{
	var items = document.getElementsByClassName("uwt-disclosure");
	for (var i = 0; i < items.length; i++)
	{
		items[i].NativeObject = new Disclosure(items[i]);
	}
});