//Gestion du player Flash

/* 	*****************************************
	*					*
	*	FSCommand Flash			*
	*					*
   	***************************************** */

/* 	*****************************************
	*	Header		
   	***************************************** */
   	/*
	var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
	// Handle all the FSCommand messages in a Flash movie.
	function header_DoFSCommand(command, args) {
		var headerObj = isInternetExplorer ? document.all.header : document.header;

		switch(command)
		{
			case "menu_click"://Click sur un service
				switch(args)
				{
					case "accueil":
						zoneswap("esa_zone_accueil","titi");
						break;
					case "moncompte":
						zoneswap("esa_zone_main","member.php");
						break;
					case "contact":
						zoneswap("esa_zone_main","tutu");
						load_contact();
						break;
					case "presse":
						larg = (screen.availWidth/1.2);
						haut = (larg*600)/800;
        					posleft = (screen.availWidth/2)-(larg/2);
						postop = (screen.availHeight/2)-(haut/2);
						press=window.open('presse.pdf','press','resizable=yes,scrollbars=no,fullscreen=no,width='+larg+',height='+haut+',left='+posleft+',top='+postop);
      
						break;
					default:
						alert(args);
						break;
				}
				break;
		
		}
	}
	// Hook for Internet Explorer.
	if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
		document.write('<script language=\"VBScript\"\>\n');
		document.write('On Error Resume Next\n');
		document.write('Sub header_FSCommand(ByVal command, ByVal args)\n');
		document.write('	Call header_DoFSCommand(command, args)\n');
		document.write('End Sub\n');
		document.write('</script\>\n');
	}
	*/
	
/* 	*****************************************
	*	Fin FSCommand Flash		*
   	***************************************** */

//Fonction FSCommand pour dialoguer avec le Movie Flash

function getFlashMovieObject(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);
	}
}


//charger un headermovie
//nom : contient le nom du movie
function load_headermovie(nom)
{
	var so = new SWFObject("swf/subheader.swf", "subheader", "780", "160", "8", "#FFFFFF");
	so.addVariable("sHeaderMovie", nom);
	so.write("subheadermovie");
	
	/*
	Ancienne méthode utilisant external
	var flashobject = getFlashMovieObject("subheader");
	if (nom!="")
	{
		flashobject.loadsubmovie(nom);
	}
	*/
}

function load_headermovie_firefox()
{
	var flashobject = getFlashMovieObject("subheader");
	var nom=global_flash_bandeau;
	if (nom!="")
	{
		flashobject.loadsubmovie(nom);
	}
}



/*********************************************************************************************
					Fonctions obsolètes
**********************************************************************************************/

// Verifie que le movie soit bien chargé
function movieIsLoaded (theMovie)
{
	alert("fonction flash.js : movieIsLoaded obsolete");
	/*
	if (navigator.appVersion.indexOf("Mac",0)>0)
	{
		alert("Ne fonctionne pas sur Mac");

	}
	else
	{
		// First make sure the movie's defined.
		if (typeof(theMovie) != "undefined") {
			// If it is, check how much of it is loaded.
			return theMovie.PercentLoaded() == 100;
		}
		else 
		{
			// If the movie isn't defined, it's not loaded.
			return false;
		}
	}
	*/
}


//relancer l'anim de l'accueil
//nom : contient le nom du movie
function reload_accueil()
{
	alert("fonction flash.js : reload_accueil obsolete");
	/*
	if (movieIsLoaded(getFlashMovieObject("accueil"))) {
		getFlashMovieObject("accueil").GotoFrame(1);
		getFlashMovieObject("accueil").Play();
	}
	*/
}


//lance la lecture du movie (par exemple)
function playmovie() 
{
	alert("fonction flash.js : playmovie obsolete");
	/*
	if (movieIsLoaded(getFlashMovieObject(movieName))) {
		getFlashMovieObject(movieName).Play();
	}
	*/
}

//envoyer une variable a un movie
function sendtext(texte)
{
	alert("fonction flash.js : sendtext obsolete");
	if (navigator.appVersion.indexOf("Mac",0)>0)
	{
		alert("Ne fonctionne pas sur Mac");

	}
	else
	{	
		if (movieIsLoaded(getFlashMovieObject(movieName))) {
			getFlashMovieObject(movieName).SetVariable("Chaine", texte);
			getFlashMovieObject(movieName).GotoFrame(3);
			getFlashMovieObject(movieName).Play();
		}
	}
}