var times= 0; /* to prevent multiple messages*/

function onul(mess, check_confirm) {
  if (times == 0 || check_confirm) {
    var leave = true;
    if (check_confirm) {
	leave = confirm(mess);
    }
    times++;
    if (!leave) {
       // Do nothing if cancelled
       // location = self.location;
    } else {
      new Ajax.Request('/update/unload');
      window.location = '/update/welcome';
    }
  }
}
