function calculateBoxHeight(box_id, row_id, height, count)
{
	if(document.getElementById(box_id))
	{
		var box = document.getElementById(box_id);
		var hstr=String(height);
		var sb=parseInt(hstr.substr(0,hstr.length-2));
		var se=parseInt(hstr.substr(hstr.length-2,2));
		if (se>50) height=parseInt(sb+'90');
		else height=parseInt(sb+'40');
		while(box.offsetHeight > height && count > 0)
		{
			var row = document.getElementById(row_id+'_'+count);
			if(row != null)
				box.removeChild(row);
			if (document.getElementById(row_id+'_separator_'+(count-1)) != null)
				box.removeChild(document.getElementById(row_id+'_separator_'+(count-1)));

			count--;
		}
		box.parentNode.style.height=height+'px';
	}
}
