//---------------------------------------------------------------------------
// 定数設定
//---------------------------------------------------------------------------
var FlashVarsion = "8";		// Flash Player バージョン8超で動画閲覧可能とする


//---------------------------------------------------------------------------
// Flash Player バージョンチェック
//---------------------------------------------------------------------------
function checkFlash(varsion){

	var browser = navigator.appName;		// ブラウザを取得

	if (browser != "Microsoft Internet Explorer" ){		// IE以外か？
  
		for(i = 0; i < navigator.plugins.length; i++) {
			
			if(navigator.plugins[i].name ==  "Shockwave Flash"){ 
				if(parseInt(navigator.plugins["Shockwave Flash"].description.substring(navigator.plugins["Shockwave Flash"].description.indexOf(".")-1)) > varsion ){
					return 0;
				}
				else{
					return 2;
				}
			}
		}
		return 1;
	}
	else{																							// IEか？
		return 0;													// IEはプラグイン自動UPDATEなので、チェック不要
	}
}


//---------------------------------------------------------------------------
// SWF（動画プレイヤー）表示
//---------------------------------------------------------------------------
function clockSWF(flashObj , flvObj ,Bg , Width , Height , noFlashImg ){

	// Flash Player バージョンチェック
	var flag = checkFlash(FlashVarsion);

	if( flag == "0"){			// Flash Playerは閲覧できるバージョンか？
		document.open();
		document.write('<div>');
		document.write('<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\"' + Width + '\" height=\"' + Height + '\" allowFullScreen=\"true\" id=\"flvplayer\">');
		document.write('<param name=\"movie\" value=\"' + flashObj + flvObj + '\">');
		document.write('<param name=\"menu\" value=\"false\">');
		document.write('<param name=\"wmode\" value=\"transparent\">');
		document.write('<param name=\"bgcolor\" value=\"' + Bg + '\" />');
		document.write('<param name=\"allowFullScreen\" value=\"true\">');
		document.write('<embed src=\"' + flashObj + flvObj + '\" wmode=\"transparent\" quality=\"high\" bgcolor=\"' + Bg + '\" width=\"' + Width + '\" height=\"' + Height + '\" name=\"flvplayer\" align=\"middle\" allowScriptAccess=\"sameDomain\" allowFullScreen=\"true\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />');
		document.write('</object>');
		document.write('</div>' + '\n');
		document.close();
	}
	else{									// Flash Playerは閲覧できないバージョンか？
		document.write('<div>');
		document.write('<a href=\"http://www.adobe.com/go/getflashplayer_jp\" target=\"_blank\" title=\"FlashPlayer DownLoad\"><img src=\"' + noFlashImg + '\" alt=\"FlashPlayer DownLoad\"  /></a>');
		document.write('</div>');
	}
}
