Henning: Id an GetElementbyId übergeben

Beitrag lesen

Hallo,

bin Anfänger, habe es mittlerweile aber auf folgenden Code gebracht:

<html>
<head>
<title>Dynamische Areamap</title>
<style type="text/css">
h1 { color:#6363A5; font-family: Stone, Arial; }
p  { color:#000000; font-family: Stone, Arial; }
</style>
<script type="text/javascript">
function on ()
{
if (document.getElementById)
 document.getElementById("image1").style.visibility = "visible";
}
function off ()
{
if (document.getElementById)
 document.getElementById("image1").style.visibility = "hidden";
}
</script>

</head>

<body>

<table width="100%" border="1" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" style="width:1142px; height:410px; background-image:url(linkauto.jpg)">

<a style="position:absolute; top:43px; left:311px;" href="../../../index.htm" onmouseover="on()" onmouseout="off()"><img id="image1" style="visibility:hidden;" src="sh1.jpg" border="0">"</a>

</td>
</tr>
</table>

</body>
</html>

Es soll jetzt noch ein 2. Bild hinzugefügt werden. Deswegen will ich die id (z.B. image1) an die Funktion übergeben und nicht pro Bild eine Funktion schreiben. Wie mache ich das?

Gruß

Henning