var not_saved = {
	'ta': false,
	'text': 'Are you sure you want to cancel this?'
};
jQ(document).ready(function () {
	jQ('textarea').live('keypress', function (e) {
		not_saved.ta = true;
	});
	jQ('form').live('submit', function (e) {
		not_saved.ta = false;
	});
	
	window.onbeforeunload = function () {
		if (not_saved.ta) return not_saved.text;
	};
});