var flashVersion = 0;
var higherLimit = 10;
if(navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1){
	document.write("<scr" + "ipt type=\"text/VBScript\">\n");
	document.write("Private i, obj\n");
	document.write("On Error Resume Next\n");
	document.write("flashInstalled = False\n");
	document.write("For i = higherLimit To 1 Step -1\n");
	document.write("Set obj = CreateObject(\"ShockwaveFlash.ShockwaveFlash.\" & i)\n");
	document.write("flashInstalled = IsObject(obj)\n");
	document.write("If flashInstalled Then\n");
	document.write("flashVersion = CStr(i)\n");
	document.write("Exit For\n");
	document.write("End If\n");
	document.write("Next\n");
	document.write("</scr" + "ipt>\n");
}
else{
	for(var i = 0; i <= higherLimit; i++){
		if (navigator.plugins["Shockwave Flash"].description.indexOf(i + ".0") != -1 ){
			flashVersion = i;
		}
	}
}

function setDocument(){
	var requiredVersion = 8;	//Flash Playerのバージョン
	var swfFile="swf/index.swf";		//チェックファイル選択
	var w="490"						//SWFの幅
	var h="199"						//SWFの高さ

	if(flashVersion >= requiredVersion){
		document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" width="'+w+'" height="'+h+'" id="top" align="middle">');
		document.write('<param name="allowScriptAccess" value="sameDomain" />');
		document.write('<param name="movie" value="'+swfFile+'" />');
		document.write('<param name="quality" value="best" />');
		document.write('<param name="bgcolor" value="#ffffff" />');
		document.write('<param name="wmode" value="opaque" / >');
		document.write('<embed src="'+swfFile+'" quality="best" bgcolor="#ffffff" width="'+w+'" height="'+h+'" name="top" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />');
		document.write('</object>');
	}
	else{
		altSrc();
	}
}

function altSrc(){
	document.write("<div><img src='img/recommend_substitution.gif' alt='トップページのFLASHコンテンツをご覧いただくためにはFlash Player 8以降が必要です。またJavaScriptは使用可能にしてください。' width='490' height='200' border='0' usemap='#recommend_useMap'>");
	document.write("<map name='recommend_useMap'>");
	document.write("<area shape='rect' coords='197,137,293,177' href='http://www.adobe.com/go/getflashplayer' target='_blank' alt='こちらをご覧いただくためにはFlash Player 8以降が必要です。またJavaScriptは使用可能にしてください。'>");
	document.write("</map></div>");
}