/* ===================================================================================================
 * groupBoxControl
 * ===================================================================================================
 */
 
/// jsonParameters
/// { fullControlName: <string>,
///   text: <string>,
///   visible: "0" | "1"
///   description: <columnDescriptor>
/// }
function groupBoxControl_Initialize(jsonParameters)
{
	//alert(typeof jsonParameters);
	var P = parseParameters(jsonParameters);
	var c = getControl(P.fullControlName);
	c.description = P.description;
	c.style.visibility = P.visible && parseIntEx(P.visible) ? "inherit" : "hidden";
	groupBoxControl_setup(c, P.text);
}

function groupBoxControl_Update(jsonParameters)
{
	var P = parseParameters(jsonParameters);
	var c = getControl(P.fullControlName);
	c.style.visibility = P.visible && parseIntEx(P.visible) ? "inherit" : "hidden";
	groupBoxControl_setText(c, P.text);
}

/// cell: html-div-Element
/// descr: <columnDescriptor>
function groupBoxControl_setup(cell, txt)
{
	var descr = cell.description;
	switch(descr.inputType)
	{
		case "Label_Right":
			cell.style.justifyContent = "end";
			break;
		case "Label_Center":
			cell.style.textAlign = "center";
			break;
		default:
			cell.style.justifyContent = "start";
			break;
	}
	groupBoxControl_setText(cell, txt);
};

function groupBoxControl_setText(cell, txt)
{
	cell.innerText = txt;
	cell.innerHTML += "<hr>";
	cell.title = txt;
};
