CreatePopup replacement
<p>Using regular JavaScript or JQuery I want to replace the createPopup() method like done in this post:</p>

<p><a href="https://stackoverflow.com/questions/3807709/a-universal-createpopup-replacement">A universal createPopup() replacement?</a></p>

<p>but I want to use a Div instead of an iFrame. I don't need anything fancy just a simple div which can be styled.</p>

<p>The problem with using a Div is that I have a lot of existing code like this which I would like to remain untouched e.g.</p>

<pre><code>var popup = window.createPopup();
oPopup.document.body.innerHTML = "Click outside &lt;strong&gt;popup&lt;/strong&gt; to close.";
</code></pre>

<p>In the new <code>createPopup()</code> method below, is there a way to return an object that has the properties <code>document.body.innerHTML</code> to style the Div and the existing code can remain untouched.</p>

<pre><code>if(!window.createPopup){
  window.createPopup = function() {

    // TODO return div object

    }
}
</code></pre>