/******************************************************************************/
/* D'Fusion Web JavaScript Library                                            */
/*                                                                            */
/* IMPORTANT REMARKS:                                                         */
/*   - To use this file you have to include totalimmersion_dfusion_web.js     */
/******************************************************************************/

function ExecuteCommand(command)
{
	if (document.embeds && document.embeds[g_tiPluginName]) {
		if (document.embeds[g_tiPluginName].ExecuteCommand) {	
			document.embeds[g_tiPluginName].ExecuteCommand(command);
			
			return true;
		} else {
			alert("Cannot find 'ExecuteCommand' function.\nPlease restart your web browser and retry to play the D'Fusion application.");
			return false;
		}
	}
	
	if (document.getElementById) {
		document.getElementById(g_tiPluginName).excecuteCommand(command);
		
		 return true;
	 }
	
	
	
	return false;
}

function CamSelected(camname)
{
	ExecuteCommand("CamSelected '"+camname+"'");
	
}
function goFullScreen()
{
	ExecuteCommand("GoFullScreen");
}

function MakeKeystrokeActions()
{
	
	
	for (var i = 0; i < arguments.length; i++) 
	{
		ExecuteCommand("PLAYWITHKEY '"+arguments[i]+"'");
	}
	
}

function SelectStep(step)
{
	ExecuteCommand("button '" + step + "'");
}

