

// --- ROUNBOX --------------------------------------------------------------------------------------------------------------- //



function RB_GetObject(ControlName, PartName)
{
	return document.getElementById(ControlName + '-' + PartName);
}





function RB_Animate(ID, Step)
{
	var objBody = RB_GetObject(ID, 'body');
	var objClip = RB_GetObject(ID, 'clip');

	objBody.style.display = (Step == -1 ? 'none' : '');

	if (Step < -1 || Step > 1)
	{
		var Height = objBody.FullHeight * (Step > 0 ? 1-Step/128 : -Step/128);
		objBody.style.height = objClip.style.height = (Height > 1 ? Height : 1)
		objBody.style.paddingTop = objBody.style.paddingBottom = 8 * (Step > 0 ? 1-Step/128 : -Step/128);
		setTimeout("RB_Animate('" + ID + "'," + (Step/2) + ")", 30);
	}
	
	if (Step == 1)
	{
	    objBody.style.height = '';
	    objClip.style.height = '';
	    objBody.style.paddingBottom = 9;
	}



}

function RB_ChangeStatus(ID)
{
	var objBody = RB_GetObject(ID, 'body');
	var objClip = RB_GetObject(ID, 'clip');

	var OpenFlag = (objBody.style.display == '');
	if (!OpenFlag)
	{
		objBody.style.paddingTop = objBody.style.paddingBottom = 0;
		objBody.style.height = objClip.style.height = 1;
		objBody.style.display = '';
	}

	var objBodyBottom = RB_GetObject(ID, 'bodybottom');
	objBody.FullHeight = objBodyBottom.offsetTop - objBodyBottom.parentNode.offsetTop + 3;
	RB_Animate(ID, OpenFlag ? -128 : 128);
}

