Jquery Popup not always working in IE
<p>I wrote a little jquery script to show a popup. This popup contains a title , text and image. The data is provided by PHP.</p>

<p>this is the code for the popup:</p>

<pre><code>&lt;div id="praline_box"&gt;
    &lt;div id="pralineBox"&gt;
        &lt;h1 class="praline_title"&gt;&lt;/h1&gt;
        &lt;p class="praline_image"&gt;&lt;img src="" alt="" class="prImage"/&gt;&lt;/p&gt;
        &lt;p class="praline_text"&gt;&lt;/p&gt;
    &lt;/div&gt;  
&lt;/div&gt;
</code></pre>

<p>Code that activates the popup</p>

<pre><code>&lt;a href="#" onClick="return showDialog('praline_box', '{$field-&gt;get('value')|escape}', '{$field-&gt;get('info')|escape:'htmlall'}', '{$field-&gt;getPictureUrl('detail',250,250,true,false,true)}')"&gt;
    {if $field-&gt;hasPicture()}
        &lt;img src="{$field-&gt;getPictureUrl('thumbnail')}" width="39" height="39" alt="{$field-&gt;get("value")|escape}" /&gt;
    {/if}
&lt;/a&gt;
</code></pre>

<p>And this is my javascript / jQuery code:</p>

<pre><code>function showDialog(dialogId, title, infoText, imgLink ) {
    $('#modal-window, #modal-overlay').remove();
    $("#"+dialogId+" h1.praline_title").html('');
    $("#"+dialogId+" p.praline_text").html('');

    $('body').append('&lt;div id="modal-overlay"&gt;&lt;/div&gt;&lt;div id="modal-window"&gt;&lt;/div&gt;');
    $("#"+dialogId+" h1.praline_title").append(title);
    $("#"+dialogId+" p.praline_text").append(infoText);
    $("#"+dialogId+" p.praline_image .prImage").attr("src", imgLink);
    $('#modal-window').html('&lt;a id="close"&gt;&lt;/a&gt;'+$("#"+dialogId).html());
    $('#modal-overlay, a#close').click(function(){
        $('#modal-window, #modal-overlay').remove();
    });
    return false;   
}
</code></pre>

<p>Now is this code working fine in Firefox / Chrome / Safari. But in IE it sometimes crashes and my redirects to the home page. 
Does somebody know a solution for this problem, or knows what I am doing wrong?</p>

<p>Thanks in advance!</p>
