var COOKIE_NAME="ManagementSeltDiagnosis_0404";
var isMSIE = (document.all) ? true : false;
var isNS = (document.layers) ? true : false;
var isNS6 = (!isMSIE && document.getElementById) ? true : false;
var isMac = ( navigator.userAgent.indexOf('Mac')!=-1 ) ? true : false;

var SetC_String="";
var Input_err=new String("0");


myAgent = navigator.userAgent;
myTop = myAgent.indexOf("MSIE",0);
if (myTop == -1){
myTop = myAgent.indexOf("Mozilla/",0);
if (myTop == -1){
myVersion = "";
}else{
myLast = myAgent.indexOf(" ",myTop);
myVer = myAgent.substring(myTop+8,myLast);
myVersion = " Version " + myVer;
}
}else{
myLast = myAgent.indexOf(";",myTop);
myVer = myAgent.substring(myTop+5,myLast);
myVersion = " Version " + myVer;
}

// ヘルプ表示
function OpenHelp(type)
{
  if(type==0) {
	newWin0 = window.open("../html/helpContents0.html","TRD_Help0","width=900,height=450,scrollbars=yes,resizable=yes");
	newWin0.focus();
  }
  else if(type==1) {
	newWin = window.open("../template/Common/Help/help1.html","TRD_Help","width=900,height=450,scrollbars=yes,resizable=yes");
	newWin.focus();
  }
  else if(type==2) {
	newWin = window.open("../template/Common/Help/help2.html","TRD_Help","width=900,height=450,scrollbars=yes,resizable=yes");
	newWin.focus();
  }
  else if(type==3) {
	newWin = window.open("../template/Common/Help/help3.html","TRD_Help","width=900,height=450,scrollbars=yes,resizable=yes");
	newWin.focus();
  }
  else if(type==4) {
	newWin = window.open("../template/Common/Help/help4.html","TRD_Help","width=900,height=450,scrollbars=yes,resizable=yes");
	newWin.focus();
  }
  else if(type==5) {
	newWin = window.open("../template/Common/Help/help5.html","TRD_Help","width=900,height=450,scrollbars=yes,resizable=yes");
	newWin.focus();
  }
  else if(type==6) {
	newWin = window.open("../template/Common/Help/help6.html","TRD_Help","width=900,height=450,scrollbars=yes,resizable=yes");
	newWin.focus();
  }
  else if(type==7) {
	newWin = window.open("../template/Common/Help/help7.html","TRD_Help","width=900,height=450,scrollbars=yes,resizable=yes");
	newWin.focus();
  }
  else if(type==8) {
	newWin = window.open("../template/Common/Help/help8.html","TRD_Help","width=900,height=450,scrollbars=yes,resizable=yes");
	newWin.focus();
  }
  else if(type==9) {
	newWin0 = window.open("../html/system.html","TRD_Help","width=1010,height=450,scrollbars=yes,resizable=yes");
	newWin0.focus();
  }
}

// Ｊ－ｎｅｔへのリンク
function OpenJnet()
{
	lad = document.jikosindan.LinkAdr4.value;
	window.location.href(lad);
}

// 中小企業庁へのリンク
function OpenChusyo()
{
	lad = document.jikosindan.LinkAdr5.value;
	window.location.href(lad);
}

// 中小企業の会計のあり方についてのリンク
function OpenLink()
{
	lad = document.jikosindan.LinkAdr1.value;
	newWin = window.open(lad,"TRD_Inquiry","width=900,height=650,scrollbars=yes,resizable=yes");
	newWin.focus();
}

// 相談窓口表示
function OpenInquiry()
{
	lad = document.jikosindan.LinkAdr3.value;;
	newWin = window.open(lad,"TRD_Inquiry","width=900,height=650,scrollbars=yes,resizable=yes");
	newWin.focus();
}

// 問い合わせ窓口表示
function OpenInquiry2()
{
	lad = document.jikosindan.LinkAdr2.value;;
    newWin = window.open(lad,"TRD_inquiry2","width=600,height=400,scrollbars=yes,resizable=yes");
    newWin.focus();
}

// 画面印刷
function btn_print(){
  if(isMSIE == false)  return;

//  the_cookie = myGetCookie("CRD_PRINT_STS");
//  if(the_cookie!=document.jikosindan.SESSION_CODE.value){
//    alert("印刷ウィンドウから用紙の向きを横に設定して印刷をしてください。");
//    mySetCookie("CRD_PRINT_STS",document.jikosindan.SESSION_CODE.value,1);
//   }

  var chk = myVer.substring(0,3);
  if(chk == "6.0"){
    document.body.style.zoom=0.7; // 0.58, 0.6, 0.67
  }else{ // IE7
    document.body.style.zoom=0.93; // 0.79, 0.9, 0.8
  }
  print();
//  if(chk == "6.0"){
  document.body.style.zoom=1.00;
//  }
}

function btn_print_org( ){
    alert(myVer.substring(0,3));

    if(isMSIE==false || ((isMSIE==true) && (myVer.substring(0,3)=="5.0"))) {
      alert("not zoom 1");
      the_cookie = myGetCookie("CRD_PRINT_STS");
	  if (the_cookie!=document.jikosindan.SESSION_CODE.value) {
	    alert("印刷ウィンドウから用紙の向きを横に設定して印刷をしてください。");
        mySetCookie("CRD_PRINT_STS",document.jikosindan.SESSION_CODE.value,1);
      }
	  print();
	}
	else {
          alert("not zoom 2");
//	    document.body.style.zoom=0.67;
	    print();
//	    document.body.style.zoom=1.00;
	}
}

function GoToQues()
{
	newWin = window.open("diagnosis.CRD_0150", "quesform", "width=800,height=700,scrollbars=yes,resizable=yes,top=0,left=0");
	newWin.focus();
}

// トップ画面表示
function GoToTop()
{
    ExecSubmit("formGotop","0");
}

function GoToTop2()
{
    ExecSubmit("formGotop","0");
}
function GoToTop_ForInput()
{
    if(Input_err=="0")
      GoToTop();
}

//  PDFのDL
function GetToPDF(formName, action){
  var form= document.forms[formName];
  var _action = form.action;
  form.action = action;
  form.submit();
  form.action = _action;
}
//{
//    ExecSubmit("formGetPDF","0");
//}

// 決算書項目入力画面表示（ＮＮ戻る障害対応）
function GoToInput()
{
    if(isMSIE==false)
      ExecSubmit("formInput","0");
    else
      history.back();
}

// 総合診断画面表示（ＮＮ戻る障害対応）
function GoToIntegrated()
{
    if(isMSIE==false)
      ExecSubmit("jikosindan","0");
    else
      history.back();
}

// Exec Submit
function ExecSubmit(formName,procNum)
{
    document.forms[formName].ProcNum.value = procNum;
    document.forms[formName].submit();
}

// ############ Input ###############

//--押されたキ－コードを返す
function getKEYCODE(e){  
    var aKeyCode = (isNS || isNS6) ? e.which : window.event.keyCode;
//     return event.keyCode
     return aKeyCode;

}

//--キー文字の取得
function key_Press(e){ 
    //キープレス時に実行する処理をここへ書く
    if(getKEYCODE(e)==13)
      EnterNext();
}

// ログイン情報設定
function setLoginCheck( ){
  document.LoginCheck.NoLogin.value="1";
  return(true);
}

// リロード
function ReloadMe( ){
    if(document.LoginCheck.NoLogin.value!="0") {
    location.reload(true);
  }
}

//個別指標ＤＬ
function btn_DL( ){
  window.open("../html/explanation.xls","Explanation");
}

// 表示初期処理
function input_init( ){

    if(isMac || (isMSIE==false)) {
      Now_Session = myGetCookie("NOW_SESSION");
 	  if (Now_Session==document.jikosindan.SESSION_CODE.value) {
        btn_import();
	  }
    }
    else {
    
      KindChange1(-1);

      document.jikosindan.kind2.options.value = document.jikosindan.input_kind2.value;
      document.jikosindan.name1.value = document.jikosindan.input_name1.value;
      document.jikosindan.name2.value = document.jikosindan.input_name2.value;
      document.jikosindan.name3.value = document.jikosindan.input_name3.value;
      document.jikosindan.name4.value = document.jikosindan.input_name4.value;
      document.jikosindan.name5.value = document.jikosindan.input_name5.value;
      document.jikosindan.name6.value = document.jikosindan.input_name6.value;
      document.jikosindan.name7.value = document.jikosindan.input_name7.value;
      document.jikosindan.name8.value = document.jikosindan.input_name8.value;
      document.jikosindan.name9.value = document.jikosindan.input_name9.value;
      document.jikosindan.name10.value = document.jikosindan.input_name10.value;
      document.jikosindan.name11.value = document.jikosindan.input_name11.value;
      document.jikosindan.name12.value = document.jikosindan.input_name12.value;
      document.jikosindan.name13.value = document.jikosindan.input_name13.value;
      document.jikosindan.name14.value = document.jikosindan.input_name14.value;
      document.jikosindan.name15.value = document.jikosindan.input_name15.value;
      document.jikosindan.name16.value = document.jikosindan.input_name16.value;
      document.jikosindan.name17.value = document.jikosindan.input_name17.value;
      document.jikosindan.name18.value = document.jikosindan.input_name18.value;
      document.jikosindan.name19.value = document.jikosindan.input_name19.value;
      document.jikosindan.name20.value = document.jikosindan.input_name20.value;
      document.jikosindan.name21.value = document.jikosindan.input_name21.value;
      document.jikosindan.name22.value = document.jikosindan.input_name22.value;
      document.jikosindan.name23.value = document.jikosindan.input_name23.value;
 	
      if (document.jikosindan.input_chk1.value=="false")
          document.jikosindan.chk1.checked = false;
      else
          document.jikosindan.chk1.checked = true;
      DisInput();

      if(document.jikosindan.chk1.checked==false)
      {
	      document.jikosindan.name24.value = document.jikosindan.input_name24.value;
	      document.jikosindan.name25.value = document.jikosindan.input_name25.value;
	      document.jikosindan.name26.value = document.jikosindan.input_name26.value;
      }
    }
}

// 前回値表示
function btn_import() {

    InitInputColor();

    if(document.debug.test.value == "2" && ((isMSIE==true) && (myVer.substring(0,3)!="5.0"))) {

      var rs = document.debug.CrdTest.recordset;
      rs.MoveFirst();

      dno = window.prompt("テストデータ番号を入力してください。", "");
      if((dno=="") || (dno==null)) return;

		while(!rs.EOF) {

			if (dno == rs.Fields("no").value) {
				document.jikosindan.kind1.value = Number(rs.Fields("大分類").value);
				res = KindChange1(0);
				document.jikosindan.kind2.value = Number(rs.Fields("中分類").value);
				res = KindChange2();
				document.jikosindan.name1.value = rs.Fields("流動資産合計").value;
				document.jikosindan.name2.value = rs.Fields("現金・預金").value;
				document.jikosindan.name3.value = rs.Fields("受取手形").value;
				document.jikosindan.name4.value = rs.Fields("売掛金").value;
				document.jikosindan.name5.value = rs.Fields("棚卸資産").value;
				document.jikosindan.name6.value = rs.Fields("固定資産合計").value;
				document.jikosindan.name7.value = rs.Fields("有形固定資産合計").value;
				document.jikosindan.name8.value = rs.Fields("土地").value;
				document.jikosindan.name9.value = rs.Fields("資産合計").value;
				document.jikosindan.name10.value = rs.Fields("流動負債合計").value;
				document.jikosindan.name11.value = rs.Fields("短期借入金").value;
				document.jikosindan.name12.value = rs.Fields("長期借入金・社債").value;
				document.jikosindan.name13.value = rs.Fields("純資産合計").value;
				document.jikosindan.name14.value = rs.Fields("受取手形割引高").value;
				document.jikosindan.name15.value = rs.Fields("受取手形裏書譲渡高").value;
				document.jikosindan.name16.value = rs.Fields("期末従業員数").value;
				document.jikosindan.name17.value = rs.Fields("売上高").value;
				document.jikosindan.name18.value = rs.Fields("売上総利益").value;
				document.jikosindan.name19.value = rs.Fields("営業利益").value;
				document.jikosindan.name20.value = rs.Fields("受取利息配当金").value;
				document.jikosindan.name21.value = rs.Fields("支払利息割引料").value;
				document.jikosindan.name22.value = rs.Fields("経常利益").value;
				document.jikosindan.name23.value = rs.Fields("減価償却実施額").value;
				if (rs.Fields("フラグ").value == 1) {
					document.jikosindan.chk1.checked = false;
					document.jikosindan.name24.value = rs.Fields("前期資産合計").value;
					document.jikosindan.name25.value = rs.Fields("前期純資産合計").value;
					document.jikosindan.name26.value = rs.Fields("前期売上高").value;
				} else {
					document.jikosindan.chk1.checked = true;
					document.jikosindan.name24.value = "";
					document.jikosindan.name25.value = "";
					document.jikosindan.name26.value = "";
				}
				DisInput();
				break;
			}
			rs.MoveNext();

		}

    }
    else {

      the_cookie = myGetCookie(COOKIE_NAME);

	  if ((the_cookie=="") || the_cookie==(null)) {
		  alert("前回入力した情報は保存されていません。");
          return;
	  }

      broken_cookie = the_cookie.split(";");

      document.jikosindan.kind1.value = broken_cookie[0];
      res = KindChange1(0);
      document.jikosindan.kind2.value = broken_cookie[1];
      res = KindChange2();

      document.jikosindan.kind3.value = broken_cookie[2];

	  SetC(1,broken_cookie[3]);
	  document.jikosindan.name1.value = SetC_String;
  	  SetC(2,broken_cookie[4]);
  	  document.jikosindan.name2.value = SetC_String;
	  SetC(3,broken_cookie[5]);
	  document.jikosindan.name3.value = SetC_String;
	  SetC(4,broken_cookie[6]);
	  document.jikosindan.name4.value = SetC_String;
	  SetC(5,broken_cookie[7]);
	  document.jikosindan.name5.value = SetC_String;
	  SetC(6,broken_cookie[8]);
	  document.jikosindan.name6.value = SetC_String;
	  SetC(7,broken_cookie[9]);
	  document.jikosindan.name7.value = SetC_String;
	  SetC(8,broken_cookie[10]);
	  document.jikosindan.name8.value = SetC_String;
	  SetC(9,broken_cookie[11]);
	  document.jikosindan.name9.value = SetC_String;
	  SetC(10,broken_cookie[12]);
	  document.jikosindan.name10.value = SetC_String;
	  SetC(11,broken_cookie[13]);
	  document.jikosindan.name11.value = SetC_String;
	  SetC(12,broken_cookie[14]);
	  document.jikosindan.name12.value = SetC_String;
	  SetC(13,broken_cookie[15]);
	  document.jikosindan.name13.value = SetC_String;
	  SetC(14,broken_cookie[16]);
	  document.jikosindan.name14.value = SetC_String;
	  SetC(15,broken_cookie[17]);
	  document.jikosindan.name15.value = SetC_String;
	  SetC(16,broken_cookie[18]);
	  document.jikosindan.name16.value = SetC_String;
	  SetC(17,broken_cookie[19]);
	  document.jikosindan.name17.value = SetC_String;
	  SetC(18,broken_cookie[20]);
	  document.jikosindan.name18.value = SetC_String;
	  SetC(19,broken_cookie[21]);
	  document.jikosindan.name19.value = SetC_String;
	  SetC(20,broken_cookie[22]);
	  document.jikosindan.name20.value = SetC_String;
	  SetC(21,broken_cookie[23]);
	  document.jikosindan.name21.value = SetC_String;
	  SetC(22,broken_cookie[24]);
	  document.jikosindan.name22.value = SetC_String;
	  SetC(23,broken_cookie[25]);
	  document.jikosindan.name23.value = SetC_String;
      if (broken_cookie[26]=="false")
        document.jikosindan.chk1.checked = false;
      else
        document.jikosindan.chk1.checked = true;
      DisInput();

	  if(document.jikosindan.chk1.checked==false)
	  {
	    SetC(24,broken_cookie[27]);
	    document.jikosindan.name24.value = SetC_String;
	    SetC(25,broken_cookie[28]);
	    document.jikosindan.name25.value = SetC_String;
	    SetC(26,broken_cookie[29]);
	    document.jikosindan.name26.value = SetC_String;
	  }
    }
}

// クッキー書き込み
function MysetCookie()
{
  var the_cookie = "";
      the_cookie = document.jikosindan.kind1.value + ";";
      the_cookie = the_cookie + document.jikosindan.kind2.value + ";";
      the_cookie = the_cookie + document.jikosindan.kind3.value + ";";

	  the_cookie = the_cookie + CutC(document.jikosindan.name1.value) + ";";
	  the_cookie = the_cookie + CutC(document.jikosindan.name2.value) + ";";
	  the_cookie = the_cookie + CutC(document.jikosindan.name3.value) + ";";
	  the_cookie = the_cookie + CutC(document.jikosindan.name4.value) + ";";
	  the_cookie = the_cookie + CutC(document.jikosindan.name5.value) + ";";
	  the_cookie = the_cookie + CutC(document.jikosindan.name6.value) + ";";
	  the_cookie = the_cookie + CutC(document.jikosindan.name7.value) + ";";
	  the_cookie = the_cookie + CutC(document.jikosindan.name8.value) + ";";
	  the_cookie = the_cookie + CutC(document.jikosindan.name9.value) + ";";
	  the_cookie = the_cookie + CutC(document.jikosindan.name10.value) + ";";
	  the_cookie = the_cookie + CutC(document.jikosindan.name11.value) + ";";
	  the_cookie = the_cookie + CutC(document.jikosindan.name12.value) + ";";
	  the_cookie = the_cookie + CutC(document.jikosindan.name13.value) + ";";
	  the_cookie = the_cookie + CutC(document.jikosindan.name14.value) + ";";
	  the_cookie = the_cookie + CutC(document.jikosindan.name15.value) + ";";
	  the_cookie = the_cookie + CutC(document.jikosindan.name16.value) + ";";
	  the_cookie = the_cookie + CutC(document.jikosindan.name17.value) + ";";
	  the_cookie = the_cookie + CutC(document.jikosindan.name18.value) + ";";
	  the_cookie = the_cookie + CutC(document.jikosindan.name19.value) + ";";
	  the_cookie = the_cookie + CutC(document.jikosindan.name20.value) + ";";
	  the_cookie = the_cookie + CutC(document.jikosindan.name21.value) + ";";
	  the_cookie = the_cookie + CutC(document.jikosindan.name22.value) + ";";
	  the_cookie = the_cookie + CutC(document.jikosindan.name23.value) + ";";
	
      the_cookie = the_cookie + document.jikosindan.chk1.checked + ";";

	  the_cookie = the_cookie + CutC(document.jikosindan.name24.value) + ";";
	  the_cookie = the_cookie + CutC(document.jikosindan.name25.value) + ";";
	  the_cookie = the_cookie + CutC(document.jikosindan.name26.value) + ";";

      mySetCookie(COOKIE_NAME,the_cookie,31*6);

      document.jikosindan.input_name1.value = document.jikosindan.name1.value;
      document.jikosindan.input_name2.value = document.jikosindan.name2.value;
      document.jikosindan.input_name3.value = document.jikosindan.name3.value;
      document.jikosindan.input_name4.value = document.jikosindan.name4.value;
      document.jikosindan.input_name5.value = document.jikosindan.name5.value;
      document.jikosindan.input_name6.value = document.jikosindan.name6.value;
      document.jikosindan.input_name7.value = document.jikosindan.name7.value;
      document.jikosindan.input_name8.value = document.jikosindan.name8.value;
      document.jikosindan.input_name9.value = document.jikosindan.name9.value;
      document.jikosindan.input_name10.value = document.jikosindan.name10.value;
      document.jikosindan.input_name11.value = document.jikosindan.name11.value;
      document.jikosindan.input_name12.value = document.jikosindan.name12.value;
      document.jikosindan.input_name13.value = document.jikosindan.name13.value;
      document.jikosindan.input_name14.value = document.jikosindan.name14.value;
      document.jikosindan.input_name15.value = document.jikosindan.name15.value;
      document.jikosindan.input_name16.value = document.jikosindan.name16.value;
      document.jikosindan.input_name17.value = document.jikosindan.name17.value;
      document.jikosindan.input_name18.value = document.jikosindan.name18.value;
      document.jikosindan.input_name19.value = document.jikosindan.name19.value;
      document.jikosindan.input_name20.value = document.jikosindan.name20.value;
      document.jikosindan.input_name21.value = document.jikosindan.name21.value;
      document.jikosindan.input_name22.value = document.jikosindan.name22.value;
      document.jikosindan.input_name23.value = document.jikosindan.name23.value;
	
      if (document.jikosindan.chk1.checked == false)
        document.jikosindan.input_chk1.value="false";
      else
        document.jikosindan.input_chk1.value="true";

      if(document.jikosindan.chk1.checked==false)
      {
	    document.jikosindan.input_name24.value = document.jikosindan.name24.value;
	    document.jikosindan.input_name25.value = document.jikosindan.name25.value;
	    document.jikosindan.input_name26.value = document.jikosindan.name26.value;
      }

      if(isMac || (isMSIE==false)) {
        mySetCookie("NOW_SESSION",document.jikosindan.SESSION_CODE.value,31*6);
      }
}

/*        クッキーに登録する汎用関数              */
/* 書式 : mySetCookie(クッキー名,値,有効期限日数) */
/* 戻り値 : なし(void)                            */
function mySetCookie(myCookie,myValue,myDay){
   myExp = new Date();
   myExp.setTime(myExp.getTime()+(myDay*24*60*60*1000));
   myItem = "@" + myCookie + "=" + escape(myValue) + ";";
   myExpires = "expires="+myExp.toGMTString();
   document.cookie =  myItem + myExpires;
}

/*        クッキーを取り込む汎用関数              */
/* 書式 : myGetCookie(クッキー名)                 */
/* 戻り値 : 値(string)  null:該当なし             */
function myGetCookie(myCookie){
   myCookie = "@" + myCookie + "=";
   myValue = null;
   myStr = document.cookie + ";" ;
   myOfst = myStr.indexOf(myCookie);
   if (myOfst != -1){
      myStart = myOfst + myCookie.length;
      myEnd   = myStr.indexOf(";" , myStart);
      myValue = unescape(myStr.substring(myStart,myEnd));
   }
   return myValue;
}

// 選択肢未入力チェック
function no_selectcheck()
{
var msgText = "が選択されていません。";

    if((document.jikosindan.kind1.options.length == 0) || (document.jikosindan.kind1.options.value==""))
    {
		alert("業種大分類" + msgText);
		document.jikosindan.kind1.focus();
		return(false);
    }
    
    if((document.jikosindan.kind2.options.length == 0) || (document.jikosindan.kind2.options.value==""))
    {
		alert("業種中分類" + msgText);
		document.jikosindan.kind2.focus();
		return(false);
    }
    
    if((document.jikosindan.kind3.options.length == 0) || (document.jikosindan.kind3.options.value==""))
    {
		alert("単位" + msgText);
		document.jikosindan.kind3.focus();
		return(false);
    }
    
    Input_err="0";
    return(true);
}

// 未入力チェック
function no_inputcheck(n)
{
var msgText = "が入力されていません。";

    if((n==-1) || (n==1)) {
	  if(document.jikosindan.name1.value=="")
	  {
	    setErrColor(1);
		alert("流動資産合計" + msgText);
        Input_err="1";
		return(false);
	  }
	}
	
    if((n==-1) || (n==2)) {
	  if(document.jikosindan.name2.value=="")
	  {
	    setErrColor(2);
		alert("現金・預金" + msgText);
        Input_err="2";
		return(false);
	  }
	}

    if((n==-1) || (n==3)) {
	  if(document.jikosindan.name3.value=="")
	  {
	    setErrColor(3);
		alert("受取手形（割引分除く）" + msgText);
        Input_err="3";
		return(false);
	  }
	}
	
    if((n==-1) || (n==4)) {
	  if(document.jikosindan.name4.value=="")
	  {
	    setErrColor(4);
		alert("売掛金" + msgText);
        Input_err="4";
		return(false);
	  }
	}
	
    if((n==-1) || (n==5)) {
	  if(document.jikosindan.name5.value=="")
	  {
	    setErrColor(5);
		alert("棚卸資産" + msgText);
        Input_err="5";
		return(false);
	  }
	}
	
    if((n==-1) || (n==6)) {
	  if(document.jikosindan.name6.value=="")
	  {
	    setErrColor(6);
		alert("固定資産合計" + msgText);
        Input_err="6";
		return(false);
	  }
	}
	
    if((n==-1) || (n==7)) {
	  if(document.jikosindan.name7.value=="")
	  {
	    setErrColor(7);
		alert("有形固定資産合計" + msgText);
        Input_err="7";
		return(false);
	  }
	}
	
    if((n==-1) || (n==8)) {
	  if(document.jikosindan.name8.value=="")
	  {
	    setErrColor(8);
		alert("土地" + msgText);
        Input_err="8";
		return(false);
	  }
	}
	
    if((n==-1) || (n==9)) {
	  if(document.jikosindan.name9.value=="")
	  {
	    setErrColor(9);
		alert("資産合計" + msgText);
        Input_err="9";
		return(false);
	  }
	}
	
    if((n==-1) || (n==10)) {
	  if(document.jikosindan.name10.value=="")
	  {
	    setErrColor(10);
		alert("流動負債合計" + msgText);
        Input_err="10";
		return(false);
	  }
	}

    if((n==-1) || (n==11)) {
	  if(document.jikosindan.name11.value=="")
	  {
	    setErrColor(11);
		alert("短期借入金" + msgText);
        Input_err="11";
		return(false);
	  }
	}
	
    if((n==-1) || (n==12)) {
	  if(document.jikosindan.name12.value=="")
	  {
	    setErrColor(12);
		alert("長期借入金・社債" + msgText);
        Input_err="12";
		return(false);
	  }
	}
	
    if((n==-1) || (n==13)) {
	  if(document.jikosindan.name13.value=="")
	  {
	    setErrColor(13);
		alert("純資産合計" + msgText);
        Input_err="13";
		return(false);
	  }
	}
	
    if((n==-1) || (n==14)) {
	  if(document.jikosindan.name14.value=="")
	  {
	    setErrColor(14);
		alert("受取手形割引高" + msgText);
        Input_err="14";
		return(false);
	  }
	}

    if((n==-1) || (n==15)) {
	  if(document.jikosindan.name15.value=="")
	  {
	    setErrColor(15);
		alert("受取手形裏書譲渡高" + msgText);
        Input_err="15";
		return(false);
	  }
	}
	
    if((n==-1) || (n==16)) {
	  if(document.jikosindan.name16.value=="")
	  {
	    setErrColor(16);
		alert("期末従業員数" + msgText);
        Input_err="16";
		return(false);
	  }
	}
	
    if((n==-1) || (n==17)) {
	  if(document.jikosindan.name17.value=="")
	  {
	    setErrColor(17);
		alert("売上高" + msgText);
        Input_err="17";
		return(false);
	  }
	}
	
    if((n==-1) || (n==18)) {
	  if(document.jikosindan.name18.value=="")
	  {
	    setErrColor(18);
		alert("売上総利益" + msgText);
        Input_err="18";
		return(false);
	  }
	}
	
    if((n==-1) || (n==19)) {
	  if(document.jikosindan.name19.value=="")
	  {
	    setErrColor(19);
		alert("営業利益" + msgText);
        Input_err="19";
		return(false);
	  }
	}
	
    if((n==-1) || (n==20)) {
	  if(document.jikosindan.name20.value=="")
	  {
	    setErrColor(20);
		alert("受取利息配当金" + msgText);
        Input_err="20";
		return(false);
	  }
	}
	
    if((n==-1) || (n==21)) {
	  if(document.jikosindan.name21.value=="")
	  {
	    setErrColor(21);
		alert("支払利息割引料" + msgText);
        Input_err="21";
		return(false);
	  }
	}
	
    if((n==-1) || (n==22)) {
	  if(document.jikosindan.name22.value=="")
	  {
	    setErrColor(22);
		alert("経常利益" + msgText);
        Input_err="22";
		return(false);
	  }
	}
	
    if((n==-1) || (n==23)) {
	  if(document.jikosindan.name23.value=="")
	  {
	    setErrColor(23);
		alert("減価償却実施額" + msgText);
        Input_err="23";
		return(false);
	  }
	}
	
    if((n==-1) || (n==24)) {
	  if(document.jikosindan.name24.value=="")
	  {
	    if(document.jikosindan.chk1.checked==false) {
	    setErrColor(24);
		  alert("前期資産合計" + msgText);
          Input_err="24";
		  return(false);
	    }
	  }
	}
	
    if((n==-1) || (n==25)) {
	  if(document.jikosindan.name25.value=="")
	  {
	    if(document.jikosindan.chk1.checked==false) {
	      setErrColor(25);
		  alert("前期純資産合計" + msgText);
          Input_err="25";
		  return(false);
	    }
	  }
	}
	
    if((n==-1) || (n==26)) {
	  if(document.jikosindan.name26.value=="")
	  {
	    if(document.jikosindan.chk1.checked==false) {
	      setErrColor(26);
		  alert("前期売上高" + msgText);
          Input_err="26";
		  return(false);
	    }
	  }
	}

    Input_err="0";
    return(true);
}

// 未入力補正
function no_input_zero_set(){
  var msgText = "が入力されていません。";

  if(document.jikosindan.name1.value==""){
    document.jikosindan.name1.value="0";
  }
  if(document.jikosindan.name2.value==""){
    document.jikosindan.name2.value="0";
  }
  if(document.jikosindan.name3.value==""){
    document.jikosindan.name3.value="0";
  }
  if(document.jikosindan.name4.value==""){
    document.jikosindan.name4.value="0";
  }
  if(document.jikosindan.name5.value==""){
    document.jikosindan.name5.value="0";
  }
  if(document.jikosindan.name6.value==""){
    document.jikosindan.name6.value="0";
  }
  if(document.jikosindan.name7.value==""){
    document.jikosindan.name7.value="0";
  }
  if(document.jikosindan.name8.value==""){
    document.jikosindan.name8.value="0";
  }
  if(document.jikosindan.name9.value==""){
    document.jikosindan.name9.value="0";
  }
  if(document.jikosindan.name10.value==""){
    document.jikosindan.name10.value="0";
  }
  if(document.jikosindan.name11.value==""){
    document.jikosindan.name11.value="0";
  }
  if(document.jikosindan.name12.value==""){
    document.jikosindan.name12.value="0";
  }
  if(document.jikosindan.name13.value==""){
    document.jikosindan.name13.value="0";
  }
  if(document.jikosindan.name14.value==""){
    document.jikosindan.name14.value="0";
  }
  if(document.jikosindan.name15.value==""){
    document.jikosindan.name15.value="0";
  }
  if(document.jikosindan.name16.value==""){
    document.jikosindan.name16.value="0";
  }
  if(document.jikosindan.name17.value==""){
    document.jikosindan.name17.value="0";
  }
  if(document.jikosindan.name18.value==""){
    document.jikosindan.name18.value="0";
  }
  if(document.jikosindan.name19.value==""){
    document.jikosindan.name19.value="0";
  }
  if(document.jikosindan.name20.value==""){
    document.jikosindan.name20.value="0";
  }
  if(document.jikosindan.name21.value==""){
    document.jikosindan.name21.value="0";
  }
  if(document.jikosindan.name22.value==""){
    document.jikosindan.name22.value="0";
  }
  if(document.jikosindan.name23.value==""){
    document.jikosindan.name23.value="0";
  }
  if(document.jikosindan.name24.value==""){
    if(document.jikosindan.chk1.checked==false){
      setErrColor(24);
      alert("前期資産合計" + msgText);
      Input_err="24";
      return(false);
    }
  }
  if(document.jikosindan.name25.value==""){
    if(document.jikosindan.chk1.checked==false){
      setErrColor(25);
      alert("前期純資産合計" + msgText);
      Input_err="25";
      return(false);
    }
  }
  if(document.jikosindan.name26.value==""){
    if(document.jikosindan.chk1.checked==false){
      setErrColor(26);
      alert("前期売上高" + msgText);
      Input_err="26";
      return(false);
    }
  }

  Input_err="0";
  return(true);
}

// 入力範囲チェック
function scope_inputcheck(n)
{
var msgText = "の入力値が範囲を超えています。";

    if((n==-1) || (n==1)) {
      if(CutC(document.jikosindan.name1.value)!="") {
	    if((Number(CutC(document.jikosindan.name1.value))<0) || (Number(CutC(document.jikosindan.name1.value))>99999999999))
	    {
            if((Input_err != "0") && (Input_err != "1")) return(false);
	      setErrColor(1);
		  msgText = "流動資産合計" + msgText + "\n\n　0～99,999,999,999";
		  alert(msgText);
          Input_err="1";
		  return(false);
	    }
	  }
	}

    if((n==-1) || (n==2)) {
      if(CutC(document.jikosindan.name2.value)!="") {
	    if((Number(CutC(document.jikosindan.name2.value))<-99999999999) || (Number(CutC(document.jikosindan.name2.value))>99999999999))
	    {
            if((Input_err != "0") && (Input_err != "2")) return(false);
	      setErrColor(2);
		  msgText = "現金・預金" + msgText + "\n\n　-99,999,999,999～99,999,999,999";
		  alert(msgText);
          Input_err="2";
		  return(false);
	    }
	  }
	}

    if((n==-1) || (n==3)) {
      if(CutC(document.jikosindan.name3.value)!="") {
	    if((Number(CutC(document.jikosindan.name3.value))<0) || (Number(CutC(document.jikosindan.name3.value))>99999999999))
	    {
            if((Input_err != "0") && (Input_err != "3")) return(false);
	      setErrColor(3);
		  msgText = "受取手形（割引分除く）" + msgText + "\n\n　0～99,999,999,999";
		  alert(msgText);
          Input_err="3";
		  return(false);
	    }
	  }
	}
	
    if((n==-1) || (n==4)) {
      if(CutC(document.jikosindan.name4.value)!="") {
	    if((Number(CutC(document.jikosindan.name4.value))<0) || (Number(CutC(document.jikosindan.name4.value))>99999999999))
	    {
            if((Input_err != "0") && (Input_err != "4")) return(false);
	      setErrColor(4);
		  msgText = "売掛金" + msgText + "\n\n　0～99,999,999,999";
		  alert(msgText);
          Input_err="4";
		  return(false);
	    }
	  }
	}
	
    if((n==-1) || (n==5)) {
      if(CutC(document.jikosindan.name5.value)!="") {
	    if((Number(CutC(document.jikosindan.name5.value))<0) || (Number(CutC(document.jikosindan.name5.value))>99999999999))
	    {
            if((Input_err != "0") && (Input_err != "5")) return(false);
	      setErrColor(5);
		  msgText = "棚卸資産" + msgText + "\n\n　0～99,999,999,999";
		  alert(msgText);
          Input_err="5";
		  return(false);
	    }
	  }
	}
	
    if((n==-1) || (n==6)) {
      if(CutC(document.jikosindan.name6.value)!="") {
	    if((Number(CutC(document.jikosindan.name6.value))<0) || (Number(CutC(document.jikosindan.name6.value))>99999999999))
	    {
            if((Input_err != "0") && (Input_err != "6")) return(false);
	      setErrColor(6);
		  msgText = "固定資産合計" + msgText + "\n\n　0～99,999,999,999";
		  alert(msgText);
          Input_err="6";
		  return(false);
	    }
	  }
	}
	
    if((n==-1) || (n==7)) {
      if(CutC(document.jikosindan.name7.value)!="") {
	    if((Number(CutC(document.jikosindan.name7.value))<0) || (Number(CutC(document.jikosindan.name7.value))>99999999999))
	    {
            if((Input_err != "0") && (Input_err != "7")) return(false);
	      setErrColor(7);
		  msgText = "有形固定資産合計" + msgText + "\n\n　0～99,999,999,999";
		  alert(msgText);
          Input_err="7";
		  return(false);
	    }
	  }
	}
	
    if((n==-1) || (n==8)) {
      if(CutC(document.jikosindan.name8.value)!="") {
	    if((Number(CutC(document.jikosindan.name8.value))<0) || (Number(CutC(document.jikosindan.name8.value))>99999999999))
	    {
            if((Input_err != "0") && (Input_err != "8")) return(false);
	      setErrColor(8);
		  msgText = "土地" + msgText + "\n\n　0～99,999,999,999";
		  alert(msgText);
          Input_err="8";
		  return(false);
	    }
	  }
	}
	
    if((n==-1) || (n==9)) {
      if(CutC(document.jikosindan.name9.value)!="") {
	    if(Number(CutC(document.jikosindan.name9.value))<1)
	    {
            if((Input_err != "0") && (Input_err != "9")) return(false);
	      setErrColor(9);
		  msgText = "１以上の正の値を入力して下さい。";
		  alert(msgText);
          Input_err="9";
		  return(false);
	    }
	    if(Number(CutC(document.jikosindan.name9.value))>99999999999)
	    {
            if((Input_err != "0") && (Input_err != "9")) return(false);
	      setErrColor(9);
		  msgText = "資産合計" + msgText + "\n\n　1～99,999,999,999";
		  alert(msgText);
          Input_err="9";
		  return(false);
	    }
	  }
	}
	
    if((n==-1) || (n==10)) {
      if(CutC(document.jikosindan.name10.value)!="") {
	    if((Number(CutC(document.jikosindan.name10.value))<0) || (Number(CutC(document.jikosindan.name10.value))>99999999999))
	    {
            if((Input_err != "0") && (Input_err != "10")) return(false);
	      setErrColor(10);
		  msgText = "流動負債合計" + msgText + "\n\n　0～99,999,999,999";
		  alert(msgText);
          Input_err="10";
		  return(false);
	    }
	  }
	}

    if((n==-1) || (n==11)) {
      if(CutC(document.jikosindan.name11.value)!="") {
	    if((Number(CutC(document.jikosindan.name11.value))<0) || (Number(CutC(document.jikosindan.name11.value))>99999999999))
	    {
            if((Input_err != "0") && (Input_err != "11")) return(false);
	      setErrColor(11);
		  msgText = "短期借入金" + msgText + "\n\n　0～99,999,999,999";
		  alert(msgText);
          Input_err="11";
		  return(false);
	    }
	  }
	}
	
    if((n==-1) || (n==12)) {
      if(CutC(document.jikosindan.name12.value)!="") {
	    if((Number(CutC(document.jikosindan.name12.value))<0) || (Number(CutC(document.jikosindan.name12.value))>99999999999))
	    {
            if((Input_err != "0") && (Input_err != "12")) return(false);
	      setErrColor(12);
		  msgText = "長期借入金・社債" + msgText + "\n\n　0～99,999,999,999";
		  alert(msgText);
          Input_err="12";
		  return(false);
	    }
	  }
	}
	
    if((n==-1) || (n==13)) {
      if(CutC(document.jikosindan.name13.value)!="") {
	    if((Number(CutC(document.jikosindan.name13.value))<-99999999999) || (Number(CutC(document.jikosindan.name13.value))>99999999999))
	    {
            if((Input_err != "0") && (Input_err != "13")) return(false);
	      setErrColor(13);
		  msgText = "純資産合計" + msgText + "\n\n　-99,999,999,999～99,999,999,999";
		  alert(msgText);
          Input_err="13";
		  return(false);
	    }
	  }
	}
	
    if((n==-1) || (n==14)) {
      if(CutC(document.jikosindan.name14.value)!="") {
	    if((Number(CutC(document.jikosindan.name14.value))<0) || (Number(CutC(document.jikosindan.name14.value))>99999999999))
	    {
            if((Input_err != "0") && (Input_err != "14")) return(false);
	      setErrColor(14);
		  msgText = "受取手形割引高" + msgText + "\n\n　0～99,999,999,999";
		  alert(msgText);
          Input_err="14";
		  return(false);
	    }
	  }
	}

    if((n==-1) || (n==15)) {
      if(CutC(document.jikosindan.name15.value)!="") {
	    if((Number(CutC(document.jikosindan.name15.value))<0) || (Number(CutC(document.jikosindan.name15.value))>99999999999))
	    {
            if((Input_err != "0") && (Input_err != "15")) return(false);
	      setErrColor(15);
		  msgText = "受取手形裏書譲渡高" + msgText + "\n\n　0～99,999,999,999";
		  alert(msgText);
          Input_err="15";
		  return(false);
	    }
	  }
	}
	
    if((n==-1) || (n==16)) {
      if(CutC(document.jikosindan.name16.value)!="") {
	    if( Number(CutC(document.jikosindan.name16.value))<1 )
		{
            if((Input_err != "0") && (Input_err != "16")) return(false);
	      setErrColor(16);
		  msgText = "１以上の正の値を入力して下さい。";
		  alert(msgText);
          Input_err="16";
		  return(false);
		}
	    if(Number(CutC(document.jikosindan.name16.value))>99999999999)
	    {
            if((Input_err != "0") && (Input_err != "16")) return(false);
	      setErrColor(16);
		  msgText = "期末従業員数" + msgText + "\n\n　1～99,999,999,999";
		  alert(msgText);
          Input_err="16";
		  return(false);
	    }
	  }
	}
	
    if((n==-1) || (n==17)) {
      if(CutC(document.jikosindan.name17.value)!="") {
	    if((Number(CutC(document.jikosindan.name17.value))<0) || (Number(CutC(document.jikosindan.name17.value))>99999999999))
	    {
            if((Input_err != "0") && (Input_err != "17")) return(false);
	      setErrColor(17);
		  msgText = "売上高" + msgText + "\n\n　0～99,999,999,999";
		  alert(msgText);
          Input_err="17";
		  return(false);
	    }
	  }
	}
	
    if((n==-1) || (n==18)) {
      if(CutC(document.jikosindan.name18.value)!="") {
	    if((Number(CutC(document.jikosindan.name18.value))<-99999999999) || (Number(CutC(document.jikosindan.name18.value))>99999999999))
	    {
            if((Input_err != "0") && (Input_err != "18")) return(false);
	      setErrColor(18);
		  msgText = "売上総利益" + msgText + "\n\n　-99,999,999,999～99,999,999,999";
		  alert(msgText);
          Input_err="18";
		  return(false);
	    }
	  }
	}
	
    if((n==-1) || (n==19)) {
      if(CutC(document.jikosindan.name19.value)!="") {
	    if((Number(CutC(document.jikosindan.name19.value))<-99999999999) || (Number(CutC(document.jikosindan.name19.value))>99999999999))
	    {
            if((Input_err != "0") && (Input_err != "19")) return(false);
	      setErrColor(19);
		  msgText = "営業利益" + msgText + "\n\n　-99,999,999,999～99,999,999,999";
		  alert(msgText);
          Input_err="19";
		  return(false);
	    }
	  }
	}
	
    if((n==-1) || (n==20)) {
      if(CutC(document.jikosindan.name20.value)!="") {
	    if((Number(CutC(document.jikosindan.name20.value))<0) || (Number(CutC(document.jikosindan.name20.value))>99999999999))
	    {
            if((Input_err != "0") && (Input_err != "20")) return(false);
	      setErrColor(20);
		  msgText = "受取利息配当金" + msgText + "\n\n　0～99,999,999,999";
		  alert(msgText);
          Input_err="20";
		  return(false);
	    }
	  }
	}
	
    if((n==-1) || (n==21)) {
      if(CutC(document.jikosindan.name21.value)!="") {
	    if((Number(CutC(document.jikosindan.name21.value))<0) || (Number(CutC(document.jikosindan.name21.value))>99999999999))
	    {
            if((Input_err != "0") && (Input_err != "21")) return(false);
	      setErrColor(21);
		  msgText = "支払利息割引料" + msgText + "\n\n　0～99,999,999,999";
		  alert(msgText);
          Input_err="21";
		  return(false);
	    }
	  }
	}
	
    if((n==-1) || (n==22)) {
      if(CutC(document.jikosindan.name22.value)!="") {
	    if((Number(CutC(document.jikosindan.name22.value))<-99999999999) || (Number(CutC(document.jikosindan.name22.value))>99999999999))
	    {
            if((Input_err != "0") && (Input_err != "22")) return(false);
	      setErrColor(22);
		  msgText = "経常利益" + msgText + "\n\n　-99,999,999,999～99,999,999,999";
		  alert(msgText);
          Input_err="22";
		  return(false);
	    }
	  }
	}
	
    if((n==-1) || (n==23)) {
      if(CutC(document.jikosindan.name23.value)!="") {
	    if((Number(CutC(document.jikosindan.name23.value))<0) || (Number(CutC(document.jikosindan.name23.value))>99999999999))
	    {
            if((Input_err != "0") && (Input_err != "23")) return(false);
	      setErrColor(23);
		  msgText = "減価償却実施額" + msgText + "\n\n　0～99,999,999,999";
		  alert(msgText);
          Input_err="23";
		  return(false);
	    }
	  }
	}
	
    if((n==-1) || (n==24)) {
      if(CutC(document.jikosindan.name24.value)!="") {
	    if(Number(CutC(document.jikosindan.name24.value))<1)
	    {
	      if(document.jikosindan.chk1.checked==false) {
              if((Input_err != "0") && (Input_err != "24")) return(false);
	        setErrColor(24);
		    msgText = "１以上の正の値を入力して下さい。";
		    alert(msgText);
            Input_err="24";
		    return(false);
	      }
	    }
	    if(Number(CutC(document.jikosindan.name24.value))>99999999999)
	    {
	      if(document.jikosindan.chk1.checked==false) {
              if((Input_err != "0") && (Input_err != "24")) return(false);
	        setErrColor(24);
		    msgText = "前期資産合計" + msgText + "\n\n　1～99,999,999,999";
		    alert(msgText);
            Input_err="24";
		    return(false);
	      }
	    }
	  }
	}
	
    if((n==-1) || (n==25)) {
      if(CutC(document.jikosindan.name25.value)!="") {
	    if((Number(CutC(document.jikosindan.name25.value))<-99999999999) || (Number(CutC(document.jikosindan.name25.value))>99999999999))
	    {
	      if(document.jikosindan.chk1.checked==false) {
              if((Input_err != "0") && (Input_err != "25")) return(false);
	        setErrColor(25);
		    msgText = "前期純資産合計" + msgText + "\n\n　-99,999,999,999～99,999,999,999";
		    alert(msgText);
            Input_err="25";
		    return(false);
	      }
	    }
	  }
	}
	
    if((n==-1) || (n==26)) {
      if(CutC(document.jikosindan.name26.value)!="") {
	    if((Number(CutC(document.jikosindan.name26.value))<0) || (Number(CutC(document.jikosindan.name26.value))>99999999999))
	    {
	      if(document.jikosindan.chk1.checked==false) {
              if((Input_err != "0") && (Input_err != "-1") && (Input_err != "26")) return(false);
	        setErrColor(26);
		    msgText = "前期売上高" + msgText + "\n\n　0～99,999,999,999";
		    alert(msgText);
            Input_err="26";
		   return(false);
	      }
	    }
	  }
	}

    Input_err="0";
    return(true);
}

// バランスチェック
function balance_inputcheck()
{
var msgText = "\nに適合する値を入力してください。";

	if(Number(CutC(document.jikosindan.name1.value)) > Number(CutC(document.jikosindan.name9.value)))
	{
	    setErrColor(1);
	    setErrColor(9);
		msgText = "「流動資産合計　≦　資産合計」" + msgText;
		alert(msgText);
        Input_err="1";
		return(false);
	}

	else if(Number(CutC(document.jikosindan.name8.value)) > Number(CutC(document.jikosindan.name7.value)))
	{
	    setErrColor(7);
	    setErrColor(8);
		msgText = "「土地　≦　有形固定資産合計」" + msgText;
		alert(msgText);
        Input_err="7";
		return(false);
	}

	else if(Number(CutC(document.jikosindan.name6.value)) > Number(CutC(document.jikosindan.name9.value)))
	{
	    setErrColor(6);
	    setErrColor(9);
		msgText = "「固定資産合計　≦　資産合計」" + msgText;
		alert(msgText);
        Input_err="6";
		return(false);
	}

	else if(Number(CutC(document.jikosindan.name11.value)) > Number(CutC(document.jikosindan.name10.value)))
	{
	    setErrColor(10);
	    setErrColor(11);
		msgText = "「短期借入金　≦　流動負債合計」" + msgText;
		alert(msgText);
        Input_err="10";
		return(false);
	}

	else if(Number(CutC(document.jikosindan.name13.value)) > Number(CutC(document.jikosindan.name9.value)))
	{
	    setErrColor(9);
	    setErrColor(13);
		msgText = "「純資産合計　≦　資産合計」" + msgText;
		alert(msgText);
        Input_err="9";
		return(false);
	}

	else if(Number(CutC(document.jikosindan.name18.value)) < Number(CutC(document.jikosindan.name19.value)))
	{
	    setErrColor(18);
	    setErrColor(19);
		msgText = "「売上総利益　≧　営業利益」" + msgText;
		alert(msgText);
        Input_err="18";
		return(false);
	}

	else if(Number(CutC(document.jikosindan.name7.value)) > Number(CutC(document.jikosindan.name6.value)))
	{
	    setErrColor(6);
	    setErrColor(7);
		msgText = "「有形固定資産　≦　固定資産合計」" + msgText;
		alert(msgText);
        Input_err="6";
		return(false);
	}

	else if(Number(CutC(document.jikosindan.name1.value)) + Number(CutC(document.jikosindan.name6.value)) > (Number(CutC(document.jikosindan.name9.value)) + 10))
	{
	    setErrColor(1);
	    setErrColor(6);
	    setErrColor(9);
		msgText = "「流動資産合計　＋　固定資産合計　≦　資産合計」" + msgText;
		alert(msgText);
        Input_err="1";
		return(false);
	}

	else if(Number(CutC(document.jikosindan.name10.value)) + Number(CutC(document.jikosindan.name12.value)) + Number(CutC(document.jikosindan.name13.value)) > (Number(CutC(document.jikosindan.name9.value)) + 10))
	{
	    setErrColor(10);
	    setErrColor(12);
	    setErrColor(13);
	    setErrColor(9);
		msgText = "「流動負債合計　＋　長期借入金・社債　＋　純資産合計　≦　資産合計」" + msgText;
		alert(msgText);
        Input_err="9";
		return(false);
	}

	else if(Number(CutC(document.jikosindan.name19.value)) > Number(CutC(document.jikosindan.name17.value)))
	{
	    setErrColor(17);
	    setErrColor(19);
		msgText = "「営業利益　≦　売上高」" + msgText;
		alert(msgText);
        Input_err="17";
		return(false);
	}

    Input_err="0";
    return(true);

}

// 入力ボックスカラー初期化
function InitInputColor()
{
    document.jikosindan.name1.style.background='White';
    document.jikosindan.name1.style.color='';

    document.jikosindan.name2.style.background='White';
    document.jikosindan.name2.style.color='';

    document.jikosindan.name3.style.background='White';
    document.jikosindan.name3.style.color='';

    document.jikosindan.name4.style.background='White';
    document.jikosindan.name4.style.color='';

    document.jikosindan.name5.style.background='White';
    document.jikosindan.name5.style.color='';

    document.jikosindan.name6.style.background='White';
    document.jikosindan.name6.style.color='';

    document.jikosindan.name7.style.background='White';
    document.jikosindan.name7.style.color='';

    document.jikosindan.name8.style.background='White';
    document.jikosindan.name8.style.color='';

    document.jikosindan.name9.style.background='White';
    document.jikosindan.name9.style.color='';

    document.jikosindan.name10.style.background='White';
    document.jikosindan.name10.style.color='';

    document.jikosindan.name11.style.background='White';
    document.jikosindan.name11.style.color='';

    document.jikosindan.name12.style.background='White';
    document.jikosindan.name12.style.color='';

    document.jikosindan.name13.style.background='White';
    document.jikosindan.name13.style.color='';

    document.jikosindan.name14.style.background='White';
    document.jikosindan.name14.style.color='';

    document.jikosindan.name15.style.background='White';
    document.jikosindan.name15.style.color='';

    document.jikosindan.name16.style.background='White';
    document.jikosindan.name16.style.color='';

    document.jikosindan.name17.style.background='White';
    document.jikosindan.name17.style.color='';

    document.jikosindan.name18.style.background='White';
    document.jikosindan.name18.style.color='';

    document.jikosindan.name19.style.background='White';
    document.jikosindan.name19.style.color='';

    document.jikosindan.name20.style.background='White';
    document.jikosindan.name20.style.color='';

    document.jikosindan.name21.style.background='White';
    document.jikosindan.name21.style.color='';

    document.jikosindan.name22.style.background='White';
    document.jikosindan.name22.style.color='';

    document.jikosindan.name23.style.background='White';
    document.jikosindan.name23.style.color='';

    if(document.jikosindan.chk1.checked==false) {
      document.jikosindan.name24.style.background='White';
      document.jikosindan.name24.style.color='';

      document.jikosindan.name25.style.background='White';
      document.jikosindan.name25.style.color='';

      document.jikosindan.name26.style.background='White';
      document.jikosindan.name26.style.color='';
    }
}

// 入力チェック
function inputcheck()
{

    InitInputColor();

    // 選択肢未入力チェック
    if(no_selectcheck()==false)
		return(false);

    // 未入力チェック
    if(no_input_zero_set()==false)
		return(false);

    // 入力範囲チェック
    if(scope_inputcheck(-1)==false)
		return(false);

    // バランスチェック
    if(balance_inputcheck()==false)
		return(false);

    return(true);

}


//診断ボタンクリック
function btn_kakunin(formName,procNum)
{

    if (Input_err!="0") {
      return; //(ReloadMe( ));
    }
    
 	if(false == inputcheck())
	{
        if (Input_err!="0") {
           Jto = Input_err;
           Input_err="0";
           id = setTimeout("goFocus(Jto)", 100);
		   return; //(ReloadMe( ));
		}
	}
	
	if (! window.confirm("この入力された数値で診断を行います。間違いはありませんか？"))
	{
		return; //(ReloadMe( ));
	}

    MysetCookie();
    ExecSubmit(formName,procNum);

}

// 入力フォーカスのリターンキーで制御する
function EnterNext() {
  if(document.jikosindan.input_num.value=="1")
    document.jikosindan.name2.focus();
  else if(document.jikosindan.input_num.value=="2")
    document.jikosindan.name3.focus();
  else if(document.jikosindan.input_num.value=="3")
    document.jikosindan.name4.focus();
  else if(document.jikosindan.input_num.value=="4")
    document.jikosindan.name5.focus();
  else if(document.jikosindan.input_num.value=="5")
    document.jikosindan.name6.focus();
  else if(document.jikosindan.input_num.value=="6")
    document.jikosindan.name7.focus();
  else if(document.jikosindan.input_num.value=="7")
    document.jikosindan.name8.focus();
  else if(document.jikosindan.input_num.value=="8")
    document.jikosindan.name9.focus();
  else if(document.jikosindan.input_num.value=="9")
    document.jikosindan.name10.focus();
  else if(document.jikosindan.input_num.value=="10")
    document.jikosindan.name11.focus();
  else if(document.jikosindan.input_num.value=="11")
    document.jikosindan.name12.focus();
  else if(document.jikosindan.input_num.value=="12")
    document.jikosindan.name13.focus();
  else if(document.jikosindan.input_num.value=="13")
    document.jikosindan.name14.focus();
  else if(document.jikosindan.input_num.value=="14")
    document.jikosindan.name15.focus();
  else if(document.jikosindan.input_num.value=="15")
    document.jikosindan.name16.focus();
  else if(document.jikosindan.input_num.value=="16")
    document.jikosindan.name17.focus();
  else if(document.jikosindan.input_num.value=="17")
    document.jikosindan.name18.focus();
  else if(document.jikosindan.input_num.value=="18")
    document.jikosindan.name19.focus();
  else if(document.jikosindan.input_num.value=="19")
    document.jikosindan.name20.focus();
  else if(document.jikosindan.input_num.value=="20")
    document.jikosindan.name21.focus();
  else if(document.jikosindan.input_num.value=="21")
    document.jikosindan.name22.focus();
  else if(document.jikosindan.input_num.value=="22")
    document.jikosindan.name23.focus();
  else if(document.jikosindan.input_num.value=="23")
  {
    if(document.jikosindan.chk1.checked)
//     	document.jikosindan.submit2.focus();
     	document.all["submit2"].focus();
    else
      document.jikosindan.name24.focus();
  }
  else if(document.jikosindan.input_num.value=="24")
    document.jikosindan.name25.focus();
  else if(document.jikosindan.input_num.value=="25")
    document.jikosindan.name26.focus();
  else if(document.jikosindan.input_num.value=="26") {
        Input_err="-1";
//        document.jikosindan.submit2.focus();
     	  document.all["submit2"].focus();
  }
  return(false);
}

// ジャンプ入力ボックス
function goFocus(n) {

  if(n=="1")
    document.jikosindan.name1.focus();
  else if(n=="2")
    document.jikosindan.name2.focus();
  else if(n=="3")
    document.jikosindan.name3.focus();
  else if(n=="4")
    document.jikosindan.name4.focus();
  else if(n=="5")
    document.jikosindan.name5.focus();
  else if(n=="6")
    document.jikosindan.name6.focus();
  else if(n=="7")
    document.jikosindan.name7.focus();
  else if(n=="8")
    document.jikosindan.name8.focus();
  else if(n=="9")
    document.jikosindan.name9.focus();
  else if(n=="10")
    document.jikosindan.name10.focus();
  else if(n=="11")
    document.jikosindan.name11.focus();
  else if(n=="12")
    document.jikosindan.name12.focus();
  else if(n=="13")
    document.jikosindan.name13.focus();
  else if(n=="14")
    document.jikosindan.name14.focus();
  else if(n=="15")
    document.jikosindan.name15.focus();
  else if(n=="16")
    document.jikosindan.name16.focus();
  else if(n=="17")
    document.jikosindan.name17.focus();
  else if(n=="18")
    document.jikosindan.name18.focus();
  else if(n=="19")
    document.jikosindan.name19.focus();
  else if(n=="20")
    document.jikosindan.name20.focus();
  else if(n=="21")
    document.jikosindan.name21.focus();
  else if(n=="22")
    document.jikosindan.name22.focus();
  else if(n=="23")
    document.jikosindan.name23.focus();
  else if(n=="24")
    document.jikosindan.name24.focus();
  else if(n=="25")
    document.jikosindan.name25.focus();
  else if(n=="26")
    document.jikosindan.name26.focus();
}

// 入力情報クリア
function btn_reset( ){

	if (! window.confirm("入力された値をクリアします。よろしいですか？"))
	{
		return(false);
	}

	document.jikosindan.name1.value="0";
	document.jikosindan.name2.value="0";
	document.jikosindan.name3.value="0";
	document.jikosindan.name4.value="0";
	document.jikosindan.name5.value="0";
	document.jikosindan.name6.value="0";
	document.jikosindan.name7.value="0";
	document.jikosindan.name8.value="0";
	document.jikosindan.name9.value="0";
	document.jikosindan.name10.value="0";
	document.jikosindan.name11.value="0";
	document.jikosindan.name12.value="0";
	document.jikosindan.name13.value="0";
	document.jikosindan.name14.value="0";
	document.jikosindan.name15.value="0";
	document.jikosindan.name16.value="0";
	document.jikosindan.name17.value="0";
	document.jikosindan.name18.value="0";
	document.jikosindan.name19.value="0";
	document.jikosindan.name20.value="0";
	document.jikosindan.name21.value="0";
	document.jikosindan.name22.value="0";
	document.jikosindan.name23.value="0";

      if(document.jikosindan.chk1.checked==false){
	document.jikosindan.name24.value="";
	document.jikosindan.name25.value="";
	document.jikosindan.name26.value="";
	}
	document.jikosindan.MSG.value="";
}

// 項目大分類変更
function KindChange1(opt)
{

	var strkwk = document.jikosindan.OPT.value;
	var dcnt = document.jikosindan.DCNT.value;
	var kind = new Array(dcnt);
	var kind1 = document.jikosindan.kind1.value;
	var res = 0;
	var bfg = false;
	var kwk = "";
	var kwk2 = "";
	var twk = "";
	var max_idx = 0;
	var idx = 0;

	// 中分類を配列に設定
	for(i=0 ; i<dcnt ; i++){
		if(bfg == false){
			res = strkwk.indexOf(",", 0);
			if(res > 0){
				if(isMSIE == true)
					kind[i] = strkwk.substring(0, res-2);
				else
					kind[i] = strkwk.substring(0, res-1);
				strkwk = strkwk.substring(res+1);
			}else{
				kind[i] = strkwk;
				bfg = true;
			}
		}
	}

	// 同一大分類コードの中分類数を取得
	for(i=0 ; i<dcnt ; i++){
		kwk = kind[i].substring(0, 2);
		if(eval(kind1) == eval(kwk)){
			max_idx++;
		}
	}

	// 同一中分類コードをコンボボックスに設定
	document.jikosindan.kind2.options.length = max_idx;
	for(i=0 ; i<dcnt ; i++){
		kwk = kind[i].substring(0, 2);
		kwk2 = kind[i].substring(2, 6);
		twk = kind[i].substring(6);
		
		if(eval(kind1) == eval(kwk)){
			var num = new Number(kwk2);
			document.jikosindan.kind2.options[idx].text = twk;
			document.jikosindan.kind2.options[idx].value = String(num);
			idx++;
		}
	}
	
	if(document.jikosindan.kind2.options.length != 0) {
		document.jikosindan.kind2.options[0].selected = true;
    }

    if(opt==0) {
      document.jikosindan.INPUT_KIND2_NAME.value = document.jikosindan.kind2.options[0].value;
      document.jikosindan.input_kind2.value = document.jikosindan.kind2.options[0].value;
    }
}

// 項目中分類変更
function KindChange2()
{
document.jikosindan.input_kind2.value = document.jikosindan.kind2.options.value;

	var strkwk = document.jikosindan.OPT.value;
	var dcnt = document.jikosindan.DCNT.value;
	kind = new Array(dcnt);
	var kind1 = document.jikosindan.kind1.value;
	var kind2 = document.jikosindan.kind2.value;
	var res = 0;
	var bfg = false;
	var kwk = "";
	var kwk2 = "";
	var twk = "";

	// 中分類を配列に設定
	for(i=0 ; i<dcnt ; i++){
		if(bfg == false){
			res = strkwk.indexOf(",", 0);
			if(res > 0){
				if(isMSIE == true)
					kind[i] = strkwk.substring(0, res-2);
				else
					kind[i] = strkwk.substring(0, res-1);
				strkwk = strkwk.substring(res+1);
			}else{
				kind[i] = strkwk;
				bfg = true;
			}
		}
	}

	// 同一一中分類コード、中分類コードの名称取得
	for(i=0 ; i<dcnt ; i++){
		kwk = kind[i].substring(0, 2);
		kwk2 = kind[i].substring(2, 6);
		twk = kind[i].substring(6);
		var num = new Number(kwk2);
		if(eval(kind1) == eval(kwk) && eval(kind2) == String(num)){
			document.jikosindan.INPUT_KIND2_NAME.value = String(num);
		}
	}

}

// カンマセット
function SetC(n,t) {
  WkStr1 = new String(CutC(t));
  WkStr2 = new String("");

var msgText = "に数値以外の不正な入力があります。";
var chkData = escape(WkStr1);

  if (isNaN(WkStr1) ||( WkStr1.indexOf(".")!=-1) || (chkData!=WkStr1)) {
    if (n==1)
    {
      setErrColor(1);
      msgText = "流動資産合計" + msgText;
      Input_err="1";
    }
    else if (n==2)
    {
      setErrColor(2);
      msgText = "現金・預金" + msgText;
      Input_err="2";
    }
    else if (n==3)
    {
      setErrColor(3);
      msgText = "受取手形（割引分除く）" + msgText;
      Input_err="3";
    }
    else if (n==4)
    {
      setErrColor(4);
      msgText = "売掛金" + msgText;
      Input_err="4";
    }
    else if (n==5)
    {
      setErrColor(5);
      msgText = "棚卸資産" + msgText;
      Input_err="5";
    }
    else if (n==6)
    {
      setErrColor(6);
      msgText = "固定資産合計" + msgText;
      Input_err="6";
    }
    else if (n==7)
    {
      setErrColor(7);
      msgText = "有形固定資産合計" + msgText;
      Input_err="7";
    }
    else if (n==8)
    {
      setErrColor(8);
      msgText = "土地" + msgText;
      Input_err="8";
    }
    else if (n==9)
    {
      setErrColor(9);
      msgText = "資産合計" + msgText;
      Input_err="9";
    }
    else if (n==10)
    {
      setErrColor(10);
      msgText = "流動負債合計" + msgText;
      Input_err="10";
    }
    else if (n==11)
    {
      setErrColor(11);
      msgText = "短期借入金" + msgText;
      Input_err="11";
    }
    else if (n==12)
    {
      setErrColor(12);
      msgText = "長期借入金・社債" + msgText;
      Input_err="12";
    }
    else if (n==13)
    {
      setErrColor(13);
      msgText = "純資産合計" + msgText;
      Input_err="13";
    }
    else if (n==14)
    {
      setErrColor(14);
      msgText = "受取手形割引高" + msgText;
      Input_err="14";
    }
    else if (n==15)
    {
      setErrColor(15);
      msgText = "受取手形裏書譲渡高" + msgText;
      Input_err="15";
    }
    else if (n==16)
    {
      setErrColor(16);
      msgText = "期末従業員数" + msgText;
      Input_err="16";
    }
    else if (n==17)
    {
      setErrColor(17);
      msgText = "売上高" + msgText;
      Input_err="17";
    }
    else if (n==18)
    {
      setErrColor(18);
      msgText = "売上総利益" + msgText;
      Input_err="18";
    }
    else if (n==19)
    {
      setErrColor(19);
      msgText = "営業利益" + msgText;
      Input_err="19";
    }
    else if (n==20)
    {
      setErrColor(20);
      msgText = "受取利息配当金" + msgText;
      Input_err="20";
    }
    else if (n==21)
    {
      setErrColor(21);
      msgText = "支払利息割引料" + msgText;
      Input_err="21";
    }
    else if (n==22)
    {
      setErrColor(22);
      msgText = "経常利益" + msgText;
      Input_err="22";
    }
    else if (n==23)
    {
      setErrColor(23);
      msgText = "減価償却実施額" + msgText;
      Input_err="23";
    }
    else if (n==24)
    {
      setErrColor(24);
      msgText = "前期資産合計" + msgText;
      Input_err="24";
    }
    else if (n==25)
    {
      setErrColor(25);
      msgText = "前期純資産合計" + msgText;
      Input_err="25";
    }
    else if (n==26)
    {
      setErrColor(26);
      msgText = "前期売上高" + msgText;
      Input_err="26";
    }

    alert(msgText);
    Input_err=String(n);
    SetC_String = t;
    return t;
  }
  else {
    c = 0;
    for (i = WkStr1.length ; i > 0; i--) {
      c = c + 1;
      if(c > 3) 
      {
        WkStr2 = WkStr1.substr(i-1, 1) + "," + WkStr2;
        c = 1;
      }
      else
      {
        WkStr2 = WkStr1.substr(i-1, 1) + WkStr2;
      }
    }
    
    if (WkStr2.length > 1)
    {
      if ((WkStr2.substr(0, 2)=="-,") || (WkStr2.substr(0, 2)=="+,"))
      {
        WkStr2 = WkStr2.substr(0, 1) + WkStr2.substr(2);
      }
    }
 
    Input_err="0";
    SetC_String = WkStr2;
    return WkStr2;
  }
}

//エラー時の入力ボックスの色つけ
function setErrColor(n) {

  if (n==1) {
    document.jikosindan.name1.style.background='Pink';
    document.jikosindan.name1.style.color='';
  }
  else if (n==2) {
    document.jikosindan.name2.style.background='Pink';
    document.jikosindan.name2.style.color='';
  }
  else if (n==3) {
    document.jikosindan.name3.style.background='Pink';
    document.jikosindan.name3.style.color='';
  }
  else if (n==4) {
    document.jikosindan.name4.style.background='Pink';
    document.jikosindan.name4.style.color='';
  }
  else if (n==5) {
    document.jikosindan.name5.style.background='Pink';
    document.jikosindan.name5.style.color='';
  }
  else if (n==6) {
    document.jikosindan.name6.style.background='Pink';
    document.jikosindan.name6.style.color='';
  }
  else if (n==7) {
    document.jikosindan.name7.style.background='Pink';
    document.jikosindan.name7.style.color='';
  }
  else if (n==8) {
    document.jikosindan.name8.style.background='Pink';
    document.jikosindan.name8.style.color='';
  }
  else if (n==9) {
    document.jikosindan.name9.style.background='Pink';
    document.jikosindan.name9.style.color='';
  }
  else if (n==10) {
    document.jikosindan.name10.style.background='Pink';
    document.jikosindan.name10.style.color='';
  }
  else if (n==11) {
    document.jikosindan.name11.style.background='Pink';
    document.jikosindan.name11.style.color='';
  }
  else if (n==12) {
    document.jikosindan.name12.style.background='Pink';
    document.jikosindan.name12.style.color='';
  }
  else if (n==13) {
    document.jikosindan.name13.style.background='Pink';
    document.jikosindan.name13.style.color='';
  }
  else if (n==14) {
    document.jikosindan.name14.style.background='Pink';
    document.jikosindan.name14.style.color='';
  }
  else if (n==15) {
    document.jikosindan.name15.style.background='Pink';
    document.jikosindan.name15.style.color='';
  }
  else if (n==16) {
    document.jikosindan.name16.style.background='Pink';
    document.jikosindan.name16.style.color='';
  }
  else if (n==17) {
    document.jikosindan.name17.style.background='Pink';
    document.jikosindan.name17.style.color='';
  }
  else if (n==18) {
    document.jikosindan.name18.style.background='Pink';
    document.jikosindan.name18.style.color='';
  }
  else if (n==19) {
    document.jikosindan.name19.style.background='Pink';
    document.jikosindan.name19.style.color='';
  }
  else if (n==20) {
    document.jikosindan.name20.style.background='Pink';
    document.jikosindan.name20.style.color='';
  }
  else if (n==21) {
    document.jikosindan.name21.style.background='Pink';
    document.jikosindan.name21.style.color='';
  }
  else if (n==22) {
    document.jikosindan.name22.style.background='Pink';
    document.jikosindan.name22.style.color='';
  }
  else if (n==23) {
    document.jikosindan.name23.style.background='Pink';
    document.jikosindan.name23.style.color='';
  }
  else if (n==24) {
    document.jikosindan.name24.style.background='Pink';
    document.jikosindan.name24.style.color='';
  }
  else if (n==25) {
    document.jikosindan.name25.style.background='Pink';
    document.jikosindan.name25.style.color='';
  }
  else if (n==26) {
    document.jikosindan.name26.style.background='Pink';
    document.jikosindan.name26.style.color='';
  }
}

// カンマ削除
function CutC(t) {
  WkStr1 = new String(t);
  WkStr2 = new String("");
  WkStr3 = new String("");
  for (i = 0; i < WkStr1.length; i++) {
    if (!((WkStr1.substr(i, 1)==",") || (WkStr1.substr(i, 1)=="+") || (WkStr1.substr(i, 1)==" "))) {
        WkStr2 = WkStr2 + WkStr1.substr(i, 1);
    }
  }

  z = 1;
  for (i = 0; i < WkStr2.length; i++) {
    if (z == 0 ) {
        WkStr3 = WkStr3 + WkStr2.substr(i, 1);
    }
    else {
      if (WkStr2.substr(i, 1)=="-") {
        if( i==0 ) {
          WkStr3 = WkStr3 + WkStr2.substr(i, 1);
        }
        else {
          z = 0;
          WkStr3 = WkStr3 + WkStr2.substr(i, 1);
        }
      }
      else if (WkStr2.substr(i, 1)!="0") {
        z = 0;
        WkStr3 = WkStr3 + WkStr2.substr(i, 1);
      }
      else if (WkStr2.substr(i, 1)=="0") {
         if(i == WkStr2.length - 1) {
            WkStr3 = WkStr3 + WkStr2.substr(i, 1);
         }
      }
    }
  }

  if (WkStr3 == "-0") {
    WkStr3 = "0";
  }

  return WkStr3;
}

// 入力フォーカスイン
function input_guid_on(n){
	document.jikosindan.input_num.value=n;

	switch (n) {
	case 1:
	    if(document.jikosindan.COMMENT1.value!=null)
		    GuidText=document.jikosindan.COMMENT1.value;
		else
		    GuidText=" ";
	    document.jikosindan.name1.style.background='blue';
	    document.jikosindan.name1.style.color='Yellow';
	    document.jikosindan.name1.value = CutC(document.jikosindan.name1.value);
	    document.jikosindan.name1.select();
	    break;
	case 2:
	    if(document.jikosindan.COMMENT2.value!=null)
		    GuidText=document.jikosindan.COMMENT2.value;
		else
		    GuidText=" ";
	    document.jikosindan.name2.style.background='blue';
	    document.jikosindan.name2.style.color='Yellow';
	    document.jikosindan.name2.value = CutC(document.jikosindan.name2.value);
	    document.jikosindan.name2.select();
	    break;
	case 3:
	    if(document.jikosindan.COMMENT3.value!=null)
		    GuidText=document.jikosindan.COMMENT3.value;
		else
		    GuidText=" ";
	    document.jikosindan.name3.style.background='blue';
	    document.jikosindan.name3.style.color='Yellow';
	    document.jikosindan.name3.value = CutC(document.jikosindan.name3.value);
	    document.jikosindan.name3.select();
	    break;
	case 4:
	    if(document.jikosindan.COMMENT4.value!=null)
		    GuidText=document.jikosindan.COMMENT4.value;
		else
		    GuidText=" ";
	    document.jikosindan.name4.style.background='blue';
	    document.jikosindan.name4.style.color='Yellow';
	    document.jikosindan.name4.value = CutC(document.jikosindan.name4.value);
	    document.jikosindan.name4.select();
	    break;
	case 5:
	    if(document.jikosindan.COMMENT5.value!=null)
		    GuidText=document.jikosindan.COMMENT5.value;
		else
		    GuidText=" ";
	    document.jikosindan.name5.style.background='blue';
	    document.jikosindan.name5.style.color='Yellow';
	    document.jikosindan.name5.value = CutC(document.jikosindan.name5.value);
	    document.jikosindan.name5.select();
	    break;
	case 6:
	    if(document.jikosindan.COMMENT6.value!=null)
		    GuidText=document.jikosindan.COMMENT6.value;
		else
		    GuidText=" ";
	    document.jikosindan.name6.style.background='blue';
	    document.jikosindan.name6.style.color='Yellow';
	    document.jikosindan.name6.value = CutC(document.jikosindan.name6.value);
	    document.jikosindan.name6.select();
	    break;
	case 7:
	    if(document.jikosindan.COMMENT7.value!=null)
		    GuidText=document.jikosindan.COMMENT7.value;
		else
		    GuidText=" ";
	    document.jikosindan.name7.style.background='blue';
	    document.jikosindan.name7.style.color='Yellow';
	    document.jikosindan.name7.value = CutC(document.jikosindan.name7.value);
	    document.jikosindan.name7.select();
	    break;
	case 8:
	    if(document.jikosindan.COMMENT8.value!=null)
		    GuidText=document.jikosindan.COMMENT8.value;
		else
		    GuidText=" ";
	    document.jikosindan.name8.style.background='blue';
	    document.jikosindan.name8.style.color='Yellow';
	    document.jikosindan.name8.value = CutC(document.jikosindan.name8.value);
	    document.jikosindan.name8.select();
	    break;
	case 9:
	    if(document.jikosindan.COMMENT9.value!=null)
		    GuidText=document.jikosindan.COMMENT9.value;
		else
		    GuidText=" ";
	    document.jikosindan.name9.style.background='blue';
	    document.jikosindan.name9.style.color='Yellow';
	    document.jikosindan.name9.value = CutC(document.jikosindan.name9.value);
	    document.jikosindan.name9.select();
	    break;
	case 10:
	    if(document.jikosindan.COMMENT10.value!=null)
		    GuidText=document.jikosindan.COMMENT10.value;
		else
		    GuidText=" ";
	    document.jikosindan.name10.style.background='blue';
	    document.jikosindan.name10.style.color='Yellow';
	    document.jikosindan.name10.value = CutC(document.jikosindan.name10.value);
	    document.jikosindan.name10.select();
	    break;
	case 11:
	    if(document.jikosindan.COMMENT11.value!=null)
		    GuidText=document.jikosindan.COMMENT11.value;
		else
		    GuidText=" ";
	    document.jikosindan.name11.style.background='blue';
	    document.jikosindan.name11.style.color='Yellow';
	    document.jikosindan.name11.value = CutC(document.jikosindan.name11.value);
	    document.jikosindan.name11.select();
	    break;
	case 12:
	    if(document.jikosindan.COMMENT12.value!=null)
		    GuidText=document.jikosindan.COMMENT12.value;
		else
		    GuidText=" ";
	    document.jikosindan.name12.style.background='blue';
	    document.jikosindan.name12.style.color='Yellow';
	    document.jikosindan.name12.value = CutC(document.jikosindan.name12.value);
	    document.jikosindan.name12.select();
	    break;
	case 13:
	    if(document.jikosindan.COMMENT13.value!=null)
		    GuidText=document.jikosindan.COMMENT13.value;
		else
		    GuidText=" ";
	    document.jikosindan.name13.style.background='blue';
	    document.jikosindan.name13.style.color='Yellow';
	    document.jikosindan.name13.value = CutC(document.jikosindan.name13.value);
	    document.jikosindan.name13.select();
	    break;
	case 14:
	    if(document.jikosindan.COMMENT14.value!=null)
		    GuidText=document.jikosindan.COMMENT14.value;
		else
		    GuidText=" ";
	    document.jikosindan.name14.style.background='blue';
	    document.jikosindan.name14.style.color='Yellow';
	    document.jikosindan.name14.value = CutC(document.jikosindan.name14.value);
	    document.jikosindan.name14.select();
	    break;
	case 15:
	    if(document.jikosindan.COMMENT15.value!=null)
		    GuidText=document.jikosindan.COMMENT15.value;
		else
		    GuidText=" ";
	    document.jikosindan.name15.style.background='blue';
	    document.jikosindan.name15.style.color='Yellow';
	    document.jikosindan.name15.value = CutC(document.jikosindan.name15.value);
	    document.jikosindan.name15.select();
	    break;
	case 16:
	    if(document.jikosindan.COMMENT16.value!=null)
		    GuidText=document.jikosindan.COMMENT16.value;
		else
		    GuidText=" ";
	    document.jikosindan.name16.style.background='blue';
	    document.jikosindan.name16.style.color='Yellow';
	    document.jikosindan.name16.value = CutC(document.jikosindan.name16.value);
	    document.jikosindan.name16.select();
	    break;
	case 17:
	    if(document.jikosindan.COMMENT17.value!=null)
		    GuidText=document.jikosindan.COMMENT17.value;
		else
		    GuidText=" ";
	    document.jikosindan.name17.style.background='blue';
	    document.jikosindan.name17.style.color='Yellow';
	    document.jikosindan.name17.value = CutC(document.jikosindan.name17.value);
	    document.jikosindan.name17.select();
	    break;
	case 18:
	    if(document.jikosindan.COMMENT18.value!=null)
		    GuidText=document.jikosindan.COMMENT18.value;
		else
		    GuidText=" ";
	    document.jikosindan.name18.style.background='blue';
	    document.jikosindan.name18.style.color='Yellow';
	    document.jikosindan.name18.value = CutC(document.jikosindan.name18.value);
	    document.jikosindan.name18.select();
	    break;
	case 19:
	    if(document.jikosindan.COMMENT19.value!=null)
		    GuidText=document.jikosindan.COMMENT19.value;
		else
		    GuidText=" ";
	    document.jikosindan.name19.style.background='blue';
	    document.jikosindan.name19.style.color='Yellow';
	    document.jikosindan.name19.value = CutC(document.jikosindan.name19.value);
	    document.jikosindan.name19.select();
	    break;
	case 20:
	    if(document.jikosindan.COMMENT20.value!=null)
		    GuidText=document.jikosindan.COMMENT20.value;
		else
		    GuidText=" ";
	    document.jikosindan.name20.style.background='blue';
	    document.jikosindan.name20.style.color='Yellow';
	    document.jikosindan.name20.value = CutC(document.jikosindan.name20.value);
	    document.jikosindan.name20.select();
	    break;
	case 21:
	    if(document.jikosindan.COMMENT21.value!=null)
		    GuidText=document.jikosindan.COMMENT21.value;
		else
		    GuidText=" ";
	    document.jikosindan.name21.style.background='blue';
	    document.jikosindan.name21.style.color='Yellow';
	    document.jikosindan.name21.value = CutC(document.jikosindan.name21.value);
	    document.jikosindan.name21.select();
	    break;
	case 22:
	    if(document.jikosindan.COMMENT22.value!=null)
		    GuidText=document.jikosindan.COMMENT22.value;
		else
		    GuidText=" ";
	    document.jikosindan.name22.style.background='blue';
	    document.jikosindan.name22.style.color='Yellow';
	    document.jikosindan.name22.value = CutC(document.jikosindan.name22.value);
	    document.jikosindan.name22.select();
	    break;
	case 23:
	    if(document.jikosindan.COMMENT23.value!=null)
		    GuidText=document.jikosindan.COMMENT23.value;
		else
		    GuidText=" ";
	    document.jikosindan.name23.style.background='blue';
	    document.jikosindan.name23.style.color='Yellow';
	    document.jikosindan.name23.value = CutC(document.jikosindan.name23.value);
	    document.jikosindan.name23.select();
	    break;
	case 24:
	    if(document.jikosindan.COMMENT24.value!=null)
		    GuidText=document.jikosindan.COMMENT24.value;
		else
		    GuidText=" ";
	    document.jikosindan.name24.style.background='blue';
	    document.jikosindan.name24.style.color='Yellow';
	    document.jikosindan.name24.value = CutC(document.jikosindan.name24.value);
	    document.jikosindan.name24.select();
	    break;
	case 25:
	    if(document.jikosindan.COMMENT25.value!=null)
		    GuidText=document.jikosindan.COMMENT25.value;
		else
		    GuidText=" ";
	    document.jikosindan.name25.style.background='blue';
	    document.jikosindan.name25.style.color='Yellow';
	    document.jikosindan.name25.value = CutC(document.jikosindan.name25.value);
	    document.jikosindan.name25.select();
	    break;
	case 26:
	    if(document.jikosindan.COMMENT26.value!=null)
		    GuidText=document.jikosindan.COMMENT26.value;
		else
		    GuidText=" ";
	    document.jikosindan.name26.style.background='blue';
	    document.jikosindan.name26.style.color='Yellow';
	    document.jikosindan.name26.value = CutC(document.jikosindan.name26.value);
	    document.jikosindan.name26.select();
	    break;
	default:
	    GuidText="(>_<)"
	    break;
	}

    document.jikosindan.MSG.value=GuidText;
}

// 入力フォーカスアウト
function input_guid_off(n){
	switch (n) {
	case 1:
	    document.jikosindan.name1.style.background='White';
	    document.jikosindan.name1.style.color='';
        if(scope_inputcheck(n)==false) {break;}
        SetC(1,document.jikosindan.name1.value);
        document.jikosindan.name1.value = SetC_String;
	    break;
	case 2:
	    document.jikosindan.name2.style.background='White';
	    document.jikosindan.name2.style.color='';
        if(scope_inputcheck(n)==false) {break;}
        SetC(2,document.jikosindan.name2.value);
        document.jikosindan.name2.value = SetC_String;
	    break;
	case 3:
	    document.jikosindan.name3.style.background='White';
	    document.jikosindan.name3.style.color='';
        if(scope_inputcheck(n)==false) {break;}
	    SetC(3,document.jikosindan.name3.value);
	    document.jikosindan.name3.value = SetC_String;
	    break;
	case 4:
	    document.jikosindan.name4.style.background='White';
	    document.jikosindan.name4.style.color='';
        if(scope_inputcheck(n)==false) {break;}
	    SetC(4,document.jikosindan.name4.value);
	    document.jikosindan.name4.value = SetC_String;
	    break;
	case 5:
	    document.jikosindan.name5.style.background='White';
	    document.jikosindan.name5.style.color='';
        if(scope_inputcheck(n)==false) {break;}
	    SetC(5,document.jikosindan.name5.value);
	    document.jikosindan.name5.value = SetC_String;
	    break;
	case 6:
	    document.jikosindan.name6.style.background='White';
	    document.jikosindan.name6.style.color='';
        if(scope_inputcheck(n)==false) {break;}
	    SetC(6,document.jikosindan.name6.value);
	    document.jikosindan.name6.value = SetC_String;
	    break;
	case 7:
	    document.jikosindan.name7.style.background='White';
	    document.jikosindan.name7.style.color='';
        if(scope_inputcheck(n)==false) {break;}
	    SetC(7,document.jikosindan.name7.value);
	    document.jikosindan.name7.value = SetC_String;
	    break;
	case 8:
	    document.jikosindan.name8.style.background='White';
	    document.jikosindan.name8.style.color='';
        if(scope_inputcheck(n)==false) {break;}
	    SetC(8,document.jikosindan.name8.value);
	    document.jikosindan.name8.value = SetC_String;
	    break;
	case 9:
	    document.jikosindan.name9.style.background='White';
	    document.jikosindan.name9.style.color='';
        if(scope_inputcheck(n)==false) {break;}
	    SetC(9,document.jikosindan.name9.value);
	    document.jikosindan.name9.value = SetC_String;
	    break;
	case 10:
	    document.jikosindan.name10.style.background='White';
	    document.jikosindan.name10.style.color='';
        if(scope_inputcheck(n)==false) {break;}
	    SetC(10,document.jikosindan.name10.value);
	    document.jikosindan.name10.value = SetC_String;
	    break;
	case 11:
	    document.jikosindan.name11.style.background='White';
	    document.jikosindan.name11.style.color='';
        if(scope_inputcheck(n)==false) {break;}
	    SetC(11,document.jikosindan.name11.value);
	    document.jikosindan.name11.value = SetC_String;
	    break;
	case 12:
	    document.jikosindan.name12.style.background='White';
	    document.jikosindan.name12.style.color='';
        if(scope_inputcheck(n)==false) {break;}
	    SetC(12,document.jikosindan.name12.value);
	    document.jikosindan.name12.value = SetC_String;
	    break;
	case 13:
	    document.jikosindan.name13.style.background='White';
	    document.jikosindan.name13.style.color='';
        if(scope_inputcheck(n)==false) {break;}
	    SetC(13,document.jikosindan.name13.value);
	    document.jikosindan.name13.value = SetC_String;
	    break;
	case 14:
	    document.jikosindan.name14.style.background='White';
	    document.jikosindan.name14.style.color='';
        if(scope_inputcheck(n)==false) {break;}
	    SetC(14,document.jikosindan.name14.value);
	    document.jikosindan.name14.value = SetC_String;
	    break;
	case 15:
	    document.jikosindan.name15.style.background='White';
	    document.jikosindan.name15.style.color='';
        if(scope_inputcheck(n)==false) {break;}
	    SetC(15,document.jikosindan.name15.value);
	    document.jikosindan.name15.value = SetC_String;
	    break;
	case 16:
	    document.jikosindan.name16.style.background='White';
	    document.jikosindan.name16.style.color='';
        if(scope_inputcheck(n)==false) {break;}
	    SetC(16,document.jikosindan.name16.value);
	    document.jikosindan.name16.value = SetC_String;
	    break;
	case 17:
	    document.jikosindan.name17.style.background='White';
	    document.jikosindan.name17.style.color='';
        if(scope_inputcheck(n)==false) {break;}
	    SetC(17,document.jikosindan.name17.value);
	    document.jikosindan.name17.value = SetC_String;
	    break;
	case 18:
	    document.jikosindan.name18.style.background='White';
	    document.jikosindan.name18.style.color='';
        if(scope_inputcheck(n)==false) {break;}
	    SetC(18,document.jikosindan.name18.value);
	    document.jikosindan.name18.value = SetC_String;
	    break;
	case 19:
	    document.jikosindan.name19.style.background='White';
	    document.jikosindan.name19.style.color='';
        if(scope_inputcheck(n)==false) {break;}
	    SetC(19,document.jikosindan.name19.value);
	    document.jikosindan.name19.value = SetC_String;
	    break;
	case 20:
	    document.jikosindan.name20.style.background='White';
	    document.jikosindan.name20.style.color='';
        if(scope_inputcheck(n)==false) {break;}
	    SetC(20,document.jikosindan.name20.value);
	    document.jikosindan.name20.value = SetC_String;
	    break;
	case 21:
	    document.jikosindan.name21.style.background='White';
	    document.jikosindan.name21.style.color='';
        if(scope_inputcheck(n)==false) {break;}
	    SetC(21,document.jikosindan.name21.value);
	    document.jikosindan.name21.value = SetC_String;
	    break;
	case 22:
	    document.jikosindan.name22.style.background='White';
	    document.jikosindan.name22.style.color='';
        if(scope_inputcheck(n)==false) {break;}
	    SetC(22,document.jikosindan.name22.value);
	    document.jikosindan.name22.value = SetC_String;
	    break;
	case 23:
	    document.jikosindan.name23.style.background='White';
	    document.jikosindan.name23.style.color='';
        if(scope_inputcheck(n)==false) {break;}
	    SetC(23,document.jikosindan.name23.value);
	    document.jikosindan.name23.value = SetC_String;
	    break;
	case 24:
	    document.jikosindan.name24.style.background='White';
	    document.jikosindan.name24.style.color='';
        if(scope_inputcheck(n)==false) {break;}
	    SetC(24,document.jikosindan.name24.value);
	    document.jikosindan.name24.value = SetC_String;
	    break;
	case 25:
	    document.jikosindan.name25.style.background='White';
	    document.jikosindan.name25.style.color='';
        if(scope_inputcheck(n)==false) {break;}
	    SetC(25,document.jikosindan.name25.value);
	    document.jikosindan.name25.value = SetC_String;
	    break;
	case 26:
	    document.jikosindan.name26.style.background='White';
	    document.jikosindan.name26.style.color='';
        if(scope_inputcheck(n)==false) {break;}
	    SetC(26,document.jikosindan.name26.value);
	    document.jikosindan.name26.value = SetC_String;
	    break;
	default:
	    GuidText="(>_<)"
	    break;
	}
    
    if(Input_err!="0") {
      Jto = Input_err;
      id = setTimeout("goFocus(Jto)", 100);
      return(false);
    }
    else {
	  document.jikosindan.input_num.value="";
      return(true);
    }
}

// 前期決算書入力有無チェックボックス背景色制御
function input_Chk1(ctl){
    if(isMSIE == true) {
      if(ctl == "on")
	    document.jikosindan.chk1.style.background='#0000FF';
      else
	    document.jikosindan.chk1.style.background='#FFFFFF';
    }
}

// 前期決算書入力項目制御
function DisInput() {
	if(document.jikosindan.chk1.checked)
	{
		document.jikosindan.name24.value="";
		document.jikosindan.name24.style.background='Gray';
		document.jikosindan.name24.disabled=true;
		document.jikosindan.name25.value="";
		document.jikosindan.name25.style.background='Gray';
		document.jikosindan.name25.disabled=true;
		document.jikosindan.name26.value="";
		document.jikosindan.name26.style.background='Gray';
		document.jikosindan.name26.disabled=true;
	}
	else
	{
		document.jikosindan.name24.disabled=false;
		document.jikosindan.name24.style.background='White';
		document.jikosindan.name25.disabled=false;
		document.jikosindan.name25.style.background='White';
		document.jikosindan.name26.disabled=false;
		document.jikosindan.name26.style.background='White';
	}
}

// ############ Integrated ###############
// 表示初期処理
function Integrated_init() {
    if(document.debug.test.value == "2") {
      the_cookie = myGetCookie("CRD_TEST_LOG");
/*
	  if (the_cookie!=document.debug.log_name.value) {
	    newWin = window.open("../data/tmp/" + document.debug.log_name.value,"DEBUG","width=800,height=650 scrollbars=yes resizable=yes");
        mySetCookie("CRD_TEST_LOG",document.debug.log_name.value,1);
	    newWin.focus();
	  }
*/
	}
}

// ############ Explanation ###############

// 解説文表示
function Explan(n)
{
	switch (n) {
	case 1:
	    ExplanationText=document.jikosindan.EXPLAN1.value;
	    break;
	case 2:
	    ExplanationText=document.jikosindan.EXPLAN2.value;
	    break;
	case 3:
	    ExplanationText=document.jikosindan.EXPLAN3.value;
	    break;
	case 4:
	    ExplanationText=document.jikosindan.EXPLAN4.value;
	    break;
	case 5:
	    ExplanationText=document.jikosindan.EXPLAN5.value;
	    break;
	case 6:
	    ExplanationText=document.jikosindan.EXPLAN6.value;
	    break;
	case 7:
	    ExplanationText=document.jikosindan.EXPLAN7.value;
	    break;
	case 8:
	    ExplanationText=document.jikosindan.EXPLAN8.value;
	    break;
	case 9:
	    ExplanationText=document.jikosindan.EXPLAN9.value;
	    break;
	case 10:
	    ExplanationText=document.jikosindan.EXPLAN10.value;
	    break;
	case 11:
	    ExplanationText=document.jikosindan.EXPLAN11.value;
	    break;
	case 12:
	    ExplanationText=document.jikosindan.EXPLAN12.value;
	    break;
	case 13:
	    ExplanationText=document.jikosindan.EXPLAN13.value;
	    break;
	case 14:
	    ExplanationText=document.jikosindan.EXPLAN14.value;
	    break;
	case 15:
	    ExplanationText=document.jikosindan.EXPLAN15.value;
	    break;
	case 16:
	    ExplanationText=document.jikosindan.EXPLAN16.value;
	    break;
	case 17:
	    ExplanationText=document.jikosindan.EXPLAN17.value;
	    break;
	case 18:
	    ExplanationText=document.jikosindan.EXPLAN18.value;
	    break;
	case 19:
	    ExplanationText=document.jikosindan.EXPLAN19.value;
	    break;
	case 20:
	    ExplanationText=document.jikosindan.EXPLAN20.value;
	    break;
	case 21:
	    ExplanationText=document.jikosindan.EXPLAN21.value;
	    break;
	case 22:
	    ExplanationText=document.jikosindan.EXPLAN22.value;
	    break;
	case 23:
	    ExplanationText=document.jikosindan.EXPLAN23.value;
	    break;
	case 24:
	    ExplanationText=document.jikosindan.EXPLAN24.value;
	    break;
	case 25:
	    ExplanationText=document.jikosindan.EXPLAN25.value;
	    break;
	case 26:
	    ExplanationText=document.jikosindan.EXPLAN26.value;
	    break;
	case 27:
	    ExplanationText=document.jikosindan.EXPLAN27.value;
	    break;
	default:
	    ExplanationText="(>_<)"
	    break;
	}

	document.jikosindan.MSG.value = ExplanationText;
}

//半角を全角に全角を半角にする。
function change12(str){
	var wk="";
	var ch=0;

var han=new Array("1","2","3","4","5","6","7","8","9","0","-","^","\\","q","w","e","r","t","y","u","i","o","p","@","[","a","s","d","f","g","h","j","k","l",";",":","]","z","x","c","v","b","n","m",",",".","/","\\","!","\"","#","$","%","&","'","(",")","=","~","|","Q","W","E","R","T","Y","U","I","O","P","`","{","A","S","D","F","G","H","J","K","L","+","*","}","Z","X","C","V","B","N","M","<",">","?","_","ガ","ギ","グ","ゲ","ゴ","ダ","ヂ","ヅ","デ","ド","バ","ビ","ブ","ベ","ボ","パ","ピ","プ","ペ","ポ","ウ゛","ア","イ","ウ","エ","オ","カ","キ","ク","ケ","コ","サ","シ","ス","セ","ソ","タ","チ","ツ","テ","ト","ナ","ニ","ヌ","ネ","ノ","ハ","ヒ","フ","ヘ","ホ","マ","ミ","ム","メ","モ","ヤ","ユ","ヨ","ラ","リ","ル","レ","ロ","ワ","ヲ","ン","ァ","ィ","ゥ","ェ","ォ","ッ","ャ","ョ","。","、","・"," ");
var zen=new Array("１","２","３","４","５","６","７","８","９","０","－","＾","￥","ｑ","ｗ","ｅ","ｒ","ｔ","ｙ","ｕ","ｉ","ｏ","ｐ","＠","［","ａ","ｓ","ｄ","ｆ","ｇ","ｈ","ｊ","ｋ","ｌ","；","：","］","ｚ","ｘ","ｃ","ｖ","ｂ","ｎ","ｍ","，","．","／","￥","！","”","＃","＄","％","＆","’","（","）","＝","～","｜","Ｑ","Ｗ","Ｅ","Ｒ","Ｔ","Ｙ","Ｕ","Ｉ","Ｏ","Ｐ","‘","｛","Ａ","Ｓ","Ｄ","Ｆ","Ｇ","Ｈ","Ｊ","Ｋ","Ｌ","＋","＊","｝","Ｚ","Ｘ","Ｃ","Ｖ","Ｂ","Ｎ","Ｍ","＜","＞","？","＿","ガ","ギ","グ","ゲ","ゴ","ダ","ヂ","ヅ","デ","ド","バ","ビ","ブ","ベ","ボ","パ","ピ","プ","ペ","ポ","ヴ","ア","イ","ウ","エ","オ","カ","キ","ク","ケ","コ","サ","シ","ス","セ","ソ","タ","チ","ツ","テ","ト","ナ","ニ","ヌ","ネ","ノ","ハ","ヒ","フ","ヘ","ホ","マ","ミ","ム","メ","モ","ヤ","ユ","ヨ","ラ","リ","ル","レ","ロ","ワ","ヲ","ン","ァ","ィ","ゥ","ェ","ォ","ッ","ャ","ョ","。","、","・","　");

//alert(str);

	for (i=0;i<str.length;i++){
		for(j in han){
			ch=1;
			//全角へ
			//濁音対策
			if (str.substr(i,2)==han[j]){
				wk+=String(zen[j]);
				ch=0;
				break;
			}
			if (str.substr(i,1)==han[j]){
				wk+=String(zen[j]);
				ch=0;
				break;
			}
		}
		//ないものはそのまま渡す。
		if ((ch==1) && (str.substr(i,1)!="゛" && str.substr(i,1)!="゜")) {
			wk+=String(str.substr(i,1));
		}
	}

	document.sousin.textdata.value = wk;
}

function btn_open(){
	document.sousin.button1.disabled=false;
}

function btn_ques(formName,procNum){
	var wk1="";
	var wk2="";
	var wk3="";
	var wk4="";
	var i=0;

	for(i=0; i<document.sousin.ques1.length; i++)
	{
		if( document.sousin.ques1[i].checked == true)
		{
			wk1=document.sousin.ques1[i].value;
		}
	}

	for(i=0; i<document.sousin.ques2.length; i++)
	{
		if( document.sousin.ques2[i].checked == true)
		{
			wk2=document.sousin.ques2[i].value;
		}
	}

	for(i=0; i<document.sousin.ques3.length; i++)
	{
		if( document.sousin.ques3[i].checked == true)
		{
			wk3=document.sousin.ques3[i].value;
		}
	}

	for(i=0; i<document.sousin.ques4.length; i++)
	{
		if( document.sousin.ques4[i].checked == true)
		{
			wk4=document.sousin.ques4[i].value;
		}
	}

//	if( wk1=="" && wk2=="" && wk3=="" && wk4=="" )
//	{
//		return;
//	}


	wk1=document.sousin.textdata.value;

	change12(wk1);

	wk1=document.sousin.textdata.value;
	if( 300 < wk1.length )
	{
		alert("300字以内で入力して下さい。");
		return;
	}

	ExecSubmit(formName,procNum);
}

function key_in(){
	var wk1="";
	wk1=document.sousin.textdata.value;
//alert(wk1.length);
	if( 299 < wk1.length )
	{
//		alert("300字以内で入力して下さい。");
//		return false;
		return;
	}
}

function test_wname(){
	var wk1="";
	wk1=window.name;
//alert(wk1);
	if( wk1!="quesform" )
	{
alert("直接起動はできません。");
		document.sousin.button1.disabled=true;
		for(i=0; i<document.sousin.ques1.length; i++)
		{
			document.sousin.ques1[i].disabled=true;
		}
		for(i=0; i<document.sousin.ques2.length; i++)
		{
			document.sousin.ques2[i].disabled=true;
		}
		for(i=0; i<document.sousin.ques3.length; i++)
		{
			document.sousin.ques3[i].disabled=true;
		}
		for(i=0; i<document.sousin.ques4.length; i++)
		{
			document.sousin.ques4[i].disabled=true;
		}

//		window.close();
	}
}

function chk_wname(){
	var wk1="";
	wk1=window.name;
//alert(wk1);
	if( wk1=="quesform" )
	{
//alert("マスク解除！");
		document.sousin.button1.disabled=true;
		for(i=0; i<document.sousin.ques1.length; i++)
		{
			document.sousin.ques1[i].disabled=false;
		}
		for(i=0; i<document.sousin.ques2.length; i++)
		{
			document.sousin.ques2[i].disabled=false;
		}
		for(i=0; i<document.sousin.ques3.length; i++)
		{
			document.sousin.ques3[i].disabled=false;
		}
		for(i=0; i<document.sousin.ques4.length; i++)
		{
			document.sousin.ques4[i].disabled=false;
		}
		for(i=0; i<document.sousin.ques5.length; i++)
		{
			document.sousin.ques5[i].disabled=false;
		}
		document.sousin.textdata.disabled=false;
		document.sousin.button1.disabled=false;

//		window.close();
	}
}

