// Copyright 2005
// Auteur: Gilles CRUCHON

// cpa_active est définie à true de façon externe pour activer le mécanisme
var cpa_Valid = false;
var cpa_Modified = false;
function changePageAlert_hasBeenModified(){
	return cpa_Modified;
}

function changePageAlert_IE() {
    if( changePageAlert_hasBeenModified() ){
    	event.returnValue = msg__changePageAlert_closemsg;
    }
}

function changePageAlert_FF() {
    if( changePageAlert_hasBeenModified() ){
    	return msg__changePageAlert_closemsg;
    }
}

function changePageAlert_changeModify( b ){
	cpa_Modified = b;
}

if( cpa_active ){
	if( navigator.appName.indexOf("Microsoft") != -1 ){
		window.onbeforeunload = changePageAlert_IE;
		cpa_Valid = true;
	}
	if( navigator.appName.indexOf("Netscape") != -1 ){
		window.onbeforeunload = function(){
			return changePageAlert_FF();
		}
		cpa_Valid = true;
	}
	if( !cpa_Valid ){
		alert( msg__changePageAlert_notsupported );
	}
}


