rea { height: 100px; display: block; }
#dialog { height: auto !important; }
.ui-dialog { font-size: 10px; }
.ui-dialog .ui-dialog-titlebar { padding: 2px 3px; height: 15px; }
.ui-button { outline: 0; }
.ui-dialog .ui-dialog-content { padding: 0px; margin: 0 5px; }
</style>

<script>
var resetUI = function(div){
  if(div.html().length > 0) $('#dialog').dialog('destroy');
  div.empty(); // clear previous problem, if any
}

var createDialog = function(div){
  var html = '<p>' + ui_utils.generateWords(4,8) + '<