function slider(divContainerID,totalElement,expandElementNumber)
{
	divContainer = $(divContainerID);
	divContainer.totalElement = totalElement;
	for(i=0;i<divContainer.totalElement;i++)
	{
		contentElement = $(divContainerID+""+i+"content");
		contentElement.maxHeight = contentElement.offsetHeight;
		if(i==expandElementNumber)
		{
			contentElement.style.height = contentElement.maxHeight+"px";
			contentElement.style.opacity = 1;
			contentElement.style.filter = "alpha(opacity=100)";
			contentElement.style.display = "block";
		}
		else
		{
			contentElement.style.height = "0px";
			contentElement.style.opacity = 0;
			contentElement.style.filter = "alpha(opacity=0)";
			contentElement.style.display = "none";
		}
		contentElement.timer = "";
		contentElement.elementID = i;
		
		headerElement = $(divContainerID+""+i+"header");
		headerElement.elementID = i;
		headerElement.onclick = function()
		{
			for(j=0;j<this.parentNode.totalElement;j++)
			{
				content = $(divContainerID+""+j+"content");
				clearInterval(content.timer);
				if(j==this.elementID)
					content.timer = setInterval("slide('"+content.id+"',1)",30);
				else
					content.timer = setInterval("slide('"+content.id+"',-1)",30);
			}
		}
	}
}

function slide(elementID,direction)
{
	element = $(elementID);
	element.style.display = "block";
	currentHeight = parseInt(element.style.height);
	if(isNaN(currentHeight)){currentHeight=0;}
	maxHeight = element.maxHeight;
	dist = (direction==1)?Math.round((maxHeight-currentHeight)/5):Math.round(currentHeight/5);
	element.style.height = (currentHeight + (dist*direction)) + "px";
	element.style.opacity = currentHeight/maxHeight;
	element.style.filter = "alpha(opacity="+(currentHeight*100/maxHeight)+")";
	if(dist<0.5)
	{
		if(direction==1){ element.style.height = maxHeight+"px";}
		else{ element.style.height = "0px"; element.style.display = "none"; }
		clearInterval(element.timer);
		element.style.removeAttribute("filter");
	}
}