Just realized that this is about a simple image. You do not need to use the transform stuff in this case. Here is a simpler code:
Code:
<img id="stretchgif" src="index_htm_files/waves.gif" style="width:100%;height:auto;">
<script>
function SG_resize(){
   var width=Math.max(parseInt(window.getComputedStyle(SG_WinSizeElem).width),SG_MinWidth);
   SG_el.style.width=width+"px";
   SG_el.style.marginLeft=-Math.round(width/2)+"px";
}

var SG_WinSizeElem = document.createElement("div");
document.body.appendChild(SG_WinSizeElem);
SG_WinSizeElem.style.cssText="position:fixed;top:0px;left:0px;height:100%;width:100%;z-index:-99";

var SG_el=document.getElementById("stretchgif").parentNode;
var SG_MinWidth = parseInt(SG_el.style.width);

SG_el.style.overflow="hidden";
SG_el.style.left="50%";

if (window.addEventListener) {
   window.addEventListener("resize", SG_resize);
} else if (window.attachEvent) {
   window.attachEvent("onresize", SG_resize);
}
SG_resize();
</script>