function Stack(id)
{
	this.stack = document.getElementById(id);
	this.titles = new Array();
	this.items = new Array();

	if (arguments[1])
		curElemNum = arguments[1];
	else
		curElemNum = 0;

	function set(e, obj)
	{
		obj.stack.oldElem = obj.stack.curElem;
		obj.stack.curElem = obj.stack.items[obj.n];

		obj.stack.oldTitle = obj.stack.curTitle;
		obj.stack.curTitle = obj.stack.titles[obj.n];

		if (obj.stack.oldElem != obj.stack.curElem)
		{
			new YAHOO.widget.Effects.Appear(obj.stack.curElem, { seconds: 0.8 });
			//obj.stack.curElem.style.display = 'block';
			new YAHOO.widget.Effects.Fade(obj.stack.oldElem, { seconds: 0.8 });
			new YAHOO.widget.Effects.BlindDown(obj.stack.curElem, { seconds: 0.8 });
			new YAHOO.widget.Effects.BlindUp(obj.stack.oldElem, { seconds: 0.8 });

			obj.stack.oldTitle.className = 'closed';
			obj.stack.curTitle.className = '';
		}
	}

	var elems = this.stack.childNodes;

	for (var i = 0; i < elems.length; i++)
	{
		if (elems[i].tagName == 'DIV')
		{
			this.items.push(elems[i]);

			if (this.items.length - 1 != curElemNum)
				elems[i].style.display = 'none';
		}
		else if (elems[i].tagName == 'H3')
		{
			this.titles.push(elems[i]);
			elems[i].className = 'closed';
			YAHOO.util.Event.addListener(elems[i], 'click', set, {stack: this, n: this.items.length});
		}
	}

	this.curTitle = this.titles[curElemNum];
	this.oldTitle = this.curTitle;
	this.curElem = this.items[curElemNum];
	this.oldElem = this.curElem;

	this.curTitle.className = 'selected';
}

