/* Create answer_ sliders */
var subnav_sections;

window.onload = function()
{
	subnav_sections = new Sliders('category_');
	
	if (subnav_sections.elements.length > 0) {
		if (close_elements.length > 0) {
			subnav_sections.closeElements(close_elements);
		} else {
			subnav_sections.closeAll();
		}
	}
}

function toggleSubnavSection(key)
{
	elementId = 'category_' + key;
	divId     = 'toggle_link_' + key;
	
	subnav_sections.toggleElement(elementId);
	toggleDivIcon(divId);
	
	/* Prevent links from being followed */
	return false;
}

function toggleDivIcon(divId)
{
	var div = document.getElementById(divId);
	
	if (div == null) {
		return;	
	}
	
	var current_class = div.className;
	
	if (current_class == 'view_more_items') {
		div.className = 'view_less_items';
	} else {
		div.className = 'view_more_items';
	}
}