How can I trigger a javascript that adjusts the size of DIVs to work as quickly as possible?
<p>I am going to be using the following script:</p>

<pre><code>&lt;script type="text/javascript"&gt;
    window.document.onload = function(e){
        var aheight = document.getElementById("a").offsetHeight;
        var bheight = document.getElementById("b").offsetHeight;
        if(aheight &gt; bheight) {
            document.getElementById("b").offsetHeight = aheight;
        }else {
            document.getElementById("a").offsetHeight = bheight;
         }
    }
&lt;/script&gt;
</code></pre>

<p>HTML: </p>

<pre><code>&lt;div&gt;
    &lt;div id="a" class="grid_6" style="background-color: #ff00ff"&gt;
        &lt;div class="block-border"&gt;
            Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
        &lt;/div&gt;
    &lt;/div&gt;
    &lt;div id="b" class="grid_6" style="background-color: #ffff00"&gt;
        &lt;div class="block-border"&gt;
            Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>and CSS:</p>

<pre><code>.grid_6 {
    width: 200px;
    display:inline;
    float: left;
    margin-left: 0.99%;
    margin-right: 0.99%;
}
</code></pre>

<p>I'll use this to equalize the height between two DIVs on my page. Can someone tell me where is the best place to put this script so that it works as quickly as possible. Also is the window.document.onload the best trigger for this? Could I alternatively trigger on the DIVs with element id "a" and "b" being loaded? I just want to avoid a user seeing the DIVS change is size.</p>
