function imgSubmitMouseover()
{
    var inps = document.body.getElementsByTagName('INPUT');
    if(null != inps)
    {
        for(var i=0,l=inps.length;i<l;i++)
        {

            // Skip anything but image inputs
            var inp = inps[i];
            if(inp.type != 'image') continue;
            if(inp.className == 'nomouseover') continue;
            
            // Preload and assign images to input
            inp.up_img = new Image();
            inp.up_img.src = inp.src;
            inp.over_img = new Image();
            
           // Reset images to prevent caching of _over-images after history.back() (in Firefox)
            if(inp.src.match(/_over/g))
            {
                inp.src = inp.src.replace(/_over/,'');
                inp.up_img.src = inp.src;
            }
            
            // <Work out over URL based on naming convention
            inp.over_img.src = inp.src.replace(/\.([a-z][a-z][a-z])$/,'_over.$1');
            // Assign functions
            inp.onmouseover = inp.onfocus = function(){ if(this.hasFocus) return false; this.src = this.over_img.src; this.hasFocus = true; };
            inp.onmouseout = inp.onblur = function(){ this.src = this.up_img.src; this.hasFocus = false; };
        }
    }
}


/*
if (window.attachEvent) {
    window.attachEvent('onload', imgSubmitMouseover);
} else if (window.addEventListener) {
    window.addEventListener('load',imgSubmitMouseover, false);
} 
*/

window.onload=imgSubmitMouseover;