var flowPlayed 		= Array();
var videoPlaying 	= Array();

function flowPauseTimer(id,startTime)
{
	alert(id + ' ' + startTime);	
}
function flowPause(id,autostart)
{
	if(flowPlayed[id] != 1)
	{
		if(autostart != 1)
		{
			flowplayer(id).pause();
		}
		flowPlayed[id] = 1;
	}
}
function flowLoop(id)
{
	flowplayer(id).play();
}
function videoPause(id,autostart)
{
	if(flowPlayed[id] != 1)
	{	
		if(autostart != 1)
		{
			var elt = document.getElementById(id);
			elt.pause();
		}
		flowPlayed[id] = 1;
	}
}
function playOver(id)
{
	var elt = document.getElementById(id);
	elt.src = '/eswpublic/icons/video/video_play_roll.png';
}
function playOut(id)
{
	var elt = document.getElementById(id);
	elt.src = '/eswpublic/icons/video/video_play_normal.png';	
}
function playVideo(imageid,id)
{
	var elt = document.getElementById(imageid);	
	if(elt)
	{
		elt.style.visibility = 'hidden';
	}
	var elt = document.getElementById(id);
	elt.play();	
}
function hidePlayButton(vid,id)
{
	videoPlaying[vid] = true;
	var elt = document.getElementById(id);
	elt.style.visibility = 'hidden';
}
function showPlayButton(vid,id)
{
	videoPlaying[vid] = false;	
	var elt = document.getElementById(id);
	elt.style.visibility = 'visible';
}
function togglePlay(id)
{
	flowPlayed[id] = 1;
	var elt = document.getElementById(id);
	if(videoPlaying[id])
	{ 
		elt.pause();
	}
	else
	{
		elt.play();
	}
}
