можно короче и проще
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
<!--
.стиль1 {background-color: #000000;}
</style>
<script>
var z=false;
function as(i)
{
if(i!=z)
{
i.className="стиль1";
if(z!=false)
{
z.className="";
z=i;
}
else z=i;
}
else{i.className="";z=false;}
}
</script>
</head>
<body>
<table width="286" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="162" height="15"></td>
<td width="124"></td>
</tr>
<tr>
<td height="26" valign="top" class="" onclick="as(this)">ffgg</td>
<td></td>
</tr>
<tr>
<td height="14"></td>
<td></td>
</tr>
<tr>
<td height="23" valign="top" class="" onclick="as(this)" >ttggg</td>
<td></td>
</tr>
<tr>
<td height="56"> </td>
<td></td>
</tr>
</table>
</body>