
var flashinstalled = 0;
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.charAt(y.indexOf('.')-1);
		}
	}
	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
{
	MSDetect = "true";
}

function ifFlashInstalled(filename,alternate,width,height)
{
	if (flashinstalled == 2)
	{
		if (flashversion > 5)
		{
			document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='"+width+"' height='"+height+"'>");
			document.write("<param name='allowScriptAccess' value='sameDomain' />");
			document.write("<param name='movie' value='"+filename+"' />");
			document.write("<param name='quality' value='high' />");
			document.write("<embed src='"+filename+"' quality='high' width='"+width+"' height='"+height+"' quality='high' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
			document.write("</object>");
		}
		else
		{
			// Too old of a version
			doFlashAlt(alternate,width,height);
		}
	}
	else
	{
		// Not installed
		doFlashAlt(alternate,width,height);
	}
}

function doFlashAlt(alternate,width,height)
{
	if (alternate != "")
	{
		document.write("<img src='"+alternate+"' width='"+width+"' height='"+height+"'>");
	}
	else
	{
		document.write("<span style='width: "+width+"; height: "+height+"; font-size:11px; font-family:Arial, Tahoma, sans-serif;'><center>This web site makes use of <a href='http://www.macromedia.com/software/flash/' target='_blank'><u>Macromedia.FlashTM</u></a> software. Please install the newest version of Macromedia Flash Player to view this page.</center></span>");
	}

}
