Dialog - how to pass variables

Dialog - how to pass variables


I'm using UI 1.7 and jquery 1.3.2.
I have the dialog set up
[code]
    $(document).ready(function(){
        $("#review_update").dialog({
            autoOpen: false,
            modal: true,
            overlay: {
                backgroundColor: '#000',
                opacity: 0.5
            },
            buttons: {
                'Close This Review': function() {
                    //pass id here
//$("#printouts").load
("documents/mydocuments/setreview/"+id+"/");
                },
                Cancel: function() {
                    $(this).dialog('close');
                }
            }
        });
    });
    $(document).ready(function(){
     $(".updatereview").css("cursor","pointer").click(function(){
            var tmp = this.id.split("-");
            id = tmp[tmp.length-1];
            $("#review_update").dialog("open");
         });
    });
[/code]
I'm getting an id from the click function which I would like to pass
to id to the $("#review_update").dialog() (first function) so that i
can use it with the dialog buttons, but have no idea how to do this.
Any ideas would be appreciated.