// global flash check
var MM_contentVersion = 8;
var MM_FlashCanPlay   = 0;

function check_flash_version() {
	var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
	if ( plugin ) {
			var words = navigator.plugins["Shockwave Flash"].description.split(" ");
			for (var i = 0; i < words.length; ++i)
			{
			if (isNaN(parseInt(words[i])))
			continue;
			var MM_PluginVersion = words[i];
		}
		MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
	} else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1)) {
		document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
		document.write('on error resume next \n');
		document.write('dim obFlash \n');
		document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
		document.write('</SCR' + 'IPT\> \n');
	}
	return MM_FlashCanPlay;
}

if (!check_flash_version()) {
	document.location.href = "download_flash.html";
}

// get's round the ie security issue
function write_flash(file, width, height, wmode, params, version) {

	document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8\" width=\"" + width + "\" height=\"" + height +"\">");
	document.write("<param name=\"movie\" value=\"" + file + "?version=" + version + "\">");
	document.write("<param name=\"quality\" value=\"high\">");
	document.write("<param name=\"menu\" value=\"false\">");
	document.write("<param name=\"wmode\" value=\"" + wmode + "\">");
	document.write("<param name=\"FlashVars\" value=\"" + params + "\">");
	document.write("<embed src=\"" + file + "?version=" + version + "\" quality=\"high\" type=\"application/x-shockwave-flash\" width=\"" + width + "\" height=\"" + height +"\" wmode=\"" + wmode + "\" menu=\"false\" FlashVars=\"" + params + "\"></embed>");
	document.write("</object>");
}