Passing jQuey array

Passing jQuey array

Hello
I'm working on a control panel form. One of those fields is a selection of images from a gallery. I'd like to open the gallery in another page and do everything I want (upload, edit, delete images) and then, select the images I'd like to include in my post. I put all the selected files into a jQuery array called 'selectedItems'. Everything is fine here, the problem is, I don't know how to pass that array to the parent page... I mean, I have the post data into the page A (title, content, etc), but the images loading from the page B (gallery) and when I finished my selection, I'd like to close the B window and has the values into the A page... How could I do that? I used to call functions with $.post but in this case, the user has to interact with the gallery....
Thank you