// JavaScript Document
// this file holds the javascript functions responsible for hiding and displaying page elements

function hideAll(expander_id, no_of_categories)
	{
		for(var count = 0; count< no_of_categories; count++)
			{
				var element_id = expander_id+"_content_"+count;
				hideElement(element_id);
			}
	}
	
function toggleSingleDisplay(element_id, expander_id, no_of_categories)
	{
		var state_of_element_before_all_categories_closed = currentDisplayStatus(element_id);
		hideAll(expander_id, no_of_categories);
		(state_of_element_before_all_categories_closed == "none") ? unhideElement(element_id) : hideElement(element_id);
	}
	
function toggleMultipleDisplay(element_id)
	{
		var current_state_of_element = currentDisplayStatus(element_id);
		(current_state_of_element == "none") ? unhideElement(element_id) : hideElement(element_id);
	}
	
function currentDisplayStatus(element_id)
	{
		var current_display_state = document.getElementById(element_id).style.display;
		current_display_state = (current_display_state == "") ? "none" : current_display_state ;
		return current_display_state;
	}
	
function unhideElement(element_id)
	{
		document.getElementById(element_id).style.display = 'block';
	}
	
function hideElement(element_id)
	{
		document.getElementById(element_id).style.display = 'none';
	}
	
	

