/**
 * The javasccript that warns the user when they move off a page that has had edits
 * To mark a page as edited call windowChanged()
 */
window.changed = false;
function checkForChanges( /*event*/ evt ) {
	if( window.ignoreChange ) {
		window.ignoreChange = false;
	} else {
		// IE supports evt.returnValue to cancel in the onBeforeUnload handler
		// firefox supports evt.preventDefault() in the onUnload handler
		//    (but onBeforeUnload appears to work also so we are using that).
		if ( window.changed ) {
			if ( evt.preventDefault ) {
				evt.preventDefault();
			} else {
				evt.returnValue = "This window has changed";
			}
		}
	}
}
function recordChange() {
	window.changed = true;
}
function clearChangeNotification() {
	window.changed = false;
	return true;
}
