//$(document).ready(function() { 	alert('Bonjour');	});

//$(window).focusout( function () { gererUnload(); } );
//$(window).beforeunload( function () { gererUnload(); } );

window.onbeforeunload =  function () { gererUnload(); } ;

function gererUnload() {	
	var oFlash = getFlashInforoute();
//	alert(oFlash+' ==> '+oFlash.gererFermetureApplication);
	if (oFlash!= null && oFlash.gererFermetureApplication!=null) {		
		oFlash.gererFermetureApplication();		
	}	
}

function getFlashInforoute() {		return document['inforoute'];		}

/** Enregistrement des statistiques envoyés par le flex
*
*/
function enregistrerStatistiques(sStat,sUrlDossier,sPrefixeFichier) {	
	var param = new Object();
	param.statistique = sStat;
	if(sUrlDossier != '') 		param.url_dossier = sUrlDossier;
	if(sPrefixeFichier !='') 	param.prefixe_fichier = sPrefixeFichier;
//	alert('enregistrerStatistiques JS');
	$.post("mod_turbolead/mod/inforoute/stat-ajax.php", param,retourEnregistrement,"json");
}

/** fonction de retour ajax appelé par enregistrerStatistiques
*
*/
function retourEnregistrement(o) {}
