var resizeDiv, currentHeight, increment, target, timer;

function displayPage(id)
{
	hideAllPages();
	var a = document.getElementById(id + "_heading");
	a.id = id + "_heading_sel";
	a.className = "heading_sel";
	a.blur();
	var div = document.getElementById(id + "_content");
	div.style.display = "";
	div.style.overflow = "hidden";
	var height = div.offsetHeight;
	resizeDiv = div;
	resizeDiv.style.height = "0px";
	increment = height / 10;
	target = height;
	currentHeight = 0;
	timer = setInterval("resize()", 25);
}

function hidePage(id)
{
	var div = document.getElementById(id + "_content");
	div.style.display = "none";
	var a = document.getElementById(id + "_heading_sel");
	if (a)
	{
		a.id = id + "_heading";
		a.className = "heading";
	}
}

function resize()
{
	currentHeight += increment;
	currentHeight = Math.min(currentHeight, target);
	resizeDiv.style.height = currentHeight + "px";
	if (currentHeight == target)
	{
		clearInterval(timer);
		resizeDiv.style.height = "auto";
	}
}

function hideAllPages()
{
	hidePage("dj");
	hidePage("karaoke");
	hidePage("gossip");
	hidePage("booking");
}