// **************  setup *******************

	// Flashファイルへの相対パス
	var flashFilePath = "./index.swf";

	// Flash横幅
	var flashWidth = "950";

	// Flash縦幅
	var flashHeight = "370";

	// Flashの必要バージョン
	var reqVersion = 7;

	// Flashがインストールされていないときに表示するメッセージ
	var noFlashMsg =
		"<a href=\"http://www.macromedia.com/shockwave/download/download.cgi?P5_Language=Japanese&Lang=Japanese&P1_Prod_Version=ShockwaveFlash&amp;Lang=Japanese\" target=\"_blank\"><img src=\"./img/top/image_main_fla.jpg\" width=\"1410\" height=\"370\" alt=\"Macromedia Flash Player DOWNLOAD\" border=\"0\"></a>";

// ************** メイン *********************

	var maxVersion = 7;
	var actualVersion = 0;
	var jsVersion = 1.0;
	var noflashflag;
	var flash2Installed = false;
	var flash3Installed = false;
	var flash4Installed = false;
	var flash5Installed = false;
	var flash6Installed = false;
	var flash7Installed = false;
	var rightVersion = false;
	var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
	var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false;
	jsVersion = 1.1;

	if(isIE && isWin){
		document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
		document.write('on error resume next \n');
		document.write('flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
		document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
		document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
		document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');  
		document.write('flash6Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');  
		document.write('flash7Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n');  
		document.write('</SCR' + 'IPT\> \n');
	}

	function detectFlash() {
		if (navigator.plugins) {
			if (navigator.mimeTypes['application/x-shockwave-flash']) {
				var flashDescription = navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin.description;
				var flashVersion = flashDescription.replace(/^[A-Za-z\s]+/, '');
				var flashmVersion = flashVersion.substring(0, flashVersion.indexOf("."));
				
				flash2Installed = flashmVersion == 2;
				flash3Installed = flashmVersion == 3;
				flash4Installed = flashmVersion == 4;
				flash5Installed = flashmVersion == 5;
				flash6Installed = flashmVersion == 6;
				flash7Installed = flashmVersion >= 7;
			}
		}

		for (var i = 2; i <= maxVersion; i++) {  
			if (eval("flash" + i + "Installed") == true) actualVersion = i;
		}

		if(navigator.userAgent.indexOf("WebTV") != -1) actualVersion = 3;

		if (actualVersion >= reqVersion) {
			rightVersion = true;
			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\" width=\"" + flashWidth + "\" height=\"" + flashHeight + "\">");
			document.write("<param name=movie value=\"" + flashFilePath + "\">");
			document.write("<param name=quality value=high>");
			document.write("<param name=\"allowscriptaccess\" value=\"always\">");
			document.write("<param name=\"bgcolor\" value=\"#ffffff\">");
			document.write("<embed src=\"" + flashFilePath + "\" quality=\"high\" bgcolor=\"#ffffff\" allowScriptAccess=\"always\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"" + flashWidth + "\" height=\"" + flashHeight + "\">");
			document.write("</embed>");
			document.write("</object>");
		} else {
			document.write(noFlashMsg);
		}
	}

	detectFlash();
