//window.onbeforeunload = confirmExit;


var needToConfirm = false;
var status = '';
var readerstatus = '';

function setDirtyFlag(status)
{
	readerstatus = status;

	needToConfirm = true; //Call this function if some changes is made to the web page and requires an alert
// Of-course you could call this is Keypress event of a text box or so...
}

function releaseDirtyFlag()
{

	needToConfirm = false; //Call this function if dosent requires an alert.
//this could be called when save button is clicked
}


window.onbeforeunload = confirmExit;

function confirmExit()
{
	if(needToConfirm){
		return "Uw heeft uw status nog steeds op "+ readerstatus +" staan.\nZorg ervoor dat u OFFLINE bent, voordat u deze pagina verlaat!\n\n Klik op ANNULEREN en zet uw status op OFFLINE voordat u deze pagina verlaat.";
	}
}