//set a reference to the main frame
var mainFrame = parent.frames['frameContent'];

//open menu with given ID and left position
function openMenu(menuID,menuX)
{
	if(
		//if the "um" object exists in the main frame
		typeof mainFrame.um != 'undefined'
		&&
		//and the ready state variable exists
		typeof mainFrame.um.ready!='undefined'
		&&
		//and it has a value of true
		mainFrame.um.ready == true
		)
	{
		//find y-scrolling amount plus a top margin
		var scrollY = (mainFrame.um.getScrollAmount() + 5);
		
		//activate menu at given left position and scroll-top position
		mainFrame.um.activateMenu(menuID, menuX, scrollY + 'px');
	}
}

//close menu with given ID
function closeMenu(menuID)
{
	if(
		//if the "um" object exists in the main frame
		typeof mainFrame.um != 'undefined'
		&&
		//and the ready state variable exists
		typeof mainFrame.um.ready!='undefined'
		&&
		//and it has a value of true
		mainFrame.um.ready == true
		)
	{
		//deactivate menu
		mainFrame.um.deactivateMenu(menuID);
	}
}

function getOffsetLeft (el) {
	var ol=el.offsetLeft;
	while ((el=el.offsetParent) != null) { ol += el.offsetLeft; }
	return ol - 140;
}
