var exit = true;  // set this to false when you need to let them leave the page without getting another popup

var url2 = "http://www.myfreepaysite.com/leaving.php"; //url of the exit popup
if (jsAid != '')
   url2 += "?aid=" + jsAid;

var pop2width = 780;
var pop2height = 420;

function pop() {
  if (exit)
  {

if (document.cookie.indexOf("MFPpopCFG=") == -1)    
{
    window.open(url2,"exitwindow","height=" + pop2height + ",width=" + pop2width + ",scrollbars=auto,resizable=1,status=0,toolbar=0,menubar=0,location=0")
}

  }
}

try{
attachEvent('onbeforeunload',pop);
} catch (e) { };

