Hi, I am making an Iframe to pop up when users is leaving a page.. It is like a goodbye message. Now i have called a function with window.onbeforeunload.

The problem is that the iframe fires but disappears quickly.

To be precise it is a MOOdle popup and below is the code.

Code:
<html>
<head>
<title></title>

<script type="text/javascript" src="javascript/moodalbox121compressed/js/mootools.js"></script>
<script type="text/javascript" src="javascript/moodalbox121compressed/js/moodalbox.js"></script>
<script type="text/javascript" src="javascript/modalbox.js"></script>
<link href="javascript/moodalbox121compressed/css/moodalbox.css" rel="stylesheet" type="text/css" media="screen">
<script type="text/javascript">
window.onbeforeunload = popup;
function popup(){
MOOdalBox.open( "popup.htm","Some kind of caption", "450 305" )

}</script>

</head>