﻿var needToConfirm = false;

function setCloseConfirmFlag()
{
   needToConfirm = true; 
}

function releaseCloseConfirmFlag()
{
   needToConfirm = false;
}

window.onbeforeunload = confirmExit;
function confirmExit()
{
   if (needToConfirm)
   return "You have attempted to leave this page. Are you sure you want to exit this page?";
}
