///////////////////////////////////////////////////////////////////////////////////////////////////
//
// Constants used in the script.
//
///////////////////////////////////////////////////////////////////////////////////////////////////

var CONST_CLOSE_TIMEOUT_MS			= 500;					// Menu closing timeout.
var CONST_SEPARATOR_TOKEN			= '_';					// Separator for menu elements
var CONST_CONTAINER_TOKEN			= 'C';					// Denotes container
var CONST_MENU_ITEM_CLASS_NAME		= 'fwMenuItem';			// Base CSS class name for the menu items.
var CONST_MENU_DATA_CLASS_NAME		= 'fwMenuItemData';		// Base CSS class name for the menu item data.
var CONST_MENU_DATA_SPLITTER		= '||';					// Splitter for the menu data.
var CONST_MENU_DATA_URL				= 0;					// Index to retrieve Url.
var CONST_MENU_DATA_TARGET			= 1;					// Index to retrieve target.
var CONST_MENU_DATA_SATUS			= 2;					// Index to retrieve status.
var CONST_MENU_HIDE_ELEMENT_CLASS	= 'fwHideWithMenu';		// All elements on the page that have this CSS class set are hidden while menu is displayed.



///////////////////////////////////////////////////////////////////////////////////////////////////
//
// Methods access directly from the templates (and external scripts).
//
///////////////////////////////////////////////////////////////////////////////////////////////////

/** fwMenu_ShowHideMenu(e, id, imageNumber)
	*
	* Handles the show/hide of the menu.
	* Internally, it also moves the menu from one place to another.
	*
	* @param  e event.
	* @param  id id of the element where the image menu is to be placed beside.
	* @param  imageNumber current image number.
	* @return nothing
	*/
function fwMenu_ShowHideMenu(e, id, imageNumber)
{
	//fwDebugPrint('fwMenu_ShowHideMenu(' + e + ', ' + id + ', ' + imageNumber + ')');
	
	// Cancel further event propagation
	fwStopEventPropagation(e);
	
	// Get the placement element.
	var placementElement = document.getElementById(id);
	if (!placementElement)
	{
		//fwDebugPrint('Cannot find placement element: ' + id);
		return;
	}
	
	// Note! Add '_C' to the passed in id to get the root container of the menu.
	var rootContainer = document.getElementById(id + CONST_SEPARATOR_TOKEN + CONST_CONTAINER_TOKEN);
	if (!rootContainer)
	{
		//fwDebugPrint('Cannot find root container: ' + id + CONST_SEPARATOR_TOKEN + CONST_CONTAINER_TOKEN);
		return;
	}
	
	// If menu is showing then hide it.
	if (rootContainer.state)
	{
		// Hide all child containers for the root container
		fwMenu_HideChildContainers(rootContainer, null);
		rootContainer.state = 0;
		rootContainer.style.visibility = 'hidden';
		return;
	}
	
	// Close all image menus on the page.
	fwMenu_CloseAllImageMenus(imageNumber);
	
	
	if (!rootContainer.menuMoved)
	{
		// The menu exists in Html form and we are not able to move it freely on the page.
		// So we clone the entire menu structure in the memory. Delete the original menu and
		// place the cloned structure right where we want it.
		
		//fwDebugPrint('Cloning');
		
		// Clone the container.
		rootContainer = fwMenu_CloneContainer(rootContainer);
		if (!rootContainer)
		{
			//fwDebugPrint('Failed to clone root container.');
			return;
		}
	
		// Add cloned menu structure to the page DOM.
		document.body.appendChild(rootContainer);
		
		// Set flag for a successful move operation.
		rootContainer.menuMoved = 1;
	}
	else
	{
		//fwDebugPrint('Already cloned');
	}
	
	// Set positioning parameters for the cloned menu structure.
	rootContainer.style.position = 'absolute';
	rootContainer.style.top = fwGetAbsoluteTop(id) + 'px';
	rootContainer.style.left = fwGetAbsoluteLeft(id) + parseInt(placementElement.offsetWidth) + 'px';
	rootContainer.state = 1;
	rootContainer.style.visibility = 'visible';
}




///////////////////////////////////////////////////////////////////////////////////////////////////
//
// Event handlers for the menus.
//
///////////////////////////////////////////////////////////////////////////////////////////////////




/**
	*
	* @param menuItem The item spawning the mouse over event
	*/
function fwMenu_OnMouseOver()
{
	var menuItem = this;

	if (!menuItem)
	{				
		return(true);
	}

	// Set status.
	status = fwMenu_GetMenuData(menuItem, CONST_MENU_DATA_SATUS);
	
	// Cancel further event propagation
	fwStopEventPropagation(menuItem.event);

	// Get reference to root node and set some global values.
	var rootContainer = fwMenu_GetRootContainer(menuItem);
	if (!rootContainer)
	{				
		return(true);
	}
	
	
	rootContainer.currentItem = menuItem;	// Id of the current item
	rootContainer.CanHide = 0;				// Cannot hide the menu structure at this time.
	

	// Item is currently being shown.
	if (rootContainer.isShowing)
	{
		var currentContainer = fwMenu_GetCurrentContainer(menuItem);
		fwMenu_HideChildContainers(currentContainer, null);	// Hide all child containers
	}
	
	// Set Css class.

	if (!menuItem.originalClassName)
	{
		menuItem.originalClassName = menuItem.className;
		menuItem.className = CONST_MENU_ITEM_CLASS_NAME + ' ' + fwMenu_GetSelectedCssClassName(rootContainer);
	}

	
	// Grab the child container of the current item (this is the item's sub-menu, if any)
	var childContainer = fwMenu_GetChildContainer(menuItem);

	if (!childContainer)
	{				
		return(true);
	}

	childContainer = fwMenu_CloneContainer(childContainer);
	if (!childContainer)
	{
		//fwDebugPrint('3: no childContainer again');
		return(true);
	}
	
	if (!childContainer)
	{
		//fwDebugPrint('4: dude, children are totally gone');
		return(true);
	}
	
	// Position the current container
	fwMenu_PositionElement(menuItem, childContainer);
	
	// Page edge handling
	fwMenu_RePositionElement(childContainer);

	
	// Show the child container
	childContainer.style.visibility = 'visible';
	rootContainer.isShowing = 1;
	
	
	return(true);
}




/**
	*
	*
	* @param menuItem
	*/
function fwMenu_OnMouseOut()
{
	// Clear status.
	status = '';
	
	// Get the root node and read the global values.
	var menuItem = this;

	if (!menuItem)
	{
		return(true);
	}

	fwStopEventPropagation(menuItem.event);
	var rootContainer = fwMenu_GetRootContainer(menuItem);

	if(menuItem == rootContainer.currentItem)
	{
		rootContainer.CanHide = 1;

		if (rootContainer.closeTimer)
		{
			clearTimeout(rootContainer.closeTimer);
		}
		rootContainer.closeTimer = setTimeout('fwMenu_ResetMenu(\'' + menuItem.id + '\')', CONST_CLOSE_TIMEOUT_MS);
	}
	
	return(true);
}




/**
	*
	*
	* @param menuItem
	*/
function fwMenu_OnClick()
{
	// Get the navigation data and call designated function.
	var menuItem = this;
	
	// Cancel further event propagation
	fwStopEventPropagation( menuItem.event );

	var rootMenu = fwMenu_GetRootContainer( menuItem );
	
	// If menu is showing then hide it.
	if (rootMenu.state)
	{
		// Hide all child containers for the root container
		fwMenu_HideChildContainers(rootMenu, null);
		rootMenu.state = 0;
		rootMenu.style.visibility = 'hidden';	
	}
	
	// Execute the menu's command
	fwNavigateWithTarget(fwMenu_GetMenuData(menuItem, CONST_MENU_DATA_URL), fwMenu_GetMenuData(menuItem, CONST_MENU_DATA_TARGET));		
	
	
	
	return(true);
}




///////////////////////////////////////////////////////////////////////////////////////////////////
//
// Helper methods for event handlers.
//
///////////////////////////////////////////////////////////////////////////////////////////////////

/** fwMenu_CloseAllImageMenus(refId)
	*
	* The function closes all other image menus the are opened except for the one referred.
	*
	* @param  refId Reference to the image menu not to hide.
	* @return nothing
	*/
function fwMenu_CloseAllImageMenus(refId)
{
	// Close all page menus below the reference id.
	var index = parseInt(refId) - 1;
	var element = document.getElementById('imgCtxMenu' + index + CONST_SEPARATOR_TOKEN + CONST_CONTAINER_TOKEN);
	
	while(element)
	{
		if (element.state)
		{
			fwMenu_HideChildContainers(element, null);
			element.state = 0;
			element.style.visibility = 'hidden';
		}
		
		index--;
		element = document.getElementById('imgCtxMenu' + index + CONST_SEPARATOR_TOKEN + CONST_CONTAINER_TOKEN);
	}
	
	
	// Close all page menus above the reference id.
	index = parseInt(refId) + 1;
	element = document.getElementById('imgCtxMenu' + index + CONST_SEPARATOR_TOKEN + CONST_CONTAINER_TOKEN);
	
	while(element)
	{
		if (element.state)
		{
			fwMenu_HideChildContainers(element, null);
			element.state = 0;
			element.style.visibility = 'hidden';
		}
		
		index++;
		element = document.getElementById('imgCtxMenu' + index + CONST_SEPARATOR_TOKEN + CONST_CONTAINER_TOKEN);
	}

}




/** fwMenu_GetSubData(menuItem, index)
	*
	* The function returns the specified data entry from within the name attribute
	* of the menu item.
	*
	*
	* @param  menuItem The menu item to get data from.
	* @param  index the index to retrieve.
	* @return The text retrieved, an empty string otherwise.
	*/
function fwMenu_GetMenuData(menuItem, index)
{
	if (!menuItem)
	{
		return('');
	}
	
	// Get the hidden div with menu specific data.
	var subElements = fwGetElementsByClassName(menuItem, CONST_MENU_DATA_CLASS_NAME);
	if (!subElements || !subElements.length)
	{
		return('');
	}
	
	// Get menu item data from the first element retrieved and split it.
	var menuItemData = subElements[0].innerHTML.split(CONST_MENU_DATA_SPLITTER);
	if (!menuItemData || !menuItemData.length || menuItemData.length <= index)
	{
		return('');
	}
	
	// Return the requested data.
	return(menuItemData[index]);
}




/** fwMenu_GetSelectedCssClassName(rootContainer)
	*
	* Retrieves the Css class name for selected menu items.
	* This class name is stored in a hidden div within the root container of the menu
	* and is common for the entire menu.
	*
	* @param  rootContainer - Reference to the root container.
	* @return The class name if retrieved, an empty string otherwise.
	*/
function fwMenu_GetSelectedCssClassName(rootContainer)
{
	if (!rootContainer)
	{
		return('');
	}
	
	// Get the hidden div with menu specific data.
	var subElements = fwGetElementsByClassName(rootContainer, CONST_MENU_DATA_CLASS_NAME);
	if (!subElements || !subElements.length)
	{
		return('');
	}
	
	// Get menu item data from the first element retrieved.
	var selectedClassName = subElements[0].innerHTML;
	if (!selectedClassName)
	{
		return('');
	}
	
	// Return  the class name.
	return(selectedClassName);
}




/** fwMenu_GetParentMenuItem(refItem)
	*
	* The function works by find the last index of the separator token twice, and
	* returning the remainder of the string as it's parent, i.e:
	*
	* parameter : 'fwMenu_C_2_C_3'
	* result    : 'fwMenu_C_2'
	*
	* @param  refItem Reference to menu item
	* @return reference to parent element
	*/
function fwMenu_GetParentMenuItem(refItem)
{
	// Perform initial search for the very last underscore
	var tokenPosition = refItem.id.lastIndexOf(CONST_SEPARATOR_TOKEN);
	if (-1 == tokenPosition)	// not found, fail function
	{
		return null;
	}

	// Use the position of the last underscore to find the next-to-last underscore
	tokenPosition= refItem.id.lastIndexOf(CONST_SEPARATOR_TOKEN, tokenPosition);
	if (-1 == tokenPosition) // not found, fail function
	{
		return null;
	}
	var resultID = refItem.id.substr(0, tokenPosition);
	return document.getElementById(resultID);
}




/** fwMenu_GetParentContainer()
	* Simply traverse the ID tag of the referenced item backwards until
	* a container ID is found
	*
	* @param  refItem Reference to menu item
	* @return reference to parent container element or null if not found
	*/
function fwMenu_GetParentContainer(refItem)
{
	// ensure we have an id tag to play with

	if (!refItem || !refItem.id.length)
	{
		return null;
	}
	var currentPosition = refItem.id.length - 2;	// skip last char
	var strHelper = refItem.id.substr(0, refItem.id.length - 2);

	currentPosition = strHelper.lastIndexOf(CONST_SEPARATOR_TOKEN + CONST_CONTAINER_TOKEN);
	if (-1 == currentPosition)
	{
		return null;
	}
	return document.getElementById(refItem.id.substr(0, currentPosition + 2));
}




/**
	* Position the container according to it's parent container and style of menu (horisontal or vertical)
	*
	* @param menuItem  needed to get absolute top and absolute left
	* @param container the container to position
	*/
function fwMenu_PositionElement(menuItem, container)
{	
	if (!menuItem || !container)
	{
		return;
	}
		
	var newTop			 = fwGetAbsoluteTop(menuItem.id);
	var newLeft			 = fwGetAbsoluteLeft(menuItem.id);	
	var currentContainer = menuItem.parentNode;
	var className		 = currentContainer.className.toString();
	var classNames		 = className.split(' ');					// in case we have more than one class
	var i                = 0;

	// Support multiple class names by splitting className on space, and looking for our menus
	for (i; i < classNames.length; i++)
	{
		if (classNames[i].indexOf('fwMenuContainer') == 0 )
		{
			className = classNames[i];
			break;
		}
	}

	// Opera may give us extra overhead because of the top Margin
	if (g_browser.isOpera == 1)
	{
		newTop -= parseInt(document.body.topMargin);
	}

	if (className.length && className.charAt(className.length - 1) == 'H')
	{
		// Hide the search form while we're working with menu's
		SetSensitiveElementVisibility ( true );

		newTop  = fwGetAbsoluteTopWithScrollOffset (menuItem.id);
		newLeft = fwGetAbsoluteLeftWithScrollOffset(menuItem.id);
	
		newTop += parseInt(currentContainer.offsetHeight);
		container.style.top  = newTop  + 'px';
		container.style.left = newLeft + 'px';
	}
	else
	{
		container.style.top = newTop + 'px';
		container.style.left = newLeft + parseInt(container.offsetWidth) + 'px';
	}
	container.style.visibility = 'visible';
}




/**
	* Adjust the position of the current container item in the case of it's extremes
	* hitting the screen edges (move menu to the left if it's (in whole or in part)
	* outside the screen.
	*
	* @param containerItem the container to move
	*/
function fwMenu_RePositionElement(containerItem)
{	
	if (!containerItem)
	{
		return;
	}
	fwDebugPrint(containerItem.id);
	var parentContainer     = fwMenu_GetParentContainer(containerItem);
	var ContainerTop	    = parseInt(containerItem.style.top);
	var ContainerLeft		= parseInt(containerItem.style.left);
	var limitX;
	var limitY;

	if (g_browser.isFirefox || g_browser.isSafari || g_browser.isExplorer7 )
	{
		limitX = parseInt( window.innerWidth  ) +  parseInt( window.pageXOffset );
		limitY = parseInt( window.innerHeight ) +  parseInt( window.pageYOffset );
	}
	else
	{		
		limitX = parseInt( document.body.clientWidth )  + parseInt( document.body.scrollLeft );
		limitY = parseInt( document.body.clientHeight)  + parseInt( document.body.scrollTop  );
	}

	var firstMenuItem = document.getElementById( containerItem.id + '_0' );
	if ( !firstMenuItem )
	{
		return;
	}
	var ContainerWidth		= parseInt( containerItem.offsetWidth  );
	var ContainerHeight		= parseInt( containerItem.offsetHeight );

	// If the container is touching edge
	if ( ContainerLeft + ContainerWidth > limitX )
	{
		// If there is a parent container, then use its style left and then add position offset.
		if ( parentContainer )
		{
			// parentContainer is not the root element because it too has a parent
			if ( fwMenu_GetParentContainer( parentContainer ) )
			{
				ContainerLeft = fwGetAbsoluteLeft( parentContainer.id ) - ContainerWidth;
			}
		}
	}

	while( ContainerLeft + ContainerWidth > limitX )
	{
		ContainerLeft -= 5;
	}


	// If the container is touching edge
	if ( ContainerTop + ContainerHeight > limitY )
	{
		//fwDebugPrint ('ContainerTop + ContainerHeight > limitY ' + ContainerTop + '+' + ContainerHeight + '>' + limitY);
		if ( parentContainer )
		{
			if (fwMenu_GetParentContainer(parentContainer))
			{
				ContainerTop = fwGetAbsoluteTop(parentContainer.id);

			}
			else
			{
				//fwDebugPrint(fwGetAbsoluteTop(parentContainer.id) + '  ' + containerItem.offsetHeight);
				ContainerTop = fwGetAbsoluteTopWithScrollOffset(parentContainer.id) - containerItem.offsetHeight;
				if (g_browser.isOpera)
				{
					ContainerTop -= document.body.topMargin;
				}
				if (g_browser.isSafari)
				{
					// ContainerTop -= 12;
				}
			}
		}
	}

	// If still touching the edge, then slowly move up.
	while(ContainerTop + ContainerHeight > limitY)
	{
		ContainerTop -= 5;
	}
	containerItem.style.top  = ContainerTop  + 'px';
	containerItem.style.left = ContainerLeft + 'px';
}




/**
	* Returns an object reference to the root node, which would be the first occurrence within
	* a given id structure where a separator token + a container token is found, i.e.
	* the element id 'fwMenu_C_0_C_1_C_2_C_7' will result in a root node
	* of value       'fwMenu_C'
	*
	* @param menuItem the DOM object to inspect
	* @return reference to root node
	*/
function fwMenu_GetRootContainer(menuItem)
{
	if (!menuItem)
	{
		return(null);
	}
	
	var posRootNode = menuItem.id.indexOf(CONST_SEPARATOR_TOKEN + CONST_CONTAINER_TOKEN);
	if (-1 == posRootNode)
	{
		return(null);
	}
	
	return(document.getElementById(menuItem.id.substr(0, posRootNode) + CONST_SEPARATOR_TOKEN + CONST_CONTAINER_TOKEN));
}




/**
	* Inspects the fw id structure tags, and returns a reference to the element which
	* defines the current container element (separator + container tokens), i.e.
	* e.id = 'fwMenu_C_0_C_3_C_1'  -> 'fwMenu_C_0_C_3_C'
	* e.id = 'fwMenu_C_0_C_3_C'    -> 'fwMenu_C_0_C_3_C' (element is a container)
	*
	* @param menuItem
	* @return reference to container element
	*/
function fwMenu_GetCurrentContainer(menuItem)
{
	var posC = menuItem.id.lastIndexOf(CONST_SEPARATOR_TOKEN + CONST_CONTAINER_TOKEN);
	if (-1 == posC)
	{
		return	null;
	}
	return document.getElementById(menuItem.id.substr(0, posC) + CONST_SEPARATOR_TOKEN + CONST_CONTAINER_TOKEN);
}




/**
	* For a given element, return it's child container (if any)
	*
	* @param menuItem menu Item to inspect
	* @return reference to the element's child container or null (implicit) if it doesen't exist.
	*/
function fwMenu_GetChildContainer(menuItem)
{
	return(document.getElementById(menuItem.id + CONST_SEPARATOR_TOKEN + CONST_CONTAINER_TOKEN));
}




/**
	* Sets the visibility to hidden for all elements that are children of the currentContainer.
	* <b>This function uses recursion</b>
	*
	* @param currentContainer
	* @param childContainer
	*/
function fwMenu_HideChildContainers(currentContainer, childContainer)
{
	// Hide all child containers.
	if (!currentContainer)
	{
		return;
	}
	var i = 0;
	var currentElement = document.getElementById( currentContainer.id + CONST_SEPARATOR_TOKEN + i);
	var subContainer = null;

	while (currentElement)
	{
		// Set Css class.
		if (currentElement.originalClassName)
		{
			currentElement.className = currentElement.originalClassName;
			currentElement.originalClassName = '';
		}
	
		// Hide child container.
		subContainer = fwMenu_GetChildContainer(currentElement);
		if (subContainer && subContainer != childContainer)
		{
			// Move recursively down to sub containers as well.
			fwMenu_HideChildContainers(subContainer, null)
			subContainer.style.visibility = 'hidden';
		}
		currentElement = document.getElementById( currentContainer.id + CONST_SEPARATOR_TOKEN + ++i);
	}
}




/**
	* Put the containerItem directly on the html body
	* by cloning it and placing the clone directly at body level.
	* The cloning only happens once, controlled by the custom property 'isCloned'
	*
	* @param containerItem The container Item to clone
	* @return cloned object, or null on any error
	*/
function fwMenu_CloneContainer(containerItem)
{
	if (!containerItem.isCloned)
	{
		// Create the clone
		var newChild = containerItem.cloneNode(true);
		if (!newChild)
		{
			return null;
		}

		//  Get a reference to the original item's parent, which we'll use to
		// remove the original item (by use of removeChild() )
		var temp = containerItem.parentNode;
		if (!temp)
		{
			return null;
		}
		temp.removeChild(containerItem);

		// Assign the clone as our new child
		containerItem = newChild;
		containerItem.isCloned = true;

		// put the new child container on a body level
		document.body.appendChild(containerItem);

		// Re-assign events to children after clone, as they're lost
		fwMenu_AddMenuItemEventsToContainer(containerItem);
	}
	return containerItem;
}


/**
	* Hides all child elements of the menuItem's root node
	*
	* @param menuItem the element used to detect the root node
	*/
function fwMenu_ResetMenu(menuItemId)
{
	// Get menu item
	var menuItem = document.getElementById(menuItemId);

	// Get the root node and read the global values.
	var rootContainer = fwMenu_GetRootContainer(menuItem);

	if (rootContainer && rootContainer.CanHide)
	{
		var rootContainer = fwMenu_GetRootContainer(menuItem);

		// Hide all child containers for the root container
		fwMenu_HideChildContainers(rootContainer, null);
		
		// Hide the search form while we're working with menu's
		SetSensitiveElementVisibility ( false );
	}
}

function SetSensitiveElementVisibility( hideIt )
{
	if( g_browser.isExplorer7 )
	{
		return;
	}

	// Show/hide elements by name.
	if (g_browser.isExplorer == 1 )
	{
		SetElementVisibility( 'searchForm', hideIt );
		SetElementVisibility( 'previewToolbar', hideIt );
	
		/*
		* The following option is very generic and handy, but it causes great delays on grid.fwx
		* where there are a huge amount of HTML elements.
		* Maybe we can limit this option for DIVs only.
		*
		// Show/hide elements by CSS class name.
		var hideElements = fwGetElementsByClassName(document, CONST_MENU_HIDE_ELEMENT_CLASS);
		if (!hideElements || !hideElements.length)
		{
			return;
		}
		
		var ix = 0;
		for ( ix = 0; ix < hideElements.length; ix++ )
		{
			hideElements[ ix ].style.visibility = hideIt ? 'hidden' : 'visible';
		}
		*/
	}
}

function SetElementVisibility( elementId, hideIt )
{
	fwDebugPrint('SetElementVisibility(' + elementId + ', ' + hideIt + ')');
	
	var element = document.getElementById(elementId);

	if ( element )
	{
		fwDebugPrint('SetElementVisibility: OK');
		element.style.visibility = hideIt ? 'hidden' : 'visible';
	}
}


/**
	* 
	*
	* @param target
	* @param url
	* @param status
	*/
function fwMenu_Navigate(url, target, status)
{
	//fwDebugPrint('fwNavigate(' + target + ', ' + url + ', ' + status + ')');

	fwNavigateWithTarget(url, target);
}




/**
	* For any given container, search it's childnodes for the anchor (A) tag
	* and force upon them the mouseover, mouseout and click events.
	*
	* @containerItem Containing html element
	*/
function fwMenu_AddMenuItemEventsToContainer(containerItem)
{
	if (!containerItem)
	{
		return;
	}
	var array = containerItem.getElementsByTagName('div');
	for (var i = 0; i < array.length; i++)
	{
		if (fwHasElementClassName(array[i], CONST_MENU_ITEM_CLASS_NAME))
		{
			fwAddEvent(array[i], 'mouseover',	fwMenu_OnMouseOver,	false);
			fwAddEvent(array[i], 'mouseout',	fwMenu_OnMouseOut,	false);
			fwAddEvent(array[i], 'click',		fwMenu_OnClick,		false);
		}
	}
}




///////////////////////////////////////////////////////////////////////////////////////////////////
//
// Menu initiation instructions
//

function fwMenu_MouseOverFunctor()
{
	fwMenu_AddMenuItemEventsToContainer(document.body);
}

fwAddEvent(window, 'load', fwMenu_MouseOverFunctor, false);

//
// End menu initiation instructions
//
///////////////////////////////////////////////////////////////////////////////////////////////////