	needToConfirm = false;
	submitHit = false;
 	
function wysiwygDirty(){
	if (tinyMCE.activeEditor) {
		return tinyMCE.activeEditor.isDirty();
	}
	else {
		return false;
	}
}

function cleanWysiwygDirty(){
	if (tinyMCE.activeEditor) {
		tinyMCE.activeEditor.isNotDirty = true;
	}
}
	
function askConfirm(){
	if (submitHit){
		}
	else {
		if (needToConfirm){
			return 'There are unsaved changes.';
			}
		else {
			if (tinyMCE.activeEditor.isDirty()) {
				return 'There are unsaved changes.';
			}
		}   
		}
	}
        
function askConfirmAjax(){
	if (needToConfirm || wysiwygDirty()){
		if (confirm('Are you sure you want to navigate away from this page?' + '\n' + '\n' + 'There are unsaved changes.' + '\n' + '\n' + 'Press OK to continue, or Cancels to stay on the current page.')) {
			cleanWysiwygDirty();
			return true;
			}
		else {
			return false;
			}
	}
	else {
		return true;
		}
}
        