allora... questa dovrebbe andare
in realtà prima cannavo io perchè dimenticavo che il td di una table non può avere l'attributo 'name'.... quindi ho risolto così:
<html>
<head>
<title>Untitled</title>
<script language='javascript'>
var numero_di_voci = 3 // setta qui il numero di voci del tuo menu
function pressed(objTd){
for (i = 0; i < numero_di_voci; i++) {
document.getElementById("tdmenu" + i).className = 'class1';
}
objTd.className = 'class2';
}
function over(objTd){
objTd.className = 'class3';
}
function out(objTd){
if (objTd.className != 'class2')
objTd.className = 'class1';
}
</script>
<style>
.class1 { background-color: white; color: black; }
.class2 { background-color: green; color: white; }
.class3 { background-color: red; color: white; }
</style>
</head>
<body>
<table>
<tr>
<td id="tdmenu0" onmouseover='over(this)' onmouseout='out(this)' onclick='pressed(this)'>home|</td>
<td id="tdmenu1" onmouseover='over(this)' onmouseout='out(this)' onclick='pressed(this)' >Chi siamo|</td>
<td id="tdmenu2" onmouseover='over(this)' onmouseout='out(this)' onclick='pressed(this)' >Contatti</td>
</tr>
</table>
</body>
</html>
ciao!