I have 4 image buttons on a page


As soon as the page is loaded i am inserting blank image instead of the original image in in the image tag:

<img name="imgEdit" id="imgEdit" border="0" src="../../images/blank.gif">
<img name="imgCopy" id="imgCopy" border="0" src="../../images/blank.gif">
<img name="imgRun" id="imgRun" border="0" src="../../images/blank.gif">
<img name="imgOrder" id="imgOrder" border="0" src="../../images/blank.gif">

According to the selected criteria then blank images will replace by the appropriate image this is being done with the help of following 2 functions:

function DisableButton(){
document.images['imgEdit'].src = blank image source;
document.images['Copy'].src = blank image source;
document.images['imgRun'].src = blank image source;
document.images['imgOrder'].src = blank image source;

Function EnableButton(){
if(true for Edit)
document.images['imgEdit'].src = edit image source;
if(true for Copy)
document.images['Copy'].src = copy image source;
if(true for Run)
document.images['imgRun'].src = run image source;
if(true for Order)
document.images['imgOrder'].src = order image source;

As i have not specified the width and height properties in the image tag, in Netscape 4.7 instead of the image when the image is ENABLED i get a "-". Netscape 6 and 7 versions are working fine along with IE different versions.

If i specify the width and height in the image tag, then blank image is also set as the same height and width and as there is URL associated with all of these images, mouse pointer turns to "hand" and blankimage is clickable.

I have tried specifing width and height properties in disable and enable functions above as:

document.images['imgRun'].width = 80 for enable and 0 for disable
document.images['imgRun'].height = 20 for enable and 0 for disable

but Netscape 4.7 is still putting - for the image and when i tried to look at the width and height value after setting it as above, i get 0. OTher versions of netscape and IE work fine.