I'm using a popup (I know I know......bad idea) window with survey to ask visitors why they're leaving our commerce engine (early abandonment survey). In IE it works properly in that the window only opens when the user closes the commerce window (which itself was opened as a separate window from our site - again, not my decision but I have to live with and work with it).

I'm checking for onclicks on a graphic based 'close button' as well as a separate script checking for a click on the window's 'X' in the upper right corner. In Firefox the survey is called everytime the page in the commerce window changes (i.e. when they continue on through the process within the window). Obviously this would be frustrating as anytime the page is reloaded or advanced to the next step page, the survey pops up.

Here are the JS code blocks that exist in the the commerce window and do the "popping up" bit:

Code:
// called if graphic 'close' button clicked
function callMyParentWindow (){
 surveyRequest();
 window.self.blur();
  window.close();
}
 
function eventListeners(e) {
 var closeClicked = document.getElementById('UcTop_Container1_subheader_RollOverLink2');
 addEvent(closeClicked, 'click', callMyParentWindow, false);
 //alert('fn eventListeners was called');
}
 

//addEvent(window, 'load', eventListeners, false);
 
//function eventListener (e) {
// var t = window.event ? window.event.srcElement : e ? e.target : null;
//}
 
function addEvent (elm, evType, fn, useCapture){
 if (elm.addEventListener){// Check for Gecko event method
  elm.addEventListener(evType, fn, useCapture);
  return true;
 } else if (elm.attachEvent) {// if not above, then check for IE event method
  var r = elm.attachEvent('on' + evType, fn);
  return r;
 } else {
  elm['on' + evType] = fn;
 }
 //alert('fn addEvent was called');
}
 
function surveyRequest (){
 window.open('https://www.sitepoint.com/somesurvey.html','popped2','toolbar=no,location=no,status=no,scrollbars=yes,width=500,height=600');
 window.self.blur();
}
Code:
// called if window is closed using 'X' button.
function SetIt(){
//Need to store Page for Netscape Look Up
 ThePage=document.location.href;
}
function trapIt(){
 
 if(document.all){
 var tempX = event.clientX + document.body.scrollLeft;
 var tempY = event.clientY + document.body.scrollTop;
//If mouse is over X will return very large negative numbers
  if(tempX<0&&tempY<0){
 
  ItBClosed();
  }
 }
 else{
//Detects Back/Forward Buttons and Location Box Launching
 ThisPage=document.location.href;
 if(ThePage!=ThisPage){
  //Different Location detected - fine for next and previous
 }
 else{
  ItBClosed();
  }
 }
}
 
function ItBClosed(){
 window.open('https://www.sitepoint.com/somesurvey.html','popped2','toolbar=no,location=no,status=no,scrollbars=yes,width=500,height=600');
 return false;
}
Can anyone see why I'm getting the wrong behaviour in FF?

- I've been staring at this too long, I can't see what's right in front of me anymore

Thanks in advance folks.
- PBME