Pop-upwindows

hi,

im having 2 scenarios where i got ask to add pop-up widows to a rails
app.
1)
on is a regular index view, clicking on “add new item” should popup a
new window. when i create a new item thorugh that window, i want that
the base window, meaning the index view, gets refreshed.

same here, i want to have a “search” link to open a new window to
select criteris for a search. once u hit the button seach it should
refresh the main-index view and keep the "search-pop-up-window open…

im just not sure how to interact with the window in the back…are
ther eany tutorials or ideas?

//i know rails so far, but not really js…

thx tom