﻿function get_flash_version() {
 var version='0.0.0';
 if(navigator.plugins && navigator.mimeTypes['application/x-shockwave-flash']){
  var plugin=navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin;
  // the code below is used in SWFObject
  //var plugin=navigator.plugins['Shockwave Flash'];
  if (plugin && plugin.description) {
   // convert the description like 'Shockwave Flash 9.0 r28' into version string like '9.0.8';
   // regex is provided by SWFObject
   version=plugin.description.replace(/^[A-Za-z\s]+/, '').replace(/(\s+r|\s+b[0-9]+)/, ".");
  }
  
 } else { // in the case of Win IE
  var x='';
  try {
   // for ver.7 and later
   var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
   x=axo.GetVariable("$version");
  } catch(e) {
   try {
    // for ver.6
    axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
    x="WIN 6,0,21,0";
    /*
     * GetVariable() crashes player version 6.0.22-29, and
     * players which have those versions throws when access 
     * to AllowScriptAccess
     */
    axo.AllowScriptAccess="always";
    x=axo.GetVariable("$version");
   } catch(e) {
    if (!x.match(/^WIN/)) {
     try {
      // for 4.x,5.x
      axo=null;
      axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
      // version 3 player throws when you call GetVariale().
      x=axo.GetVariable("$version");
     } catch(e) {
      if (axo) {
       // for 3.x
       x="WIN 3,0,18,0";
      } else {
       try {
        // for 2.x
        axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
        x="WIN 2,0,0,11";
       } catch(e) {
        x="WIN 0,0,0,0";
       }
      }
     }
    }
   }
  }
  // convert ActiveX version string to our version string like '9.0.28'
  version=x.replace(/^WIN /,'').replace(/,[0-9]+$/,'').replace(/,/g,'.');
 }
 // check version string format
 // Quicktime enabled Safari returns a description in natural language
 if (version.match(/^[0-9]+\.[0-9]+\.[0-9]+$/)) {
  return version;
 } else {
  return '0.0.0';
 }
}

/*
<div id="noflash">
	<p id="update">Episode.1～4を公開しました！ 次回更新は00/00です。</p>
	<p><img src="images/index/h1.gif" alt="エピソード ～先輩社員の挑戦・成長・未来～" width="302" height="88" /></p>
	<p class="noflashSection01">
		業界の第一線で活躍し、数々のエンタテインメントを生み出してきた先輩社員たち。<br />
		彼らは入社後何に挑戦し、どのように成長してきたのか？現場の声に耳を傾けてみよう。
	</p>
	<p><img src="images/index/txt_01.gif" width="331" height="84" alt="このページは、Adobe Flashを使用しています。ページをご覧いただく為には、最新のFlashプレーヤーが必要です。Flashプレーヤーをインストールされていない方はAdobeのサイトよりダウンロードしてご覧ください。" /></p>
	<p class="noflashSection01"><a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&amp;Lang=Japanese" target="_blank"><img src="../../common/images/flashplayer_02.jpg" width="161" height="42" alt="Get ADOBE FLASH PLAYER" /></a></p>
</div>
*/
//振り分け
function printMovie () {
	var mejorVersion = get_flash_version();
	mejorVersion = mejorVersion.substring(0,mejorVersion.indexOf('.',0));
	if (mejorVersion >= 8) {//振り分けの対象となるFLASH PLAYERのバージョン
		//FLASHを表示させる
		document.write ('<scr'+ 'ipt language="javascript">');
		document.write ('	AC_FL_RunContent(');
		document.write ('	\'codebase\', \'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\',');
		document.write ('	\'width\', \'635\',');
		document.write ('	\'height\', \'682\',');
		document.write ('	\'src\', \'swf/index\',');
		document.write ('	\'quality\', \'high\',');
		document.write ('	\'pluginspage\', \'http://www.macromedia.com/go/getflashplayer\',');
		document.write ('	\'align\', \'middle\',');
		document.write ('	\'play\', \'true\',');
		document.write ('	\'loop\', \'true\',');
		document.write ('	\'scale\', \'showall\',');
		document.write ('	\'wmode\', \'transparent\',');
		document.write ('	\'devicefont\', \'false\',');
		document.write ('	\'id\', \'index\',');
		document.write ('	\'bgcolor\', \'#ffffff\',');
		document.write ('	\'name\', \'index\',');
		document.write ('	\'menu\', \'true\',');
		document.write ('	\'allowFullScreen\', \'false\',');
		document.write ('	\'allowScriptAccess\',\'sameDomain\',');
		document.write ('	\'movie\', \'swf/index\',');
		document.write ('	\'salign\', \'\'');
		document.write ('	); ');
		document.write ('</scr'+ 'ipt>');
	
	} else {
		//代替THMLを表示させる
		document.write('	<p><img src="images/index/txt_01.gif" width="331" height="84" alt="このページは、Adobe Flashを使用しています。ページをご覧いただく為には、最新のFlashプレーヤーが必要です。Flashプレーヤーをインストールされていない方はAdobeのサイトよりダウンロードしてご覧ください。" /></p>');
		document.write('	<p class="noflashSection01"><a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&amp;Lang=Japanese" target="_blank"><img src="../../common/images/flashplayer_02.jpg" width="161" height="42" alt="Get ADOBE FLASH PLAYER" /></a></p>');
		
	}
}
printMovie ();



