Help needed with centred pop up windows

Hi guys,

Thanks for the interest in my post…

I am opening centred pop up windows with Flash for a gallery so when you click on a thumbnail, it brings up the centred pop win.

Unfortunately, if the user opens a pop up window, they have to close it in order to open another one. What I want to happen is if the user has a pop up window already open and selects another thumbnail from the gallery, the pop up window is replaced by the new one, meaning the user won’t have to close a pop win.

Is this do-able with the code I’m using?

_root.contentMain.openWinCentre = function (url, winName, w, h, toolbar, location, directories, status, menubar, scrollbars, resizable) {

    getURL ("javascript:var myWin; if(!myWin || myWin.closed){myWin = window.open('" + url + "','" + winName + "','" + "width=" + w + ",height=" + h + ",toolbar=" + toolbar + ",location=" + location + ",directories=" + directories + ",status=" + status + ",menubar=" + menubar + ",scrollbars=" + scrollbars + ",resizable=" + resizable + ",top='+((screen.height/2)-(" + h/2 + "))+',left='+((screen.width/2)-(" + w/2 + "))+'" + "')}else{myWin.focus();};void(0);");

    }

…and…

on (release) {
    address = "gallery/large.php?image=041";
    target_winName = "gallery";
    width = 750;
    height = 493;
    toolbar = 0;
    location = 0;
    directories = 0;
    status = 0;
    menubar = 0;
    scrollbars = 0;
    resizable = 0;
    //sends data back to the function
    openWinCentre(address, target_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable);

    }

Thank you very much and I hope to hear from you.

All the best,

Mark