// ############################################################################
// ##  Used for loading an external html file and imbeding it in a DIV or SPAN
// ##  element with a specified ID value.
// ############################################################################
// ##  Parameters: id  - The id attribute value of the element to load external
// ##                    content into.
// ##              url - The url for the external content to be loaded.
// ############################################################################
function ClientSideInclude(id, url) 
{
	var req = false;
	// For Safari, Firefox, and other non-MS browsers
	if (window.XMLHttpRequest)
	{
		try
		{
			req = new XMLHttpRequest();
		}
		catch (e)
		{
			req = false;
		}
	}
	else if (window.ActiveXObject)
	{
		// For Internet Explorer on Windows
		try
		{
			req = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e)
		{
			try
			{
				req = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e)
			{
				req = false;
			}
		}
	}
	
	var element = document.getElementById(id);
	
	if (!element)
	{
		alert("Bad id " + id + " passed to clientSideInclude. You need a DIV or SPAN element with this id in your page.");
		return;
	}
	
	if (req)
	{
		// Synchronous request, wait till we have it all
		req.open('GET', url, false);
		req.send(null);
		element.innerHTML = req.responseText;
	} 
	else
	{
		element.innerHTML =
			"Sorry, your browser does not support XMLHTTPRequest objects. " +
			"This page requires Internet Explorer 5 or better, or Firefox for any system, or Safari. " +
			"Other compatible browsers may also exist.";
	}
}


// ############################################################################
// ##  Changes the CSS layout options for an element.
// ############################################################################
// ##  Parameters: element    - The id value of the element to modify.
// ##              styleValue - The Display style value to apply.
// ##                           block, none
// ############################################################################
function SetLayerDisplayStyle(element, styleValue)
{
	var style2;
	
	if (document.getElementById)
	{
		// this is the way the standards work
		style2 = document.getElementById(element).style;
	}
	else if (document.all)
	{
		// this is the way old msie versions work
		style2 = document.all[element].style;
	}
	else if (document.layers)
	{
		// this is the way nn4 works
		style2 = document.layers[element].style;
	}
	
	style2.display = styleValue; //style2.display ? "" : "block";
}


function ShowMenu(targetMenu, currentMenu)
{
	SetLayerDisplayStyle(currentMenu, 'none');
	SetLayerDisplayStyle(targetMenu, 'block')
}









// ############################################################################
// ##  
// ############################################################################
// ##  
// ############################################################################
