Javascript Image onload function in IE
<p>I am trying to place the image in the middle of the screen but in <code>IE</code> it's not working</p>

<p>here is my sample code.</p>

<pre><code>function showMap(event, url, element)
{
        var map_container = $('map_container'),
        viewport = document.viewport.getDimensions(),
        offset = $(element).viewportOffset(),
        top = offset.top + getScrollTop() + $(element).getHeight() + 10,
        image_mapgross = $('image_mapgross');
        image_mapgross.onload = middleMap;
        image_mapgross.src = url;
        map_container.style.cssText = "display:block;left:10px;top:" + top + "px;";

        Event.stop(event);
        //Event.observe(map_container, 'click', stopEvent);
}
</code></pre>

<p>in <code>IE</code> the function <code>middleMap</code> is never called.</p>

<pre><code>function middleMap() {

    var map_container = $('map_container');
    middle(map_container);
}
</code></pre>
