var target_flash_Ver = 8;

//plugin check
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {

	//plugin version check
	var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	for (var i = 0; i < words.length; ++i){
		if (isNaN(parseInt(words[i])))
		continue;
		var PluginVersion = words[i]; 
	}

	var FlashCanPlay = PluginVersion >= target_flash_Ver;

}else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1)) {

	//for windows Internet explorer
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & target_flash_Ver)))\n');
	document.write('</SCR' + 'IPT\> \n');
}



function dispContent (flashDataObj,  NO_flashDataObj) {
	if ( FlashCanPlay ) {
		swfName = flashDataObj.swfName;
		swfWidth = flashDataObj.swfWidth;
		swfHeight = flashDataObj.swfHeight;
		swfBgColor = flashDataObj.swfBgColor;
		custom_embed(swfName, swfWidth, swfHeight, swfBgColor);
	} else{
		dispImage(NO_flashDataObj);
	}
}

function custom_embed(swfName, swfWidth, swfHeight, swfBgColor){
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width=" + swfWidth + " height=" + swfHeight + ">");
	document.write("<param name=movie value=" + swfName + ">");
	document.write("<param name=bgcolor value=" + swfBgColor + ">");
	document.write("<param name=quality value=high>");
	document.write("<param name=menu value=false>");
	document.write("<param name=scale value=noscale>");
	document.write("<embed src=" + swfName + " menu=false quality=high scale=noscale pluginspage='http://www.macromedia.com/jp/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' bgcolor=" + swfBgColor +" width=" + swfWidth + "  height=" + swfHeight + "></embed>"); 
	document.write("</object>");
}


function dispImage(NO_flashDataObj) {
	document.write(NO_flashDataObj);
}