title: jQuery UI dialog issue
body: <p>I'm trying to create jquery dialog, but there is no use :(
  here is my jQuery code:</p>
  
  <pre><code>$(document).ready(function() {
      createDialog();
  
  });
  function createDialog() {
  
      $("#dialog:ui-dialog").dialog("destroy");
      $("#dialog-form").dialog(
              {
                  autoOpen : false,
                  height : 475,
                  width : 350,
                  modal : true,
                  buttons : {
                      "submit" : function() {
  
                          var bValid = true;
                          allFields.removeClass("ui-state-error");
                          postText();
                              $(this).dialog("close");
                          }
                      },
                      cancel : function() {
                          $(this).dialog("close");
                      }
                  },
                  close : function() {
                      allFields.val("").removeClass("ui-state-error");
                  }
              });
  
      $(".add-org").click(function() {
  
              $("#dialog-form").dialog("open");
      });
  }
  </code></pre>
  
  <p>here is html code:</p>
  
  <pre><code>&lt;link href="&lt;c:url value="/resources/styles/jquery-ui-1.8.21.custom.css"/&gt;"
      rel="stylesheet" type="text/css"&gt;
  &lt;script type="text/javascript"
      src="&lt;c:url value='/resources/js/jquery-1.7.js'/&gt;"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"
      src="&lt;c:url value='/resources/js/jquery-ui-1.8.21.custom.min.js'/&gt;"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"
      src="&lt;c:url value='/resources/js/myScript.js'/&gt;"&gt;&lt;/script&gt;
  
      &lt;a href="javascript:void(0)" class="add-org"&gt;New &lt;/a&gt;
  
  &lt;div id="dialog-form" title="Add New "&gt;
      &lt;p class="validateTips"&gt;All form fields are required.&lt;/p&gt;
      &lt;form&gt;
      ..................
      &lt;/form&gt;
  &lt;/div&gt;  
  </code></pre>
  
  <p>and firebug says: </p>
  
  <blockquote>
    <p>TypeError: $("#dialog:ui-dialog").dialog is not a function </p>
    
    <p>$("#dialog:ui-dialog").dialog("destroy");</p>
  </blockquote>
  
  <p>and on my page I see all the fields from the form.
  so what is my problem?</p>