BDG Scenario 3

IsDirty.js

var isDirty = false;

function setDirty() {
   isDirty = true;
}

function clearDirty() {
   isDirty = false;
}

function checkDirty() {
   if (isDirty) return L_PageIsDirty;
}

window.onbeforeunload = checkDirty;