Here is the script code. when you get out of this page you'll see it working.

<script language="Javascript">

<!-- hide from old browsers
//script code by Carlos Nieto
//You must place the body tag with the onUnload part
function sign() {
if (confirm('Would you like to sign my guestbook?'))
alert('Bye! Come back soon.')
You can use another url above instead of the alert. Just write the same as the location.href= above.
} }
// stop hiding from old browsers -- >
<body onUnload="sign()">

Script code by Carlos Nieto

Tommy Raven says Moo.