parent = parentNode;
while (parent != null && parent.name != "tr") {
parent = parent.parentNode;
}
if (parent == null) return -1;
HTMLCollection nl = ((HTMLTableRowElement)parent).getCells();
for (int i=0;i<nl.getLength();i++) {
Node n = nl.item(i);
if (n == this) return i;
}
return -1;
}