Need your help in javascript
I am using following script for image over (to display another image)
<html>
<img src="mobilesmallimage.jpg" name="ShowRoom" width="129" height="96" onMouseOver=" ShowPic(name,'mobilebigimage.jpg') " onmouseout="ShowPic(name,'mobilesmallimage.jpg')" border="0"> </a>
I am sending 2 parameters
1. Name of image - variable name
2. Name of image to be displayed
Using following javascript
<javascript>
<script language="javascript"> function ShowPic(imgname, sImage) {
var Imgname=imgname;
var sImage = sImage ; j='document.' +Imgname+'.src = '+sImage; alert(j); eval('document.' +Imgname+'.src = '+sImage);
; } </script>
alert shows me correct value i.e. the image to be dispayed however the image is not displayed here
However following set of code works fine
<img src="mobilesmallimage.jpg" name="ShowRoom" width="129" height="96" onMouseOver="ShowPic('mobilebigimage.jpg')" onmouseout="ShowPic('mobilesmallimage.jpg')" border="0"> </a>
and javascript
<script language="javascript"> function ShowPic(sImage) {
sImage = sImage ; document.ShowRoom.src = sImage; } </script>
Please help
Thanks in advance