dialog close button only appears on hover

dialog close button only appears on hover

I'm using version 1.8.6, with the "Lightness" theme, which I have not modified. I put a dialog on the page, and the close button ("X" in the upper right hand corner, in the title bar) does not show up. If I hover over the spot where it should be, I get a white square, which does close the dialog when I click it. The dialog is displaying exactly as desired otherwise. Is there something I need to do to have this always show up? Or am I not using the dialog correctly? 

Below is the code I'm using to populate and place the dialog (the lines where I actually place the dialog are highlighted:

  1. $(".masterDetailGrid > tbody > tr:not(:has(table, th))")
  2.     .css("cursor", "pointer")
  3.     .click(function(event)
  4.     {
  5.         //debugger;
  6.         var $row = $(this);
  7.         var firstParam = $("td", $row).eq(0).text();
  8.         $.ajax(
  9.         {
  10.             type: "POST",
  11.             url: "GetPromotionCodeDetails.ashx?code=" + firstParam,
  12.             //dataType: "text/html",
  13.             async: true,
  14.             cache: false,
  15.             success: function(msg)
  16.             {
  17.                 //debugger;
  18.                 var details = msg;
  19.                 if (details.length > 0)
  20.                 {
  21.                     Display(details);
  22.                 }
  23.                 else
  24.                 {
  25.                     $("detailsDisplay").text("No Data Found");
  26.                 }
  27.                 $("#dialog").dialog({ width: 400, modal: true });
  28.                 $("#dialog").dialog('open');
  29.             },
  30.             error: function(XMLHttpRequest, textStatus, errorThrown)
  31.             {
  32.                 alert(textStatus);
  33.             }
  34.         });
  35.     });