var flashVersion = 0;
MSDetect = "false";

if (navigator.plugins && navigator.plugins.length)
{
	x = navigator.plugins["Shockwave Flash"];
	if (x)
	{
		flashinstalled = 2;
		if (x.description)
		{
			y = x.description;
			flashVersion = y.substr(y.indexOf('.')-2,2).replace(" ", "");
		}
	}
	else
		flashinstalled = 1;
		
	if (navigator.plugins["Shockwave Flash 2.0"])
	{
		flashinstalled = 2;
		flashVersion = 2;
	}
}
else if (navigator.mimeTypes && navigator.mimeTypes.length)
{
	x = navigator.mimeTypes['application/x-shockwave-flash'];
	if (x && x.enabledPlugin)
		flashinstalled = 2;
	else
		flashinstalled = 1;
}
else
{
	PlayerVersion = function(arrVersion)
	{
		return (arrVersion[0] != null ? parseInt(arrVersion[0]) : 0);
	}

	try
	{
		var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
	}
	catch(e)
	{
		try 
		{
				var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
				PlayerVersion = PlayerVersion([6,0,21]);
				axo.AllowScriptAccess = "always"; // error if player version < 6.0.47 (thanks to Michael Williams @ Adobe for this code)
				flashVersion = PlayerVersion;
		} 
		catch(e) 
		{
			if (PlayerVersion == 6) 
			{
				flashVersion = 6;
			}
		}
		try 
		{
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
		} 
		catch(e) {}
	}
	if (axo != null) 
	{
		flashVersion = PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
	}
}


function loadFlash(filename, objectid, width, height)
{
	/****************************************************************
	*  SCRIPT FOR DETECTION FLASH VERSION
	****************************************************************/


	var strFlash = "<OBJECT id=\""+objectid+"\" name=\""+objectid+"\" codeBase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" height=\""+height+"\" width=\""+width+"\" align=\"left\" classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" VIEWASTEXT>" +
		"<PARAM NAME=\"_cx\" VALUE=\"11245\">" +
		"<PARAM NAME=\"_cy\" VALUE=\"3466\">" +
		"<PARAM NAME=\"FlashVars\" VALUE=\"\">" +
		"<PARAM NAME=\"Movie\" VALUE=\"" + filename + ".swf\">" +
		"<PARAM NAME=\"Src\" VALUE=\"" + filename + ".swf\">" +
		"<PARAM NAME=\"WMode\" VALUE=\"Transparent\">" +
		"<PARAM NAME=\"Play\" VALUE=\"-1\">" +
		"<PARAM NAME=\"Loop\" VALUE=\"-1\">" +
		"<PARAM NAME=\"Quality\" VALUE=\"High\">" +
		"<PARAM NAME=\"SAlign\" VALUE=\"\">" +
		"<PARAM NAME=\"Menu\" VALUE=\"-1\">" +
		"<PARAM NAME=\"Base\" VALUE=\"\">" +
		"<PARAM NAME=\"AllowScriptAccess\" VALUE=\"sameDomain\">" +
		"<PARAM NAME=\"Scale\" VALUE=\"ShowAll\">" +
		"<PARAM NAME=\"DeviceFont\" VALUE=\"0\">" +
		"<PARAM NAME=\"EmbedMovie\" VALUE=\"0\">" +
		"<PARAM NAME=\"BGColor\" VALUE=\"FFFFFF\">" +
		"<PARAM NAME=\"SWRemote\" VALUE=\"\">" +
		"<PARAM NAME=\"MovieData\" VALUE=\"\">" +
		"<PARAM NAME=\"SeamlessTabbing\" VALUE=\"1\">" +
		"<PARAM NAME=\"Profile\" VALUE=\"0\">" +
		"<PARAM NAME=\"ProfileAddress\" VALUE=\"\">" +
		"<PARAM NAME=\"ProfilePort\" VALUE=\"0\">" +
		"<embed src=\"" + filename + ".swf\" wmode=\"transparent\" id=\""+objectid+"\" name=\""+objectid+"\" quality=\"high\" bgcolor=\"#ffffff\" width=\""+width+"\" height=\""+height+"\" swLiveConnect=\"true\" align=\"left\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />" +
		"</OBJECT>";
		
	var strNoFlash = "<a href=\"http://www.macromedia.com/go/getflashplayer\" target=\"_blank\"><img id="+objectid+" src=\"images/noflash.gif\" border=\"0\"></a>";

	if (flashVersion > 7)
	{
		if (navigator.userAgent.toLowerCase().indexOf("msie") == -1)
			document.write(strFlash);
		else
			AC_FL_RunContent('src',filename,'movie',filename,'id',objectid,'codebase','http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0','width',width,'height',height,'align','left','quality','high','pluginspage','http://www.macromedia.com/go/getflashplayer','WMode','transparent');	
	}
	else
		document.write(strNoFlash);
}
