if (!document.getElementById)
    document.getElementById = function() { return null; }

menu_status = new Array();

function menuselect_new()
{	var menuid = readCookie('menuid'); //document.cookie;
	if (menuid  != '')
	{	showHide(menuid);
		//showHide(document.cookie);
		//alert('== nothing: '+menuid);
	}
	//else alert('somthing? '+menuid);
	
}

function showHide_new(theid)
{   //document.cookie = theid;
	createCookie('menuid',theid,0)
	if (document.getElementById) 
	{   var switch_id = document.getElementById(theid);
		if(menu_status[theid] != 'show') 
        {  switch_id.className = 'show';
           menu_status[theid] = 'show';
        }else
        {  switch_id.className = 'hide';
           menu_status[theid] = 'hide';
           //document.cookie = "";
           eraseCookie('menuid')
}   }	}

//-Cookie Functions Begin------------------------------------------------------

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}
//-Cookie Functions End ------------------------------------------------------


function showHide(theid)
{   document.cookie = theid;
        	if (document.getElementById) 
	{   var switch_id = document.getElementById(theid);
		if(menu_status[theid] != 'show') 
        {  switch_id.className = 'show';
           menu_status[theid] = 'show';
        }else
        {  switch_id.className = 'hide';
           menu_status[theid] = 'hide';
           document.cookie = "";
}   }	}


function menuselect()
{	var menuid = document.cookie;
	if (menuid  != '')
	{	
		showHide(document.cookie);
}	}

function menuselect_Advisors(theid)
{	//alert("menuselect_Advisors function entry point");
    var menuid = document.cookie;
	if (menuid  != '')
	{	
		showHide(document.cookie);		
    }	

	//alert("menuselect_Advisors function popout point");
	
	document.cookie = theid;
	    var switch_id = document.getElementById(theid);
		   switch_id.className = 'hide';
           menu_status[theid] = 'hide';
           document.cookie = "";	
		
}


