var menuArray = new Array();

function showObj(thisObj)
{
	findObj(thisObj).style.display='';
	findObj(thisObj).style.visibility = 'visible';
}
function hideObj(thisObj)
{
	findObj(thisObj).style.display='none';
	findObj(thisObj).style.visibility = 'hidden';
}
function isCurrentMenu(thisObj)
{
	return (findObj(thisObj).style.visibility == 'visible');
}
function findObj(n, d) { //v4.01
  var p,i,x;  
  if(!d) d=document; 
  //if((p=n.indexOf("?"))>0&&parent.frames.length) {
   // d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
  // }
  if(!(x=d[n])&&d.all) x=d.all[n]; 
  
  //for (i=0;!x&&i<d.forms.length;i++) 
  //	x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) 
  	x=findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function initMenu(thisMenuArray)
{
	queryString	=	new obj_queryString();
	menuArray = thisMenuArray;
	hideWholeMenu();
	if (queryString["menu"]!=null && queryString["menu"]!="")
	{
		openMenu(queryString["menu"])
	}
	choice = "";
}
function openMenu(menuName)
{

	if (isCurrentMenu(menuName))
	{
		hideWholeMenu();
	} else {

		hideWholeMenu();
		showObj(menuName);
	}
}
function hideWholeMenu()
{
	
	for (i=0; i<menuArray.length; i++)
	{
		hideObj(menuArray[i]);
	}
}
// Query String Operation
function obj_queryString()
{
    qs = document.location.href.substring(document.location.href.indexOf('?')+1,document.location.href.length);
    queries=qs.split(/\&/);
    for(i=0;i<queries.length;i++)
    { 
		query=queries[i].split(/\=/);
		this[query[0]]=unescape(query[1]);
    }
}
// Open new Windows
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}