var menu_numbers = 2;

var menu = new Array();
menu[0] = "introduction";
menu[1] =  "education";
menu[2] = 'working_groups';

var hide;

/*
		Function showMenu
		Shows a sub menu by setting
		its display property to "inline"
		and its visibility property to
		"visible"
		Parameters:
			Input: sub menu index of menu to display
			       must be 1+ menu array index of
			       sub menu to display
			Output: n/a
*/
function showMenu(on_menu_index)
{
	var obj;
	
	for(var x=0;x<menu.length;x++)
	{
		obj = getObjReference(menu[x]);
		
		if(testObject(obj))
		{
			if(x != (on_menu_index - 1))
			{	
				if(obj.display == "inline")
				{
					obj.display = "none";
					obj.visibility="hidden";
				}
			}
			else
			{
					if((location.href.indexOf("/rdp/index.asp") != -1) || (location.href.charAt(location.href.length - 1) == "/"))
					{
						obj.top = 247;
					}
					else
					{
						obj.top = 230;
					}
					obj.display = "inline";
					obj.visibility="visible";
			}
		}		
	}
		
}

/*
		Function turnTopMenu
		Changes the top menu link (on | off) 
		Parameters:
			Input: menu_name (name of menu to turn (on | off)
			       menu_src (image src to st the menu to (on | off image)
			Output: n/a
*/
function turnTopMenu(menu_name,menu_src)
{
	var menu_img_name = eval("document.images['" + menu_name + "_menu']");
	menu_img_name.src = menu_src.src;
}



/*
		Function hideMenu
		Hides a sub menu by setting
		its display property to "none"
		and its visibility property to
		"hidden"
		Parameters:
			Input: sub menu index of menu to hide
			       must be 1+ menu array index of
			       sub menu to hide
			Output: n/a
*/
function hideMenu(menu_id)
{
	var obj;

	obj = getObjReference(menu[(menu_id-1)]);
	if(testObject(obj))
	{
		//turnTopMenu(menu[(menu_id-1)],menu_imgs_off[(menu_id-1)]);
		obj.display = "none";
		obj.visibility = "hidden";	
	}
}

/*
		Function testObject
		Tests to determine if (Object reference) var is defined
		returns true if defined, false if undefined
		Parameters:
			Input: undefined or defined (object) var
			Output: boolean
*/
function testObject(cur_obj)
{
	if(cur_obj)
	{
		return true;
	}
	else
	{
		return false;
	}
}

/*
		Function getObjReference
		Establishes and returns a CSS Style Object Reference
		based on the user's browser
		Parameters:
			Input: object id for which to create an obj reference
			Output: obj reference to css tag with id specified
					by input object id
*/

function getObjReference(obj)
{
	var objReference;

	if(document.all)
	{
		objReference = eval("document.all." +obj +".style");
	}
	else if(document.getElementById)
	{
		// I.E. 5, Netscape 6.2
		objReference = eval("document.getElementById('" +obj + "').style");
	}

	return objReference;

}