var slidVitesse = 2;
var deltaPx = 5;

function slidDown(id)
{
	var elem = $(id);
	var height = elem.offsetHeight;
	
	elem.style.overflow = 'hidden';
	elem.style.position = 'relative';
	elem.style.height = height +'px';
	
	changeHeight(id, height, '-');
}

function slidUp(id)
{
	var elem = $(id);
	var height = elem.offsetHeight;
	
	elem.style.overflow = 'hidden';
	elem.style.position = 'relative';
	elem.style.height = height +'px';
	
	changeHeight(id, height, '+');
}

function changeHeight(id, nextHeight, operation)
{
	$(id).style.height = nextHeight +'px';
	eval('nextHeight '+ operation +'= '+ deltaPx);
	
	if ( operation == '-' && nextHeight > -5 || operation == '+' && nextHeight < $(id).scrollHeight)
	{
		if ( operation == '-' && nextHeight < 0)
			nextHeight = 0;
		else if ( operation == '+' && nextHeight > $(id).scrollHeight)
			nextHeight = $(id).scrollHeight;
			
		setTimeout("changeHeight('"+ id +"', "+ nextHeight +", '"+ operation +"');", slidVitesse);
	}
}

function $(id)
{
	return document.getElementById(id);
}