function doSlide(objId, textId, duration, curHeight, newHeight)
{
	// Running at 30 fps
	var frames = 30 * duration; 

	// time increment in miliseconds
	var tIncrement = (duration*1000) / frames;
	tIncrement = Math.round(tIncrement);
	
	// 
	var sIncrement = (curHeight-newHeight) / frames;

	var frameSizes = new Array();
	var i;
	for(i=0; i < frames; i++) {
		if(i < frames/2) {
			frameSizes[i] = (sIncrement * (i/frames))*4;
		} else {
			frameSizes[i] = (sIncrement * (1-(i/frames)))*4;
		}
	}
			
	for(i=0; i < frames-1; i++) {
		curHeight = curHeight - frameSizes[i];
		window.setTimeout("document.getElementById('"+objId+"').style.height='"+Math.round(curHeight)+"px';",tIncrement * i);
	}
	if (frames > 0)
	{		
		window.setTimeout("document.getElementById('"+objId+"').style.height='"+Math.round(newHeight)+"px';",tIncrement * i);
	}
	
	if (curHeight < newHeight)
		window.setTimeout("document.getElementById('"+textId+"').innerHTML='Less';", duration*1000);
	else
		window.setTimeout("document.getElementById('"+textId+"').innerHTML='More';", duration*1000);
				
	return tIncrement * i;	
}	

function Slide(objId, textId, duration, shortHeight, fullHeight)
{	
	var height = parseInt(document.getElementById(objId).style.height);		
	if (height <= shortHeight)
		doSlide(objId, textId, duration, height, fullHeight);
	else if (height >= fullHeight)
		doSlide(objId, textId, duration, height, shortHeight);
}
