# Trouble with pop up window

**URL:** <https://forum.kirupa.com/t/trouble-with-pop-up-window/168180>\
**Category:** Uncategorized\
**Created:** [November 4, 2005, 3:36pm UTC](https://forum.kirupa.com/t/trouble-with-pop-up-window/168180 "2005-11-04T15:36:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pkcidstudio](https://avatars.discourse-cdn.com/v4/letter/p/278dde/32.png) [@pkcidstudio](https://forum.kirupa.com/u/pkcidstudio)\
**Post date:** [November 4, 2005, 3:36pm UTC](https://forum.kirupa.com/t/trouble-with-pop-up-window/168180/1 "2005-11-04T15:36:44Z")

</div>

greetings, i am using a simple new window script, but need to alter it. when i open up one of the links, if i dont close it, but go to open up a different link. the already open window pops back up. i need this window to change due to the new link pressed. the site is [COLOR=Red][link removed by claudio][/COLOR] click on the prodoct locator to see an example.

here is the script for the root-\>

```auto
 _root.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);");
};
 

```

the script for the button.\>

```auto
on (release) {
 //customize the window that gets opened 
 // 0 equals NO. 
 // 1 equals YES. 
 address = [COLOR=Red][removed by claudio][/COLOR] 
 width = 650;
 height = 590;
 toolbar = 0;
 location = 0;
 directories = 0;
 status = 0;
 menubar = 0;
 scrollbars = 1;
 resizable = 0;
 //sends data back to the function 
 openWinCentre(address, target_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable);
}

```

any help would be great help
