//お問合わせ
function openWindow()
{
	var myBrowser = navigator.appName;
	var myBrowser_version = navigator.appVersion;
	var Check = false;

	if( myBrowser == "Netscape" || myBrowser_version.indexOf("4.0", 0) > -1 || myBrowser_version.indexOf("Mac", 0) > -1 ) {
		Check = true;
	}
	var	newWin = window.open("","newWin","scrollbars=yes,status=yes,resizable=no,width=590,height=500,left=0,top=0");
	if(Check){
		newWin.focus();
	}
}

function click1()
{
	openWindow();
	document.TargetForm1.action="https://www.mitsui-direct.co.jp/other/M10601.asp";
	document.TargetForm1.page_id.value = "312405_check";	//お問い合わせ画面IDを指定
	document.TargetForm1.submit();
}

//保険料かんたんチェック
var w = window;
function openWin(url){
	if((w == window)||w.closed){
		w = open(url,"_blank","menubar=no,toolbar=no,scrollbars=no,width=730,height=575");
	}else{
		w.location.href = url
		w.focus('checkwindow');
	}
	return(false);
}

//ファミリー劇場
function flashWin1(url){
	var winName="flashWin"
	var W="670";
	var H="505";
  var SW;
  SW= window.open(url,winName,'menubar=no,resizable=yes,scrollbars=yes,width='+W+',height='+H+'');
  SW.focus();
}
//用語集
function subWin1(url){
 var winName="newWin"
 var W="590";
 var H="500";
  var SW;
  SW= window.open(url,winName,'menubar=no,resizable=no,scrollbars=yes,width='+W+',height='+H+'');
  SW.focus();
 }

//　スタイルシート振分け
var ns4,ns6,ie,saf;
var Mac = navigator.appVersion.indexOf('Mac',0) != -1;
var Win = navigator.appVersion.indexOf('Win',0) != -1;

function getBrowserName()
{
    var aName  = navigator.appName.toUpperCase();
    var uName = navigator.userAgent.toUpperCase();
    if (uName.indexOf("SAFARI") >= 0)  return "Safari";
    if (aName.indexOf("NETSCAPE") >= 0)  return "Netscape";
    if (aName.indexOf("MICROSOFT") >= 0) return "Explorer";
    return "";
}

browser = getBrowserName();
ver = navigator.appVersion;
int_ver = parseInt(ver);
if (browser == "Safari") saf = 1;
if ((browser == "Netscape") && (int_ver < 5)) ns4 = 1;
if ((browser == "Netscape") && (int_ver >= 5)) ns6 = 1;
if ((browser == "Explorer") && (int_ver >= 4)) ie = 1;
if (saf){var csstype='mac_saf';}
if (ns4){
	if(Mac){var csstype='mac_nn4';}
	else if(Win){var csstype='win_nn4';}}
if (ns6){
	if(Mac){var csstype='mac_ns6';}
	else if(Win){var csstype='win_ns6';}}
if (ie){
	if(Mac){var csstype='mac_ie';}
	else if(Win){var csstype='win_ie';}}
if (csstype)
{	document.write('<link rel=stylesheet type="text/css" ')
	document.write('href=../css/')
	document.write(csstype + '.css>')}


//NN4用リサイズ対策
if(!window.saveInnerWidth) {
  window.onresize = resizeIt;
  window.saveInnerWidth = window.innerWidth;
  window.saveInnerHeight = window.innerHeight;}
function resizeIt() {
    if (saveInnerWidth < window.innerWidth || 
        saveInnerWidth > window.innerWidth || 
        saveInnerHeight > window.innerHeight || 
        saveInnerHeight < window.innerHeight ) 
    {window.history.go(0);}}


//  サブウィンドウリンク



function subWinLink(url){
	var NextPage = url;
	w = screen.width;
	h = screen.height;
	if(w < 640){ww=620}
	else if(w < 810){ww=770}
	else{ww=970}
	if(browser == "Netscape"){wh=h-230}
	else{wh=h-80;}
	var thiswindow=window.name;
	if(thiswindow=="newWin"){
		if(ns6){
			if(!window.opener){newwindow=window.open(NextPage,"MAIN","screenX=20,screenY=20,left=20,top=20,toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1,width="+ww+",height="+wh);
			newwindow.focus();}
		else{
		window.opener.location.href = NextPage;
		window.opener.focus();}}
		else{
			if(window.opener.closed){newwindow=window.open(NextPage,"MAIN","screenX=20,screenY=20,left=20,top=20,toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1,width="+ww+",height="+wh);
			newwindow.focus();}
		else{
		window.opener.location.href = NextPage;
		window.opener.focus();}}
			}
	else{
			newwindow=window.open(NextPage,"MAIN","screenX=20,screenY=20,left=20,top=20,toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1,width="+ww+",height="+wh);
			newwindow.focus();
			}
}


//画像処理

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; i<a.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&&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_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];}
}

//クッキー
function CookieWriteUrl()
{
	var name;
	name = ("MIBSURL");
	document.cookie = name + "=" + escape(location.href) + "; path=/";
}


function openWindow()
{
	var myBrowser = navigator.appName;
	var myBrowser_version = navigator.appVersion;
	var Check = false;

	if( myBrowser == "Netscape" || myBrowser_version.indexOf("4.0", 0) > -1 || myBrowser_version.indexOf("Mac", 0) > -1 ) {
		Check = true;
	}
	var	newWin = window.open("","newWin","scrollbars=yes,status=yes,resizable=no,width=590,height=500,left=0,top=0");
	if(Check){
		newWin.focus();
	}
}

//  メインウィンドウリンク


function is_opener() {

      var ua = navigator.userAgent;
      if(!!window.opener){
          if( ua.indexOf('MSIE 4')!=-1 && ua.indexOf('Win')!=-1){
               return !window.opener.closed;}
          else{return typeof window.opener.document  == 'object';}}
      else{
							return false;
						}
  }

function mainWinLink(url){
	w = screen.width;
	h = screen.height;
	if(w < 640){ww=620}
	else if(w < 810){ww=770}
	else{ww=970}
	if(browser == "Netscape"){wh=h-230}
	else{wh=h-80;}
   if(is_opener()){
				window.opener.location.href=url;
				window.opener.focus();}
   else{
				newwindow=window.open(url,"mainWin","screenX=20,screenY=20,left=20,top=20,toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1,width="+ww+",height="+wh);
				newwindow.focus();
			}
  }
		
