Modal Dialog Best Practices?

Modal Dialog Best Practices?

Hi all.  Just finishing up rolling out my first project involving a modal dialog, and am wondering how others are tackling what, I would think, are common issues that I encountered.  I am rolling a modal dialog, with login/registration forms (each form located on a jQuery UI accordion panel).

1) Dialog content.  In it's most basic form, you'd have a hidden div that the jquery would then display the contents.  As my dialog is a login/registration form, and the initiating link is a common UI element shown on evry page of the site (across several subdomains) I needed to 'include' this hidden div on each page.  Unhappy with the extra content being sent when it often isn't needed, I now have a single hidden (and empty) div included on each page, and via jquery I am populating the dialog via a .load call, like so:

  1. $('#dialog').dialog('open').load('/form.content', function() {
          $('div.accordion').accordion({header: 'h2', autoHeight: false, animated: false, active: 0});
    });

As I mentioned above, I also have a jQUeryUI accordion as part of the page content.  Anything obviously flawed/wrong with this logic?  Is there a simpler or more standard way to populate the form without the mess of always sending the entire dialog contents to the browser in the form of a hidden div?

2) SSL.  I'd like to employ SSL for the dialog/dialog contents so that password arent sent from the dialog form to the backend in plain text.  I have a valid SSL cert for all of the domains, but can't quite figure out how to properly initiate the content as SSL when the dialog is initiated from a non-ssl page, such as a generic homepage of the site.  I have tried the above .load() call and specified the content source as being secure (i.e. .load(https://www.example.com/form.content)), but the content of the dialog will now only display on pages that themselves are secured via SSL.  Short of running the whole site in SSL (a non-starter), what am I missing?  I am sure others must have implemented a secure dialog that is initiated from a non-secure page (wouldn't almost all login/registration dialogs fall into this situation?)

Thanks for any input on this, would really appreciate any feedback experiences on this, as the dialog is proving to be very central to core site functionality now!

Paul