function CFlashCommunication()
{
	this.constructor = function()
	{
		this.flashGame = undefined;
		this.hasDoneOnBeforeUnload=false;
	}
	
	this.getFlashVar = function()
	{
		if(this.flashGame == undefined) this.flashGame = this.getFlashMovieObject("game");
		
		if(this.flashGame != undefined)
		{
			this.flashGame.SetVariable('_global.LTN_tracking.javascriptVar', "closeHtmlWindow");
			this.hasDoneOnBeforeUnload=true;
		}
	}
	
	this.getFlashMovieObject = function(movieName)
	{
		if (window.document[movieName]) 
		{
			return window.document[movieName];
		}
		if (navigator.appName.indexOf("Microsoft Internet")==-1)
		{
			if (document.embeds && document.embeds[movieName]) return document.embeds[movieName]; 
		}
		else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
		{
			return document.getElementById(movieName);
		}
	}
	this.constructor();
}


var FLASHCOM = new CFlashCommunication();

// fonction appelée lorsque l'on ferme la fenêtre.
window.onbeforeunload = confirmExit;
function confirmExit()
{
	if(FLASHCOM.hasDoneOnBeforeUnload) window.onbeforeunload=undefined;
	FLASHCOM.getFlashVar();
}