title: jquery ui dialog is creating two dialogs
body: <p>A screenshot : <a href="http://d.pr/i/A4Kv" rel="nofollow">http://d.pr/i/A4Kv</a></p>
  
  <p>This is my dialog code:</p>
  
  <pre><code>function popupbox(title,html,buttonTxt,buttonAction) {
    var buttons = {};
    if(buttonTxt != null) {
      buttons[buttonTxt] = buttonAction;
    }
    buttons['Cancel'] = function() {
      jQuery(this).dialog('destroy').remove();
    };
    var p = jQuery('&lt;form class="dialoginnerbox"&gt;' + html  + '&lt;/form&gt;');
    p.dialog({
      autoOpen: false,
      resizable: false,
      modal: false,
      width: 'auto',
      height: 'auto',
      maxHeight: 600,
      maxWidth: 980,
      title: title,
      close: function(event, ui){
          jQuery(this).dialog('destroy').remove();
      },
      buttons: buttons
    });
    p.dialog('open');
  }
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p>---- UPDATE ----</p>
  
  <p>I swapped out the returning html for some dummy text and that fixed it.. so something with the html that is being put into the popup is making it open twice...</p>