var userAgent = navigator.userAgent.toLowerCase();

if (document.getElementById) {
  init = function() {
    fixHeights = function() {
      var maxHeight = 0;
      var tmpHeight,i;
      for(i=0; i < arguments.length; i++) {
        tmpHeight = document.getElementById(arguments[i]).offsetHeight;
        if (maxHeight < tmpHeight) maxHeight = tmpHeight;
	}
      for(i=0; i < arguments.length; i++) {
        document.getElementById(arguments[i]).style.height = maxHeight + "px";
      }
    }
    fixHeights("nav");
    
    if(userAgent.indexOf("msie") > -1) {
      if(userAgent.indexOf("opera") == -1) {
        var navs = new Array("leftmenu");
        for(var j=0; j<navs.length;j++) {
          var sfEls = document.getElementById(navs[j]).getElementsByTagName("LI");
          for (var i=0; i<sfEls.length; i++) {
            sfEls[i].onmouseover = function() {
              this.className+=" sfhover";
            }
            sfEls[i].onmouseout=function() {
              this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
            }
          }
        }
      }
    }
  }
};

if (window.attachEvent) { 
  window.attachEvent("onload", init); 
} else if (userAgent.indexOf("firefox/1.5" > -1) ) {
  window.onload=init;
};
