dialog save position and size

dialog save position and size

I have  dialog in a page the auto-refreshes every 5 minutes.  If the dialog is resized or moved i would like to save its position and size.   what is the easeist way to do this?   thanks for any help.

  1. <div id="dialog_mon" class="mon" title="Dialog">
  2. </div>
  3.  <script type="text/javascript">
  4.                                 $(function () {
  5.                                         $("#dialog_mon").dialog({
  6.                                                 resizable: true,
  7.                                                 height:800,
  8.                                                 width:800,
  9.                                                 modal: false,
  10.                                                 position:[50, 50],
  11.                                                 dialogClass: "mon",
  12.                                         });
  13.                                         $(".mon .ui-widget-content").css("background-color", "black");
  14.                                    });
  15. </script>