NS Prob. Set TD bgcolor w/JS

Hi!
 
The syntax in the "if (ns4)" case below doesn't work. Does anybody know why?
(Can't set a td background color in ns4+. What's the syntax?)
 
Another question: Where can I find a referance like this one xxx only it's
for Netscape?
 
 
  var ns4 = (document.layers)? true:false
  var ie4 = (document.all)? true:false
  var iSelTab = -1; var selColor = "#FFCC99"; var unSelColor = "#CCCCCC";
  function selTab(j) {
   if (j!=iSelTab) {
          if (ns4) {
     eval("document.layers[t"+j+"].backgroundColor = selColor");
     eval("document.i"+j+".src = 'tabSel.gif'");
     if (iSelTab>-1) {
      eval("document.layers[t"+iSelTab+"].backgroundColor = selColor");
      eval("document.i"+iSelTab+".src = 'tabSel.gif'");
     }
          } else if (ie4) {
     document.all["t"+j].style.backgroundColor = selColor;
     document.all["i"+j].src = "tabSel.gif";
     if (iSelTab>-1) {
      document.all["t"+iSelTab].style.backgroundColor = unSelColor;
      document.all["i"+iSelTab].src = "tab.gif";     
     }
    }
    iSelTab = j;
   }
  }

Received on Thursday, 15 February 2001 09:57:20 UTC