// -----------------------------------------------------------------------------
// グローバル

// 必要なFlashPlayerのメジャーバージョンの設定
var requiredMajorVersion = 8;
// 必要なFlashPlayerのマイナーバージョンの設定
var requiredMinorVersion = 0;
// 必要なFlashPlayerのリビジョンの設定
var requiredRevision = 0;

// Flashのプラグインチェック
var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);

// 使用可能なバージョンが検出された場合
if(hasRightVersion) {
	var url = location.href ;
	guideSwf();
}
// Flashが古い、またはプラグインが存在しない場合
else{
	// Flash が古すぎるか、プラグインを検出できません
	// Flash 以外のコンテンツを挿入する
	var alternateContent = '<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" class="top5"><tr><td align="center"><table border="0" cellpadding="0" cellspacing="0"><tr><td width="96"><a href="http://www.macromedia.com/jp/shockwave/download/?P1_Prod_Version=ShockwaveFlash&Lang=Japanese" target="_blank"><img src="/products/maxart/common/images/bn_flash.gif" alt="Get macromedia FLASH PLAYER" border="0"></a></td><td><div><p class="caption01">マックスアートホームページをご覧になるにはMacromedia Flash Playerの最新版のダウンロードが必要です。</p></div></td></tr></table></td></tr></table>';
	document.write(alternateContent);
}

var url = location.href ;

function guideSwf() {
	
	if (url.indexOf('?') != -1) {
		startPoint = checkString('?');
		id = url.substring(startPoint, url.length);
	} else {
		id="";
	};
	
	
	// Flashのタグ
	var oeTags = '<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="931" height="632" id="top" align="middle"><param name="allowScriptAccess" value="sameDomain"><param name="movie" value="navi.swf' + id + '"><param name="quality" value="high"><param name="bgcolor" value="#ffffff"><embed src="navi.swf' + id + '" quality="high" bgcolor="#ffffff" width="931" height="632" name="top" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></object>';
	
	// Flash ムービーの埋め込み
	document.write(oeTags);
}

function checkString(str){
	startPoint = url.indexOf(str,0);
	return startPoint;
}

// リンク先を親ウィンドウへ表示
function winOpener(url) {  // Mac対応
	if ( (navigator.userAgent.indexOf("Mac") > -1) ) {
		if (window.opener) {  // 親ウィンドウが開いている場合は、親ウィンドウのURL変更
		window.opener.location.href = url;
		window.opener.focus(); // 親ウィンドウを前面へ
		}
		else {  // 親ウィンドウが閉じている場合は、新規親ウィンドウをオープン
		oyawin = window.open(url,'oya');
		oyawin.focus(); // 親ウィンドウを前面へ
		}
	}
	else {
		if (!window.opener.closed) {
		window.opener.location.href = url;
		window.opener.focus(); // 親ウィンドウを前面へ
		}
		else {  // 親ウィンドウが閉じている場合は、新規親ウィンドウをオープン
		oyawin = window.open(url,'oya');
		oyawin.focus(); // 親ウィンドウを前面へ
		}
	}
}
;
