Hello!

First off, im not good with Javascript.

Since god knows how long i use the same script to swap images.
PHP Code:
xoff = new Image();    xoff.src "images/speichern_off.gif";
xon = new Image();    xon.src "images/speichern_on.gif";

function 
imgOn(imgName)
{
document.images.[imgName].src = eval(imgName +  "on.src");
}
function 
imgOff(imgName)
{
document.images.[imgName].src = eval(imgName +  "off.src");

Now for the first time i need to do this with an image that serves as a button in a form.

Like this
<td><input type="image" name="submit" src="./images/speichern_off.gif" OnMouseOver="imgOn('xon')" OnMouseOut="imgOff('xoff')"></td>

But i keep on getting the message: Object expected..

I tried everything i know but failed, i searched the web like crazy, but either i had bad luck, or this aint even possible.

Any help would be greatly appreciated!

Thanks a lot in advance,
datune