<!-- #include file="../../../include.asp" -->

<%
'<!--
'################################################
'	名称	:振替伝票表示
'	作成日:2002/7/18
'	作成者:山崎
'	目的 :振替伝票画面を表示する。
'	概要	:
'	 <<表示>>
'	・初期は"追加モード":伝票番号はNULL
'	・伝票番号が指定してある場合は"修正モード"
'	<<入力チェック>>
'	・NULLチェック
'	・勘定科目のマスタチェック
'	修正変更:(080317小野)製造部振替伝票モードを新設
'################################################
'-->
'
%>

<%
main()
Sub main()
	If Not(SessionCheck()) Then
		Exit Sub
	End If

	Dim LabelSoumu
	Dim LabelTanto
	Dim LabelKakari
	LabelSoumu = ""
	LabelTanto = ""
	LabelKakari = "係 印"
	If MHMINRANLEFT <> "" Then LabelSoumu = MHMINRANLEFT End If
	If MHMINRANCENTER <> "" Then LabelTanto = MHMINRANCENTER End If
	If MHMINRANRIGHT <> "" Then LabelKakari = MHMINRANRIGHT End If

	Dim DenpyoNo, Torihikibi, DenpyoTekiyo	 '伝票番号、取引日、伝票摘要
	Dim KanjyoCD(10)							 '勘定科目コード
	Dim Kanjyomei(10)						 '勘定科目名称
	Dim Kingaku(10)							 '金額
	Dim Tekiyo(10)							 '摘要
	Dim TekiyoCD(10)						 '取引先CD
	Dim KarikataGokei, KashikataGokei		 '借方合計、貸方合計
	Dim OldDenpyoNo


	Dim Query
	Dim Content
	Dim GakuseiShimei
	Dim GakuseiBango
	Dim DenpyoSyoriKubun

	Dim ShowDel
	ShowDel = Request("ShowDel")

	Dim Mode
	Mode = Request("Mode")
	Dim Title
	Dim TmpGyosyu
	If Mode = "Seizo" Then
		Title = "製造部"
		TmpGyosyu = "G"
	Else
		Title = ""
		TmpGyosyu = ConvKaisyaGyosyuKubun(KaisyaCD)
	End If

	DenpyoNo = Request("DenpyoNo")
	KashikataGokei = 0
	KarikataGokei = 0


	If Session(HomeAlias & "EnshuKubun") = "P" AND GB_JisyaFlag = "0" Then
	Else
		GakuseiBango =  GB_GakuseiNo
	End If


	Dim TmpCnt
	Dim ErrorFlg
	ErrorFlg = Request("ErrorFlg")

	'追加モードでリジェクトされた場合はクエリを取得(090528小野)
	If ErrorFlg <> "" Then

		DenpyoNo = Request("DenpyoNo")
		Torihikibi = Request("Torihikibi")
		DenpyoTekiyo = Request("DenpyoTekiyo")
		For TmpCnt = 1 To 10
			KanjyoCD(TmpCnt) = Request("KanjyoCD" & CStr(TmpCnt))
			Kanjyomei(TmpCnt) = ConvKanjyoMeisyoDx(GB_SystemCD, GB_EnshuCD, KanjyoCD(TmpCnt))
			Kingaku(TmpCnt) = Request("Kingaku" & CStr(TmpCnt))
			TekiyoCD(TmpCnt) = Request("TekiyoCD" & CStr(TmpCnt))
			Tekiyo(TmpCnt) = Request("Tekiyo" & CStr(TmpCnt))
			If Kingaku(TmpCnt) <> "" Then
				If TmpCnt Mod 2 = 0 Then
					KashikataGokei = KashikataGokei + CLng(Kingaku(TmpCnt))
				Else
					KarikataGokei = KarikataGokei + CLng(Kingaku(TmpCnt))
				End If
			End If
		Next

	'修正モード
	ElseIf DenpyoNo <> "" Then

		OldDenpyoNo = DenpyoNo	'この場合のみOldDenpyoNoを持たせる(090528小野)

		Query = "exec SPK伝票_振替伝票取得 '" & GB_SystemCD & "','" & EnshuCD & "', '" & KaisyaCD & "', '" & DenpyoNo & "', '" & TmpGyosyu & "'"
		Set Content = OpenQuery(Query)

		If Not(Content.BOF Or Content.EOF) Then

			Torihikibi = SetTimeYYYYMMDD(Content.Fields("取引日"))
			DenpyoTekiyo = Content.Fields("伝票摘要")
			GakuseiShimei = Content.Fields("氏名")
			GakuseiBango = Content.Fields("学生番号")
			DenpyoSyoriKubun = Content.Fields("伝票処理区分")

			Do While Not(Content.BOF Or Content.EOF)
				Dim DenpyoSEQ
				DenpyoSEQ = Content.Fields("伝票SEQ")

				KanjyoCD(DenpyoSEQ) = Content.Fields("勘定CD")
				Kanjyomei(DenpyoSEQ) = ConvKanjyoMeisyoDx(GB_SystemCD, GB_EnshuCD, Content.Fields("勘定CD"))
				If DenpyoSEQ mod 2 = 0 Then
					Kingaku(DenpyoSEQ) = Content.Fields("貸方金額")
					KashikataGokei = KashikataGokei + Content.Fields("貸方金額")
				Else
					Kingaku(DenpyoSEQ) = Content.Fields("借方金額")
					KarikataGokei = KarikataGokei + Content.Fields("借方金額")
				End If
				TekiyoCD(DenpyoSEQ) = Content.Fields("摘要CD")
				Tekiyo(DenpyoSEQ) = Content.Fields("摘要")

				Content.MoveNext
			Loop
		End If
	End If



	Dim TekiyoCDs
	Query = "exec SPM摘要表示一覧 '" & GB_SystemCD & "','" & EnshuCD & "', '" & KaisyaCD & "'"

	Set Content = OpenQuery(Query)

	Do While Not(Content.BOF Or Content.EOF)
		If TekiyoCDs <> "" Then
			TekiyoCDs = TekiyoCDs & ","
		End If
		TekiyoCDs = TekiyoCDs & Content.Fields("摘要CD")

		Content.MoveNext
	Loop

'	Dim JidoBangoDenpyo
'	JidoBangoDenpyo = GetEnshuParam(EnshuCD, "自動番号伝票")

	'自動番号伝票・実践日・振替伝票表示行数フラグ取得
	Dim JidoBangoDenpyo
	Dim Jissenbi
	Dim Gyousu
	Jissenbi = ""
	Query = "exec SPM演習取得 '" & GB_SystemCD & "','" & EnshuCD & "'"
	Set Content = OpenQuery(Query)
	If Not(Content.BOF Or Content.EOF) Then
		JidoBangoDenpyo = "" & Content.Fields("自動番号伝票")
		Jissenbi = "" & SetTimeYYYYMMDD(Content.Fields("実践日"))
		Gyousu = Content.Fields("振替伝票表示行数")
	End If

	Dim SenColor
	SenColor = "#5522FF"

	Dim KouriRiyo
	KouriRiyo = KourihanbaiRiyo()

	If Gyousu = 0 Or "" & Gyousu = "" Then
		Gyousu = 5
	End If

'Gyousu = 2

	Dim GyouHeight
	Dim GyouHeight2
	Dim GyouHeight3
	Dim GyouHaichi
	If Gyousu = 1 Then
		GyouHeight = 300
		GyouHeight2 = 100
		GyouHeight3 = 200
		GyouHaichi = "middle"
		GyouHeight = 150
		GyouHeight2 = 50
		GyouHeight3 = 100
		GyouHaichi = "bottom"
	ElseIf Gyousu = 2 Then
		GyouHeight = 150
		GyouHeight2 = 50
		GyouHeight3 = 100
		GyouHaichi = "bottom"
	ElseIf Gyousu = 3 Then
		GyouHeight = 100
		GyouHeight2 = 40
		GyouHeight3 = 60
		GyouHaichi = "bottom"
	ElseIf Gyousu = 4 Then
		GyouHeight = 75
		GyouHeight2 = 30
		GyouHeight3 = 45
		GyouHaichi = "bottom"
	Else
		GyouHeight = 60
		GyouHeight2 = 26
		GyouHeight3 = 34
		GyouHaichi = "bottom"
	End If


	'摘要配列作成
	Dim TekiyoCDA
	Dim TekiyoNameA
	Dim TekiyoShijoA
	ReDim TekiyoCDA(0)
	ReDim TekiyoNameA(0)
	ReDim TekiyoShijoA(0)
	Query = "exec SPM摘要表示一覧 '" & GB_SystemCD & "','" & EnshuCD & "', '" & KaisyaCD & "'"
	Set Content = OpenQuery(Query)
'Response.Write(Query)
'Exit Sub
	Do While Not(Content.BOF Or Content.EOF)
		If Not(Content.Fields("摘要区分") = "K" AND Content.Fields("摘要CD") = KaisyaCD) Then
			ReDim PreServe TekiyoCDA(UBound(TekiyoCDA) + 1)	'配列数+1
			ReDim PreServe TekiyoNameA(UBound(TekiyoCDA))
			ReDim PreServe TekiyoShijoA(UBound(TekiyoCDA))
			TekiyoCDA(UBound(TekiyoCDA)) = "" & Content.Fields("摘要CD")
			TekiyoNameA(UBound(TekiyoCDA)) = "" & Content.Fields("摘要")
			TekiyoShijoA(UBound(TekiyoCDA)) = "" & Content.Fields("市場CD")
		End If
		Content.MoveNext
	Loop
	If KouriRiyo > 0 Then
		ReDim PreServe TekiyoCDA(UBound(TekiyoCDA) + 1)	'配列数+1
		ReDim PreServe TekiyoNameA(UBound(TekiyoCDA))
		ReDim PreServe TekiyoShijoA(UBound(TekiyoCDA))
		TekiyoCDA(UBound(TekiyoCDA)) = "SJ4KOURIHANBAI"
		TekiyoNameA(UBound(TekiyoCDA)) = "" & ConvKaisyaMeisyo("SJ4KOURIHANBAI")
		TekiyoShijoA(UBound(TekiyoCDA)) = ""
	End If

	Dim ii

%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=shift_jis">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Expires" content="-1">
<link href="../../../binx/sj3web.css?<% = TimeUniq() %>" rel="stylesheet" type="text/css">
<title><% = AppTitle %></title>
<script language="JScript" src="../../../include.js?<% = TimeUniq() %>"></script>
<script language="JScript" src="../../../includesj.js?<% = TimeUniq() %>"></script>
<script language="JScript.Encode" src="../../../include_enc.js?<% = TimeUniq() %>"></script>
<script language="JScript.Encode" src="../../../includesj_enc.js?<% = TimeUniq() %>"></script>
<script type=""text/javascript"" src="../../../javascript.js?<% = TimeUniq() %>"></script>
</head>
<SCRIPT LANGUAGE="JavaScript">
<!--
	HomeAlias = "<% = HomeAlias %>";
	HomeAliasSL = "<% = HomeAliasSL %>";
	ExitFlg = 2;
-->
</SCRIPT>

<body onkeydown="if(ExitFlg==2)ExitFlg=3;" onBeforeUnload="window.event.returnValue = ExitMsg(ExitFlg)" bgcolor="#5C70B6" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<form OnKeyDown="FormKeyDown(this)"	name="form1" method="POST" action="fk_furikae_bin.asp" autocomplete="off">
<input type="hidden" name="OldDenpyoNo" value="<% = OldDenpyoNo %>">
<input type="hidden" name="Mode" value="<% = Mode %>">
<input type="hidden" name="ShowDel" value="<% = ShowDel %>">
<%
	Response.Write(HtmlDesign(1))

	Response.Write(HttpL1(2))

	If Mode = "Seizo" Then
		Response.Write(HttpL2("会社選択" ,"tblbtn( '/" & HomeAlias & "/user/bk/')", GB_GyosyuMeisyo, "tblbtn( '/" & HomeAlias & "/user/bk/menu_" & GB_Gyosyu & ".asp')", "製造部", "tblbtn( '/" & HomeAlias & "/user/bk/menu_s6.asp')", Title & "振替伝票", "tblbtn( '/" & HomeAlias & "/user/bk/denpyo/fk_furikae.asp?DenpyoNo=" & DenpyoNo & "&Mode=" & Mode & "&ShowDel=" & ShowDel & "')", "", "", "", ""))
	ElseIf PackageMode = 1 Then
		Response.Write(HttpL2("メインメニュー" ,"tblbtn('/" & HomeAlias & "/user/bk/menu_cyac.asp')", "伝票", "tblbtn( '/" & HomeAlias & "/user/bk/menu_s11.asp')", Title & "振替伝票", "", "", "", "", "", "", ""))
	ElseIf GB_Gyosyu <> "B" Then
		Response.Write(HttpL2("会社選択" ,"tblbtn( '/" & HomeAlias & "/user/bk/')", GB_GyosyuMeisyo, "tblbtn( '/" & HomeAlias & "/user/bk/menu_" & GB_Gyosyu & ".asp')", "経理部", "tblbtn( '/" & HomeAlias & "/user/bk/menu_s1.asp')", "伝票", "tblbtn( '/" & HomeAlias & "/user/bk/menu_s11.asp')", "振替伝票", "tblbtn( '/" & HomeAlias & "/user/bk/denpyo/fk_furikae.asp?DenpyoNo=" & DenpyoNo & "&ShowDel=" & ShowDel & "')", "", ""))
	Else
		Response.Write(HttpL2("会社選択" ,"tblbtn( '/" & HomeAlias & "/user/bk/')", GB_GyosyuMeisyo, "tblbtn( '/" & HomeAlias & "/user/bk/menu_" & GB_Gyosyu & ".asp')", "経理業務", "tblbtn( '/" & HomeAlias & "/user/bk/menu_" & GB_Gyosyu & "1.asp')", "伝票", "tblbtn( '/" & HomeAlias & "/user/bk/menu_s11.asp')", "振替伝票", "tblbtn( '/" & HomeAlias & "/user/bk/denpyo/fk_furikae.asp?DenpyoNo=" & DenpyoNo & "&ShowDel=" & ShowDel & "')", "", ""))
	End If

	Response.Write(HttpL3("データを入力し保存ボタンを押して下さい", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""))

	Response.Write(HttpL3_1("保存", "SubmitCheck()", "", "", "", "", "", "", "", ""))

	If OldDenpyoNo <> "" Then
		Response.Write(HttpL3_2("追加", "tblbtn( 'fk_furikae.asp?Mode=" & Mode & "&ShowDel=" & ShowDel & "')", "一覧表示", "tblbtn( 'fk_furikae_ichiran.asp?DenpyoNo=" & DenpyoNo & "&Mode=" & Mode & "&ShowDel=" & ShowDel & "')", "", "", "", "", "", ""))
	Else
		Response.Write(HttpL3_2("一覧表示", "tblbtn( 'fk_furikae_ichiran.asp?DenpyoNo=" & DenpyoNo & "&Mode=" & Mode & "&ShowDel=" & ShowDel & "')", "", "", "", "", "", "", "", ""))
	End If

	If OldDenpyoNo <> "" Then
		Response.Write(HttpL4(Title & "振替伝票", "修正"))
	Else
		Response.Write(HttpL4(Title & "振替伝票", "追加"))
	End If

	Response.Write(HttpL5(ErrorFlg))

%>


<div id="L0" style="position: absolute; visibility: hidden; left: 0px; top: -2000px;">
	<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td align="center">
				<table width="540" height="400" border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td height="350">
							<table width="650" height="<% If Gyousu > 1 Then %>480<% Else %>320<% End If %>" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border:solid 1px #111111">
								<tr>
									<td height="60">
										<table width="625" height="70" border="0" cellpadding="0" cellspacing="0">
											<tr>
												<td width="495" align="right" valign="bottom">
												<table border="0" cellpadding="0" cellspacing="0" width="100%">
													<tr>
<% 'Mode = "Seizo" %>
														<td class="tx1618" style="color:<% = SenColor %>" width="15"></td>
														<td class="tx2022" style="color:<% = SenColor %>" height="35"><% If Mode = "Seizo" Then %>製造部振替伝票<% Else %>振 替 伝 票<% End If %></td>
														<td valign="bottom">
															<table width="325" border="0" cellpadding="0" cellspacing="0">
																<tr class="tx1416">
																	<td width="80" height="20" align="right" style="color:<% = SenColor %>">伝票番号:</td>
																	<td height="20" style="color:<% = SenColor %>">
<% If JidoBangoDenpyo = "1" Or (DenpyoNo <> "" And ErrorFlg = "") Then %>
																		<input type="text" name="DenpyoNo" size="20" readonly class="tbox4_ro" value="<% = DenpyoNo %>" tabindex="-1">
<% Else %>
																		<input type="text" name="DenpyoNo" size="20" onkeyup="FormStrLeft(this,12,false,false);" onKeypress="FormStrLeft(this,12,false,false);" onBlur="FormStrTrim(this,true);" class="tbox4" value="<% = DenpyoNo %>"><!-- 半角シャープを拒否 -->
<% End If %>
																	</td>
																</tr>
															</table>
														</td>
													</tr>
													<tr>
														<td width="15">
														</td>
														<td>
													<table width="150" border="0" cellpadding="0" cellspacing="0">
														<tr class="tx1416">
															<td width="60" height="20" align="right" style="color:<% = SenColor %>">取引日:</td>
															<td height="20">
															<% If Jissenbi <> "" And DenpyoNo <> "" Then '実践日固定モード且つ修正モード %>
															<input type="text" name="Torihikibi" size="13" value="<% = Torihikibi %>" onkeyup="FormStrDate(this);" onKeypress="FormStrDate(this);" onBlur="SetDate(this, 1, true, '<% = Torihikibi %>', '')" readonly class="tbox4_ro" tabindex="-1">
															<% ElseIf Jissenbi <> "" Then '実践日固定モード %>
																<input type="text" name="Torihikibi" size="13" value="<% = Jissenbi %>" onkeyup="FormStrDate(this);" onKeypress="FormStrDate(this);" onBlur="SetDate(this, 1, true, '<% = Jissenbi %>', '')" readonly class="tbox4_ro" tabindex="-1">
															<% Else %>
																<input type="text" name="Torihikibi" size="13" onkeyup="FormStrDate(this);" onKeypress="FormStrDate(this);" onBlur="SetDate(this, 1, true)" class="tbox4" value="<% = Torihikibi %>" tabindex="1">
															<% End If %>
															</td>
														</tr>
													</table>
														</td>
														<td>
													<table width="325" border="0" cellpadding="0" cellspacing="0">
														<tr class="tx1416">
															<td width="80" height="20" align="right" style="color:<% = SenColor %>">伝票摘要:</td>
															<td height="20">
																<input type="text" name="DenpyoTekiyo" size="38" class="tbox4_ime" value="<% = DenpyoTekiyo %>" onBlur="FormStrLeftIME(this,30,true)" tabindex="2">
															</td>
														</tr>
													</table>
														</td>
													</tr>
												</table>
												</td>
												<td align="right" valign="bottom">
													<table width="120" height="40" border="1" cellpadding="0" cellspacing="0" bordercolor="<% = SenColor %>" STYLE="border-collapse: collapse">
														<tr class="tx1214" style="color:<% = SenColor %>">
															<td width="40" height="14" align="center"><% = LabelSoumu %></td>
															<td width="40" height="14" align="center"><% = LabelTanto %></td>
															<td width="40" height="14" align="center"><% = LabelKakari %></td>
														</tr>
														<tr class="tx1214">
															<td width="40" height="40" align="center"> </td>
															<td width="40" height="40" align="center"> </td>
															<td width="40" height="40" align="center"><font color="FF0000"><% = ConvShimeiRyakuMeisyo(GakuseiBango)  %></font></td>
														</tr>
													</table>
												</td>
											</tr>
										</table>
									</td>
								</tr>
								<tr>
									<td height="230" align="center" valign="top">
										<table width="620" height="230" border="0" cellpadding="0" cellspacing="0">
											<tr>
												<td width="310" align="left" valign="top">
													<table width="305" height="230" border="1" cellpadding="0" cellspacing="0" bordercolor="<% = SenColor %>" style="border-collapse: collapse">
														<tr>
															<td height="15" align="center" class="tx1618" style="color:<% = SenColor %>">借  方</td>
														</tr>
														<tr>
															<td height="30" align="center">
																<table width="100%" height="15" border="1" cellpadding="0" cellspacing="0" frame="below" style="border-collapse: collapse" bordercolor="<% = SenColor %>" class="tx1416">
																	<tr style="color:<% = SenColor %>">
																		<td align="center" width="19%" class="tx1214">勘定コード</td>
																		<td align="center" width="48%">勘定名称</td>
																		<td align="center" width="33%">金 額</td>
																	</tr>
																</table>
																<table width="100%" height="15" border="1" cellpadding="0" cellspacing="0" frame="void" style="border-collapse: collapse" bordercolor="<% = SenColor %>" class="tx1416">
																	<tr style="color:<% = SenColor %>">
																		<td align="center" width="42%">取引先</td>
																		<td align="center" width="58%">明細摘要</td>
																	</tr>
																</table>
															</td>
														</tr>
														<tr id="MeisaiLine1" onClick="SetKanjyoKamokuForm(1);">
															<td height="<% = GyouHeight %>">
																<table width="100%" height="<% = GyouHeight3 %>" border="1" cellpadding="0" cellspacing="0" bordercolor="<% = SenColor %>" frame="below" class="tx1214" style="border-collapse: collapse">
																	<tr valign="<% = GyouHaichi %>">
																		<td width="15%" align="center">
																			<input type="text" name="KanjyoCD1" size="4" value="<% = KanjyoCD(1) %>" onFocus="SetKanjyoKamokuForm(1);" ondblclick="SetKanjyoKamoku(this);SetKanjyoMeisyo(1);" onBlur="SetKanjyoMeisyo(1);" class="tbox4_y" tabindex="11">
																		</td>
																		<td width="52%" align="center">
																			<input type="text" name="Kanjyomei1" size="23" value="<% = Kanjyomei(1) %>" readonly class="tbox4_ro" onFocus="SetKanjyoKamokuForm(1);" tabindex="-1">
																		</td>
																		<td width="33%" align="center">
																			<input type="text" name="Kingaku1" size="13" value="<% = SetMoney(Kingaku(1), false, true) %>" onKeyup="FormStrFloat(this,10,0);SetGokei();" onKeypress="FormStrFloat(this,10,0);SetGokei();" onBlur="FormStrFloatCutoff(this,true);SetGokei();" onFocus="SetKanjyoKamokuForm(1);" class="tbox5_y" tabindex="11">
																		</td>
																	</tr>
																</table>
																<table width="100%" height="<% = GyouHeight2 %>" border="1" cellpadding="0" cellspacing="0" bordercolor="<% = SenColor %>" frame="void" class="tx1214" style="border-collapse: collapse">
																	<tr valign="middle">
																		<td width="42%" align="center">
																			<select size="1" name="TekiyoCD1" class="tbox4" STYLE="width:118px;ime-mode:disabled;" onFocus="SetKanjyoKamokuForm(1);GetActIndex(this);" onKeydown="GetkeyCode(this);" tabindex="11">
																			<option value="">    </option>
																			<%
																				'摘要配列より
																				For ii = 1 To UBound(TekiyoCDA)
																					Response.Write("<option value=""" & TekiyoCDA(ii) & """")
																					If TekiyoCDA(ii) = TekiyoCD(1) Then
																						Response.Write(" selected")
																					End If
																					Response.Write(">" & TekiyoNameA(ii) & "</option>" & vbCrLf)
																				Next
																			%>
																			</select>
																		</td>
																		<td width="58%" align="center">
																			<input type="text" name="Tekiyo1" size="25" value="<% = Tekiyo(1) %>" class="tbox4_ime" onBlur="FormStrLeftIME(this,100,true);" onFocus="SetKanjyoKamokuForm(1);" tabindex="11">
																		</td>
																	</tr>
																</table>
															</td>
														</tr>
<% If Gyousu > 1 Then %>
														<tr id="MeisaiLine3" onClick="SetKanjyoKamokuForm(3);">
															<td height="<% = GyouHeight %>">
																<table width="100%" height="<% = GyouHeight3 %>" border="1" cellpadding="0" cellspacing="0" bordercolor="<% = SenColor %>" frame="below" class="tx1214" style="border-collapse: collapse">
																	<tr valign="<% = GyouHaichi %>">
																		<td width="15%" align="center">
																			<input type="text" name="KanjyoCD3" size="4" value="<% = KanjyoCD(3) %>" onFocus="SetKanjyoKamokuForm(3);" ondblclick="SetKanjyoKamoku(this);SetKanjyoMeisyo(3);" onBlur="SetKanjyoMeisyo(3);" class="tbox4_y" tabindex="21">
																		</td>
																		<td width="52%" align="center">
																			<input type="text" name="Kanjyomei3" size="23" value="<% = Kanjyomei(3) %>" readonly class="tbox4_ro" onFocus="SetKanjyoKamokuForm(3);" tabindex="-1">
																		</td>
																		<td width="33%" align="center">
																			<input type="text" name="Kingaku3" size="13" value="<% = SetMoney(Kingaku(3), false, true) %>" onKeyup="FormStrFloat(this,10,0);SetGokei();" onKeypress="FormStrFloat(this,10,0);SetGokei();" onBlur="FormStrloatCutoff(this,true);SetGokei();" onFocus="SetKanjyoKamokuForm(3);" class="tbox5_y" tabindex="21">
																		</td>
																	</tr>
																</table>
																<table width="100%" height="<% = GyouHeight2 %>" border="1" cellpadding="0" cellspacing="0" bordercolor="<% = SenColor %>" frame="void" class="tx1214" style="border-collapse: collapse">
																	<tr valign="middle">
																		<td width="42%" align="center">
																			<select size="1" name="TekiyoCD3" class="tbox4" STYLE="width:118px;ime-mode:disabled;" onFocus="SetKanjyoKamokuForm(3);GetActIndex(this);" onKeydown="GetkeyCode(this);" tabindex="21">
																			<option value="">    </option>
																			<%
																				'摘要配列より
																				For ii = 1 To UBound(TekiyoCDA)
																					Response.Write("<option value=""" & TekiyoCDA(ii) & """")
																					If TekiyoCDA(ii) = TekiyoCD(3) Then
																						Response.Write(" selected")
																					End If
																					Response.Write(">" & TekiyoNameA(ii) & "</option>" & vbCrLf)
																				Next
																			%>
																			</select>
																		</td>
																		<td width="58%" align="center">
																			<input type="text" name="Tekiyo3" size="25" value="<% = Tekiyo(3) %>" class="tbox4_ime" onBlur="FormStrLeftIME(this,100,true);" onFocus="SetKanjyoKamokuForm(3);" tabindex="21">
																		</td>
																	</tr>
																</table>
															</td>
														</tr>
<% Else %>
																			<input type="hidden" name="KanjyoCD3" size="5" value="<% = KanjyoCD(3) %>">
																			<input type="hidden" name="Kanjyomei3" size="16" value="<% = Kanjyomei(3) %>">
																			<input type="hidden" name="Kingaku3" size="16" value="<% = SetMoney(Kingaku(3), false, true) %>">
																			<input type="hidden" name="TekiyoCD3" size="16" value="">
<% End If %>
<% If Gyousu > 2 Then %>
														<tr id="MeisaiLine5" onClick="SetKanjyoKamokuForm(5);">
															<td height="<% = GyouHeight %>">
																<table width="100%" height="<% = GyouHeight3 %>" border="1" cellpadding="0" cellspacing="0" bordercolor="<% = SenColor %>" frame="below" class="tx1214" style="border-collapse: collapse">
																	<tr valign="<% = GyouHaichi %>">
																		<td width="15%" align="center">
																			<input type="text" name="KanjyoCD5" size="4" value="<% = KanjyoCD(5) %>" onFocus="SetKanjyoKamokuForm(5);" ondblclick="SetKanjyoKamoku(this);SetKanjyoMeisyo(5);" onBlur="SetKanjyoMeisyo(5);" class="tbox4_y" tabindex="31">
																		</td>
																		<td width="52%" align="center">
																			<input type="text" name="Kanjyomei5" size="23" value="<% = Kanjyomei(5) %>" readonly class="tbox4_ro" onFocus="SetKanjyoKamokuForm(5);" tabindex="-1">
																		</td>
																		<td width="33%" align="center">
																			<input type="text" name="Kingaku5" size="13" value="<% = SetMoney(Kingaku(5), false, true) %>" onKeyup="FormStrFloat(this,10,0);SetGokei();" onKeypress="FormStrFloat(this,10,0);SetGokei();" onBlur="FormStrFloatCutoff(this,true);SetGokei();" onFocus="SetKanjyoKamokuForm(5);" class="tbox5_y" tabindex="31">
																		</td>
																	</tr>
																</table>
																<table width="100%" height="<% = GyouHeight2 %>" border="1" cellpadding="0" cellspacing="0" bordercolor="<% = SenColor %>" frame="void" class="tx1214" style="border-collapse: collapse">
																	<tr valign="middle">
																		<td width="42%" align="center">
																			<select size="1" name="TekiyoCD5" class="tbox4" STYLE="width:118px;ime-mode:disabled;" onFocus="SetKanjyoKamokuForm(5);GetActIndex(this);" onKeydown="GetkeyCode(this);" tabindex="31">
																			<option value="">    </option>
																			<%
																				'摘要配列より
																				For ii = 1 To UBound(TekiyoCDA)
																					Response.Write("<option value=""" & TekiyoCDA(ii) & """")
																					If TekiyoCDA(ii) = TekiyoCD(5) Then
																						Response.Write(" selected")
																					End If
																					Response.Write(">" & TekiyoNameA(ii) & "</option>" & vbCrLf)
																				Next
																			%>
																			</select>
																		</td>
																		<td width="58%" align="center">
																			<input type="text" name="Tekiyo5" size="25" value="<% = Tekiyo(5) %>" class="tbox4_ime" onBlur="FormStrLeftIME(this,100,true);" onFocus="SetKanjyoKamokuForm(5);" tabindex="31">
																		</td>
																	</tr>
																</table>
															</td>
														</tr>
<% Else %>
																			<input type="hidden" name="KanjyoCD5" size="5" value="<% = KanjyoCD(5) %>">
																			<input type="hidden" name="Kanjyomei5" size="16" value="<% = Kanjyomei(5) %>">
																			<input type="hidden" name="Kingaku5" size="16" value="<% = SetMoney(Kingaku(5), false, true) %>">
																			<input type="hidden" name="TekiyoCD5" size="16" value="">
<% End If %>
<% If Gyousu > 3 Then %>
														<tr id="MeisaiLine7" onClick="SetKanjyoKamokuForm(7);">
															<td height="<% = GyouHeight %>">
																<table width="100%" height="<% = GyouHeight3 %>" border="1" cellpadding="0" cellspacing="0" bordercolor="<% = SenColor %>" frame="below" class="tx1214" style="border-collapse: collapse">
																	<tr valign="<% = GyouHaichi %>">
																		<td width="15%" align="center">
																			<input type="text" name="KanjyoCD7" size="4" value="<% = KanjyoCD(7) %>" onFocus="SetKanjyoKamokuForm(7);" ondblclick="SetKanjyoKamoku(this);SetKanjyoMeisyo(7);" onBlur="SetKanjyoMeisyo(7);" class="tbox4_y" tabindex="41">
																		</td>
																		<td width="52%" align="center">
																			<input type="text" name="Kanjyomei7" size="23" value="<% = Kanjyomei(7) %>" readonly class="tbox4_ro" onFocus="SetKanjyoKamokuForm(7);" tabindex="-1">
																		</td>
																		<td width="33%" align="center">
																			<input type="text" name="Kingaku7" size="13" value="<% = SetMoney(Kingaku(7), false, true) %>" onKeyup="FormStrFloat(this,10,0);SetGokei();" onKeypress="FormStrFloat(this,10,0);SetGokei();" onBlur="FormStrFloatCutoff(this,true);SetGokei();" onFocus="SetKanjyoKamokuForm(7);" class="tbox5_y" tabindex="41">
																		</td>
																	</tr>
																</table>
																<table width="100%" height="<% = GyouHeight2 %>" border="1" cellpadding="0" cellspacing="0" bordercolor="<% = SenColor %>" frame="void" class="tx1214" style="border-collapse: collapse">
																	<tr valign="middle">
																		<td width="42%" align="center">
																			<select size="1" name="TekiyoCD7" class="tbox4" STYLE="width:118px;ime-mode:disabled;" onFocus="SetKanjyoKamokuForm(7);GetActIndex(this);" onKeydown="GetkeyCode(this);" tabindex="41">
																			<option value="">    </option>
																			<%
																				'摘要配列より
																				For ii = 1 To UBound(TekiyoCDA)
																					Response.Write("<option value=""" & TekiyoCDA(ii) & """")
																					If TekiyoCDA(ii) = TekiyoCD(7) Then
																						Response.Write(" selected")
																					End If
																					Response.Write(">" & TekiyoNameA(ii) & "</option>" & vbCrLf)
																				Next
																			%>
																			</select>
																		</td>
																		<td width="58%" align="center">
																			<input type="text" name="Tekiyo7" size="25" value="<% = Tekiyo(7) %>" class="tbox4_ime" onBlur="FormStrLeftIME(this,100,true);" onFocus="SetKanjyoKamokuForm(7);" tabindex="41">
																		</td>
																	</tr>
																</table>
															</td>
														</tr>
<% Else %>
																			<input type="hidden" name="KanjyoCD7" size="5" value="<% = KanjyoCD(7) %>">
																			<input type="hidden" name="Kanjyomei7" size="16" value="<% = Kanjyomei(7) %>">
																			<input type="hidden" name="Kingaku7" size="16" value="<% = SetMoney(Kingaku(7), false, true) %>">
																			<input type="hidden" name="TekiyoCD7" size="16" value="">
<% End If %>
<% If Gyousu > 4 Then %>
														<tr id="MeisaiLine9" onClick="SetKanjyoKamokuForm(9);">
															<td height="<% = GyouHeight %>">
																<table width="100%" height="<% = GyouHeight3 %>" border="1" cellpadding="0" cellspacing="0" bordercolor="<% = SenColor %>" frame="below" class="tx1214" style="border-collapse: collapse">
																	<tr valign="<% = GyouHaichi %>">
																		<td width="15%" align="center">
																			<input type="text" name="KanjyoCD9" size="4" value="<% = KanjyoCD(9) %>" onFocus="SetKanjyoKamokuForm(9);" ondblclick="SetKanjyoKamoku(this);SetKanjyoMeisyo(9);" onBlur="SetKanjyoMeisyo(9);" class="tbox4_y" tabindex="51">
																		</td>
																		<td width="52%" align="center">
																			<input type="text" name="Kanjyomei9" size="23" value="<% = Kanjyomei(9) %>" readonly class="tbox4_ro" onFocus="SetKanjyoKamokuForm(9);" tabindex="-1">
																		</td>
																		<td width="33%" align="center">
																			<input type="text" name="Kingaku9" size="13" value="<% = SetMoney(Kingaku(9), false, true) %>" onKeyup="FormStrFloat(this,10,0);SetGokei();" onKeypress="FormStrFloat(this,10,0);SetGokei();" onBlur="FormStrFloatCutoff(this);SetGokei();" onFocus="SetKanjyoKamokuForm(9);" class="tbox5_y" tabindex="51">
																		</td>
																	</tr>
																</table>
																<table width="100%" height="<% = GyouHeight2 %>" border="1" cellpadding="0" cellspacing="0" bordercolor="<% = SenColor %>" frame="void" class="tx1214" style="border-collapse: collapse">
																	<tr valign="middle">
																		<td width="42%" align="center">
																			<select size="1" name="TekiyoCD9" class="tbox4" STYLE="width:118px;ime-mode:disabled;" onFocus="SetKanjyoKamokuForm(9);GetActIndex(this);" onKeydown="GetkeyCode(this);" tabindex="51">
																			<option value="">    </option>
																			<%
																				'摘要配列より
																				For ii = 1 To UBound(TekiyoCDA)
																					Response.Write("<option value=""" & TekiyoCDA(ii) & """")
																					If TekiyoCDA(ii) = TekiyoCD(9) Then
																						Response.Write(" selected")
																					End If
																					Response.Write(">" & TekiyoNameA(ii) & "</option>" & vbCrLf)
																				Next
																			%>
																			</select>
																		</td>
																		<td width="58%" align="center">
																			<input type="text" name="Tekiyo9" size="25" value="<% = Tekiyo(9) %>" class="tbox4_ime" onBlur="FormStrLeftIME(this,100,true);" onFocus="SetKanjyoKamokuForm(9);" tabindex="51">
																		</td>
																	</tr>
																</table>
															</td>
														</tr>
<% Else %>
																			<input type="hidden" name="KanjyoCD9" size="5" value="<% = KanjyoCD(9) %>">
																			<input type="hidden" name="Kanjyomei9" size="16" value="<% = Kanjyomei(9) %>">
																			<input type="hidden" name="Kingaku9" size="16" value="<% = SetMoney(Kingaku(9), false, true) %>">
																			<input type="hidden" name="TekiyoCD9" size="16" value="">
<% End If %>
														<tr>
															<td height="20">
																<table width="100%" height="20" border="1" cellpadding="0" cellspacing="0" bordercolor="<% = SenColor %>" frame="void" style="border-collapse: collapse">
																	<tr>
																		<td class="tx1416" align="CENTER" width="67%" style="color:<% = SenColor %>">借方合計</td>
																		<td width="33%" align="CENTER">
																			<input type="text" name="KarikataGokei" size="13" value="<% = SetMoney(KarikataGokei, false, true) %>" readonly class="tbox5_ro" tabindex="-1">
																		</td>
																	</tr>
																</table>
															</td>
														</tr>
													</table>
												</td>
												<td width="310" align="right" valign="top">
													<table width="305" height="230" border="1" cellpadding="0" cellspacing="0" bordercolor="<% = SenColor %>" style="border-collapse: collapse">
														<tr>
															<td height="15" align="center" class="tx1618" style="color:<% = SenColor %>">貸  方</td>
														</tr>
														<tr>
															<td height="30" align="center">
																<table width="100%" height="15" border="1" cellpadding="0" cellspacing="0" frame="below" style="border-collapse: collapse" bordercolor="<% = SenColor %>" class="tx1416">
																	<tr style="color:<% = SenColor %>">
																		<td align="center" width="19%" class="tx1214">勘定コード</td>
																		<td align="center" width="48%">勘定名称</td>
																		<td align="center" width="33%">金 額</td>
																	</tr>
																</table>
																<table width="100%" height="15" border="1" cellpadding="0" cellspacing="0" frame="void" style="border-collapse: collapse" bordercolor="<% = SenColor %>" class="tx1416">
																	<tr style="color:<% = SenColor %>">
																		<td align="center" width="42%">取引先</td>
																		<td align="center" width="58%">明細摘要</td>
																	</tr>
																</table>
															</td>
														</tr>

														<tr id="MeisaiLine2" onClick="SetKanjyoKamokuForm(2);">
															<td height="<% = GyouHeight %>">
																<table width="100%" height="<% = GyouHeight3 %>" border="1" cellpadding="0" cellspacing="0" bordercolor="<% = SenColor %>" frame="below" class="tx1214" style="border-collapse: collapse">
																	<tr valign="<% = GyouHaichi %>">
																		<td width="15%" align="center">
																			<input type="text" name="KanjyoCD2" size="4" value="<% = KanjyoCD(2) %>" onFocus="SetKanjyoKamokuForm(2);" ondblclick="SetKanjyoKamoku(this);SetKanjyoMeisyo(2);" onBlur="SetKanjyoMeisyo(2);" class="tbox4_y" tabindex="12">
																		</td>
																		<td width="52%" align="center">
																			<input type="text" name="Kanjyomei2" size="23" value="<% = Kanjyomei(2) %>" readonly class="tbox4_ro" onFocus="SetKanjyoKamokuForm(2);" tabindex="-1">
																		</td>
																		<td width="33%" align="center">
																			<input type="text" name="Kingaku2" size="13" value="<% = SetMoney(Kingaku(2), false, true) %>" onKeyup="FormStrFloat(this,10,0);SetGokei();" onKeypress="FormStrFloat(this,10,0);SetGokei();" onBlur="FormStrFloatCutoff(this);SetGokei();" onFocus="SetKanjyoKamokuForm(2);" class="tbox5_y" tabindex="12"
																		</td>
																	</tr>
																</table>
																<table width="100%" height="<% = GyouHeight2 %>" border="1" cellpadding="0" cellspacing="0" bordercolor="<% = SenColor %>" frame="void" class="tx1214" style="border-collapse: collapse">
																	<tr valign="middle">
																		<td width="42%" align="center">
																			<select size="1" name="TekiyoCD2" class="tbox4" STYLE="width:118px;ime-mode:disabled;" onFocus="SetKanjyoKamokuForm(2);GetActIndex(this);" onKeydown="GetkeyCode(this);" tabindex="12">
																			<option value="">    </option>
																			<%
																				'摘要配列より
																				For ii = 1 To UBound(TekiyoCDA)
																					Response.Write("<option value=""" & TekiyoCDA(ii) & """")
																					If TekiyoCDA(ii) = TekiyoCD(2) Then
																						Response.Write(" selected")
																					End If
																					Response.Write(">" & TekiyoNameA(ii) & "</option>" & vbCrLf)
																				Next
																			%>
																			</select>
																		</td>
																		<td width="58%" align="center">
																			<input type="text" name="Tekiyo2" size="25" value="<% = Tekiyo(2) %>" class="tbox4_ime" onBlur="FormStrLeftIME(this,100,true);" onFocus="SetKanjyoKamokuForm(2);" tabindex="12">
																		</td>
																	</tr>
																</table>
															</td>
														</tr>
<% If Gyousu > 1 Then %>
														<tr id="MeisaiLine4" onClick="SetKanjyoKamokuForm(4);">
															<td height="<% = GyouHeight %>">
																<table width="100%" height="<% = GyouHeight3 %>" border="1" cellpadding="0" cellspacing="0" bordercolor="<% = SenColor %>" frame="below" class="tx1214" style="border-collapse: collapse">
																	<tr valign="<% = GyouHaichi %>">
																		<td width="15%" align="center">
																			<input type="text" name="KanjyoCD4" size="4" value="<% = KanjyoCD(4) %>" onFocus="SetKanjyoKamokuForm(4);" ondblclick="SetKanjyoKamoku(this);SetKanjyoMeisyo(4);" onBlur="SetKanjyoMeisyo(4);" class="tbox4_y" tabindex="22">
																		</td>
																		<td width="52%" align="center">
																			<input type="text" name="Kanjyomei4" size="23" value="<% = Kanjyomei(4) %>" readonly class="tbox4_ro" onFocus="SetKanjyoKamokuForm(4);" tabindex="-1">
																		</td>
																		<td width="33%" align="center">
																			<input type="text" name="Kingaku4" size="13" value="<% = SetMoney(Kingaku(4), false, true) %>" onKeyup="FormStrFloat(this,10,0);SetGokei();" onKeypress="FormStrFloat(this,10,0);SetGokei();" onBlur="FormStrFloatCutoff(this);SetGokei();" onFocus="SetKanjyoKamokuForm(4);" class="tbox5_y" tabindex="22">
																		</td>
																	</tr>
																</table>
																<table width="100%" height="<% = GyouHeight2 %>" border="1" cellpadding="0" cellspacing="0" bordercolor="<% = SenColor %>" frame="void" class="tx1214" style="border-collapse: collapse">
																	<tr valign="middle">
																		<td width="42%" align="center">
																			<select size="1" name="TekiyoCD4" class="tbox4" STYLE="width:118px;ime-mode:disabled;" onFocus="SetKanjyoKamokuForm(4);GetActIndex(this);" onKeydown="GetkeyCode(this);" tabindex="22">
																			<option value="">    </option>
																			<%
																				'摘要配列より
																				For ii = 1 To UBound(TekiyoCDA)
																					Response.Write("<option value=""" & TekiyoCDA(ii) & """")
																					If TekiyoCDA(ii) = TekiyoCD(4) Then
																						Response.Write(" selected")
																					End If
																					Response.Write(">" & TekiyoNameA(ii) & "</option>" & vbCrLf)
																				Next
																			%>
																			</select>
																		</td>
																		<td width="58%" align="center">
																			<input type="text" name="Tekiyo4" size="25" value="<% = Tekiyo(4) %>" class="tbox4_ime" onBlur="FormStrLeftIME(this,100,true);" onFocus="SetKanjyoKamokuForm(4);" tabindex="22">
																		</td>
																	</tr>
																</table>
															</td>
														</tr>
<% Else %>
																			<input type="hidden" name="KanjyoCD4" size="5" value="<% = KanjyoCD(4) %>">
																			<input type="hidden" name="Kanjyomei4" size="16" value="<% = Kanjyomei(4) %>">
																			<input type="hidden" name="Kingaku4" size="16" value="<% = SetMoney(Kingaku(4), false, true) %>">
																			<input type="hidden" name="TekiyoCD4" size="16" value="">
<% End If %>
<% If Gyousu > 2 Then %>
														<tr id="MeisaiLine6" onClick="SetKanjyoKamokuForm(6);">
															<td height="<% = GyouHeight %>">
																<table width="100%" height="<% = GyouHeight3 %>" border="1" cellpadding="0" cellspacing="0" bordercolor="<% = SenColor %>" frame="below" class="tx1214" style="border-collapse: collapse">
																	<tr valign="<% = GyouHaichi %>">
																		<td width="15%" align="center">
																			<input type="text" name="KanjyoCD6" size="4" value="<% = KanjyoCD(6) %>" onFocus="SetKanjyoKamokuForm(6);" ondblclick="SetKanjyoKamoku(this);SetKanjyoMeisyo(6);" onBlur="SetKanjyoMeisyo(6);" class="tbox4_y" tabindex="32">
																		</td>
																		<td width="52%" align="center">
																			<input type="text" name="Kanjyomei6" size="23" value="<% = Kanjyomei(6) %>" readonly class="tbox4_ro" onFocus="SetKanjyoKamokuForm(6);" tabindex="-1">
																		</td>
																		<td width="33%" align="center">
																			<input type="text" name="Kingaku6" size="13" value="<% = SetMoney(Kingaku(6), false, true) %>" onKeyup="FormStrFloat(this,10,0);SetGokei();" onKeypress="FormStrFloat(this,10,0);SetGokei();" onBlur="FormStrFloatCutoff(this);SetGokei();" onFocus="SetKanjyoKamokuForm(6);" class="tbox5_y" tabindex="32">
																		</td>
																	</tr>
																</table>
																<table width="100%" height="<% = GyouHeight2 %>" border="1" cellpadding="0" cellspacing="0" bordercolor="<% = SenColor %>" frame="void" class="tx1214" style="border-collapse: collapse">
																	<tr valign="middle">
																		<td width="42%" align="center">
																			<select size="1" name="TekiyoCD6" class="tbox4" STYLE="width:118px;ime-mode:disabled;" onFocus="SetKanjyoKamokuForm(6);GetActIndex(this);" onKeydown="GetkeyCode(this);" tabindex="32">
																			<option value="">    </option>
																			<%
																				'摘要配列より
																				For ii = 1 To UBound(TekiyoCDA)
																					Response.Write("<option value=""" & TekiyoCDA(ii) & """")
																					If TekiyoCDA(ii) = TekiyoCD(6) Then
																						Response.Write(" selected")
																					End If
																					Response.Write(">" & TekiyoNameA(ii) & "</option>" & vbCrLf)
																				Next
																			%>
																			</select>
																		</td>
																		<td width="58%" align="center">
																			<input type="text" name="Tekiyo6" size="25" value="<% = Tekiyo(6) %>" class="tbox4_ime" onBlur="FormStrLeftIME(this,100,true);" onFocus="SetKanjyoKamokuForm(6);" tabindex="32">
																		</td>
																	</tr>
																</table>
															</td>
														</tr>
<% Else %>
																			<input type="hidden" name="KanjyoCD6" size="5" value="<% = KanjyoCD(6) %>">
																			<input type="hidden" name="Kanjyomei6" size="16" value="<% = Kanjyomei(6) %>">
																			<input type="hidden" name="Kingaku6" size="16" value="<% = SetMoney(Kingaku(6), false, true) %>">
																			<input type="hidden" name="TekiyoCD6" size="16" value="">
<% End If %>
<% If Gyousu > 3 Then %>
														<tr id="MeisaiLine8" onClick="SetKanjyoKamokuForm(8);">
															<td height="<% = GyouHeight %>">
																<table width="100%" height="<% = GyouHeight3 %>" border="1" cellpadding="0" cellspacing="0" bordercolor="<% = SenColor %>" frame="below" class="tx1214" style="border-collapse: collapse">
																	<tr valign="<% = GyouHaichi %>">
																		<td width="15%" align="center">
																			<input type="text" name="KanjyoCD8" size="4" value="<% = KanjyoCD(8) %>" onFocus="SetKanjyoKamokuForm(8);" ondblclick="SetKanjyoKamoku(this);SetKanjyoMeisyo(8);" onBlur="SetKanjyoMeisyo(8);" class="tbox4_y" tabindex="42">
																		</td>
																		<td width="52%" align="center">
																			<input type="text" name="Kanjyomei8" size="23" value="<% = Kanjyomei(8) %>" readonly class="tbox4_ro" onFocus="SetKanjyoKamokuForm(8);" tabindex="-1">
																		</td>
																		<td width="33%" align="center">
																			<input type="text" name="Kingaku8" size="13" value="<% = SetMoney(Kingaku(8), false, true) %>" onKeyup="FormStrFloat(this,10,0);SetGokei();" onKeypress="FormStrFloat(this,10,0);SetGokei();" onBlur="FormStrFloatCutoff(this);SetGokei();" onFocus="SetKanjyoKamokuForm(8);" class="tbox5_y" tabindex="42">
																		</td>
																	</tr>
																</table>
																<table width="100%" height="<% = GyouHeight2 %>" border="1" cellpadding="0" cellspacing="0" bordercolor="<% = SenColor %>" frame="void" class="tx1214" style="border-collapse: collapse">
																	<tr valign="middle">
																		<td width="42%" align="center">
																			<select size="1" name="TekiyoCD8" class="tbox4" STYLE="width:118px;ime-mode:disabled;" onFocus="SetKanjyoKamokuForm(8);GetActIndex(this);" onKeydown="GetkeyCode(this);" tabindex="42">
																			<option value="">    </option>
																			<%
																				'摘要配列より
																				For ii = 1 To UBound(TekiyoCDA)
																					Response.Write("<option value=""" & TekiyoCDA(ii) & """")
																					If TekiyoCDA(ii) = TekiyoCD(8) Then
																						Response.Write(" selected")
																					End If
																					Response.Write(">" & TekiyoNameA(ii) & "</option>" & vbCrLf)
																				Next
																			%>
																			</select>
																		</td>
																		<td width="58%" align="center">
																			<input type="text" name="Tekiyo8" size="25" value="<% = Tekiyo(8) %>" class="tbox4_ime" onBlur="FormStrLeftIME(this,100,true);" onFocus="SetKanjyoKamokuForm(8);" tabindex="42">
																		</td>
																	</tr>
																</table>
															</td>
														</tr>
<% Else %>
																			<input type="hidden" name="KanjyoCD8" size="5" value="<% = KanjyoCD(8) %>">
																			<input type="hidden" name="Kanjyomei8" size="16" value="<% = Kanjyomei(8) %>">
																			<input type="hidden" name="Kingaku8" size="16" value="<% = SetMoney(Kingaku(8), false, true) %>">
																			<input type="hidden" name="TekiyoCD8" size="16" value="">
<% End If %>
<% If Gyousu > 4 Then %>
														<tr id="MeisaiLine10" onClick="SetKanjyoKamokuForm(10);">
															<td height="<% = GyouHeight %>">
																<table width="100%" height="<% = GyouHeight3 %>" border="1" cellpadding="0" cellspacing="0" bordercolor="<% = SenColor %>" frame="below" class="tx1214" style="border-collapse: collapse">
																	<tr valign="<% = GyouHaichi %>">
																		<td width="15%" align="center">
																			<input type="text" name="KanjyoCD10" size="4" value="<% = KanjyoCD(10) %>" onFocus="SetKanjyoKamokuForm(10);" ondblclick="SetKanjyoKamoku(this);SetKanjyoMeisyo(10);" onBlur="SetKanjyoMeisyo(10);" class="tbox4_y" tabindex="52">
																		</td>
																		<td width="52%" align="center">
																			<input type="text" name="Kanjyomei10" size="23" value="<% = Kanjyomei(10) %>" readonly class="tbox4_ro" onFocus="SetKanjyoKamokuForm(10);" tabindex="-1">
																		</td>
																		<td width="33%" align="center">
																			<input type="text" name="Kingaku10" size="13" value="<% = SetMoney(Kingaku(10), false, true) %>" onKeyup="FormStrFloat(this,10,0);SetGokei();" onKeypress="FormStrFloat(this,10,0);SetGokei();" onBlur="FormStrFloatCutoff(this);SetGokei();" onFocus="SetKanjyoKamokuForm(10);" class="tbox5_y" tabindex="52">
																		</td>
																	</tr>
																</table>
																<table width="100%" height="<% = GyouHeight2 %>" border="1" cellpadding="0" cellspacing="0" bordercolor="<% = SenColor %>" frame="void" class="tx1214" style="border-collapse: collapse">
																	<tr valign="middle">
																		<td width="42%" align="center">
																			<select size="1" name="TekiyoCD10" class="tbox4" STYLE="width:118px;ime-mode:disabled;" onFocus="SetKanjyoKamokuForm(10);GetActIndex(this);" onKeydown="GetkeyCode(this);" tabindex="52">
																			<option value="">    </option>
																			<%
																				'摘要配列より
																				For ii = 1 To UBound(TekiyoCDA)
																					Response.Write("<option value=""" & TekiyoCDA(ii) & """")
																					If TekiyoCDA(ii) = TekiyoCD(10) Then
																						Response.Write(" selected")
																					End If
																					Response.Write(">" & TekiyoNameA(ii) & "</option>" & vbCrLf)
																				Next
																			%>
																			</select>
																		</td>
																		<td width="58%" align="center">
																			<input type="text" name="Tekiyo10" size="25" value="<% = Tekiyo(10) %>" class="tbox4_ime" onBlur="FormStrLeftIME(this,100,true);" onFocus="SetKanjyoKamokuForm(10);" tabindex="52">
																		</td>
																	</tr>
																</table>
															</td>
														</tr>
<% Else %>
																			<input type="hidden" name="KanjyoCD10" size="5" value="<% = KanjyoCD(10) %>">
																			<input type="hidden" name="Kanjyomei10" size="16" value="<% = Kanjyomei(10) %>">
																			<input type="hidden" name="Kingaku10" size="16" value="<% = SetMoney(Kingaku(10), false, true) %>">
																			<input type="hidden" name="TekiyoCD10" size="16" value="">
<% End If %>
														<tr>
															<td height="20">
																<table width="100%" height="20" border="1" cellpadding="0" cellspacing="0" bordercolor="<% = SenColor %>" frame="void" style="border-collapse: collapse">
																	<tr>
																		<td class="tx1416" align="center" width="67%" style="color:<% = SenColor %>">貸方合計</td>
																		<td width="33%" align="CENTER">
																			<input type="text" name="KashikataGokei" size="13" value="<% = SetMoney(KashikataGokei, false, true) %>" readonly class="tbox5_ro" tabindex="-1">
																		</td>
																	</tr>
																</table>
															</td>
														</tr>
													</table>
												</td>
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</td>
			<td width="255" valign="top">
				<table width="245" height="100%" border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td height="10" align="center"><img src="/<% = HomeAlias %>/images/spacer.gif?<% = GB_STU %>" width="100" height="10"></td>
					</tr>
					<tr>
						<td height="10" align="center"><img src="/<% = HomeAlias %>/images/palspc_gu.gif?<% = GB_STU %>" width="245" height="10"></td>
					</tr>
				<% If PackageMode = 1 Then %>
				<% Else %>
					<tr>
						<td height="10" align="center" class="tx1416" background="/<% = HomeAlias %>/images/palspc_gc.gif?<% = GB_STU %>">
							&nbsp;取引先市場
							<select size="1" name="ShijoCD" class="tbox4" onChange="SetTorihikisakiMenu(this.selectedIndex);">
								<option value="">全て表示</option>
								<%
									Query = "exec SPM市場一覧 '" & GB_SystemCD & "','" & EnshuCD & "'"
									Set Content = OpenQuery(Query)
									Do While Not(Content.BOF Or Content.EOF)
										Response.Write("<option value=""" & Content.Fields("市場CD") & """")
										'If Content.Fields("市場CD") = ShijoCD Then
										'	Response.Write(" selected")
										'End If
										Response.Write(">" & Content.Fields("市場名称") & "</option>" & vbCrLf)
										Content.MoveNext
									Loop
								%>
							</select>
						</td>
					</tr>
					<tr>
						<td height="5" align="center"><img src="/<% = HomeAlias %>/images/palspc_gc.gif?<% = GB_STU %>" width="245" height="5"></td>
					</tr>
				<% End If %>
					<tr>
						<td width="245" height="145" align="center" valign="top" background="/<% = HomeAlias %>/images/palspc_gc.gif?<% = GB_STU %>">
							<table width="225" height="135" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td align="center" valign="middle">

										<table width="225" height="135" border="0" cellpadding="0" cellspacing="0">
												<tr align="center">
														<td id="TDA" width="75" height="45" class="tbtn3w" onclick="SetKanjyoKamokuList('A');" background="/<% = HomeAlias %>/images/palbtn_01.gif?<% = GB_STU %>">資産</td>
														<td id="TDD" width="75" height="45" class="tbtn3w" onclick="SetKanjyoKamokuList('D');" background="/<% = HomeAlias %>/images/palbtn_01.gif?<% = GB_STU %>">収益</td>
														<td id="TDG" width="75" height="45" class="tbtn3w" onclick="SetKanjyoKamokuList('G');" background="/<% = HomeAlias %>/images/palbtn_01.gif?<% = GB_STU %>">特別損益</td>
												</tr>
												<tr align="center">
														<td id="TDB" width="75" height="45" class="tbtn3w" onclick="SetKanjyoKamokuList('B');" background="/<% = HomeAlias %>/images/palbtn_01.gif?<% = GB_STU %>">負債</td>
														<td id="TDE" width="75" height="45" class="tbtn3w" onclick="SetKanjyoKamokuList('E');" background="/<% = HomeAlias %>/images/palbtn_01.gif?<% = GB_STU %>">費用</td>
														<td id="TDH" width="75" height="45" class="tbtn3w" onclick="SetKanjyoKamokuList('H');" background="/<% = HomeAlias %>/images/palbtn_01.gif?<% = GB_STU %>">その他</td>
												</tr>
												<tr align="center">
														<td id="TDC" width="75" height="45" class="tbtn3w" onclick="SetKanjyoKamokuList('C');" background="/<% = HomeAlias %>/images/palbtn_01.gif?<% = GB_STU %>"><% If MHMKANJOSAIMOKC <> "" Then Response.Write(MHMKANJOSAIMOKC) Else Response.Write("資本") End If %></td>
														<td id="TDF" width="75" height="45" class="tbtn3w" onclick="SetKanjyoKamokuList('F');" background="/<% = HomeAlias %>/images/palbtn_01.gif?<% = GB_STU %>">営業外</td>
														<td id="TD" width="75" height="45" class="tbtn3w" onclick="SetKanjyoKamokuList('');" background="/<% = HomeAlias %>/images/palbtn_02.gif?<% = GB_STU %>">全勘定</td>
												</tr>
										</table>
									</td>
								</tr>
							</table>
						</td>
					</tr>
					<tr>
						<td align="center" background="/<% = HomeAlias %>/images/palspc_gc.gif?<% = GB_STU %>" valign="top">
							<!-- 複数行リストボックスは高さをピクセル指定するとIE11で激重になるのでsize属性の行数指定のみにする。tboxクラスは高さ指定しているのでダメ                   IE11ではダブルクリックが効かないケースがあるため自前判定を追加(念のため両方作動) -->
							<select size="24" name="kanjyokamoku" style="width:216px; font-size:14px; border:solid 2px; border-color:#444444 #cccccc #dddddd #666666; background-color: #EEFFFF;" onClick="OnDblClickInstant();" onDblClick="SetKanjyoKamoku2();">
							<%
								Dim i
								Dim KanjyoMeisai
								KanjyoMeisai = Request("kanjyomeisai")
								If Mode = "Seizo" Then	'製造部
									Query = "exec SPM勘定科目一覧 '" & GB_SystemCD & "','" & EnshuCD & "', 'G', '" & KanjyoMeisai & "', '" & GB_KaisyaCD & "'"
								Else
									Query = "exec SPM勘定科目一覧 '" & GB_SystemCD & "','" & EnshuCD & "', '" & GB_GyosyuKubun & "', '" & KanjyoMeisai & "', '" & GB_KaisyaCD & "'"
								End If
								Set Content = OpenQuery(Query)
								Do While Not(Content.BOF Or Content.EOF)
									Response.Write("<option value=""" & Content.Fields("勘定CD") & """>" & Content.Fields("勘定CD") & " " & Content.Fields("勘定名称") & "</option>" & vbCrLf)
								Content.MoveNext
								Loop
							%>
							</select>
						</td>
					</tr>
					<tr>
						<td height="10" align="center" bgcolor="#99E6CC"><img src="/<% = HomeAlias %>/images/palspc_gd.gif?<% = GB_STU %>" width="245" height="10"></td>
					</tr>
					<tr>
						<td height="10" align="center"><img src="/<% = HomeAlias %>/images/spacer.gif?<% = GB_STU %>" width="100" height="10"></td>
					</tr>
				</table>
			</td>
		</tr>
	</table>

</div>
</form>
</body>
<% = HtmlFooter %>


<script language="JavaScript">
ChangeSeiri()
	function ChangeSeiri()
	{
	}


	function SubmitCheck()
	{
<%
				If DenpyoNo <> "" Then
%>

<% If JidoBangoDenpyo <> "1" Then %>
//				if(form1.OldDenpyoNo.value == form1.DenpyoNo.value)
//				{
//					alert("伝票を修正する場合は、新しい伝票番号を付ける必要があります。");
//					return false;
//				}
<% End If %>

//				if(!confirm("この伝票を削除し、新しい伝票を保存します。\r\n保存してもよろしいですか?"))
//				{
//						return false;
//				}
<%
				End If
%>



<% If JidoBangoDenpyo <> "1" Then %>
				if(form1.DenpyoNo.value == "")
				{
					alert("伝票番号を入力してください。");
					form1.DenpyoNo.focus();
					return false;
				}
<% End If %>


		var ii;
		for(ii = 1;ii <= 10; ii++)
		{
			var KanjyoCD;
			KanjyoCD = document.form1["KanjyoCD" + ii].value;

			if(KanjyoCD != "")
			{
				if(ConvKanjyoMeisyo(KanjyoCD) == "")
				{
					alert("勘定コードを正しく入力して下さい");
					return false;
				}
				else if(form1["Kingaku" + ii].value == "")
				{
					alert("勘定コードと金額の両方を入力して下さい");
					return false;
				}
			}
			else
			{
				if(form1["Kingaku" + ii].value != "")
				{
					alert("勘定科目を入力してください");
					return false;
				}

			}
		}

		if(form1.KarikataGokei.value != form1.KashikataGokei.value)
		{
			alert("貸借金額がバランスしません");
			return false;
		}

		if(ConvMoneyToInt(form1.KashikataGokei.value) == 0)
		{
			alert("仕訳を入力して下さい");
			return false;
		}

		if(form1.Torihikibi.value == "")
		{
			alert("取引日を入力して下さい");
			return false;
		}

		SubmitReal(form1);
		return true;
	}


	function SetGokei()
	{
		var gokei;
		var ii;
		gokei = 0;
		for(ii = 1; ii<=<% = Gyousu * 2 %>; ii=ii+2)
		{
			var Kingaku;
			Kingaku = ConvMoneyToInt(form1["Kingaku" + ii].value);
			if(Kingaku == "" || Kingaku == "isNaN" || Kingaku == "ERR")
			{
				Kingaku = 0;
			}
			gokei = gokei + Kingaku;
		}
		form1["KarikataGokei"].value = ConvIntToMoney(gokei, false, false);


		gokei = 0;
		for(ii = 2; ii<=<% = Gyousu * 2 %>; ii=ii+2)
		{
			var Kingaku;
			Kingaku = ConvMoneyToInt(form1["Kingaku" + ii].value);
			if(Kingaku == "" || Kingaku == "isNaN" || Kingaku == "ERR")
			{
				Kingaku = 0;
			}
			gokei = gokei + Kingaku;
		}
		form1["KashikataGokei"].value = ConvIntToMoney(gokei);
	}

	function SetKanjyoKamoku(obj)
	{
		var idx;
		idx = form1.kanjyokamoku.selectedIndex;
		if(idx >= 0)
		{
			obj.value = form1.kanjyokamoku.options[idx].value;
		}
	}


	//勘定科目フォーム指定用グローバル変数(080322小野)
	var KanjyoKamokuForm = 1;	//初期設定
	celsel(KanjyoKamokuForm);	//初期設定

	//勘定科目フォーム指定用グローバル変数を変更する関数(080322小野)
	//(勘定科目フォームonFocusで作動させることでフォーカス位置を保持する)
	function SetKanjyoKamokuForm(value) {
		KanjyoKamokuForm = value;
		celsel(KanjyoKamokuForm);	//セル色変更
	}

	//勘定科目一覧ダブルクリックで勘定科目フォームに代入する関数(080322小野)
	//(KanjyoKamokuForm変数に保持されたフォーム番号に代入する)
	function SetKanjyoKamoku2() {
		if (KanjyoKamokuForm > 0 && KanjyoKamokuForm < 11) {
			if (form1.kanjyokamoku.selectedIndex >= 0) {
				form1["KanjyoCD" + KanjyoKamokuForm].value = form1.kanjyokamoku.options[form1.kanjyokamoku.selectedIndex].value;
				SetKanjyoMeisyo(KanjyoKamokuForm);
				form1["KanjyoCD" + KanjyoKamokuForm].focus();
			}
		}
	}

	//ダブルクリック判定関数(IE11でダブルクリックが2回に1回しか作動しないバグのため)
	var DblClickFlg = false;
	function OnDblClickInstant() {
		if (!DblClickFlg) {
			//1回目のクリックでフラグを立てる
			DblClickFlg = true;
			//500ミリ秒経過したらフラグを降ろすタイマーをセット
			setTimeout("DblClickFlg = false;", 500);
		} else {
			//ダブルクリック処理(1回目のクリックから500ミリ秒以内で作動)
			DblClickFlg = false;
			SetKanjyoKamoku2();
		}
	}



	function SetKanjyoMeisyo(ii)
	{
		form1["Kanjyomei" + ii].value = ConvKanjyoMeisyo(document.form1["KanjyoCD" + ii].value);
	}

//	function SetTekiyo(ii)
//	{
//		form1["TmpTekiyo" + ii].value = ConvTekiyoMeisyoDx(EnshuCD, KaisyaCD, document.form1["TekiyoCD" + ii].value);
//	}




	function ConvKanjyoMeisyo(kanjyoCD)
	{
<%
		If Mode = "Seizo" Then	'製造部
			Query = "exec SPM勘定科目一覧 '" & GB_SystemCD & "','" & EnshuCD & "', 'G', '', '" & GB_KaisyaCD & "'"
		Else
			Query = "exec SPM勘定科目一覧 '" & GB_SystemCD & "','" & EnshuCD & "', '" & GB_GyosyuKubun & "', '', '" & GB_KaisyaCD & "'"
		End If
		Set Content = OpenQuery(Query)

		Do While Not(Content.BOF Or Content.EOF)
			Response.Write("if(kanjyoCD == """ & Content.Fields("勘定CD") & """)return """ & Content.Fields("勘定名称") & """;" & vbCrLf)
			Content.MoveNext
		Loop
%>
		return "";
	}

//	function ConvTekiyoMeisyoDx(EnshuCD, KaisyaCD, tekiyoCD) {
<%
	'摘要配列より
'	For ii = 1 To UBound(TekiyoCDA)
'		Response.Write("		if (tekiyoCD == """ & Content.Fields("摘要CD") & """) return """ & Content.Fields("摘要") & """;" & vbCrLf)
'	Next
%>
//	}



	function SetKanjyoKamokuList(kanjyomeisai)
	{

		var Meisais;
		var ii;
		Meisais = Array("A", "B", "C", "D", "E", "F", "G", "H", "");
		for(ii=0; ii<Meisais.length; ii++)
		{
			document.all.item("TD" + Meisais[ii]).background = "/<% = HomeAlias %>/images/palbtn_01.gif?<% = GB_STU %>";
		}
		document.all.item("TD" + kanjyomeisai).background = "/<% = HomeAlias %>/images/palbtn_02.gif?<% = GB_STU %>";


		var ii;
		var Idx;
		Idx = 0;

		do
		{
			form1.kanjyokamoku.options[0] = null;
		}
		while(form1.kanjyokamoku.length != 0)

	<%
		If Mode = "Seizo" Then	'製造部
			Query = "exec SPM勘定科目一覧 '" & GB_SystemCD & "','" & EnshuCD & "', 'G', '" & KanjyoMeisai & "', '" & GB_KaisyaCD & "'"
		Else
			Query = "exec SPM勘定科目一覧 '" & GB_SystemCD & "','" & EnshuCD & "', '" & GB_GyosyuKubun & "', '" & KanjyoMeisai & "', '" & GB_KaisyaCD & "'"
		End If
		Set Content = OpenQuery(Query)

		Dim PreKanjyoMeisai
		PreKanjyoMeisai = ""

		Response.Write("if(1 == 0){" & vbCrLf)
		Do While Not(Content.BOF Or Content.EOF)
			If PreKanjyoMeisai <> Content.Fields("勘定細目") Then
				Response.Write("}" & vbCrLf)
				Response.Write("if(kanjyomeisai == """" || kanjyomeisai == """ & Content.Fields("勘定細目") & """){" & vbCrLf)
				PreKanjyoMeisai = Content.Fields("勘定細目")
			End If
			Response.Write("form1.kanjyokamoku.options[Idx] = new Option(""" & Content.Fields("勘定CD") & " " & Content.Fields("勘定名称") & """, """ & Content.Fields("勘定CD") & """);")
			Response.Write("Idx = Idx + 1;" & vbCrLf)
			Content.MoveNext
		Loop
		Response.Write("}" & vbCrLf)
	%>

		return false;
	}



//////取引先メニュー変更ロジック

	//取引先CD及び取引先名称の配列を作成
	var Val = new Array();	//配列番号=市場メニューのselectedIndexで動作する
	var Tex = new Array();
<%
	Dim ContentTorihikisaki
	Dim iii
	Dim jjj
	iii = 0
	jjj = 0
	'TDA市場Mから市場(市場CD)を取得
	Query = "exec SPM市場一覧 '" & GB_SystemCD & "','" & EnshuCD & "'"
	Set Content = OpenQuery(Query)
	If Not(Content.BOF Or Content.EOF) Then
		Do While Not(Content.BOF Or Content.EOF)
			Response.Write("Val[" & iii & "] = new Array()" & vbCrLf)	'2次元配列
			Response.Write("Tex[" & iii & "] = new Array()" & vbCrLf)
			If UBound(TekiyoCDA) > 0 Then
				jjj = 0
				Response.Write("Val[" & iii & "][" & jjj & "] = ''" & vbCrLf )
				Response.Write("Tex[" & iii & "][" & jjj & "] = ''" & vbCrLf )
				jjj = jjj + 1
				'摘要配列より
				For ii = 1 To UBound(TekiyoCDA)
					'iii=0は全取引先取得	TekiyoShijoA(ii)=NULLも取得(小売販売対応)
					If iii = 0 Or TekiyoShijoA(ii) = "" Or TekiyoShijoA(ii) = Content.Fields("市場CD") Then
						Response.Write("Val[" & iii & "][" & jjj & "] = '" & TekiyoCDA(ii) & "'" & vbCrLf)
						Response.Write("Tex[" & iii & "][" & jjj & "] = '" & TekiyoNameA(ii) & "'" & vbCrLf)
						jjj = jjj + 1
					End If
				Next
			End If
			'iii=0は全取引先取得なのでMoveNextしない
			If iii <> 0 then
				Content.MoveNext
			End If
			iii = iii + 1
		Loop
	End If

%>

	function SetTorihikisakiMenu(selindex) {
		for (ii=1; ii<=<% = Gyousu * 2 %>; ii++) {
			var plusLen = 0;
			//現在選択されているメニュー内容を取得
			var selVal = form1['TekiyoCD' + ii].value;
			var selTex = form1['TekiyoCD' + ii].options[form1['TekiyoCD' + ii].selectedIndex].text;
			//メニューの配列長を変更(Valの2次元目の配列長)
			if (selVal != '') {
				plusLen = 1;
				//現在選択されているメニュー内容がnullで無ければ配列長+1&先頭メニュー配列にセット
				form1['TekiyoCD' + ii].options.length = Val[selindex].length + plusLen;
				form1['TekiyoCD' + ii].options[0].value = selVal;
				form1['TekiyoCD' + ii].options[0].text = selTex;
			} else {
				form1['TekiyoCD' + ii].options.length = Val[selindex].length;
			}
			for (jj=0; jj<Val[selindex].length; jj++) {
				//メニューの内容を変更
				form1['TekiyoCD' + ii].options[jj + plusLen].value = Val[selindex][jj]
				form1['TekiyoCD' + ii].options[jj + plusLen].text = Tex[selindex][jj]
			}
			form1['TekiyoCD' + ii].selectedIndex = 0;
		}
	}



	//入力キーコードから摘要CDの次候補を探す
	var ActIndex = 0;
	var ActkeyCode = "";
	var AllkeyCode = "";
	//選択フォームのselectedIndexを取得
	//※キー入力で動作するとIE自前の機能が割り込んでしまうためonFocusで取得しておく
	function GetActIndex(Form) {
		if (typeof(Form.options[0]) == "object") {
			Form.style.imeMode = "disabled";
//			ActIndex = Form.selectedIndex;
			AllkeyCode = "";
		}
	}
	//※キー入力された文字を取得しキーイベントをキャンセルする(IE自前の機能を殺す)
	function GetkeyCode(Form) {
		if (event.keyCode == 27) {	//Escキー
			AllkeyCode = "";
			event.keyCode = null;
			event.returnValue = false;
		} else {
			ActkeyCode = String.fromCharCode(event.keyCode);
			if (ActkeyCode.match(/^[0-9a-zA-Z]+$/)) {
				AllkeyCode = AllkeyCode + ActkeyCode;
				event.keyCode = null;
				event.returnValue = false;
				TekiyoCodeSearch(Form);
			}
		}
	}
	function TekiyoCodeSearch(Form) {
		inputStr = AllkeyCode;
//		alert(inputStr);
//		if (inputStr.match(/^[a-zA-Z]+$/)) {
			if (typeof(Form.options[0]) == "object") {
				Form.style.imeMode = "disabled";
//				Form.disabled = "true";
//				Form.blur();
				ActIndex = Form.selectedIndex;
				SelIndex = 9999999;
//				alert(Form.length);
				//選択されている行の次行から末尾まで検索
				//for (ii=ActIndex+1; ii<Form.length; ii++) {
				for (ii=ActIndex; ii<Form.length; ii++) {
					if (Form.options[ii].value.substring(0, AllkeyCode.length) == AllkeyCode) {
						SelIndex = ii;
						break;
					}
				}
				if (SelIndex == 9999999) {
					//先頭から選択されている行の前行まで検索
					for (ii=0; ii<ActIndex; ii++) {
						if (Form.options[ii].value.substring(0, AllkeyCode.length) == AllkeyCode) {
							SelIndex = ii;
							break;
						}
					}
				}
				if (SelIndex != 9999999) {
//					alert(SelIndex);
					ActIndex = SelIndex;
					Form.selectedIndex = SelIndex;
				}
//				Form.focus();
			}
//		}
	}



	//選択された明細行のセル色変更
	function celsel(rw) {
		for (k=1; k<=<% = Gyousu * 2 %> ; k++) {
			document.getElementById('MeisaiLine' + k).style.backgroundColor = "";	//セル色クリア
		}
		document.getElementById('MeisaiLine' + rw).style.backgroundColor = "#ffcdde";	//選択行色変更
	}

</script>

<SCRIPT FOR="window" EVENT="onload" LANGUAGE="JavaScript">

<% If ErrorFlg <> "" Then '伝票番号重複時の処理(090528小野)%>
	alert("<% = ErrorFlg %>");
	form1.DenpyoNo.focus();
	form1.DenpyoNo.select();
<% Else %>
	form1.Torihikibi.focus();
	form1.Torihikibi.select();
<% End If %>
	event.returnValue = false;
	return;

</SCRIPT>

</html>
<%
End Sub
%>