function seekChildElement (pElement, pTag) {

	var i = 0;

	for (i=0; i<(pElement.childNodes.length); i+=1) {
		if (pElement.childNodes[i].nodeType == 1) {
			if (pElement.childNodes[i].tagName == pTag) {
				return pElement.childNodes[i];
			}
			else {
				seekChildElement (pElement.childNodes[i]);
			} 
		}
	}
}

function clickLink(pElement) {

	var linkElement = seekChildElement(pElement, 'A');
	
	if (linkElement) {
		if (linkElement.click())
			linkElement.click()
		else
			if (linkElement.target.length == 0) {
				window.location = linkElement.href;
				}
	}

}

function highlightMenu(pElement) {

	pElement.style.borderColor = '#ff0000';
	pElement.style.backgroundColor = '#ffcccc';

}

function revertMenu(pElement) {

	pElement.style.borderColor = '';
	pElement.style.backgroundColor = '';

}

