Hi Learner! I just tested this in my test site, and it works perfectly.
<a name="mypopuplink" id="mypopuplink" href="javascript
:void(0);" onclick="javascript
: return !popupOpen(xcart_web_dir + '/popup_ask.php?productid=2'); return false;"><img src="{ImagesDir}/mypopupimage.jpg" /></a>
I used the code you provided back to me so I can't imagine why this isn't working for you. Of course this link references "productid=2" and it is only going to work on the product page with that product id.
Try: productid=`$product.productid`
Hope that helps. Feel free to
send me a coffee.