SwfParam = {
boxId :'header', //設置するボックスのID名
file : 'index.swf', //swfの場所
width : '800',
height : '356',
requiredVer : 8 //プラグインの必要バージョン
};

/*----- Flash Player のバージョン判定[BEGIN]-----*/
// IE以外でFlash Player のバージョンを取得　変数pluginVerに入る。
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : null;
if (navigator.mimeTypes["application/x-shockwave-flash"]) {
	pluginVer = parseInt(plugin.description.substring(plugin.description.indexOf(".") -1));
}
// IEの場合、Flash Player のバージョンをvbscriptで取得(IEでnavigator.mimeTypesが使えないため)
else{
	document.write('<script type="text/vbscript">\n');
	document.write('on error resume next \n');
	document.write('Dim Flash \n');
	document.write('Dim pluginVer \n');
	document.write('Flash=IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash"))\n');
	document.write('pluginVer=Left(Hex(Int(CreateObject("ShockwaveFlash.ShockwaveFlash").FlashVersion)),1)\n');
	document.write('</script>\n');
}
/*----- Flash Player のバージョン判定[END]-----*/

/*----- Flash Player のバージョンが必要バージョン以上で埋め込み[BEGIN]-----*/
function putSWF(){	
	if(pluginVer>=SwfParam.requiredVer){
		var flashBox = document.getElementById(SwfParam.boxId);
		//remove defo elements
		for(i=0;i<flashBox.childNodes.length;i++){
			flashBox.removeChild(flashBox.firstChild);
		}
		//put swf
		flashBox.innerHTML = ('<object data=\"'+SwfParam.file+'\" type=\"application/x-shockwave-flash\" width=\"'+SwfParam.width+'\" height=\"'+SwfParam.height+'\"><param name=\"movie\" value=\"'+SwfParam.file+'\" /></object>');
	}
}
/*----- Flash Player のバージョンが必要バージョン以上で埋め込み[END]-----*/
window.onload = putSWF;
