SwfParam = {
flashArea :'header', //設置する場所のID名
file : 'index.swf', //swfの場所
width : '1016',
height : '368',
requiredVer : 7 //プラグインの必要バージョン
};


/*----- 判別完了まで表示しないでおく[BEGIN]-----*/
document.write("<style type=\"text/css\">\n");
document.write("#"+SwfParam.flashArea+"{visibility:hidden;}\n");
document.write("</style>");
/*----- 判別完了まで表示しないでおく[END]-----*/


/*----- 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 replaceSWF(){
	if(pluginVer>=SwfParam.requiredVer){
		var flashArea = document.getElementById(SwfParam.flashArea);
		//remove defo elements
		for(i=0;i<flashArea.childNodes.length;i++){
			flashArea.removeChild(flashArea.firstChild);
		}
		//put swf
		flashArea.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]-----*/


/*----- 判別前に隠したエリアを表示[BEGIN]-----*/
function showFlashArea(){
	document.getElementById(SwfParam.flashArea).style.visibility = "visible";
}
/*----- 判別前に隠したエリアを表示[END]-----*/


window.onload = function(){
	replaceSWF();
	showFlashArea();
}
