// JavaScript Document
//Flash表示用

/* フラッシュが有効か確認する */
var MM_contentVersion = 8;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;

if ( plugin ) {
  var words = navigator.plugins["Shockwave Flash"].description.split(" ");

  for (var i = 0; i < words.length; ++i) {
	if (isNaN(parseInt(words[i])))
	  continue;

	var MM_PluginVersion = words[i]; 
  }

  var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
} else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1)) {
  document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
  document.write('on error resume next \n');
  document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
  document.write('</SCR' + 'IPT\> \n');
}
	

/* 
 * フラッシュが有効な場合、書き出す 
 * 
 * 引数：
 * 　フラッシュファイルのパス
 * 　フラッシュの幅
 * 　フラッシュの高さ
 * 　フラッシュID
 * 　フラッシュの背景色
 * 　描画モード
 */
function writeFlash(filePass, width, height, id, bgcolor, wmode) {
	if ( MM_FlashCanPlay ) {
	  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 + '" id="' + id + '" align="middle">');
	  document.write('<param name="allowScriptAccess" value="sameDomain" />');
	  document.write('<param name="movie" value="'+ filePass + '" />');
	  document.write('<param name="menu" value="false" />');
	  document.write('<param name="quality" value="high" />');
	  document.write('<param name="bgcolor" value="' + bgcolor + '" />');
	  document.write('<param name="wmode" value="' + wmode + '" />');
	  document.write('<embed src="' + filePass + '" menu="false" quality="high" bgcolor="' + bgcolor + '" wmode="' + wmode + '" width="' + width + '" height="' + height + '" name="' + id +'" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	  document.write('</object>');
	  document.write('</div>');
	  return true;
	}
	else{
		return false;
	}
}

/* 
 * フラッシュが有効かを取得する
 * 
 * 戻り値
 * フラッシュ有効フラグ
 */
function GetFlachFlag(){
	return MM_FlashCanPlay;
}