
function JCMenu(sOpenedSections)
{
	this.oSections = {};

	var aSect = sOpenedSections.split(',');
	for(var i in aSect)
		this.oSections[aSect[i]] = true;

	this.ToggleDiv = function(div)
	{
		var style = document.getElementById(div).style;
		if (style.display!="none")
			style.display = "none";
		else
			style.display = "block";
		return (style.display != "none");
	}

	this.ToggleSection = function(cell, div_id, level)
	{
		if (this.ToggleDiv(div_id))
		{
			this.oSections[div_id] = true;
			cell.className='chapter signminus';
			cell.title = messExpand;
		}
		else
		{
			this.oSections[div_id] = false;
			cell.className='chapter signplus';
			cell.title = messHide;
		}
			

		var sect='';
		for(var i in this.oSections)
		if(this.oSections[i] == true)
			sect += (sect != ''? ',':'')+i;
		document.cookie = "LEARN_MENU_"+COURSE_ID+"=" + sect + "; expires=Thu, 31 Dec 2020 23:59:59 GMT; path=/;";
	}
}
