//
// Copyright (c) 2005 Advanced Computer Graphics, Inc. All rights reserved.
//
// The information in this file is protected by copyright law and international
// treaty provisions. Unauthorized reproduction, distribution or reverse
// engineering of this file, or any portion of it, is strictly prohibited.
//
// For information on licensing this software, please contact us by visiting
// our website at <www.acgmultimedia.com>.
//

function IsRealPlayerInstalled()
{
	return ( ACG_Detect.DetectActiveXControl( 'rmocx.RealPlayer G2 Control.1' ) );
}

function GetRealPlayerMajorVersion()
{
	if ( IsRealPlayerInstalled() )
	{
		var pTemp = new ACG_MediaG2( null, "VideoPlayerRP", "", 0, 0, 1, 1, 0, false, { autostart: 0 } );
		var pG2 = pTemp.GetPlayerObject();
		return pG2.GetVersionInfo();
	}
}

function CheckMinimumRequirements()
{
//alert( "mp:" + ACG_DetectMP.GetMajorVersion() + "." + ACG_DetectMP.GetMinorVersion() );
	var bRequirementsMet = true;

	var Requirements = new Object();

	Requirements.bOSSupport = ACG_Detect.bWin;
	Requirements.bBrowserSupport = ACG_Detect.bIe6up | ACG_Detect.bFirefox;

//	Requirements.bResolutionSupport = ( ( ACG_Detect.GetScreenWidth() >= 800 ) || 
//						   ( ACG_Detect.GetScreenHeight() >= 600 ) );

//	Requirements.bColorSupport = ( ACG_Detect.GetScreenColorDepth() >= 16 );

	Requirements.bFlashSupport = ACG_DetectFlash.IsInstalled() && ( ACG_DetectFlash.GetMajorVersion() >= 7 );

	if ( g_WindowsMedia )
		Requirements.bMediaSupport = ACG_DetectMP.IsInstalled();
	else
		Requirements.bMediaSupport = IsRealPlayerInstalled();

	for ( var prop in Requirements )
	{
		if ( !Requirements[prop] )
		{
			bRequirementsMet = false;
			break;
		}
	}

	if ( !bRequirementsMet )
	{
		sConfirm = "The presentation did not detect the following minimum system specifications:\n";
		if ( !Requirements.bOSSupport )
			sConfirm += "- Microsoft(R) Windows(R)\n";
		if ( !Requirements.bBrowserSupport )
			sConfirm += "- Microsoft(R) Internet Explorer 6.x or Firefox 1.0.7+\n";
		if ( !Requirements.bFlashSupport )
			sConfirm += "- Macromedia(R) Flash(TM) 7.x\n";
//		if ( !Requirements.bResolutionSupport )
//			sConfirm += "- 800x600 screen resolution\n";
//		if ( !Requirements.bColorSupport )
//			sConfirm += "- 16-bit color\n";
		if ( !Requirements.bMediaSupport )
		{
			if ( g_WindowsMedia )
				sConfirm += "- Microsoft(R) Windows Media\n";
			else
				sConfirm += "- RealNetworks(R) RealPlayer(R)\n";
		}

//		alert( sConfirm );
//		return false;

		sConfirm += "\nDo you want to continue?";
		if ( !confirm( sConfirm ) )
			return false;
	}
	return true;
}

