var menuitems;		//Array to store the menu items
var submenuitems;		//Array to store the submenu items, this will be followed by itemname and 1, 2, 3, etc

//frame height
function set_hgt(dblHeight)
{
		var cmt = document.getElementById('ifrm');
		cmt.height=dblHeight;
		var cmt = document.getElementById('frm');
		cmt_height=dblHeight;
}


//function adjustframeheight()
//{
//var cmt = document.getElementById('ifrm');
//dblWidth=document.frames[0].document.body.scrollWidth;
//dblHeight=document.frames[0].document.body.scrollHeight;
//cmt.height=dblHeight;
//cmt.width=dblWidth;
//}

function adjustframeheight()
{
if(navigator.appName.indexOf("Microsoft Internet")<0)
 {
	dblWidth=document.getElementById('ifrm').contentWindow.document.width
	dblHeight=document.getElementById('ifrm').contentWindow.document.height
 }
else
 {
	dblWidth=document.frames[0].document.body.scrollWidth;
	dblHeight=document.frames[0].document.body.scrollHeight;
 }
var cmt = document.getElementById('ifrm');
cmt.height=dblHeight;
cmt.width=dblWidth;
}

function hideall(){

	//First set everything to a block element (for firefox)
	var arallmenuitems=allmenuitems.split(",")
	for(i=0;i<arallmenuitems.length;i++)
	{
	 var ob=document.getElementById(arallmenuitems[i])
	 ob.style.display='block'
	}

if(!menuitems=="")
{

//Get the element IDs stored in the two variables, load it in an array, then start hiding each element (first the main menus, and then the submenus
	var arMenus=menuitems.split(",")
	for(i=0;i<arMenus.length;i++)
		{
		var ob=document.getElementById(arMenus[i])
		ob.style.display='none'
		}
}

if(!submenuitems=="")
{
	var arMenus=submenuitems.split(",")
	for(i=0;i<arMenus.length;i++)
	hidesublinks(arMenus[i])

}
}


function hidesublinks(strID){
var i=1;
var ob=document.getElementById(strID+i)

//See the showsublinks function for further documentation
while(ob){
	ob.style.display='none';
	i++;
	var ob=document.getElementById(strID+i);
	}
}

function showsublinks(strID){
var i=1;

//Just add 1, 2, 3, etc. and go on to display the sublinks.  If an error occurs/object is invalid, exit from the loop
var ob=document.getElementById(strID+i)
while(ob){
	ob.style.display='block';
	i++;
	var ob=document.getElementById(strID+i);
	}
}

function showall2()
{
hideall();


	for(i=0;i<arguments.length;i++)
		{
		//Each argument is an element ID. If it is an object, try displaying it.  Else, go on to display the sublinks

		var ob=document.getElementById(arguments[i])
		if(ob){	ob.style.display='block'} 	//Display if this is a valid ID
		showsublinks(arguments[i])  		//Display all the subitems, adding 1, 2, 3, etc. with the parameter
		}
}