// Allow presentation location to be displayed

"use strict";

// open anonymous function
(function()
{
	var is_visible = false;

	function toggle()
	{
		this.firstChild.nodeValue = 
			is_visible ? "Hide Locations" : "View Locations";
	
		// set display of all submenus
		var ulList = document.getElementsByTagName('ul');
		
		for (var ul_num = 0; ul_num < ulList.length; ul_num++)
			if (ulList[ul_num].className == 'location')
				ulList[ul_num].style.display = is_visible ? "block" : "none";
	
		is_visible = !is_visible;
	
		this.blur();
	
		return false;
	}

	var toggle_location = document.getElementById('toggle-location');
	// no location, exit
	if (!toggle_location)
		return;

	// Create text child
	if (!toggle_location.firstChild)
		toggle_location.appendChild(document.createTextNode(""));

	toggle_location.onclick = toggle;

	// disable location display on startup by simulating toggle_location.onclick()
	toggle.call(toggle_location);

// close anonymous function
})();

