﻿// ****************************************
// ファイル名：flash_Ctrl.js
// 処理概要：Flashプラグインのチェック処理やFlashプラグインがインストールされて
// 　　　　　いないときの動作を行う。
// 作成日：2004.3
// ****************************************

// プラグインチェック用にJavaScript、VBScriptから参照されるグローバル変数
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
var plugin2 = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
var plugin3 = (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(".")-1)) >= 4;
	}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.4")))\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="770" height="70" id="head_menu">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="movie" value="/art/official/yuriemiura/img/menu2.swf?2009" />');
	document.write('<param name="wmode" value="opaque" />');
	document.write('<param name="quality" value="high" />');
	document.write('<embed src="/art/official/yuriemiura/img/menu2.swf?2009" 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="770" height="70">');
	document.write('</object>');
}

// ------------------------------------------------------
// 関数名：view_gif
// 処理概要：GIFの表示
// ------------------------------------------------------
function view_gif(){
	document.write('<div><img src="/art/official/yuriemiura/img/menu2.jpg" alt="" width="770" height="70" usemap="#headmenu" /></div>');
}

// =====================================================================================

// -------------------------------------------------------
// 関数名：flashORgifTop
// 処理概要：Flashプラグインが存在する場合はFlashを再生、
//           ない場合は、gifを表示
// -------------------------------------------------------
function flashORgifTop(){

	var flg2 = flash_chkTop();

	if(flg2){
		view_Flash_top();
	}else{
		view_gif_top();
	}
}
// --------------------------------------------------------
// 関数名：flash_chk
// 処理概要：Flashプラグインが存在するかのチェック
// 　　　　　Flashバージョンは4以上
// --------------------------------------------------------


function flash_chkTop(){
	
	if(plugin2){
		plugin2 = parseInt(plugin2.description.substring(plugin2.description.indexOf(".")-1)) >= 4;
	}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('plugin2 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4")))\n');
		document.write('</script>');
	}
	
	if(plugin2){
		return true;
	}else{
		return false;
	}
}
// ------------------------------------------------------
// 関数名：view_Flash_top
// 処理概要：Flashの再生
// ------------------------------------------------------
function view_Flash_top(){

	// 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="770" height="70" id="top_menu">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="movie" value="/art/official/yuriemiura/img/menu.swf?2009" />');
	document.write('<param name="wmode" value="opaque" />');
	document.write('<param name="quality" value="high" />');
	document.write('<embed src="/art/official/yuriemiura/img/menu.swf?2009" 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="770" height="70">');
	document.write('</object>');
}

// ------------------------------------------------------
// 関数名：view_gif_top
// 処理概要：GIFの表示
// ------------------------------------------------------
function view_gif_top(){
	document.write('<div><img src="/art/official/yuriemiura/img/menu.jpg" alt="" width="770" height="70" usemap="#headmenu" /></div>');
}

// =====================================================================================

// -------------------------------------------------------
// 関数名：flashORgifTopMain
// 処理概要：Flashプラグインが存在する場合はFlashを再生、
//           ない場合は、gifを表示
// -------------------------------------------------------
function flashORgifTopMain(){

	var flg3 = flash_chkTopMain();

	if(flg3){
		view_Flash_topmain();
	}else{
		view_gif_topmain();
	}
}
// --------------------------------------------------------
// 関数名：flash_chkTopMain
// 処理概要：Flashプラグインが存在するかのチェック
// 　　　　　Flashバージョンは4以上
// --------------------------------------------------------


function flash_chkTopMain(){
	
	if(plugin3){
		plugin3 = parseInt(plugin3.description.substring(plugin3.description.indexOf(".")-1)) >= 4;
	}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('plugin3 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4")))\n');
		document.write('</script>');
	}
	
	if(plugin3){
		return true;
	}else{
		return false;
	}
}
// ------------------------------------------------------
// 関数名：view_Flash_topmain
// 処理概要：Flashの再生
// ------------------------------------------------------
function view_Flash_topmain(){

	// 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="770" height="500" id="top_main">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="movie" value="/art/official/yuriemiura/img/top.swf?2009" />');
	document.write('<param name="wmode" value="opaque" />');
	document.write('<param name="quality" value="high" />');
	document.write('<embed src="/art/official/yuriemiura/img/top.swf?2009" 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="770" height="500">');
	document.write('</object>');
}

// ------------------------------------------------------
// 関数名：view_gif_topmain
// 処理概要：GIFの表示
// ------------------------------------------------------
function view_gif_topmain(){
	document.write('<div><img src="/art/official/yuriemiura/img/main.jpg" alt="Yurie Miura Official Website" width="770" height="500" /></div>');
}
