function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

//---------------------------------------------------------------------------
// 定数設定
//---------------------------------------------------------------------------
var FlashVarsion = "8";		// Flash Player バージョン8超で動画閲覧可能とする


//---------------------------------------------------------------------------
// Flash Player バージョンチェック
//---------------------------------------------------------------------------
function checkFlash(varsion){

	var browser = navigator.appName;		// ブラウザを取得

	if (browser != "Microsoft Internet Explorer" ){		// IE以外か？
  
		for(i = 0; i < navigator.plugins.length; i++) {
			
			if(navigator.plugins[i].name ==  "Shockwave Flash"){ 
				if(parseInt(navigator.plugins["Shockwave Flash"].description.substring(navigator.plugins["Shockwave Flash"].description.indexOf(".")-1)) > varsion ){
					return 0;
				}
				else{
					return 2;
				}
			}
		}
		return 1;
	}
	else{																							// IEか？
		return 0;													// IEはプラグイン自動UPDATEなので、チェック不要
	}
}
//---------------------------------------------------------------------------
// SWF（動画プレイヤー）表示
//---------------------------------------------------------------------------
function writeNowupload(flashObj ,Bg , Width , Height , noFlashImg ){

	// Flash Player バージョンチェック
	var flag = checkFlash(FlashVarsion);

	if( flag == "0"){			// Flash Playerは閲覧できるバージョンか？
		document.open();
		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 + '\">');
		document.write('<param name=\"movie\" value=\"' + flashObj + '\">');
		document.write('<param name=\"menu\" value=\"false\">');
		document.write('<param name=\"wmode\" value=\"transparent\">');
		document.write('<embed src=\"' + flashObj + '\" wmode=\"transparent\" quality=\"high\" width=\"' + Width + '\" height=\"' + Height + '\" align=\"middle\" allowScriptAccess=\"sameDomain\" allowFullScreen=\"true\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />');
		document.write('</object>');
		document.write('</div>' + '\n');
		document.close();
	}
	else{									// Flash Playerは閲覧できないバージョンか？
		document.write('<div>');
		document.write('<a href=\"http://www.adobe.com/go/getflashplayer_jp\" target=\"_blank\" title=\"FlashPlayer DownLoad\"><img src=\"' + noFlashImg + '\" alt=\"FlashPlayer DownLoad\"  /></a>');
		document.write('</div>');
	}
}
