
var currentSection;

function showSection(initialChar, fileName)
{
	if (bShowAll)
	{
		var url;
		
		if (fileName != "")
			url = fileName + "#" + initialChar;
		else
			url = "#" + initialChar;
			
		document.location.href = url;
	}
	else
	{
		if (currentSection == null)
		{
			var charArray = initialsList.split("|");

			currentSection = charArray[0];
		}
			
		// hide old section
		var div = document.getElementById("char_" + currentSection);
		div.style.display = "none";
		// show new section
		div = document.getElementById("char_" + initialChar);
		div.style.display = "block";
		
		currentSection = initialChar;
	}
}

function switchViewMode(bAll)
{
	var charArray = initialsList.split("|");
	
	for (i=0; i < charArray.length; i++)
	{
		// show new section
		div = document.getElementById("char_" + charArray[i]);
		
		if (div != null)
		{
			if (bAll)
				div.style.display = "block";
			else	
				div.style.display = "none";
		}
	}
	
	// change button style
	if (bAll)
	{
		currentSection = null;		
	}
	else
	{
		div = document.getElementById("char_" + charArray[0]);
		if (div != null)
		{
			div.style.display = "block";
			currentSection = charArray[0];
		}
	}
	bShowAll = bAll;
	
}