
function initMenu(menuid){
/*
// this will open an entire tree of menus from root to menuid

	var parent,img,imgsrc;
	inimenuid= menuid;

	while (menuid && menuid != "0" && menuid != "%menuid%")
	{

		name = theMenu[theMenuId[menuid]][2];
		icosel="";
		if (menuid==inimenuid) { icosel	= "_sel"; } else icosel	= "_exp";

// change div
		if (MM_findObj('menu_div_'+menuid)!="null")	MM_showHideLayers2('menu_div_'+menuid,'','show');

// change image
		MY_swapImage('menu_'+name ,'/img/menu_'+name+icosel+'.gif');

// change control

		img=MM_findObj('menu_control_'+menuid);

		if (img!= null) len= img.src.length;

		if ((img !=null)&&(img.src.substring(len-12,len+1)=="_default.gif"))	{
			MY_swapImage('menu_control_'+menuid ,'/img/menu_control0_default_sel.gif');
			}
		else
			MY_swapImage('menu_control_'+menuid ,'/img/menu_control'+icosel+'_minus.gif');

		parent = theMenu[theMenuId[menuid]][1];
		menuid = parent;
		if (menuid!=0) name = theMenu[theMenuId[menuid]][2];

	}
/**/

}




function closeLeafs (menuid) {

/*
	var obj, parent, testparent, testid;
	
	// close all leafs on same level

	parent = theMenu[theMenuId[menuid]][1];

	for (i=1; i<=theMenuSize; i++) {
	testid		= theMenu[i][0];
	testparent	= theMenu[i][1];
	testname	= theMenu[i][2];

	icosel="";
	if (testid==selectedMenu) { icosel	= "_sel"; };

		if ((testparent == parent) && (testid != menuid))
		{
				obj=MM_findObj('menu_div_'+testid);

				if (obj!=null) {	
					
					if (obj.style) {obj=obj.style;}
					obj.display = 'none';
					// change tree control image [+/-]
					MY_swapImage('menu_control_'+testid ,'/img/menu_control'+icosel+'_plus.gif');
					if (obj.display=='block')	{ icosel="_exp";	}
					MY_swapImage('menu_'+testname,'/img/menu_'+testname+icosel+'.gif');
				}
		}
	}
// end close leafs
/**/
}

function closeMenus () {

	var obj, parent, testparent, testid;
	
	// close all leafs on same level

	for (i=1; i<=theMenuSize; i++) {
	testid		= theMenu[i][0];
	testparent	= theMenu[i][1];
	testname	= theMenu[i][2];

	icosel="";
	if (testid==selectedMenu) { icosel	= "_sel"; };

	obj=MM_findObj('menu_div_'+testid);

	if (obj!=null) {
					
					if (obj.style) {obj=obj.style;}
					obj.display = 'none';
					// change tree control image [+/-]
					MY_swapImage('menu_control_'+testid ,'/img/menu_control'+icosel+'_plus.gif');
					if (obj.display=='block')	{ icosel="_exp";	}
					MY_swapImage('menu_'+testname,'/img/menu_'+testname+icosel+'.gif');
	}
	}
// end close all
/**/
}

function toggle(menuid, name) {

	var obj, parent, testparent, testid;
		
	obj=MM_findObj('menu_div_'+menuid);
    if (obj.style) { obj=obj.style;}


if (obj.display=='block')
	{
	// HIDE ==============================================================================
		obj.display = 'none';

		if (menuid==selectedMenu) { icosel	= "_sel"; } else icosel="";
		// change menu image [+/-]
		MY_swapImage('menu_'+name ,'/img/menu_'+name+icosel+'.gif');
		// change tree control image [+/-]
		MY_swapImage('menu_control_'+menuid ,'/img/menu_control'+icosel+'_plus.gif');
	}

		else
	{
	// SHOW ==============================================================================
		obj.display = 'block';

		if (menuid==selectedMenu) { icosel	= "_sel"; } else icosel="_exp";
		// change menu image [+/-]
		MY_swapImage('menu_'+name ,'/img/menu_'+name+icosel+'.gif');
		// change tree control image [+/-]
		MY_swapImage('menu_control_'+menuid ,'/img/menu_control'+icosel+'_minus.gif');

		closeLeafs(menuid);

	}

}



function openMenu(menuid,name){

// this will open an entire tree of menus from root to menuid

// change ico
//	MY_swapImage('menu_ico_'+name ,'/img/menu_ico_'+name+'_on.gif');

	var parent,img,imgsrc;
	inimenuid= menuid;	

	i=0;
	while (menuid && menuid != "0")
	{
		i++;

		icosel="";
		if (menuid==selectedMenu) { icosel	= "_sel"; }
		else
		if (menuid!=inimenuid)  { icosel	= "_exp"; }

// change images
		if (menuid!=inimenuid)
		{
		if (MM_findObj('menu_div_'+menuid)!="null")	MM_showHideLayers2('menu_div_'+menuid,'','show');
		MY_swapImage('menu_control_'+menuid ,'/img/menu_control'+icosel+'_minus.gif');
		MY_swapImage('menu_'+name ,'/img/menu_'+name+icosel+'.gif');
		}
		else
		{
		MY_swapImage('menu_'+name ,'/img/menu_'+name+icosel+'_on.gif');
		}

		parent = theMenu[theMenuId[menuid]][1];
		menuid = parent;
		if (menuid!=0) name = theMenu[theMenuId[menuid]][2];

	}
/**/

}



function closeMenu(menuid,name){

// this will open an entire tree of menus from root to menuid

	var parent,img,imgsrc;

// restore ico

//	MY_swapImage('menu_ico_'+name ,'/img/menu_ico_'+name+'.gif');

	while (menuid && menuid != "0")
	{

		icosel="";
		if (menuid==selectedMenu) { icosel	= "_sel"; };


		if (MM_findObj('menu_div_'+menuid)!="null")	MM_showHideLayers2('menu_div_'+menuid,'','hide');
		MY_swapImage('menu_'+name ,'/img/menu_'+name+icosel+'.gif');
		// change images

		if (menuid!=inimenuid)
		{
		MY_swapImage('menu_control_'+menuid ,'/img/menu_control'+icosel+'_plus.gif');
		}

		parent = theMenu[theMenuId[menuid]][1];
		menuid = parent;
		if (menuid!=0) name = theMenu[theMenuId[menuid]][2];

	}
}





function selectMenu(menuid,name){
/*
// onMouseOver this will mark the menuid as ON

// change ico
//	MY_swapImage('menu_ico_'+name ,'/img/menu_ico_'+name+'_on.gif');
	
	icosel="";
	if (menuid==selectedMenu) { icosel	= "_sel"; }

	img=MM_findObj('menu_'+name);
	len= img.src.length;
	if (img.src.substring(len-8,len+1)=="_exp.gif")	{icosel	= "_exp";}
	if (img.src.substring(len-8,len+1)=="_sel.gif")	{icosel	= "_sel";}

// change image
	MY_swapImage('menu_'+name ,'/img/menu_'+name+icosel+'_on.gif');
/**/
}


function deselectMenu(menuid,name){
/*
// onMouseOver this will mark the menuid as ON

// change ico
//	MY_swapImage('menu_ico_'+name ,'/img/menu_ico_'+name+'.gif');
	
	icosel="";
	if (menuid==selectedMenu) { icosel	= "_sel"; }

	img=MM_findObj('menu_'+name);
	len= img.src.length;

	if (img.src.substring(len-8,len+1)=="_exp.gif")	{icosel	= "_exp";}
	if (img.src.substring(len-11,len+1)=="_exp_on.gif")	{icosel	= "_exp";}
	if (img.src.substring(len-11,len+1)=="_sel_on.gif")	{icosel	= "_sel";}

// change image
	MY_swapImage('menu_'+name ,'/img/menu_'+name+icosel+'.gif');
/**/
}

function showIcon(menuid,name){

	MY_swapImage('menu_ico_'+name ,'/img/menu_ico_'+name+'_on.gif');
	MY_swapImage('menu_ico_shortcut','/img/shortcut_'+name+'.gif');

//	ddrivetip(name);
}

function hideIcon(menuid,name){

	MY_swapImage('menu_ico_'+name ,'/img/menu_ico_'+name+'.gif');
	MY_swapImage('menu_ico_shortcut','/img/shortcut_default.gif');
//	hideddrivetip();
}