Lemme give you what I cooked today, it's for radio buttons but then I'm sure that you can change it yourself to do the same thing for your checkboxes.
<?PHP
<body>
<table>
<?PHP
foreach ($entitiesArr as $entity)
{
?>
<tr useHighlight="true" id="<?=$entity["id"]?>" onmouseover="if (document.getElementById('radio' + this.id).checked != true ) this.style.background = 'lightblue'"
onmouseout ="if (document.getElementById('radio' + this.id).checked != true ) this.style.background = 'white'"
onclick="this.style.background = 'orange'; document.getElementById('radio<?=$entity["id"]?>').checked = true; unCheckAllExcept(this.id);"
>
<td>
<input type="radio" id="radio<?=$entity["id"]?>" name="selectedNews" value="<?=$entity["id"]?>" />
</td>
<td>
<?=$title?>
</td>
<td>
<?=$context?>
</td>
</tr>
<?
}
?>
</body>
<script>
highlightTrs = Array();
for (i=0; i<document.getElementsByTagName("tr").length; i++)
if ( document.getElementsByTagName("tr")[i].getAttribute("useHighlight") == "true" )
highlightTrs[highlightTrs.length] = document.getElementsByTagName("tr")[i];
function unCheckAllExcept( id )
{
for (i=0; i<highlightTrs.length; i++)
if ( highlightTrs[i].id != id )
{
// I'm adding this line that it works in Moz! This stupid browser doesn't understand
// that I'm working with radio buttons, so, whenever another radio button is checked,
// the current one should be automatically unchecked! But it simply treats them like
// checkboxes! Without this line you'll see several checked radio buttons in your page!
document.getElementById("radio" + highlightTrs[i].getAttribute("id")).checked = false;
highlightTrs[i].style.background = "white";
}
}
</script>
?>
The only thing that you need to do is to put another counter for each row of your checkboxes (I assume you're using several checkboxes for each record of your table, or you didn't need them and could use radio buttons!). So, then you can change all radio things to chkbox or something like that and also you have to remove that unCheckAllExcept function, because you really don't need it anymore. I could have done that for you myself, but then I wana see you change it yourself, writing this highlight effect is much easier for a checkbox (it means what you currently have is more complex because for each new select, it should uncheck the previous buttons)
Good luck