Moving jQuery code into a function?
<p>I have the following code that I apply when the document is ready:</p>

<pre><code>$(document).ready(function () {

      $('#updateDialog').dialog({
          autoOpen: false,
          width: 400,
          resizable: false,
          modal: true,
          buttons: {
              "Update": function () {
                  $("#update-message").html(''); //make sure there is nothing on the message before we continue                         
                  $("#updateReferenceForm").submit();
              },
              "Cancel": function () {
                  $(this).dialog("close");
              }
          }
      });

  });
</code></pre>

<p>Is there a way that I can take the actions of this code and move it to a function.  Then just have a one line call to this function inside my $(document).ready(function () {</p>
