Queste sono le migliorie al codice:

<html>
<head>
<script type="text/javascript">

function toggle(val)

{
//alert('val '+val);
tr=document.getElementsByTagName('tr')

for (i=0;i<tr.length;i++)
{
if (tr[i].getAttribute(val))
{

if (tr[i].style.display=='none')
{
tr[i].style.display = '';
}
else
{
tr[i].style.display = 'none';
}
}
}

}
</script>



</head>

<body onload="toggle('name');">
<table border="1">
<tr nome="riga_i">
<td>REQUISITI RELATVI AL SERVIZIO</td>
<td> </td>
<td><input type="button" onclick="toggle('nome');toggle('name');" style="background-image: url(../images/flag_uk.jpg); background-color:Transparent;" /></td></tr>
<tr name="row_e">
<td> </td>
<td>REQUIREMENTS RELATED TO THE SERVICE</td>
<td><input type="button" onclick="toggle('name');toggle('nome');" style="background-image: url(../images/flag_italy.jpg); background-color:Transparent;" /></td></tr>

</table>
</html>