/*

function get_style(obj,atr) --- programmed by Tyron Montgomery on 03 June 2010 --- last modified on 03 June 2010

This functions gets the value of a style attribute (atr) of an object (obj).
There is some basic error checking, but the function does not return any error values:
If the object does not exist or if the attribute string is empty or if no style value could be retreived an empty string is returned.

Firefox, safari and Chrome use window.getComputedStyle to determine style settings at runtime. Internet Explorer uses obj.currentStyle.
Opera knows both, but doesn't understand obj.currentStyle.getAttribute(atr). That's why window.getComputedStyle must be checked first in the if-statement! 

*/

function get_style(obj,atr)
	{
	if (!obj || atr == "") return "";
	
	var sty = "";
	if (window.getComputedStyle) sty = window.getComputedStyle(obj, null).getPropertyValue(atr);
	else if (obj.currentStyle) sty = obj.currentStyle.getAttribute(atr);
	return sty;
	}
	

//-------------------------------------------------------------------------------------------------------------

	
function toggle_subnav(x)
	{
	var sn = document.getElementById("subnav" + x);
	if (!sn) return;
	
	var cs = get_style(sn,"display");	
	if (cs != "inline")
		{
		sn.style.display = "inline";
		}
	else sn.style.display = "none";
	}
