title: Redirect parent window from within Jquery modal UI
body: <p>I load a Jquery Modal UI with the following code:</p>
  
  <pre><code>// Dialog   
              $('#avatar-manager').click(function () {
                  $dialog.dialog('open');
                  return false;
              });
  
              var $dialog = $('&lt;div&gt;&lt;/div&gt;')
                  .dialog({
                      autoOpen: false,
                      resizeable: false,
                      modal: true,
                      title: 'Change your avatar...',
                      position: 'top',
                      width: 600,
                      open: function () {
                          $(this).load('/components/avatar/avatar.aspx?id=&lt;%=Helpers.CurrentUserId(Session["SessionHash"].ToString())%&gt;&amp;type=user');
                      }
                  });
              $dialog.parent().appendTo(jQuery("form:first"));
  </code></pre>
  
  <p>All works well.  The <code>avatar.aspx</code> page has the code on an <code>a</code> to complete the process:</p>
  
  <pre><code>$('#go').live('click', function () {
                  $('#croppanel').hide();
                  $('#loadingpanel').show();
                  $.ajax({
                      type: "POST",
                      url: "http://&lt;%=Atomic.UI.Helpers.CurrentServer()%&gt;/AtomicService/Assets.asmx/CreateAvatar",
                      data: "{'avatarPath':'" + file_path + "','type':'user', 'w':'" + $('#&lt;%=w.ClientID%&gt;').val() + "','h':'" + $('#&lt;%=h.ClientID%&gt;').val() + "','x':'" + $('#&lt;%=x.ClientID%&gt;').val() + "','y':'" + $('#&lt;%=y.ClientID%&gt;').val() + "'}",
                      contentType: "application/json",
                      dataType: "json",
                      success: function (msg) {
                          if (msg["d"].length &gt; 0) {
                              //done
                              //$dialog.dialog('close');
                              var cachekiller = Math.floor(Math.random() * 1000);
                              &gt;&gt;&gt;&gt; 
                          }
                      },
                      error: function (msg) {
                          alert("Unfortunately, we can't upload that image now. Why not try again?");
                          $('#loadingpanel').hide();
                          $('#croppanel').show();
                      }
                  });
  </code></pre>
  
  <p>I would like to redirect or close the modal where the <code>&gt;&gt;&gt;&gt;</code>'s are.  How can I do this?  I know <code>$(this).dialog</code> can't access the modal because of context, but I'm at a loss how to close from within the window.  Remembering this a completely seperate page to where the dialog instantiation is done.</p>
  
  <p>Help, suggestions and questions appreciated :)</p>