var dataChanged = 0; // global variable flags unsaved changes
function bindForChange()
{
	//jQuery('input,checkbox,textarea,radio,select').bind('change',function(event) { 
	jQuery('form.confirm').bind('change',function(event) {
		dataChanged = 1;
	}); 
	jQuery(':reset,:submit').bind('click',function(event) { 
		dataChanged = 0;
	}); 
}

function askConfirm(){
	if (dataChanged){ return "You have some unsaved changes. Press OK to continue without saving." } 
}

window.onbeforeunload = askConfirm; 
window.onload = bindForChange;
