var flashCommunication = false;
var playerValues = new Array(4); 

playerValues[0] = "video1.flv";
playerValues[1] = "video2.flv";
playerValues[2] = "video3.flv";
playerValues[3] = "video4.flv";

function player(id)
{
	if(document.getElementById("player").style.display == "none")
	{
		document.getElementById("player").style.display = "block";
		document.getElementById("intro").style.display = "none";
	}
	
	var file  = 'video/' + playerValues[id-1];	
	var playerConfig = { 
		autoPlay: true,       
		loop:false,                            
		autoRewind:true,
		autoBuffering: true,
		bufferLength:6,
		startingBufferLength: 5,
		controlBarBackgroundColor: 0,
		videoFile: file
		} 
	flashembed("player", {src:"flow-player.swf", width: 754, height: 342, bgcolor:'#000000'}, {config: playerConfig});
	
	if(flashCommunication == false)
	{
		getFlashMovie("faces_reflections").sendToFlash(); 
		flashCommunication = true;
	}
}

function getFlashMovie(movieName) 
{
	var isIE = navigator.appName.indexOf("Microsoft") != -1;
	return (isIE) ? window[movieName] : document[movieName];
}

function getFromFlash()
{
	flashCommunication = false;
}
