function GD_Detector()
{
	this.detector=null;
	if(!eval("window.ifr_v3_det"))
		document.write('<iframe name="ifr_v3_det" width=0 height=0 frameborder=0 style="width:0;height:0;top:-20px"></iframe>');
	this.ifr=eval("window.ifr_v3_det");
	
	this.isDetector=function()
	{
		this.detector=null;
		try
		{
			if(document.all)
			{
				var s='<html><body><OBJECT ID="id" name="det" width="0" height="0" style="LEFT: 0px; TOP: 0px" classid="CLSID:969873F2-B009-4F9F-AC2A-B0B059906672"></OBJECT></body></html>';
				this.ifr.document.write(s);
				this.ifr.document.close();
				this.detector=this.ifr.document.det;
				//alert(this.detector);
			}
		}catch(e){}
		
		try
		{
			if(!this.detector && navigator.plugins["GanymedeNet.Detector"])
			{
				var s='<html><body><embed type=\"application/ganymedenet-detector\" width=1 height=1 name=\"det\"></embed></body></html>';
				this.ifr.document.write(s);
				this.ifr.document.close();
				this.detector=this.ifr.document.det;
			}
		}catch(e){}
		if(!this.detector)
			return false;
		return true;
	}
	
	this.isGame=function(game_protocol)
	{
		if(!this.detector)
			this.isDetector();
		if(!this.detector)
			return false;
		try
		{
			if(this.detector.IsGame(game_protocol)==1)
				return true;
		}catch(e){}
		return false;
	}
	
	this.getVersion=function(game_protocol)
	{
		try
		{
			if(!this.isGame(game_protocol))
				return false;
				
			var version=this.detector.GetVersion(game_protocol);
			return version;
		}catch(e){return false;}
	}
	
	this.getGameError=function(game_protocol)
	{
		try
		{
			var version=this.detector.GetGameError(game_protocol);
			return version;
		}catch(e){return false;}
	}

	this.getError=function()
	{
		try
		{
			var version=this.detector.GetError();
			return version;
		}catch(e){return false;}
	}

	
	this.canStart=function(game_protocol,version)
	{
		var current_version=this.getVersion(game_protocol);
		if(current_version)
		{
			version=version.split(".");
			current_version=current_version.split(".");
			
			return parseInt(version[0])==parseInt(current_version[0]) && parseInt(version[1])==parseInt(current_version[1]) && parseInt(version[2])==parseInt(current_version[2]) && parseInt(version[3])==parseInt(current_version[3]);
		}
		return false;
	}
}