var versionMajor	=	-1;
var versionMinor	=	0;
var versionRevision	=	0;

if (navigator.plugins != null && navigator.plugins.length > 0)
{
	var flashPlugin;

	flashPlugin = navigator.plugins["Shockwave Flash 2.0"];
	if (!flashPlugin)
	{
		flashPlugin = navigator.plugins["Shockwave Flash"];
	}

	if (flashPlugin)
	{
		var flashDescription	=	flashPlugin.description;			
		var descriptionArray	=	flashDescription.split(" ");
		var versionArray	=	descriptionArray[2].split(".");
		versionMajor		=	versionArray[0];
		versionMinor		=	versionArray[1];
		if ( descriptionArray[3] != "" )
		{
			revisionArray = descriptionArray[3].split("r");
		}
		else
		{
			revisionArray = descriptionArray[4].split("r");
		}
		versionRevision	=	revisionArray[1] > 0 ? revisionArray[1] : 0;
	}
}
// MSN/WebTV 2.6 supports Flash 4
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) versionMajor = 4;
// WebTV 2.5 supports Flash 3
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) versionMajor = 3;
// older WebTV supports Flash 2
else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) versionMajor = 2;
else
{
	var version;
	var axo;
	var e;

	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry

	try
	{
		// version will be set for 7.X or greater players
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version = axo.GetVariable("$version");
	}
	catch (e)
	{
	}

	if (!version)
	{
		try
		{
			// version will be set for 6.X players only
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
			
			// installed player is some revision of 6.0
			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
			// so we have to be careful. 
			
			// default to the first public version
			version = "WIN 6,0,21,0";

			// throws if AllowScriptAccess does not exist (introduced in 6.0r47)		
			axo.AllowScriptAccess = "always";

			// safe to call for 6.0r47 or greater
			version = axo.GetVariable("$version");
		}
		catch (e)
		{
		}
	}

	if (!version)
	{
		try
		{
			// version will be set for 4.X or 5.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = axo.GetVariable("$version");
		}
		catch (e)
		{
		}
	}

	if (!version)
	{
		try
		{
			// version will be set for 3.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = "WIN 3,0,18,0";
		}
		catch (e)
		{
		}
	}

	if (!version)
	{
		try
		{
			// version will be set for 2.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			version = "WIN 2,0,0,11";
		}
		catch (e)
		{
			version = -1;
		}
	}
	var descriptionArray	=	version.split(' ');
	var versionArray	=	descriptionArray[1].split(',');
	versionMajor		=	versionArray[0];
	versionMinor		=	versionArray[1];
	versionRevision		=	versionArray[2];
}
if (versionMajor < oxado_requestedMajor ||
	(versionMajor == oxado_requestedMajor && versionMinor < oxado_requestedMinor) ||
	(versionMajor == oxado_requestedMajor && versionMinor == oxado_requestedMinor && versionRevision < oxado_requestedRevision))
{
	document.write('<A TARGET="_blank" HREF="'+oxado_rurl+'" TITLE="'+oxado_linktitle+'"><IMG SRC="'+oxado_backupimage+'" WIDTH="'+oxado_width+'" HEIGHT="'+oxado_height+'" STYLE="border: 0"></A>');
}
else
{
	var oxado_clickvars;
	if (!oxado_clickvars)
	{
		oxado_clickvars	=	'clickTag,clickTAG';
	}
	var clickvars	=	oxado_clickvars.split(',');
	var clickvars2	=	new Array();
	if (versionMajor <= 6)
	{
		// Flash 6.x and below (Actionscript 1.0) is case insensitive, we can only use one copy of variables with the same name but different capitalizations
		var clickvars1	=	new Object;
		for (var i=0;i<clickvars.length;i++)
		{
			c	=	clickvars[i].toLowerCase;
			if (!clickvars1[c])
			{
				clickvars2.push(c+'='+oxado_flashrurl);
				clickvars1[c]	=	1;
			}
		}
	}
	else
	{
		for (var i=0;i<clickvars.length;i++)
		{
			clickvars2.push(clickvars[i]+'='+oxado_flashrurl);
		}
	}
	var clickvars_str	=	clickvars2.join('&');
	oxado_strFlash = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
	oxado_strFlash += ' codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"';
	oxado_strFlash += ' width="'+oxado_width+'" height="'+oxado_height+'" wmode="window" ID="oxado_flash" NAME="oxado_flash">\n';
	if (versionMajor >= 6)
	{
		oxado_strFlash += '<param name="movie" value="'+oxado_flashFile+'">\n';
		oxado_strFlash += '<param name="FlashVars" value="'+clickvars_str+'">\n';
	}
	else
	{
		oxado_strFlash += '<param name="movie" value="'+oxado_flashFile+'?'+clickvars_str+'">\n';
	}
	oxado_strFlash += '<param name="wmode" value="window">\n';
	oxado_strFlash += '<param name="quality" value="best">\n';
	oxado_strFlash += '<param name="menu" value="false">\n';
	if (versionMajor >= 6)
	{
		oxado_strFlash += '<embed src="'+oxado_flashFile+'" flashVars="'+clickvars_str+'"';
	}
	else
	{
		oxado_strFlash += '<embed src="'+oxado_flashFile+'?'+oxado_clickvars_str+'"';
	}
	oxado_strFlash += ' menu="false" quality="best" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" swLiveConnect="true" width="'+oxado_width+'" height="'+oxado_height+'" wmode="window" ID="oxado_flash" NAME="oxado_flash"></embed></object>';
	document.write(oxado_strFlash);
}

