
// Fermer la fenêtre si elle est ouverte
function FermerFenetre(p_fenetre)
	{
	try
		{
		p_fenetre.close();
		}
	catch(err)
		{
		}
	}

function FermerToutesLesFenetres()
	{
	FermerFenetre(fenetreVideos);
	FermerFenetre(fenetrePhotos);
	}

window.onunload= FermerToutesLesFenetres;

function objFlash_DoFSCommand(command, args)
	{
	switch (command)
		{
		case "OUVRIR_VIDEO":
			
			args= unescape(args);
			
			var sFichierCible;
			
			if (IE)
				{
				sFichierCible= 'video.html';
				}
			else
				{
				sFichierCible= 'video-ff.html';
				}
			
			sParamVideo= args;
			FermerFenetre(fenetreVideos);
			fenetreVideos= window.open(sFichierCible, 'fenetreVideos', 'fullscreen=0, toolbar=0, location=0, scroll=1, menubar=0, status=1, resizable=1, left=80, top=50, width=650, height=540');
			fenetreVideos.focus();
				
			break;
		
		case "OUVRIR_PHOTO":
			sParamPhoto= args;
			FermerFenetre(fenetrePhotos);
			fenetrePhotos= window.open('photo.html', 'fenetrePhotos', 'fullscreen=0, toolbar=0, location=0, scroll=1, menubar=0, status=1, resizable=1, left=30, top=20, width=701, height=600');
			fenetrePhotos.focus();
			break;
		
		case "ALERT":
			alert(args)
			break;
		}
	}

var fenetreVideos= null;
var fenetrePhotos= null;

// Globales accessibles par les fenêtres enfant. Elles vaudront l'argument passé à FSCommand
var sParamVideo= "";
var sParamPhoto= "";

// Code exclusif à Internet Explorer
if (IE)
	{
	document.write('<script language=vbscript\> \n');
	document.write('on error resume next \n');
	document.write('sub objFlash_FSCommand(ByVal command, ByVal args)\n');
	document.write(' call objFlash_DoFSCommand(command, args)\n');
	document.write('end sub\n');
	document.write('</script\> \n');
	}
