function _PGC()
{
	this.strGameAXName		= "PlanB.Launcher";
	this.strGameFPName		= "application/x-nppb"
	this.objPGC				= null;
	
	// Browser Info Setting
	if (window.navigator.appName == "Microsoft Internet Explorer")
	{
		this.BrowserInfo= "IE";
	}
	else if (window.navigator.userAgent.toLowerCase().indexOf('firefox') > -1)
	{
		this.BrowserInfo= "FF";
	}
	else if (window.navigator.userAgent.toLowerCase().indexOf('chrome') > -1)
	{
		this.BrowserInfo= "Chrome";
	}
	else if (window.navigator.userAgent.toLowerCase().indexOf('opera') > -1)
	{
		this.BrowserInfo= "Opera";
	}
	else if (window.navigator.userAgent.toLowerCase().indexOf('safari') > -1)
	{
		this.BrowserInfo= "Safari";
	}
	else if (window.navigator.userAgent.toLowerCase().indexOf('netscape') > -1)
	{
		this.BrowserInfo= "Netscape";
	}
	else
	{
		this.BrowserInfo= "Unknown";
	}
	
	if ( this.BrowserInfo== "IE" )
	{
		this.ModuleFormat= "AX";
	}
	else if (  this.BrowserInfo== "Unknown")
	{
		this.ModuleFormat= "err";
	}
	else
	{
		this.ModuleFormat= "NP";
	}
  
	if (this.ModuleFormat == "NP")
	{
		navigator.plugins.refresh(false);
		
		var mimetype = navigator.mimeTypes[ this.strGameFPName ];
		
		if (mimetype && mimetype.enabledPlugin)
		{
			document.write("<span style='position:absolute;top:100px;left:100px;z-index:1'><embed id=\"npplanb\" type=\"" + this.strGameFPName + "\" pluginspage=\"" + "\" HIDDEN=\"true\"/></span>");
		}
	}
	
	this.InitGameControl = function PGC_InitGameControl()
	{
		if( this.objPGC == null )
		{
			try
			{
				if (this.ModuleFormat== "AX")
				{
					this.objPGC = new ActiveXObject( this.strGameAXName );
				}
				else if (this.ModuleFormat= "NP")
				{
					this.objPGC = document.getElementById('npplanb');
				}
			}
			catch( ex )
			{
			}
		}
	}
	
	this.LaunchGame = function PGC_LaunchGame( arg )
	{
		this.InitGameControl();
	
		try
		{
			return this.objPGC.Launch( String( arg ) );
		}
		catch( ex )
		{
			return -1;
		}
	}
	
	this.IsInstalled = function PGC_IsInstalled()
	{
		this.InitGameControl();
		
		try
		{
			return this.objPGC.IsInstalled();
		}
		catch( ex )
		{
			return 0;
		}
	}
}

var PGC = new _PGC();