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

function toggle(el)
{
	if(rendered(el)) {
		baseExpand(el.getAttribute("id"),400,0,100,0);
		//el.style.display='none';
	}else{
		//el.style.display='block';
		baseExpand(el.getAttribute("id"),0,400,100,1);
	}
}

function rendered(el)
{
	return el.style.height=="400px";
}

function baseExpand(id,from,to,time,expandType)
{
	var el=getEl(id);
	var pas=40;
	if(expandType==1)
	{
		from=from+pas;
		el.style.height=from+"px";
		if(from<to)
		{
			setTimeout("baseExpand('"+id+"',"+from+","+to+","+time+","+expandType+")",time);
		}
	}else if(expandType==0){
		from=from-pas;
		el.style.height=from+"px";
		if(from>to)
		{
			setTimeout("baseExpand('"+id+"',"+from+","+to+","+time+","+expandType+")",time);
		}
	}
}