Bueno, no podrias utilizar la funcion de javier pasandole el ide la fila que quieres cambiar?
Si las filas las generas dinamicamente no habra problemas para que tengan ids distintos, y si son estaticas.. aun menos
tienes dos opciones faciles:
Pasandole un valor extra aparte del this
Código:
<script>
function marcar(obj,id) {
if (obj.checked)
document.getElementById('+id+').style.backgroundColor='ff0000'
else
document.getElementById('+id+').style.backgroundColor=''
}
</script>
<tr id="X">
<td></td>
<td></td>
<td>
<input type="checkbox" onClick="marcar(this,X)">
</td>
</tr>
O usando el caller
Código:
<script>
function marcar(id) {
if (marcar.caller.checked)
document.getElementById('+id+').style.backgroundColor='ff0000'
else
document.getElementById('+id+').style.backgroundColor=''
}
</script>
<tr id="X">
<td></td>
<td></td>
<td>
<input type="checkbox" onClick="marcar(X)">
</td>
</tr>
Tambien puede que resulte mas facil acceder al objeto a traves del array de document.all [] pero eso ya como tu veas