I have a function which launches a javascript window, like this

```
    function genericPop(strLink, strName, iWidth, iHeight) {
            var parameterList = "location=0,directories=0,status=0,menubar=0,resizable=no, scrollbars=no,toolbar=0,maximize=0,width=" + iWidth + ", height=" + iHeight;
            var new_window="";

            new_window = open(strLink, strName, parameterList);
            window.self.name = "main";
            new_window.moveTo(((screen.availWidth/2)-(iWidth/2)),((screen.availHeight/2)-(iHeight/2)));
            new_window.focus();
}

```

This function is called about 52 times from different places in my web application.

I want to re-factor this code to use a DHTML modal pop-up window. The change should be as unobtrusive as possible.

To keep this solution at par with the old solution, I think would also need to do the following

1. Provide a handle to "Close" the window.
2. Ensure the window cannot be moved, and is positioned at the center of the screen.
3. Blur the background as an option.

I thought [this solution](http://particletree.com/features/lightbox-gone-wild/) is the closest to what I want, but I could not understand how to incorporate it.

Edit: A couple of you have given me a good lead. Thank you. But let me re-state my problem here. I am re-factoring existing code. I should avoid any change to the present HTML or CSS. Ideally I would like to achieve this effect by keeping the function signature of the genericPop(...) same as well.