I inherited this problem from my predessor and do not have the necessary experience in JavaScript to deal with it. This chunk of code does not work in anything except IE for PC. At least part of the problem is cancelBubble. It is not supported in Netscape. What do I do to fix it? I tried below in the Netscape check are but it does not work.
The call to this function comes in the ahref tag like this. ....id="mnuHOME2"; doMenu('mpuHOME2')....
function doMenu(MenuIDStr) {
var thisMenu = document.getElementById(MenuIDStr);
if (document.all) {//IE Check
if (ToolbarMenu == null || thisMenu == null || thisMenu == ToolbarMenu) { window.event.cancelBubble = true; return false; }
// Reset dropdown menu
window.event.cancelBubble = true;
ToolbarMenu.style.display = "none";
ToolbarMenu = thisMenu;
// Set dropdown menu display position
x = window.event.srcElement.offsetLeft + window.event.srcElement.offsetParent.offsetLeft - 8;
x2 = x + window.event.srcElement.offsetWidth;
y = window.event.srcElement.offsetTop + window.event.srcElement.offsetHeight + 4;
thisMenu.style.top = y;
thisMenu.style.left = x;
thisMenu.style.clip = "rect(0 0 0 0)";
thisMenu.style.display = "block";
// delay 2 millsecond to allow the value of ToolbarMenu.offsetHeight be set
window.setTimeout("showMenu()", 2);
return true;
}// end if for IE Check
if (document.layer | document.getElementById) { //Netscape Check
if (ToolbarMenu == null || thisMenu == null || thisMenu == ToolbarMenu)
// Reset dropdown menu
if (eval(MenuIDStr.id)==false)
{
MenuIDStr.innerhtml=document.all[MenuIDStr.iD].innerhtml;
eval(MenuIDStr.id="true"
;
}
else
{
MenuIDStr.children[0].outerhtml='';
eval(MenuIDStr.id="false"
;
}
}// end if for Netscape Check
}
The call to this function comes in the ahref tag like this. ....id="mnuHOME2"; doMenu('mpuHOME2')....
function doMenu(MenuIDStr) {
var thisMenu = document.getElementById(MenuIDStr);
if (document.all) {//IE Check
if (ToolbarMenu == null || thisMenu == null || thisMenu == ToolbarMenu) { window.event.cancelBubble = true; return false; }
// Reset dropdown menu
window.event.cancelBubble = true;
ToolbarMenu.style.display = "none";
ToolbarMenu = thisMenu;
// Set dropdown menu display position
x = window.event.srcElement.offsetLeft + window.event.srcElement.offsetParent.offsetLeft - 8;
x2 = x + window.event.srcElement.offsetWidth;
y = window.event.srcElement.offsetTop + window.event.srcElement.offsetHeight + 4;
thisMenu.style.top = y;
thisMenu.style.left = x;
thisMenu.style.clip = "rect(0 0 0 0)";
thisMenu.style.display = "block";
// delay 2 millsecond to allow the value of ToolbarMenu.offsetHeight be set
window.setTimeout("showMenu()", 2);
return true;
}// end if for IE Check
if (document.layer | document.getElementById) { //Netscape Check
if (ToolbarMenu == null || thisMenu == null || thisMenu == ToolbarMenu)
// Reset dropdown menu
if (eval(MenuIDStr.id)==false)
{
MenuIDStr.innerhtml=document.all[MenuIDStr.iD].innerhtml;
eval(MenuIDStr.id="true"
}
else
{
MenuIDStr.children[0].outerhtml='';
eval(MenuIDStr.id="false"
}
}// end if for Netscape Check
}