Close UI Dialog from inside another URL; send to other URL

Close UI Dialog from inside another URL; send to other URL

I have a php form that is called using JQuery UI Dialog but the form is in a different URL. In other words, the dialogopen opens an IFrame that contains the form. The form works perfectly (data uploaded to mySQL fine) and, after running the upload script, I want it to close the UI Dialog and redirect to another page (a receipt form). The problem is that the form script resides inside a different URL from where the original jQuery call comes from.

So...how can I do the following two things:

1) what is the jQuery code to close the dialog from the script in the form in the secondary URL (how do I refer to another URL using jQuery?), and
2) how do I set a redirect to another URL in jQuery (not the referring URL) after the dialog closes?

Any help would be appreciated.