var flashVer = 0;

if (navigator.plugins["Shockwave Flash"]) {
	versionIndex = navigator.plugins["Shockwave Flash"].description.indexOf(".");
	var versionString = navigator.plugins["Shockwave Flash"].description.substring(versionIndex-2, versionIndex);
	flashVer = parseInt(versionString);
} else if (navigator.userAgent && (navigator.userAgent.indexOf("MSIE") != -1) && (navigator.userAgent.indexOf("Win") != -1)) {
	document.writeln('<scr'+'ipt language=vbscript\>');
	document.writeln('on error resume next');
	document.writeln('for i = 15 to 5 step -1');
	document.writeln('SFlash = "ShockwaveFlash.ShockwaveFlash." & i');
	document.writeln('hasflash = isObject(CreateObject(SFlash))');
	document.writeln('if hasflash then');
	document.writeln('flashVer = i');
	document.writeln('exit for');
	document.writeln('end if');
	document.writeln('next');
	document.writeln('</scr'+'ipt\>');
}

function printFlash(src, id, width, height, ver, bg, img, alt) {
	if (flashVer>=ver) {
		document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ');
		document.write('codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+ver+',0,0,0" ');
		document.write('width="'+width+'" height="'+height+'" id="'+id+'" align="middle">');
		document.write('<param name="allowScriptAccess" value="sameDomain" />');
		document.write('<param name="movie" value="'+src+'" />');
		document.write('<param name="menu" value="false" />');
		document.write('<param name="wmode" value="transparent" />');
		document.write('<param name="quality" value="high" />');
		document.write('<param name="bgcolor" value="'+bg+'" />');
		document.write('<embed src="'+src+'" menu="false" wmode="transparent" quality="high" ');
		document.write('bgcolor="'+bg+'" width="'+width+'" height="'+height+'" name="'+id+'" align="middle" ');
		document.write('allowScriptAccess="sameDomain" type="application/x-shockwave-flash" ');
		document.write('pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');
	} else {
		document.write('<a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" target="_blank">');
		document.write('<img src="'+img+'" alt="'+alt+'" width="'+width+'" height="'+height+'" border="0" />');
		document.write('</a>');
	}
}
