var original_text = "";
var _confirm = true;

// function _onload(){
	//original_text = document.getElementById("contents").value;
//}

function _onunload(){
	if (_confirm && (document.getElementById("contents").value != original_text))
	{
		if (window.confirm(
			"There are unsaved changes.\n\nPress 'OK' to save changes.\nPress 'Cancel' to discard changes."
		)){
			document.getElementById("editor").submit();
		}
	}
}
