javascript iterate array through insertBefore
<p>I'm trying to make my code a bit more reusable.</p>

<p>Currently I am using: </p>

<pre><code>var top_element = document.getElementById('main');

document.body.insertBefore(lightbox_overlay, top_element);
document.body.insertBefore(lightbox_border, lightbox_overlay);
document.body.insertBefore(lightbox_content, lightbox_border);
</code></pre>

<p>I would like to use an array and iterate through the items to do this, however:</p>

<pre><code>var lightbox_elements = [];

lightbox_elements.push(lightbox_overlay, lightbox_border, lightbox_content);
</code></pre>

<p>Any ideas what the next steps are? Must be in plain JS..</p>

<p>Thanks :)</p>
