agt=navigator.userAgent.toLowerCase();
ie=(document.all) ? true:false
win=( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) )? true:false

pluginVer = 0;

var pluginspages = new Object();

pluginspages.japanese = "http://www.macromedia.com/jp/shockwave/download/?P1_Prod_Version=ShockwaveFlash&Lang=Japanese";
pluginspages.english = "http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash";

var plugin = ((navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0);
if (plugin) pluginVer = parseInt(plugin.description.substring(plugin.description.indexOf(".") -1 ));
if(pluginVer <= 1){
	pluginVer = parseInt(plugin.description.substring(plugin.description.indexOf(".") -2));
} 

function detectFlash(Obj) {

document.open();

if (Obj.file != "") {
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" id=' + Obj.name + ' width=' + Obj.width + ' height=' + Obj.height + ' name="' + Obj.name + '">' + '\n');
	document.write('<param name="movie" value="' + Obj.swf + '">' + '\n');
	document.write('<param name="loop" value="'+Obj.loop+'">'+'\n');
	document.write('<param name="menu" value="'+Obj.menu+'">'+'\n');
	document.write('<param name="quality" value="' + Obj.quality + '">' + '\n');
	document.write('<param name="bgcolor" value="' + Obj.bgcolor + '">' + '\n');
	document.write('<param name="flashVars" value="' + Obj.flashVars + '">' + '\n');
	document.write('<param name="menu" value="false"' + '>' + '\n');

	if ((win && ie) && !(navigator.userAgent.indexOf("Opera",0) != -1)) {
		document.write(Obj.nonflashsrc ) + '\n';
	}

	if (plugin && pluginVer >= Obj.requiredVer) {
		document.write('<embed src="' + Obj.swf + '" menu="false" quality="' + Obj.quality + '" swLiveConnect="' + Obj.liveconnect + '" flashVars="' + Obj.flashVars + '" bgcolor=' + Obj.bgcolor + ' width=' + Obj.width + ' height=' + Obj.height + ' type="application/x-shockwave-flash" pluginspage="' + pluginspages[Obj.language] + '" name="' + Obj.name + '"><\/embed><br>' + '\n');
	} else {
		if (!(win && ie)) {
			document.write(Obj.nonflashsrc ) + '\n';
		}
	}

	document.write('<\/object>' + '\n');

}

document.close();

}

