// プラグインチェック用にJavaScript、VBScriptから参照されるグローバル変数
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;


// -------------------------------------------------------
// 関数名：flashORgif
// 処理概要：Flashプラグインが存在する場合はFlashを再生、
//           ない場合は、gifを表示
// -------------------------------------------------------
function flashORgif(){

	var flg = flash_chk();
	
	if(flg){
		view_Flash();
	}else{
		view_gif();
	}
}

// --------------------------------------------------------
// 関数名：flash_chk
// 処理概要：Flashプラグインが存在するかのチェック
// 　　　　　Flashバージョンは4以上
// --------------------------------------------------------


function flash_chk(){
	
	if(plugin){
		plugin = parseInt(plugin.description.substring(plugin.description.indexOf(".")-2)) >= 8;
	}else if(navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && navigator.userAgent.indexOf("Windows")>=0){
		document.write('<script language="VBScript" type="text/vbscript">\n');
		document.write('on error resume next \n');
		document.write('plugin = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9")))\n');
		document.write('</script>');
	}
	
	if(plugin){
		return true;
	}else{
		return false;
	}
}

// ------------------------------------------------------
// 関数名：view_Flash
// 処理概要：Flashの再生
// ------------------------------------------------------
function view_Flash(){

	// Flashプラグインが有る場合に表示したいソースを記述してください。
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="800" height="550" id="top_flash">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="movie" value="./flash/top.swf?0" />');
	document.write('<param name="wmode" value="opaque" />');
	document.write('<param name="quality" value="high" />');
	document.write('<embed src="./flash/top.swf?0" loop="false" wmode="opaque" quality="high" pluginspage="http://www.macromedia.com/jp/shockwave/download/index.cgi?P1_PROD_VERSION=SHOCKWAVEFLASH" type="application/x-shockwave-flash" width="800" height="550">');

	document.write('</object>');
}

// ------------------------------------------------------
// 関数名：view_gif
// 処理概要：GIFの表示
// ------------------------------------------------------
function view_gif(){

	// Flashプラグインが無い場合に表示したいソースを記述してください。
	document.write('<h1 class="img"><img src="./img/img_main.jpg" width="800" height="550" alt="上原彩子 Yamaha Website" usemap="#MapCD" /></h1>');
	document.write('<map name="MapCD" id="MapCD">');
	document.write('<area shape="rect" coords="56,387,340,516" href="./topics/2007/001257.html" alt="上原彩子待望の3作目 「プロコフィエフ作品集」 好評発売中" />');
	document.write('<area shape="circle" coords="131,217,49" href="./index.html" alt="Top" />');
	document.write('<area shape="circle" coords="262,295,49" href="./profile.html" alt="Profile" />');
	document.write('<area shape="circle" coords="428,303,49" href="./archives/index.html" alt="Archives" />');
	document.write('</map>');
	
}

