//

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function winMin(){
	if (document.all) {        
	             // for Internet Explorer
		winWidth = document.body.clientWidth;
		winHeight = document.body.clientHeight;

		if(winWidth <= 800){
			objWidth = "820px";
		}else{
			objWidth = "100%";
		}
	  if((winHeight <= 520)){
			objHeight = "540px";
		}else{
			objHeight = "100%";
		}

		if(document.mainMovie[0] && document.mainMovie[1]){ 
			     //for win
			document.mainMovie[0].width = objWidth;
			document.mainMovie[0].height = objHeight;
			document.mainMovie[1].width = objWidth;
			document.mainMovie[1].height = objHeight;
		}else{                                    
			             //for mac
			document.mainMovie.width = objWidth;
			document.mainMovie.height = objHeight;
		}
		
	}else{
//
		if(window.innerWidth <= 800){
			objWidth = "800px";
		}else{
			objWidth = "100%";
		}
	  if((window.innerHeight <= 520)){
			objHeight = 520;
		}else{
			objHeight = innerHeight;
		}
	if(navigator.userAgent.indexOf("Firefox",0)>0){
		document.mainMovie.width = objWidth;
		document.mainMovie.height = objHeight-10;
	}else{
		document.mainMovie.width = objWidth;
		document.mainMovie.height = objHeight;
		}

	}
}


//Macromedia製品でロールオーバービヘイビアを設定したときに出るソースです
//ここにリンクしてればページ内の同じ関数は削除できます。

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; ia.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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&&id.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

//ここまで///////////////////////////////////////////////////////////////////////////////////////////

//FLASHプラグインの有無を自動的にチェックして処理を分岐させるプログラム
//変数内に関数を読み込めば（value=chkFlash();）trueまたはfalshを返します。

function chkFlash(){
var plgIn='Shockwave Flash';
with (navigator) if (appName.indexOf('Microsoft')!=-1 && appVersion.indexOf('Mac')==-1) document.write(''+'<scr'+'ipt language="VBScript">\nOn error resume next\n'+'MM_dir = IsObject(CreateObject("SWCtl.SWCtl.1"))\n'+'MM_flash = NOT IsNull(CreateObject("ShockwaveFlash.ShockwaveFlash"))\n<\/scr'+'ipt>');
with (navigator) if (appName.indexOf('Microsoft')==-1 || (plugins && plugins.length)) {
ok=(plugins && plugins[plgIn]);
} else if (appVersion.indexOf('3.1')==-1) { //not Netscape or Win3.1
if (plgIn.indexOf("Flash")!=-1 && window.MM_flash!=null) ok=window.MM_flash;
else ok=false;
}
if (!ok) return(false);
if (ok){
var chkFlg = false;
var chkMacIE5 = ((navigator.appName.indexOf("Internet Explorer")>=0) && (navigator.platform.indexOf("MacPPC") >= 0) && (navigator.appVersion.indexOf("5.") >= 0));
if (((navigator.appName.indexOf('Netscape') >= 0) && (parseInt(navigator.appVersion) >3)) || chkMacIE5) {
if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {
if (navigator.plugins && navigator.plugins["Shockwave Flash"] && (navigator.plugins["Shockwave Flash"].description.indexOf("Shockwave Flash") >= 0)) chkFlg = true;
}
} else {
if ((navigator.appName.indexOf("Internet Explorer") >= 0) && (navigator.platform.indexOf("MacPPC") >= 0) && !chkMacIE5 ) chkFlg = false;
if ((navigator.appName.indexOf("Internet Explorer") >= 0) && (navigator.platform.indexOf("MacPPC") < 0)) chkFlg = true;
}
if (chkFlg) {
return(true);
}else{
return(false);
}
}
}

function Flash(){
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="780" height="345" hspace="0" vspace="0" id="top_menu" align="top"><param name="movie" value="top_flash_menu.swf"><param name="quality" value="high"><param name="scale" value="noscale"><param name="menu" value="false"><param name="bgcolor" value="#FFFFFF"><embed src="top_flash_menu.swf" width="780" height="345" hspace="0" vspace="0" quality="high" menu="false" bgcolor="#FFFFFF" scale="noscale" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="top_menu" align="top"></embed></object>');
}




function openWin(winName,theURL,winX,winY) { //v2.0
//ブラウザウインドウを中央表示するスクリプト
//winName=開くウインドウ名
//theURL=リンク先
//winX：winY=ウインドウのサイズ
//例：<a href"#" onClick="openWin('newWin','http://test.jp',640,480)">
if(winName==null){
winName='newWin';
}
var winWidth=winX;//ウインドウの幅
var winHeight=winY;//ウインドウの高さ
var mX=(screen.width/2)-(winWidth/2);
var mY=(screen.height/2)-(winHeight/2);
 var features="toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+winWidth+",height="+winHeight+",left="+mX+",top="+mY;
  window.open(theURL,winName,features);
}
