Now works for Opera too, but I suppose its not very forward compatible.

sfHover = function() { 
  var sfEls =
document.getElementById("verMenu").getElementsByTagName("LI");
  for (var i=0; i<sfEls.length; i++) {
    if (navigator.appName == "Microsoft Internet Explorer" &&
navigator.userAgent.indexOf("Opera") < 0){
      sfEls[i].onmouseover=function() { 
        this.className+=" sfhover"; 
      }
      sfEls[i].onmouseout=function() { 
        this.className=this.className.replace(new RegExp(" sfhover\\b"),
""); 
      }
      if (sfEls[i].childNodes.length > 2) {
        if ((sfEls[i].childNodes[0].innerHTML.length > 18) &&
(sfEls[i].childNodes[2].className == "level2")) {
          sfEls[i].childNodes[2].style.marginTop = '-2.5em';
        }
        if ((sfEls[i].childNodes[0].innerHTML.length > 26) &&
(sfEls[i].childNodes[2].className == "level3")) {
          sfEls[i].childNodes[2].style.marginTop = '-3.1em';
        }
      }
    } else {
      if (sfEls[i].childNodes.length > 3){
        if ((sfEls[i].childNodes[1].innerHTML.length > 18) &&
(sfEls[i].childNodes[3].className == "level2")) {
          sfEls[i].childNodes[3].style.marginTop = '-2.4em';
        }
        if ((sfEls[i].childNodes[1].innerHTML.length > 26) &&
(sfEls[i].childNodes[3].className == "level3")) {
          sfEls[i].childNodes[3].style.marginTop = '-3.3em';
        }
      }
    }
  } 
}  


----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------

Reply via email to