function processImageEventHandlers()
{
    for ( var i = 0; i < document.images.length; i++ )
    {
        var overSrc = document.images[i].getAttribute( 'overSrc' );
        var outSrc = document.images[i].getAttribute( 'outSrc' );
        var origSrc = document.images[i].getAttribute( 'src' );

        // process mouseover/mouseout handlers
        if ( overSrc != null )
        {
            // create mouseover
            document.images[i].onmouseover = new Function ( 'this.src = "' + overSrc +'"' );
            // pre load image
            var x = new Image();
            x.src = overSrc;

            if ( outSrc != null )
            {
                // create mouseout using passed parameter
                document.images[i].onmouseout = new Function ( 'this.src = "' + outSrc +'"' );
                // pre load image
                var x = new Image();
                x.src = outSrc;
            }
            else
            {
                // if mouseout doesn't exist - use original src property
                document.images[i].onmouseout = new Function ( 'this.src = "' + origSrc +'"' );
            }
        }

        // process error event handler
        // this will try to reload the image in 2 seconds if it fails to load the first time
        document.images[i].onerror = new Function ( 'setTimeout( "this.src =\'' + origSrc + '\'" , 2000)' );
    }
}