
var nav = {
	currentSection: 0,
	currentPage: 0,
	setCurrentSection: function (sectionNumber)
	{		
		var obj = document.getElementById('nav' + sectionNumber);

		if(obj)
		{
			this.currentSection = sectionNumber;
			obj.className = "sectionSelected";
			this.showSection(sectionNumber);
		}
	},
	setCurrentPage: function (pageNumber)
	{
		var node;
		var currentLi = 0;
		var section = document.getElementById('navLevel2_' + this.currentSection);

		if(section)
		{
			for (i=0; i<section.childNodes.length; i++)
			{
				node = section.childNodes[i];
				if (node.nodeName=="LI") 
				{
					currentLi++;
					if(currentLi == pageNumber)
					{
						node.className = "selected";
					}
				}
			}
			this.currentPage = pageNumber;
		}
	},		
	showSection: function (sectionNumber)
	{
		var selectedSection = document.getElementById('navLevel2_' + sectionNumber);
		if(selectedSection)
		{
			this.hideAllSections();
			selectedSection.style.className = "selected";
			selectedSection.style.display = 'block';
		}
	},
	hideAllSections: function ()
	{
		var hideSection;
		for(x=2;x<6;x++)
		{
			hideSection = document.getElementById('navLevel2_' + x);
			if(hideSection)
			{
				hideSection.style.display = 'none';
				hideSection.style.className = "selected";
			}
		}
	}		
};
