function process_menu (oMenu) {

	// Set up the main URL string.
	mainURL = location.pathname;
	
	// Now check the serach part for url=.
	if (location.search.indexOf('url=') != -1) getURL = location.search; else getURL = '';

	// And process if necessary.
	if (getURL != '') {
		getURL = getURL.substr(location.search.indexOf('url=') + 4);
	}

	// Now call the inner function with the main URL.
	result = process_menu_items(oMenu, mainURL);

	// and the get url if neccesary.
	if (!result) process_menu_items(oMenu, getURL);
}
	
function process_menu_items (oMenu, sURL) {

	// Defaulkt to false;
	result = false;
	
	// Loop through each item.
	for(var iI=0; iI < oMenu.childNodes.length; iI++) {
		
		// Check the item type.
		if (typeof oMenu.childNodes[iI].tagName == 'string') {
			
			// Get the next item.
			if (document.all)
				oNext = oMenu.childNodes[iI+1];
			else
				oNext = oMenu.childNodes[iI+2];

			// Is there a sub menu process it.
			if (oNext) if (oNext.className == 'empty') if (document.all) result = (result || process_menu_items(oNext.childNodes[0], sURL)); else result = (result || process_menu_items(oNext.childNodes[1], sURL));

			// Get the child link href.
			sPath = oMenu.childNodes[iI].childNodes[0].pathname;
			if (document.all) sPath = '/' + sPath;

			if (sPath){
			
				// If the url and href match.
				if (sURL == sPath || (sPath.match(new RegExp('/[^/]+/[^/]+/', 'i')) != null && sURL.indexOf(sPath) == 0)) {
			
					// Get the next item.
					if (document.all)
						oNext = oMenu.childNodes[iI+1];
					else
						oNext = oMenu.childNodes[iI+2];

					// And its sub menu if it exists.
					if (oNext) if (oNext.className == 'empty') oNext.style.display = 'block';

					// Highlight the item and make sure its visible.
					oMenu.childNodes[iI].className = 'selected';
					oMenu.childNodes[iI].style.display = 'block';

					// And its parent menu if it exists.
					if (oMenu.parentNode && typeof oMenu.parentNode.tagName == 'string' && oMenu.parentNode.tagName.toUpperCase() == 'LI') {
						oMenu.parentNode.style.display = 'block';
						oMenu.parentNode.previousSibling.className = 'selected';
					}

					// Found one!
					result = true;
				}	
			}
		}
	}

	// Return;
	return result;
}
