/*
 * Functions to prevent closing the page, and losing any changes made to the document.
 *
 * this should be changed to only deny leaving the page when changes are not saved yet.
 * */

function dontCloseWindowConfirm(evt){
	if(Controls.getGlobal('pageChanged'))
		return "You are closing the window.";
}

function disable_dontCloseWindowConfirm(){
	window.onbeforeunload= function (evt) {}
}

function enable_dontCloseWindowConfirm(){
	window.onbeforeunload= function (evt) { return dontCloseWindowConfirm(evt); }
}
