/*初期値設定*/
app = navigator.appName.charAt(0);
win= (navigator.userAgent.indexOf("Win")!=-1);
ce= (navigator.userAgent.indexOf("CE")!=-1);
mac = (navigator.userAgent.indexOf("Mac")!=-1);
Netscape6 = (navigator.userAgent.indexOf("Netscape6")!=-1);
Netscape7 = (navigator.userAgent.indexOf("Netscape/7")!=-1);
Safari = (navigator.userAgent.indexOf("Safari/")!=-1);

/*バージョンチェック処理*/
function versioncheck(n) {
  /*チェックフラグ初期化*/
  checkflg = 2;
   /*Safari*/
  if (Safari) {
     if (mac) {
        var agt=navigator.userAgent.toLowerCase();
        startPoint = (agt.indexOf('safari/')+7);
        endPoint = startPoint + 6;
        version = parseFloat(agt.substring(startPoint,endPoint));
        /*バージョン2.0.4以上4未満*/
        if((version >= 419.3)&&(version < 600)) {
           checkflg = 0;
        }
     }
  }
  /*Netscape*/
  else if (app == "N") {

     /*Netscape 6*/
     if (Netscape6) {
     }
     /*Netscape6未満、7以上*/
     else {
       var agt=navigator.userAgent.toLowerCase();
       startPoint = (agt.indexOf('mozilla/')+8);
       endPoint = startPoint + 4;
       version = parseFloat(agt.substring(startPoint,endPoint));
      /*Win系*/
       if ((win)&&(!ce)) {
         /*バージョン4.51以上6未満*/
         if((version >= 4.51)&&(version < 5)) {
            checkflg = 1;
         }
     	 else if (Netscape7) {
			checkflg = 0;
     	 }
       }
      /*MAC*/
       else if (mac) {
        /*バージョン4.51以上6未満*/
         if((version >= 4.51)&&(version < 5)) {
           checkflg = 1;
         }
     	 else if (Netscape7) {
		   checkflg = 2;
     	 }
       }
     }
  } 

  /*IE*/
  else if (app == "M") {
     var agt=navigator.userAgent.toLowerCase();
     startPoint = (agt.indexOf('msie')+5);
     endPoint= (agt.indexOf(' ',startPoint)-1);
     version = parseFloat(agt.substring(startPoint,endPoint));

     /*Win系*/
     if ((win)&&(!ce)) {
        /*バージョン5.0以上*/
        if (version >= 5.0){
           checkflg = 0;
        }
     }
     /*MAC*/
     else if (mac) {
        /*バージョン5.0以上6未満*/
        if((version >= 5)&&(version < 6)){
           checkflg = 0;
        }
     }
  }
  /*振り分け*/
  /*チェックフラグ0はリサイズ可取引ウィンドウ表示*/
  /*チェックフラグ1はリサイズ不可取引ウィンドウ表示*/

  if (checkflg == 0) {
     if (n == 1){
	    window.open("https://www.shinkinbanking.com/bob/1689/BOB_90N90.htm","bb_hit",'toolbar=0,location=0,scrollbars=1,status=1,width=690,height=460,resizable=1');
    	window.open("http://www.shinkin.co.jp/nisshin/html/ib/kib/attention/info/info_popup.html","ib_info","top=0,left=0,toolbar=0,location=0,scrollbars=0,status=1,width=350,height=350,resizable=1");

     }
     else if(n == 2){
	    window.open("https://www.shinkinbanking.com/bob/1689/BOB_92N90.htm","bb_hit",'toolbar=0,location=0,scrollbars=1,status=1,width=690,height=460,resizable=1');
    	window.open("http://www.shinkin.co.jp/nisshin/html/ib/kib/attention/info/info_popup.html","ib_info","top=0,left=0,toolbar=0,location=0,scrollbars=0,status=1,width=350,height=350,resizable=1");
     }
     else{
        alert("お客様のブラウザは、インターネットバンキングがご利用いただけます。");
     }
  }
  else if (checkflg == 1) {
     if (n == 1){
	    window.open("https://www.shinkinbanking.com/bob/1689/BOB_90N90.htm","bb_hit",'toolbar=0,location=0,scrollbars=1,status=1,width=690,height=460,resizable=0');
    	window.open("http://www.shinkin.co.jp/nisshin/html/ib/kib/attention/info/info_popup.html","ib_info","top=0,left=0,toolbar=0,location=0,scrollbars=0,status=1,width=350,height=350,resizable=1");
     }
     else if(n == 2){
	    window.open("https://www.shinkinbanking.com/bob/1689/BOB_92N90.htm","bb_hit",'toolbar=0,location=0,scrollbars=1,status=1,width=690,height=460,resizable=0');
    	window.open("http://www.shinkin.co.jp/nisshin/html/ib/kib/attention/info/info_popup.html","ib_info","top=0,left=0,toolbar=0,location=0,scrollbars=0,status=1,width=350,height=350,resizable=1");
     }
     else{
        alert("お客様のブラウザは、インターネットバンキングがご利用いただけます。");
     }
  }
 /*チェックフラグ0・1以外はダイアログ表示*/
  else {
     alert("お客様のブラウザをチェックしました所、\nこのバージョンではブラウザオンラインバンキングをご利用することはできません。\n当金庫が推奨するブラウザをダウンロードして下さい。");
  }
}

/*** Ｑ＆ＡとＩＢ体験版を開くためのスクリプトです。 ***/
/*** ウィンドウの大きさ・ウィンドウ名・開くＨＴＭＬファイル名など、必要に応じて変更してください ***/
/*** ウィンドウの大きさ指定をする必要がない場合には、これ以下のスクリプトは削除しても構いません ***/
function QA_open(){
window.open("qa_index.html","qa",'toolbar=0,location=0,scrollbars=1,status=0,width=550,height=400,resizable=0');
}

function IB_Demo(){
	if ((app == "M") || (Netscape7)) {
        window.open("./ibdemo/demo/index.html","demo",'toolbar=0,location=0,scrollbars=1,status=1,width=690,height=460,resizable=1');
	}
	else{
        window.open("./ibdemo/demo/index.html","demo",'toolbar=0,location=0,scrollbars=1,status=1,width=690,height=460,resizable=0');
	}
}
