//
// javascript/viewRosters.js
//

function updateGroupCheckBoxes(groupId, parentGroupIds, childrenGroupIds)
{
	var i;
	var curGroupId;
	if(document.getElementById("group-"+groupId).checked)
	{
		// check all children if group is checked
		var children = childrenGroupIds.split("|");
		for(i=0; i<children.length; i++)
		{
			curGroupId = children[i];
			document.getElementById("group-"+curGroupId).checked = 1;
		}
	}
	else
	{
		// uncheck group's parents if it is unchecked
		var parents = parentGroupIds.split("|");
		for(i=0; i<parents.length; i++)
		{
			curGroupId = parents[i];
			document.getElementById("group-"+curGroupId).checked = 0;
		}
	}
}

