Hope this helps, this script will only work for mozilla/NS6, but can easily be made cross-browser.
this is the script in the html/image zip file attached:
Code:
<html>
<head>
<script>
var count = .1;
var inc = true;
function doFade() {
count = (inc) ? count+.1 : count-.1;
if( count >= .9 )
inc = false;
if( count <= .1 )
inc = true;
document.getElementById("myImg").style.MozOpacity = count;
setTimeout("doFade()",200)
document.myForm.myText.value = "image opacity: "+document.getElementById("myImg").style.MozOpacity
}
</script>
</head>
<body onLoad="doFade()">
<img id="myImg" src="myImage.gif" width="50" height="50" style="-moz-opacity:.1"><br><br>
<form name="myForm">
<input type="text" name="myText">
</form>
</body>
</html>