Close Quick View button

I am using a mod that changes the ‘ADD TO CART’ button to a custom link for certain products.







The link below replaces the ‘ADD TO CART’ button with my ‘BUY NOW’ button:

<br />
<a class="AffButton" href="{$product.aff_url}" target="_blank"></a><br />

```<br />
<br />
When a user clicks on the 'BUY NOW' button, a new browser window is opened.<br />
<br />
How can I add an onclick event (or whatever) to my button so it also closes the Quick View pop-up after the user clicks the 'BUY NOW' button?<br />
<br />
I tried changing my button's code to the following but it does not work:<br />
```php
<br />
<a class="AffButton" href="{$product.aff_url}" target="_blank" onclick="self.close();"></a><br />

```<br />
<br />
Is there a way to add the functionality of the Quick View close button to an onclick event in my link? I just thought of an issue... my link/button is also used on the products main page, not just in the Quick View pop-up, because I'm utilizing the 'add_to_cart' hook so is there any way to do this?<br />
<br />
Maybe something like this:<br />
```php
<br />
{if $quick_view}<br />
<a class="AffButton" href="{$product.aff_url}" target="_blank" onclick="self.close();"></a><br />
{else}<br />
<a class="AffButton" href="{$product.aff_url}" target="_blank"></a><br />
{/if}<br />

```<br />
<br />
<br />
Thanks,<br />
<br />
Jeff <img src="upload://iKNGSw3qcRIEmXySa8gItY6Gczg.gif" class="bbc_emoticon" alt=":grin:">