PageSourceSearch

https://www2.americanhome.co.jp/OCAH/js/OCAHIN01.js

js americanhome.co.jp collected 2026-10-02 06:06:20 UTC 79,693 bytes, 1,845 lines download raw bytes

1$(function(){
2	var nowStep = 0;
3	var lastStep = 4;
4
5	// ご請求内容の最終選択値
6	var lastInsureKind = "";
7
8	// ご報告者情報のリセットフラグ
9	var reporterInfoReset = false;
10	// 補償対象者さま(ケガ)情報のリセットフラグ
11	var injuredCompensationInfoReset = false;
12	// 補償対象者さま(病気)情報のリセットフラグ
13	var illCompensationInfoReset = false;
14	// 補償対象者さま(葬祭費用のみ)情報のリセットフラグ
15	var funeralCompensationInfoReset = false;
16	// 葬儀費用の負担者(ケガ)情報のリセットフラグ
17	var injuredFuneralInfoReset = false;
18	// 葬儀費用の負担者(病気)情報のリセットフラグ
19	var illFuneralInfoReset = false;
20	// 葬儀費用の負担者(葬祭費用のみ)情報のリセットフラグ
21	var funeralInfoReset = false;
22	// 書類の送付先情報のリセットフラグ
23	var destinationInfoReset = false;
24	// 日中連絡先情報のリセットフラグ
25	var contactInfoReset = false;
26
27	const buttonNameList = {
28		1:"同意して進む",
29		2:"請求内容へ進む",
30		3:"住所・電話番号へ進む",
31		4:"連絡事項へ進む",
32		5:"確認へ進む"
33	};
34	
35	// Ajaxの処理中フラグ
36	isProcessing = false;
37
38	// 対象郵便番号1
39	var targetZip1 = "";
40	// 対象郵便番号2
41	var targetZip2 = "";
42	// 対象都道府県フィールド
43	var targetPrefecture = "";
44	// 対象住所フィールド
45	var targetAddDetail = "";
46	
47	// 各種フィールド ----start
48	// 開始step指定
49	const $startStep = $('input[name="startStep"]');
50	
51	// ご契約者様との続柄
52	const $a_reporter_relationship = $('input[name="a_reporter_relationship"]');
53	// ご契約者様との続柄(詳細)
54	const $a_reporter_relationship_detail = $('input[name="a_reporter_relationship_detail"]');
55
56	// ご報告者(姓名)
57	const $a_reporter_kjsei = $('input[name="a_reporter_kjsei"]');
58	const $a_reporter_kjmei = $('input[name="a_reporter_kjmei"]');
59
60	// ご報告者(セイメイ)
61	const $a_reporter_knsei = $('input[name="a_reporter_knsei"]');
62	const $a_reporter_knmei = $('input[name="a_reporter_knmei"]');
63
64	// 保険金ご請求情報登録完了メール
65	const $a_reporter_reply_mail_confirm = $('input[name="a_reporter_reply_mail_confirm"]');
66
67	// ご契約者さま(姓名)
68	const $a_policy_info_kjsei = $('input[name="a_policy_info_kjsei"]');
69	const $a_policy_info_kjmei = $('input[name="a_policy_info_kjmei"]');
70	
71	// ご契約者さま(セイメイ)
72	const $a_policy_info_knsei = $('input[name="a_policy_info_knsei"]');
73	const $a_policy_info_knmei = $('input[name="a_policy_info_knmei"]');
74
75	// ご請求内容
76	const $insureKind = $('input[name="a_insure_kind"]');
77	const $deadFlg = $('#dead_flg');
78
79	// (ケガ)補償対象者
80	const $a_injured_compensation_person = $('input[name="a_injured_compensation_person"]');
81	const $a_injured_relationship = $('input[name="a_injured_relationship"]');
82	const $a_injured_kjsei = $('input[name="a_injured_kjsei"]');
83	const $a_injured_kjmei = $('input[name="a_injured_kjmei"]');
84	const $a_injured_knsei = $('input[name="a_injured_knsei"]');
85	const $a_injured_knmei = $('input[name="a_injured_knmei"]');
86
87	// (ケガ)保険請求意思
88	const $a_injured_show_intention = $('input[name="a_injured_show_intention"]');
89
90	// ケガされた状況
91	const $a_injured_vehicle = $('input[name="a_injured_vehicle"]');
92	const $a_injured_vehicle_type = $('select[name="a_injured_vehicle_type"]');
93	const $a_injured_vehicle_displacement = $('input[name="a_injured_vehicle_displacement"]');
94	const $a_injured_vehicle_type_other = $('input[name="a_injured_vehicle_type_other"]');
95	const $a_injured_drank = $('input[name="a_injured_drank"]');
96
97	//(ケガ)入院1/通院1/手術1
98	const $a_injured_hospitalized_flg_01 = $('select[name="a_injured_hospitalized_flg_01"]');
99	const $a_injured_outpatient_flg_01 = $('select[name="a_injured_outpatient_flg_01"]');
100	const $a_injured_operation_flg_01 = $('select[name="a_injured_operation_flg_01"]');
101	const $a_injured_advanced_medical_care_flg_01 = $('select[name="a_injured_advanced_medical_care_flg_01"]');
102
103	//(ケガ)入院2/通院2/手術2
104	const $a_injured_hospitalized_flg_02 = $('select[name="a_injured_hospitalized_flg_02"]');
105	const $a_injured_outpatient_flg_02 = $('select[name="a_injured_outpatient_flg_02"]');
106	const $a_injured_operation_flg_02 = $('select[name="a_injured_operation_flg_02"]');
107	const $a_injured_advanced_medical_care_flg_02 = $('select[name="a_injured_advanced_medical_care_flg_02"]');
108
109	//(ケガ)葬儀費用を負担された方
110	const $a_injured_funeral_payer = $('select[name="a_injured_funeral_payer"]');
111	const $a_injured_funeral_relation_deceased = $('input[name="a_injured_funeral_relation_deceased"]');
112	const $a_injured_funeral_deceased_kjsei = $('input[name="a_injured_funeral_deceased_kjsei"]');
113	const $a_injured_funeral_deceased_kjmei = $('input[name="a_injured_funeral_deceased_kjmei"]');
114	const $a_injured_funeral_deceased_knsei = $('input[name="a_injured_funeral_deceased_knsei"]');
115	const $a_injured_funeral_deceased_knmei = $('input[name="a_injured_funeral_deceased_knmei"]');
116
117	// (病気)補償対象者
118	const $a_ill_compensation_person = $('input[name="a_ill_compensation_person"]');
119	const $a_ill_relationship = $('input[name="a_ill_relationship"]');
120	const $a_ill_kjsei = $('input[name="a_ill_kjsei"]');
121	const $a_ill_kjmei = $('input[name="a_ill_kjmei"]');
122	const $a_ill_knsei = $('input[name="a_ill_knsei"]');
123	const $a_ill_knmei = $('input[name="a_ill_knmei"]');
124
125	// (病気)保険請求意思
126	const $a_ill_show_intention = $('input[name="a_ill_show_intention"]');
127
128	//(病気)入院1/手術1
129	const $a_ill_hospitalized_flg_01 = $('select[name="a_ill_hospitalized_flg_01"]');
130	const $a_ill_operation_flg_01 = $('select[name="a_ill_operation_flg_01"]');
131	const $a_ill_advanced_medical_care_flg_01 = $('select[name="a_ill_advanced_medical_care_flg_01"]');
132
133	//(病気)入院2/手術2
134	const $a_ill_hospitalized_flg_02 = $('select[name="a_ill_hospitalized_flg_02"]');
135	const $a_ill_operation_flg_02 = $('select[name="a_ill_operation_flg_02"]');
136	const $a_ill_advanced_medical_care_flg_02 = $('select[name="a_ill_advanced_medical_care_flg_02"]');
137
138	//(病気)葬儀費用を負担された方
139	const $a_ill_funeral_payer = $('select[name="a_ill_funeral_payer"]');
140	const $a_ill_funeral_relation_deceased = $('input[name="a_ill_funeral_relation_deceased"]');
141	const $a_ill_funeral_deceased_kjsei = $('input[name="a_ill_funeral_deceased_kjsei"]');
142	const $a_ill_funeral_deceased_kjmei = $('input[name="a_ill_funeral_deceased_kjmei"]');
143	const $a_ill_funeral_deceased_knsei = $('input[name="a_ill_funeral_deceased_knsei"]');
144	const $a_ill_funeral_deceased_knmei = $('input[name="a_ill_funeral_deceased_knmei"]');
145
146	// (葬祭費用)補償対象者
147	const $a_funeral_compensation_person = $('input[name="a_funeral_compensation_person"]');
148	const $a_funeral_relationship = $('input[name="a_funeral_relationship"]');
149	const $a_funeral_kjsei = $('input[name="a_funeral_kjsei"]');
150	const $a_funeral_kjmei = $('input[name="a_funeral_kjmei"]');
151	const $a_funeral_knsei = $('input[name="a_funeral_knsei"]');
152	const $a_funeral_knmei = $('input[name="a_funeral_knmei"]');
153
154	//(葬祭費用)葬儀費用を負担された方
155	const $a_funeral_payer = $('select[name="a_funeral_payer"]');
156	const $a_funeral_relation_deceased = $('input[name="a_funeral_relation_deceased"]');
157	const $a_funeral_deceased_kjsei = $('input[name="a_funeral_deceased_kjsei"]');
158	const $a_funeral_deceased_kjmei = $('input[name="a_funeral_deceased_kjmei"]');
159	const $a_funeral_deceased_knsei = $('input[name="a_funeral_deceased_knsei"]');
160	const $a_funeral_deceased_knmei = $('input[name="a_funeral_deceased_knmei"]');
161
162	//送付先
163	const $a_destination_person_type = $('input[name="a_destination_person_type"]');
164	const $a_destination_kjsei = $('input[name="a_destination_kjsei"]');
165	const $a_destination_kjmei = $('input[name="a_destination_kjmei"]');
166	const $a_destination_knsei = $('input[name="a_destination_knsei"]');
167	const $a_destination_knmei = $('input[name="a_destination_knmei"]');
168
169	//日中連絡先
170	const $a_contact_person_type = $('input[name="a_contact_person_type"]');
171	const $a_contact_relationship = $('input[name="a_contact_relationship"]');
172	const $a_contact_kjsei = $('input[name="a_contact_kjsei"]');
173	const $a_contact_kjmei = $('input[name="a_contact_kjmei"]');
174	const $a_contact_knsei = $('input[name="a_contact_knsei"]');
175	const $a_contact_knmei = $('input[name="a_contact_knmei"]');
176	
177	// 病院追加の表示制御
178	const $a_injured_hospital_02 = $('[name="a_injured_hospital_02_display"]');
179	const $a_ill_hospital_02 = $('[name="a_ill_hospital_02_display"]');
180
181	// 死亡時の病院追加の表示制御
182	const $a_injured_funeral_hospital = $('[name="a_injured_funeral_hospital_display"]');
183	const $a_ill_funeral_hospital = $('[name="a_ill_funeral_hospital_display"]');
184	
185	// 葬祭費用の表示制御
186	const $a_injured_funeral = $('[name="a_injured_funeral_display"]');
187	const $a_ill_funeral = $('[name="a_ill_funeral_display"]');
188	
189	// 各種フィールド ----end
190
191	/** 初期処理 **/
192	init();
193	function init() {
194		// 表示stepの指定がある場合は、特定のstepから開始する
195		var startStep = $startStep.val();
196		if(startStep) {
197			nowStep = Number(startStep);
198			nowStep = isNaN(nowStep) ? 0 : nowStep;
199			objectCtl();
200		}
201		sectionCtrol();
202	}
203	
204	/** 
205	** 各セクションの表示制御
206	**/
207	function sectionCtrol() {
208		// セクションの表示制御
209		$('section').addClass("hide");
210		$('section.step'+ nowStep).removeClass("hide");
211		
212		// プログレスバーの進行処理 
213		// 一旦すべて非active化
214		$('.progress .step').removeClass('active')
215		$('.progress .step').removeClass('completed')
216		
217		$('.progress .step' + nowStep).addClass('active')
218		// 現在のステップよりも前のステップにcompletedをつける
219		for ( var i = 1; i < nowStep; i++ ) {
220			$('.progress .step' + i).addClass('completed')
221		}
222		
223		// はじめに画面では戻るボタン、プログレスバーを表示しない。
224		if(nowStep == 0) {
225			$('.back').addClass("hide");
226			$('.progress').addClass("hide");
227		} else {
228			$('.back').removeClass("hide");
229			$('.progress').removeClass("hide");
230		}
231		
232		// ボタンの名称を変更
233		var buttonName = buttonNameList[nowStep + 1];
234		$('.nextBtn').text(buttonName);
235		
236		// フォームの先頭に戻る
237		const position = $('form').offset().top;
238		$('html, body').animate({scrollTop: position}, 'slow');
239	}
240
241	// 半角文字強制
242	$('.half').on('change',function() {
243		 convertToHalf(this);
244	});
245
246	// 全角文字強制
247	$('.full').on('change',function() {
248		 convertToFull(this);
249	});
250
251	/**
252	** 各種フィールドの値が変更された場合に画面表示制御を実行
253	**/
254	$('input, select, textarea').on('change',function() {
255		objectCtl($(this));
256	});
257
258	/**
259	** 画面すべての表示/非表示/非活性の処理
260	**/
261	function objectCtl($ctlObject) {
262		// 各valueを取得
263		var a_reporter_relationship =  $a_reporter_relationship.filter(':checked').val();
264		var a_reporter_relationship_detail = $a_reporter_relationship_detail.val();
265		var a_reporter_kjsei = $a_reporter_kjsei.val();
266		var a_reporter_kjmei = $a_reporter_kjmei.val();
267		var a_reporter_knsei = $a_reporter_knsei.val();
268		var a_reporter_knmei = $a_reporter_knmei.val();
269
270		var a_reporter_reply_mail_confirm_val = $a_reporter_reply_mail_confirm.filter(':checked').val();
271		
272		var a_policy_info_kjsei = $a_policy_info_kjsei.val();
273		var a_policy_info_kjmei = $a_policy_info_kjmei.val();
274		var a_policy_info_knsei = $a_policy_info_knsei.val();
275		var a_policy_info_knmei = $a_policy_info_knmei.val();
276		
277		var insureKind = $insureKind.filter(':checked').val();
278		var deadFlg = $deadFlg.prop("checked");
279		
280		var a_injured_compensation_person = $a_injured_compensation_person.filter(':checked').val();
281		var a_injured_relationship = $a_injured_relationship.val();
282		var a_injured_kjsei = $a_injured_kjsei.val();
283		var a_injured_kjmei = $a_injured_kjmei.val();
284		var a_injured_knsei = $a_injured_knsei.val();
285		var a_injured_knmei = $a_injured_knmei.val();
286		
287		var a_injured_vehicle = $a_injured_vehicle.filter(':checked').val();
288		var a_injured_vehicle_type =  $a_injured_vehicle_type.val();
289		
290		var a_injured_hospitalized_flg_01 = $a_injured_hospitalized_flg_01.val();
291		var a_injured_outpatient_flg_01 = $a_injured_outpatient_flg_01.val();
292		var a_injured_operation_flg_01 = $a_injured_operation_flg_01.val();
293		var a_injured_advanced_medical_care_flg_01 = $a_injured_advanced_medical_care_flg_01.val();
294
295		var a_injured_hospitalized_flg_02 = $a_injured_hospitalized_flg_02.val();
296		var a_injured_outpatient_flg_02 = $a_injured_outpatient_flg_02.val();
297		var a_injured_operation_flg_02 = $a_injured_operation_flg_02.val();
298		var a_injured_advanced_medical_care_flg_02 = $a_injured_advanced_medical_care_flg_02.val();
299		
300		var a_injured_funeral_payer = $a_injured_funeral_payer.val();
301
302		var a_ill_compensation_person = $a_ill_compensation_person.filter(':checked').val();
303		var a_ill_relationship = $a_ill_relationship.val();
304		var a_ill_kjsei = $a_ill_kjsei.val();
305		var a_ill_kjmei = $a_ill_kjmei.val();
306		var a_ill_knsei = $a_ill_knsei.val();
307		var a_ill_knmei = $a_ill_knmei.val();
308		
309		var a_ill_hospitalized_flg_01 = $a_ill_hospitalized_flg_01.val();
310		var a_ill_operation_flg_01 = $a_ill_operation_flg_01.val();
311		var a_ill_advanced_medical_care_flg_01 = $a_ill_advanced_medical_care_flg_01.val();
312
313		var a_ill_hospitalized_flg_02 = $a_ill_hospitalized_flg_02.val();
314		var a_ill_operation_flg_02 = $a_ill_operation_flg_02.val();
315		var a_ill_advanced_medical_care_flg_02 = $a_ill_advanced_medical_care_flg_02.val();
316		
317		var a_ill_funeral_payer = $a_ill_funeral_payer.val();
318
319		var a_funeral_compensation_person = $a_funeral_compensation_person.filter(':checked').val();
320		var a_funeral_relationship = $a_funeral_relationship.val();
321		var a_funeral_kjsei = $a_funeral_kjsei.val();
322		var a_funeral_kjmei = $a_funeral_kjmei.val();
323		var a_funeral_knsei = $a_funeral_knsei.val();
324		var a_funeral_knmei = $a_funeral_knmei.val();
325		var a_funeral_payer = $a_funeral_payer.val();
326
327		var a_destination_person_type = $a_destination_person_type.filter(':checked').val();
328		var a_destination_kjsei = $a_destination_kjsei.val();
329		var a_destination_kjmei = $a_destination_kjmei.val();
330		var a_destination_knsei = $a_destination_knsei.val();
331		var a_destination_knmei = $a_destination_knmei.val();
332
333		var a_contact_person_type = $a_contact_person_type.filter(':checked').val();
334		var a_contact_relationship = $a_contact_relationship.val();
335		var a_contact_kjsei = $a_contact_kjsei.val();
336		var a_contact_kjmei = $a_contact_kjmei.val();
337		var a_contact_knsei = $a_contact_knsei.val();
338		var a_contact_knmei = $a_contact_knmei.val();
339		
340		var a_injured_hospital_02 = $a_injured_hospital_02.val();
341		var a_injured_funeral_hospital = $a_injured_funeral_hospital.val();
342		var a_injured_funeral = $a_injured_funeral.val();
343		
344		var a_ill_hospital_02 = $a_ill_hospital_02.val();
345		var a_ill_funeral_hospital = $a_ill_funeral_hospital.val();
346		var a_ill_funeral = $a_ill_funeral.val();
347		
348		// ----------------------------------
349		// STEP1処理
350		// ----------------------------------
351
352		// 続柄の詳細表示
353		// ご親族その他を選択した場合は、続柄の詳細を表示
354		if(a_reporter_relationship == 3 || a_reporter_relationship == 4) {
355			$a_reporter_relationship_detail.closest('.td-inner-wrap').removeClass("hide");
356		} else if ($a_reporter_relationship.is($ctlObject)){
357			$a_reporter_relationship_detail.closest('.td-inner-wrap').addClass("hide");
358		}
359		
360		// 続柄の値取得
361		var tsuzuki = ''
362		if(a_reporter_relationship == 1) {
363			// 契約者本人
364			tsuzuki = '契約者本人';
365		} else if (a_reporter_relationship == 2) {
366			// 配偶者
367			tsuzuki =  $a_reporter_relationship.filter(':checked').closest("label").text();
368		} else {
369			//それ以外の場合、続柄の詳細も括弧書きで表示
370			tsuzuki = $a_reporter_relationship.filter(':checked').closest("label").text();
371			tsuzuki += "(" + a_reporter_relationship_detail + ")";
372		}
373
374		// 続柄で契約者本人を選択した場合の制御
375		if(a_reporter_relationship == 1) {
376			changeDisabled([$a_reporter_kjsei,$a_reporter_kjmei,$a_reporter_knsei,$a_reporter_knmei], true);
377			setValue([[$a_reporter_kjsei,a_policy_info_kjsei],[$a_reporter_kjmei,a_policy_info_kjmei],[$a_reporter_knsei,a_policy_info_knsei],[$a_reporter_knmei,a_policy_info_knmei]]);
378		} else if ($a_reporter_relationship.is($ctlObject) && reporterInfoReset){
379			changeDisabled([$a_reporter_kjsei,$a_reporter_kjmei,$a_reporter_knsei,$a_reporter_knmei], false);
380			setValue([[$a_reporter_relationship_detail,''],[$a_reporter_kjsei,''],[$a_reporter_kjmei,''],[$a_reporter_knsei,''],[$a_reporter_knmei,'']]);
381		}
382
383		// ご報告者情報のリセットフラグ設定
384		if (!(a_reporter_relationship == '' || a_reporter_relationship == undefined)) {
385			reporterInfoReset = true;
386		}
387		
388		// 報告者の値を設定し直す
389		a_reporter_kjsei = $a_reporter_kjsei.val();
390		a_reporter_kjmei = $a_reporter_kjmei.val();
391		a_reporter_knsei = $a_reporter_knsei.val();
392		a_reporter_knmei = $a_reporter_knmei.val();
393		
394		// 請求内容の選択
395		if(insureKind == 4) {
396			// 死亡・葬祭費用選択時は死亡をチェックし非活性
397			$deadFlg.prop("checked", true);
398			changeDisabled([$deadFlg], true);
399		} else if (insureKind == 3 || insureKind == 5) {
400			// 賠償事故/その他(携行品など)を選択した場合は死亡チェックを外して非活性
401			$deadFlg.prop("checked", false);
402			changeDisabled([$deadFlg], true);
403		} else if (insureKind != 4 && lastInsureKind == 4) {
404			// 最終選択が死亡・葬祭費用で、それ以外に変更した場合はチェックを外し活性
405			$deadFlg.prop("checked", false);
406			changeDisabled([$deadFlg], false);
407		} else {
408			// 上記以外は活性化のみ行う
409			changeDisabled([$deadFlg], false);
410		}
411		
412		deadFlg = $deadFlg.prop("checked");
413		lastInsureKind = insureKind
414
415		// ----------------------------------
416		// STEP2処理
417		// ----------------------------------
418		
419		// step2直下のdivをすべて非表示化
420		$('.step2 > div').addClass("hide");
421		
422		// 選択内容に応じて表示内容を変更
423		switch (insureKind){
424			case '1':
425				$('#injuredInfo').removeClass("hide");
426				break;
427			case '2':
428				$('#illInfo').removeClass("hide");
429				break;
430			case '3':
431				$('#damagedInfo').removeClass("hide");
432				break;
433			case '4':
434				$('#funeralExpensesInfo').removeClass("hide");
435				break;
436			case '5':
437				$('#otherDamagedInfo').removeClass("hide");
438				break;
439		}
440
441		if (deadFlg) {
442			//共通の表示/非表示処理
443			$('.dead_flg_hide').addClass("hide");
444			$('.dead_flg_show').removeClass("hide");
445		} else {
446			//共通の表示/非表示処理
447			$('.dead_flg_hide').removeClass("hide");
448			$('.dead_flg_show').addClass("hide");
449		}
450		
451		// ケガの場合
452		if(insureKind == 1) {
453			// ご報告者=ご契約者 もしくは 死亡の場合、ご報告者と同じを非表示
454			if(a_reporter_relationship == 1 || deadFlg) {
455				// ご報告者と同じを非表示
456				$('label[for="a_injured_compensation_person_01"]').addClass("hide");
457
458				// ご報告者と同じが選択されている場合には、値を初期化
459				if (a_injured_compensation_person == 1) {
460					changeDisabled([$a_injured_relationship,$a_injured_kjsei,$a_injured_kjmei,$a_injured_knsei,$a_injured_knmei], false);
461					setValue([[$a_injured_relationship,''],[$a_injured_kjsei,''],[$a_injured_kjmei,''],[$a_injured_knsei,''],[$a_injured_knmei,'']]);
462					$('#a_injured_compensation_person_01').prop('checked', false);
463					injuredCompensationInfoReset = false;
464				}
465			} else {
466				$('label[for="a_injured_compensation_person_01"]').removeClass("hide");
467			}
468			
469			// ご報告者=ご契約者 且つ 死亡の場合、ご契約者さまと同じを非表示にし、ご契約者さま以外をデフォルトチェック
470			if(a_reporter_relationship == 1 && deadFlg) {
471				// ご契約者と同じを非表示
472				$('label[for="a_injured_compensation_person_02"]').addClass("hide");
473
474				// ご契約者と同じが選択されている場合には、値を初期化
475				if (a_injured_compensation_person == 2) {
476					changeDisabled([$a_injured_relationship,$a_injured_kjsei,$a_injured_kjmei,$a_injured_knsei,$a_injured_knmei], false);
477					setValue([[$a_injured_relationship,''],[$a_injured_kjsei,''],[$a_injured_kjmei,''],[$a_injured_knsei,''],[$a_injured_knmei,'']]);
478					$('#a_injured_compensation_person_02').prop('checked', false);
479					injuredCompensationInfoReset = false;
480				}
481				
482				// 報告者以外の項目は存在しないので、デフォルトチェックを入れる
483				$('#a_injured_compensation_person_03').prop('checked', true);
484			} else {
485				$('label[for="a_injured_compensation_person_02"]').removeClass("hide");
486			}
487			
488			// その他の選択肢の制御
489			// 死亡 または 報告者 = 契約者の場合:ご契約者さま以外
490			// 死亡ではない場合:ご報告者さま・ご契約者さま以外
491			if(deadFlg || a_reporter_relationship == 1) {
492				// ご契約者と同じを表示
493				$('label[for="a_injured_compensation_person_03"]').removeClass("hide");
494				// ご報告者さま・ご契約者さま以外を非表示
495				$('label[for="a_injured_compensation_person_04"]').addClass("hide");
496				// ご契約者さま以外が選択されている場合には、同等の項目にチェックを振り変える
497				if (a_injured_compensation_person == 4) {
498					$('#a_injured_compensation_person_03').prop('checked', true);
499				}
500			} else {
501				// ご契約者と同じを非表示
502				$('label[for="a_injured_compensation_person_03"]').addClass("hide");
503				// ご報告者さま・ご契約者さま以外を表示
504				$('label[for="a_injured_compensation_person_04"]').removeClass("hide");
505				// ご契約者さま以外が選択されている場合には、同等の項目にチェックを振り変える
506				if (a_injured_compensation_person == 3) {
507					$('#a_injured_compensation_person_04').prop('checked', true);
508				}
509			}
510			
511			// 値を設定し直す
512			a_injured_compensation_person = $a_injured_compensation_person.filter(':checked').val();
513
514			// 補償対象者様情報
515			if(a_injured_compensation_person == 1) {
516				// ご報告者さまと同じ
517				changeDisabled([$a_injured_relationship,$a_injured_kjsei,$a_injured_kjmei,$a_injured_knsei,$a_injured_knmei], true);
518				setValue([[$a_injured_relationship,tsuzuki],[$a_injured_kjsei,a_reporter_kjsei],[$a_injured_kjmei,a_reporter_kjmei],[$a_injured_knsei,a_reporter_knsei],[$a_injured_knmei,a_reporter_knmei]]);
519			} else if(a_injured_compensation_person == 2) {
520				// ご契約者さまと同じ
521				changeDisabled([$a_injured_relationship,$a_injured_kjsei,$a_injured_kjmei,$a_injured_knsei,$a_injured_knmei], true);
522				setValue([[$a_injured_relationship,'契約者本人'],[$a_injured_kjsei,a_policy_info_kjsei],[$a_injured_kjmei,a_policy_info_kjmei],[$a_injured_knsei,a_policy_info_knsei],[$a_injured_knmei,a_policy_info_knmei]]);
523			} else if ($a_injured_compensation_person.is($ctlObject) && injuredCompensationInfoReset){
524				// ご契約者さま・ご報告者さま以外
525				changeDisabled([$a_injured_relationship,$a_injured_kjsei,$a_injured_kjmei,$a_injured_knsei,$a_injured_knmei], false);
526				setValue([[$a_injured_relationship,''],[$a_injured_kjsei,''],[$a_injured_kjmei,''],[$a_injured_knsei,''],[$a_injured_knmei,'']]);
527			}
528			
529			// 補償対象者に何かしらの値が設定されている場合には、リセットフラグを立てる
530			if (!(a_injured_compensation_person == '' || a_injured_compensation_person == undefined)) {
531				injuredCompensationInfoReset = true;
532			}
533			
534			// 値を設定し直す
535			a_injured_relationship = $a_injured_relationship.val();
536			a_injured_kjsei = $a_injured_kjsei.val();
537			a_injured_kjmei = $a_injured_kjmei.val();
538			a_injured_knsei = $a_injured_knsei.val();
539			a_injured_knmei = $a_injured_knmei.val();
540
541			// 保険金請求の意思の聴取項目を表示制御
542			if (deadFlg || a_injured_compensation_person == 1 
543					|| (a_injured_compensation_person == 2 && a_reporter_relationship == 1)) {
544				$a_injured_show_intention.closest('tr').addClass("hide");
545				$a_injured_show_intention.filter(':checked').prop('checked', false);
546			} else {
547				$a_injured_show_intention.closest('tr').removeClass("hide");
548			}
549		
550			// ケガの状況
551			// 乗り物に乗っていた選択時の処理
552			if (a_injured_vehicle == 1) {
553				$a_injured_vehicle_type.closest('tr').removeClass("hide");
554				$a_injured_drank.closest('tr').removeClass("hide");
555				
556				// 乗り物の種類に応じた表示制御
557				switch (a_injured_vehicle_type){
558					// 自動車
559					case '1':
560						$a_injured_vehicle_displacement.closest('tr').addClass("hide");
561						$a_injured_vehicle_type_other.closest('tr').addClass("hide");
562					break;
563					// バイク
564					case '2':
565						$a_injured_vehicle_displacement.closest('tr').removeClass("hide");
566						$a_injured_vehicle_type_other.closest('tr').addClass("hide");
567					break;
568					// 自転車
569					case '3':
570						$a_injured_vehicle_displacement.closest('tr').addClass("hide");
571						$a_injured_vehicle_type_other.closest('tr').addClass("hide");
572					break;
573					// その他
574					case '4':
575						$a_injured_vehicle_displacement.closest('tr').addClass("hide");
576						$a_injured_vehicle_type_other.closest('tr').removeClass("hide");
577					break;
578					default:
579						$a_injured_vehicle_displacement.closest('tr').addClass("hide");
580						$a_injured_vehicle_type_other.closest('tr').addClass("hide");
581					break;
582				}
583			} else {
584				$a_injured_vehicle_type.closest('tr').addClass("hide");
585				$a_injured_vehicle_displacement.closest('tr').addClass("hide");
586				$a_injured_vehicle_type_other.closest('tr').addClass("hide");
587				$a_injured_drank.closest('tr').addClass("hide");
588			}
589			
590			// 病院追加の表示制御
591			if (a_injured_hospital_02 == 1) {
592				showExField($a_injured_hospital_02.attr('name'));
593			} else {
594				hideExField($a_injured_hospital_02.attr('name'));
595			}
596			
597			if (deadFlg) {
598				//病院2はデフォルト表示なので表示にする
599				showExField($a_injured_hospital_02.attr('name'));
600				
601				if (a_injured_funeral_hospital == 1) {
602					showExField($a_injured_funeral_hospital.attr('name'));
603				} else {
604					hideExField($a_injured_funeral_hospital.attr('name'));
605				}
606				
607				// 葬祭費用の表示制御
608				if (a_injured_funeral == 1) {
609					showExField($a_injured_funeral.attr('name'));
610				}
611			} else {
612			 	//入院/手術/通院のwraperを表示
613				showExField($a_injured_funeral_hospital.attr('name'));
614				// 死亡以外は葬祭費用の請求ボタンを非表示
615				hideExField($a_injured_funeral.attr('name'));
616			}
617		
618			// 入院/通院/手術の表示制御
619			// 入院1の表示制御
620			if(a_injured_hospitalized_flg_01 == 1) {
621				$('.injured_hospitalized_01').removeClass("hide");
622			} else {
623				$('.injured_hospitalized_01').addClass("hide");
624			}
625			
626			// 通院1の表示制御
627			if(a_injured_outpatient_flg_01 == 1) {
628				$('.injured_outpatient_01').removeClass("hide");
629			} else {
630				$('.injured_outpatient_01').addClass("hide");
631			}
632			
633			// 手術1の表示制御
634			if(a_injured_operation_flg_01 == 1) {
635				$('.injured_operation_01').removeClass("hide");
636			} else {
637				$('.injured_operation_01').addClass("hide");
638			}
639			
640			// 先進医療1の表示制御
641			if(a_injured_advanced_medical_care_flg_01 == 1) {
642				$('.injured_advanced_medical_care_01').removeClass("hide");
643			} else {
644				$('.injured_advanced_medical_care_01').addClass("hide");
645			}
646			
647			// 入院2の表示制御
648			if(a_injured_hospitalized_flg_02 == 1) {
649				$('.injured_hospitalized_02').removeClass("hide");
650			} else {
651				$('.injured_hospitalized_02').addClass("hide");
652			}
653			
654			// 通院2の表示制御
655			if(a_injured_outpatient_flg_02 == 1) {
656				$('.injured_outpatient_02').removeClass("hide");
657			} else {
658				$('.injured_outpatient_02').addClass("hide");
659			}
660			
661			// 手術2の表示制御
662			if(a_injured_operation_flg_02 == 1) {
663				$('.injured_operation_02').removeClass("hide");
664			} else {
665				$('.injured_operation_02').addClass("hide");
666			}
667			
668			// 先進医療2の表示制御
669			if(a_injured_advanced_medical_care_flg_02 == 1) {
670				$('.injured_advanced_medical_care_02').removeClass("hide");
671			} else {
672				$('.injured_advanced_medical_care_02').addClass("hide");
673			}
674			
675			// 死亡の場合
676			if(deadFlg) {
677				// 葬儀費用を負担された方の表示制御
678				// 補償対象者 = 契約者の場合、契約者本人の選択肢を非表示にする
679				if ( a_injured_compensation_person == 2 ) {
680					$a_injured_funeral_payer.find('option[value="1"]').addClass('hide')
681					// 契約者さま選択中の場合は、未選択にする
682					if($a_injured_funeral_payer.val() == 1){
683						changeDisabled([$a_injured_funeral_deceased_kjsei,$a_injured_funeral_deceased_kjmei,$a_injured_funeral_deceased_knsei,$a_injured_funeral_deceased_knmei], false);
684						setValue([[$a_injured_funeral_payer,''],[$a_injured_funeral_relation_deceased,''],[$a_injured_funeral_deceased_kjsei,''],[$a_injured_funeral_deceased_kjmei,''],[$a_injured_funeral_deceased_knsei,''],[$a_injured_funeral_deceased_knmei,'']]);
685						$a_injured_funeral_relation_deceased.closest('tr').removeClass("hide");
686						a_injured_funeral_payer = $a_injured_funeral_payer.val();
687						injuredFuneralInfoReset = false;
688					}
689				} else {
690					$a_injured_funeral_payer.find('option[value="1"]').removeClass('hide')
691				}
692				
693				// 葬儀費用を負担された方の名前の表示制御
694				if(a_injured_funeral_payer == 1) {
695					changeDisabled([$a_injured_funeral_deceased_kjsei,$a_injured_funeral_deceased_kjmei,$a_injured_funeral_deceased_knsei,$a_injured_funeral_deceased_knmei], true);
696					setValue([[$a_injured_funeral_deceased_kjsei,a_policy_info_kjsei],[$a_injured_funeral_deceased_kjmei,a_policy_info_kjmei],[$a_injured_funeral_deceased_knsei,a_policy_info_knsei],[$a_injured_funeral_deceased_knmei,a_policy_info_knmei]]);
697					$a_injured_funeral_relation_deceased.closest('tr').addClass("hide");
698				} else if ($a_injured_funeral_payer.is($ctlObject) && injuredFuneralInfoReset){
699					changeDisabled([$a_injured_funeral_deceased_kjsei,$a_injured_funeral_deceased_kjmei,$a_injured_funeral_deceased_knsei,$a_injured_funeral_deceased_knmei], false);
700					setValue([[$a_injured_funeral_relation_deceased,''],[$a_injured_funeral_deceased_kjsei,''],[$a_injured_funeral_deceased_kjmei,''],[$a_injured_funeral_deceased_knsei,''],[$a_injured_funeral_deceased_knmei,'']]);
701					$a_injured_funeral_relation_deceased.closest('tr').removeClass("hide");
702				}
703				
704				// 葬祭費用負担者に何かしらの値が設定されている場合には、リセットフラグを立てる
705				if (!(a_injured_funeral_payer == '' || a_injured_funeral_payer == undefined)) {
706					injuredFuneralInfoReset = true;
707				}
708				
709				// 値を設定し直す
710				a_injured_funeral_relation_deceased = $a_injured_funeral_relation_deceased.val();
711				a_injured_funeral_deceased_kjsei = $a_injured_funeral_deceased_kjsei.val();
712				a_injured_funeral_deceased_kjmei = $a_injured_funeral_deceased_kjmei.val();
713				a_injured_funeral_deceased_knsei = $a_injured_funeral_deceased_knsei.val();
714				a_injured_funeral_deceased_knmei = $a_injured_funeral_deceased_knmei.val();
715
716			}
717		}
718
719		// 病気の場合
720		if(insureKind == 2) {
721			// ご報告者=ご契約者 もしくは 死亡の場合、ご報告者と同じを非表示
722			if(a_reporter_relationship == 1 || deadFlg) {
723				// ご報告者と同じを非表示
724				$('label[for="a_ill_compensation_person_01"]').addClass("hide");
725
726				// ご報告者と同じが選択されている場合には、値を初期化
727				if (a_ill_compensation_person == 1) {
728					changeDisabled([$a_ill_relationship,$a_ill_kjsei,$a_ill_kjmei,$a_ill_knsei,$a_ill_knmei], false);
729					setValue([[$a_ill_relationship,''],[$a_ill_kjsei,''],[$a_ill_kjmei,''],[$a_ill_knsei,''],[$a_ill_knmei,'']]);
730					$('#a_ill_compensation_person_01').prop('checked', false);
731					illCompensationInfoReset = false;
732				}
733			} else {
734				$('label[for="a_ill_compensation_person_01"]').removeClass("hide");
735			}
736			
737			// ご報告者=ご契約者 且つ 死亡の場合、ご契約者さまと同じを非表示にし、ご契約者さま以外をデフォルトチェック
738			if(a_reporter_relationship == 1 && deadFlg) {
739				// ご契約者と同じを非表示
740				$('label[for="a_ill_compensation_person_02"]').addClass("hide");
741
742				// ご契約者と同じが選択されている場合には、値を初期化
743				if (a_ill_compensation_person == 2) {
744					changeDisabled([$a_ill_relationship,$a_ill_kjsei,$a_ill_kjmei,$a_ill_knsei,$a_ill_knmei], false);
745					setValue([[$a_ill_relationship,''],[$a_ill_kjsei,''],[$a_ill_kjmei,''],[$a_ill_knsei,''],[$a_ill_knmei,'']]);
746					$('#a_ill_compensation_person_02').prop('checked', false);
747					illCompensationInfoReset = false;
748				}
749				
750				// 報告者以外の項目は存在しないので、デフォルトチェックを入れる
751				$('#a_ill_compensation_person_03').prop('checked', true);
752			} else {
753				$('label[for="a_ill_compensation_person_02"]').removeClass("hide");
754			}
755			
756			// その他の選択肢の制御
757			// 死亡 または 報告者 = 契約者の場合:ご契約者さま以外
758			// 死亡ではない場合:ご報告者さま・ご契約者さま以外
759			if(deadFlg || a_reporter_relationship == 1) {
760				// ご契約者さま以外を表示
761				$('label[for="a_ill_compensation_person_03"]').removeClass("hide");
762				// ご報告者さま・ご契約者さま以外を非表示
763				$('label[for="a_ill_compensation_person_04"]').addClass("hide");
764				// ご契約者さま以外が選択されている場合には、同等の項目にチェックを振り変える
765				if (a_ill_compensation_person == 4) {
766					$('#a_ill_compensation_person_03').prop('checked', true);
767				}
768			} else {
769				// ご契約者さま以外を非表示
770				$('label[for="a_ill_compensation_person_03"]').addClass("hide");
771				// ご報告者さま・ご契約者さま以外を表示
772				$('label[for="a_ill_compensation_person_04"]').removeClass("hide");
773				// ご契約者さま以外が選択されている場合には、同等の項目にチェックを振り変える
774				if (a_ill_compensation_person == 3) {
775					$('#a_ill_compensation_person_04').prop('checked', true);
776				}
777			}
778
779			// 値を設定し直す
780			a_ill_compensation_person = $a_ill_compensation_person.filter(':checked').val();
781
782			// 補償対象者様情報
783			if(a_ill_compensation_person == 1) {
784				// ご報告者さまと同じ
785				changeDisabled([$a_ill_relationship,$a_ill_kjsei,$a_ill_kjmei,$a_ill_knsei,$a_ill_knmei], true);
786				setValue([[$a_ill_relationship,tsuzuki],[$a_ill_kjsei,a_reporter_kjsei],[$a_ill_kjmei,a_reporter_kjmei],[$a_ill_knsei,a_reporter_knsei],[$a_ill_knmei,a_reporter_knmei]]);
787			} else if(a_ill_compensation_person == 2) {
788				// ご契約者さまと同じ
789				changeDisabled([$a_ill_relationship,$a_ill_kjsei,$a_ill_kjmei,$a_ill_knsei,$a_ill_knmei], true);
790				setValue([[$a_ill_relationship,'契約者本人'],[$a_ill_kjsei,a_policy_info_kjsei],[$a_ill_kjmei,a_policy_info_kjmei],[$a_ill_knsei,a_policy_info_knsei],[$a_ill_knmei,a_policy_info_knmei]]);
791			} else if ($a_ill_compensation_person.is($ctlObject) && illCompensationInfoReset){
792				// ご契約者さま・ご報告者さま以外
793				changeDisabled([$a_ill_relationship,$a_ill_kjsei,$a_ill_kjmei,$a_ill_knsei,$a_ill_knmei], false);
794				setValue([[$a_ill_relationship,''],[$a_ill_kjsei,''],[$a_ill_kjmei,''],[$a_ill_knsei,''],[$a_ill_knmei,'']]);
795			}
796
797			// 補償対象者に何かしらの値が設定されている場合には、リセットフラグを立てる
798			if (!(a_ill_compensation_person == '' || a_ill_compensation_person == undefined)) {
799				illCompensationInfoReset = true;
800			}
801
802			// 値を設定し直す
803			a_ill_relationship = $a_ill_relationship.val();
804			a_ill_kjsei = $a_ill_kjsei.val();
805			a_ill_kjmei = $a_ill_kjmei.val();
806			a_ill_knsei = $a_ill_knsei.val();
807			a_ill_knmei = $a_ill_knmei.val();
808
809			// 保険金請求の意思の聴取項目を表示制御
810			if (deadFlg || a_ill_compensation_person == 1 || (a_ill_compensation_person == 2 && a_reporter_relationship == 1)) {
811				$a_ill_show_intention.closest('tr').addClass("hide");
812				$a_ill_show_intention.filter(':checked').prop('checked', false);
813			} else {
814				$a_ill_show_intention.closest('tr').removeClass("hide");
815			}
816		
817			// 病院追加の表示制御
818			if (a_ill_hospital_02 == 1) {
819				showExField($a_ill_hospital_02.attr('name'));
820			} else {
821				hideExField($a_ill_hospital_02.attr('name'));
822			}
823			
824			if (deadFlg) {
825				// 葬祭費用の表示制御
826				if (a_ill_funeral == 1) {
827					showExField($a_ill_funeral.attr('name'));
828				}
829			} else {
830				// 死亡以外の場合は葬祭費用の請求を非表示
831				hideExField($a_ill_funeral.attr('name'));
832			}
833
834			// 入院/手術の表示制御
835			// 入院1の表示制御
836			if(a_ill_hospitalized_flg_01 == 1) {
837				$('.ill_hospitalized_01').removeClass("hide");
838			} else {
839				$('.ill_hospitalized_01').addClass("hide");
840			}
841			
842			// 手術1の表示制御
843			if(a_ill_operation_flg_01 == 1) {
844				$('.ill_operation_01').removeClass("hide");
845			} else {
846				$('.ill_operation_01').addClass("hide");
847			}
848			
849			// 先進医療1の表示制御
850			if(a_ill_advanced_medical_care_flg_01 == 1) {
851				$('.ill_advanced_medical_care_01').removeClass("hide");
852			} else {
853				$('.ill_advanced_medical_care_01').addClass("hide");
854			}
855
856			// 入院2の表示制御
857			if(a_ill_hospitalized_flg_02 == 1) {
858				$('.ill_hospitalized_02').removeClass("hide");
859			} else {
860				$('.ill_hospitalized_02').addClass("hide");
861			}
862			
863			// 手術2の表示制御
864			if(a_ill_operation_flg_02 == 1) {
865				$('.ill_operation_02').removeClass("hide");
866			} else {
867				$('.ill_operation_02').addClass("hide");
868			}
869			
870			// 先進医療2の表示制御
871			if(a_ill_advanced_medical_care_flg_02 == 1) {
872				$('.ill_advanced_medical_care_02').removeClass("hide");
873			} else {
874				$('.ill_advanced_medical_care_02').addClass("hide");
875			}
876
877			// 死亡の場合
878			if(deadFlg) {
879				// 葬儀費用を負担された方の表示制御
880				// お亡くなりになった方が契約者本人の場合、もしくは報告者 = 契約者の場合、契約者本人の選択肢を非表示にする
881				if ( a_ill_compensation_person == 2 ) {
882					$a_ill_funeral_payer.find('option[value="1"]').addClass('hide')
883					// 契約者さま選択中の場合は、未選択にする
884					if($a_ill_funeral_payer.val() == 1){
885						changeDisabled([$a_ill_funeral_deceased_kjsei,$a_ill_funeral_deceased_kjmei,$a_ill_funeral_deceased_knsei,$a_ill_funeral_deceased_knmei], false);
886						setValue([[$a_ill_funeral_payer,''],[$a_ill_funeral_relation_deceased,''],[$a_ill_funeral_deceased_kjsei,''],[$a_ill_funeral_deceased_kjmei,''],[$a_ill_funeral_deceased_knsei,''],[$a_ill_funeral_deceased_knmei,'']]);
887						$a_ill_funeral_relation_deceased.closest('tr').removeClass("hide");
888						a_ill_funeral_payer = $a_ill_funeral_payer.val();
889						illFuneralInfoReset = false;
890					}
891				} else {
892					$a_ill_funeral_payer.find('option[value="1"]').removeClass('hide')
893				}
894				
895				// 葬儀費用を負担された方の名前の表示制御
896				if(a_ill_funeral_payer == 1) {
897					// ご契約者様
898					changeDisabled([$a_ill_funeral_deceased_kjsei,$a_ill_funeral_deceased_kjmei,$a_ill_funeral_deceased_knsei,$a_ill_funeral_deceased_knmei], true);
899					setValue([[$a_ill_funeral_deceased_kjsei,a_policy_info_kjsei],[$a_ill_funeral_deceased_kjmei,a_policy_info_kjmei],[$a_ill_funeral_deceased_knsei,a_policy_info_knsei],[$a_ill_funeral_deceased_knmei,a_policy_info_knmei]]);
900					$a_ill_funeral_relation_deceased.closest('tr').addClass("hide");
901				} else if ($a_ill_funeral_payer.is($ctlObject) && illFuneralInfoReset){
902					changeDisabled([$a_ill_funeral_deceased_kjsei,$a_ill_funeral_deceased_kjmei,$a_ill_funeral_deceased_knsei,$a_ill_funeral_deceased_knmei], false);
903					setValue([[$a_ill_funeral_relation_deceased,''],[$a_ill_funeral_deceased_kjsei,''],[$a_ill_funeral_deceased_kjmei,''],[$a_ill_funeral_deceased_knsei,''],[$a_ill_funeral_deceased_knmei,'']]);
904					$a_ill_funeral_relation_deceased.closest('tr').removeClass("hide");
905				}
906
907				// 葬祭費用負担者に何かしらの値が設定されている場合には、リセットフラグを立てる
908				if (!(a_ill_funeral_payer == '' || a_ill_funeral_payer == undefined)) {
909					illFuneralInfoReset = true;
910				}
911
912				// 値を設定し直す
913				a_ill_funeral_relation_deceased = $a_ill_funeral_relation_deceased.val();
914				a_ill_funeral_deceased_kjsei = $a_ill_funeral_deceased_kjsei.val();
915				a_ill_funeral_deceased_kjmei = $a_ill_funeral_deceased_kjmei.val();
916				a_ill_funeral_deceased_knsei = $a_ill_funeral_deceased_knsei.val();
917				a_ill_funeral_deceased_knmei = $a_ill_funeral_deceased_knmei.val();
918
919			}
920		}
921		
922		// 賠償事故の場合
923		if(insureKind == 3) {
924		}
925
926		// 死亡・葬祭費用の場合
927		if(insureKind == 4) {
928			// 補償対象者選択の表示制御
929			// ご報告者さまと同じを非表示
930			$('label[for="a_funeral_compensation_person_01"]').addClass("hide");
931			// ご報告者さま・ご契約者さま以外を非表示
932			$('label[for="a_funeral_compensation_person_04"]').addClass("hide");
933
934			// ご報告者がご契約者の場合、ご報告者と同じを非表示
935			if(a_reporter_relationship == 1) {
936				$('label[for="a_funeral_compensation_person_02"]').addClass("hide");
937				// ご契約者と同じが選択されている場合には、値を初期化
938				if (a_funeral_compensation_person == 2) {
939					changeDisabled([$a_funeral_relationship,$a_funeral_kjsei,$a_funeral_kjmei,$a_funeral_knsei,$a_funeral_knmei], false);
940					setValue([[$a_funeral_relationship,''],[$a_funeral_kjsei,''],[$a_funeral_kjmei,''],[$a_funeral_knsei,''],[$a_funeral_knmei,'']]);
941					// ご契約者と同じのチェックを外す
942					$('input[name="a_funeral_compensation_person"]').filter('[value="2"]').prop("checked",false);
943				}
944				
945				// 契約者以外をデフォルトチェック
946				$('input[name="a_funeral_compensation_person"]').filter('[value="3"]').prop("checked",true);
947				a_funeral_compensation_person = $a_funeral_compensation_person.filter(':checked').val();
948			} else {
949				$('label[for="a_funeral_compensation_person_02"]').removeClass("hide");
950			}
951			
952			// 補償対象者様情報
953			if(a_funeral_compensation_person == 2) {
954				// ご契約者さまと同じ
955				changeDisabled([$a_funeral_relationship,$a_funeral_kjsei,$a_funeral_kjmei,$a_funeral_knsei,$a_funeral_knmei], true);
956				setValue([[$a_funeral_relationship,'契約者本人'],[$a_funeral_kjsei,a_policy_info_kjsei],[$a_funeral_kjmei,a_policy_info_kjmei],[$a_funeral_knsei,a_policy_info_knsei],[$a_funeral_knmei,a_policy_info_knmei]]);
957			} else if ($a_funeral_compensation_person.is($ctlObject) && funeralCompensationInfoReset){
958				// ご契約者さま以外
959				changeDisabled([$a_funeral_relationship,$a_funeral_kjsei,$a_funeral_kjmei,$a_funeral_knsei,$a_funeral_knmei], false);
960				setValue([[$a_funeral_relationship,''],[$a_funeral_kjsei,''],[$a_funeral_kjmei,''],[$a_funeral_knsei,''],[$a_funeral_knmei,'']]);
961			}
962
963			// 補償対象者に何かしらの値が設定されている場合には、リセットフラグを立てる
964			if (!(a_funeral_compensation_person == '' || a_funeral_compensation_person == undefined)) {
965				funeralCompensationInfoReset = true;
966			}
967
968			// 値を設定し直す
969			a_funeral_kjsei = $a_funeral_kjsei.val();
970			a_funeral_kjmei = $a_funeral_kjmei.val();
971			a_funeral_knsei = $a_funeral_knsei.val();
972			a_funeral_knmei = $a_funeral_knmei.val();
973
974			// 葬儀費用を負担された方の表示制御
975			// お亡くなりになった方が契約者本人の場合、契約者本人の選択肢を非表示にする
976			if ( a_funeral_compensation_person == 2 ) {
977				$a_funeral_payer.find('option[value="1"]').addClass('hide')
978				// 契約者さま選択中の場合は、未選択にする
979				if($a_funeral_payer.val() == 1){
980					$a_funeral_payer.val('');
981					changeDisabled([$a_funeral_deceased_kjsei,$a_funeral_deceased_kjmei,$a_funeral_deceased_knsei,$a_funeral_deceased_knmei], false);
982					setValue([[$a_funeral_relation_deceased,''],[$a_funeral_deceased_kjsei,''],[$a_funeral_deceased_kjmei,''],[$a_funeral_deceased_knsei,''],[$a_funeral_deceased_knmei,'']]);
983					a_funeral_payer = $a_funeral_payer.val();
984					$a_funeral_relation_deceased.closest('tr').removeClass("hide");
985					funeralInfoReset = false;
986				}
987			} else {
988				$a_funeral_payer.find('option[value="1"]').removeClass('hide')
989			}
990			
991			// 葬儀費用を負担された方の名前の表示制御
992			if(a_funeral_payer == 1) {
993				// ご契約者様
994				changeDisabled([$a_funeral_deceased_kjsei,$a_funeral_deceased_kjmei,$a_funeral_deceased_knsei,$a_funeral_deceased_knmei], true);
995				setValue([[$a_funeral_deceased_kjsei,a_policy_info_kjsei],[$a_funeral_deceased_kjmei,a_policy_info_kjmei],[$a_funeral_deceased_knsei,a_policy_info_knsei],[$a_funeral_deceased_knmei,a_policy_info_knmei]]);
996				$a_funeral_relation_deceased.closest('tr').addClass("hide");
997			} else if ($a_funeral_payer.is($ctlObject) && funeralInfoReset){
998				changeDisabled([$a_funeral_deceased_kjsei,$a_funeral_deceased_kjmei,$a_funeral_deceased_knsei,$a_funeral_deceased_knmei], false);
999				setValue([[$a_funeral_relation_deceased,''],[$a_funeral_deceased_kjsei,''],[$a_funeral_deceased_kjmei,''],[$a_funeral_deceased_knsei,''],[$a_funeral_deceased_knmei,'']]);
1000				$a_funeral_relation_deceased.closest('tr').removeClass("hide");
1001			}
1002
1003			// 葬祭費用負担者に何かしらの値が設定されている場合には、リセットフラグを立てる
1004			if (!(a_funeral_payer == '' || a_funeral_payer == undefined)) {
1005				funeralInfoReset = true;
1006			}
1007
1008			// 値を設定し直す
1009			a_funeral_relation_deceased = $a_funeral_relation_deceased.val();
1010			a_funeral_deceased_kjsei = $a_funeral_deceased_kjsei.val();
1011			a_funeral_deceased_kjmei = $a_funeral_deceased_kjmei.val();
1012			a_funeral_deceased_knsei = $a_funeral_deceased_knsei.val();
1013			a_funeral_deceased_knmei = $a_funeral_deceased_knmei.val();
1014
1015		}
1016
1017		// その他(携行品など)の場合
1018		if(insureKind == 5) {
1019		}
1020		
1021		// ----------------------------------
1022		// STEP3処理
1023		// ----------------------------------
1024		// 書類の送付先
1025		// 送付先の選択制御
1026		
1027		// 補償対象者の情報を取得
1028		var compensation_person = "";
1029
1030		if(insureKind == 1) {
1031			//ケガ
1032			compensation_person = a_injured_compensation_person;
1033		} else if (insureKind == 2) {
1034			//病気
1035			compensation_person = a_ill_compensation_person;
1036		} else if (insureKind == 4) {
1037			//死亡
1038			compensation_person = a_funeral_compensation_person;
1039		}
1040
1041		// 書類の送付先の表示を初期化
1042		// 補償対象者さま(ケガ・病気等をされた方)
1043		$('label[for="a_destination_person_type_01"]').removeClass("hide");
1044		// ご契約者さま
1045		$('label[for="a_destination_person_type_02"]').removeClass("hide");
1046		// ご報告者さま
1047		$('label[for="a_destination_person_type_03"]').removeClass("hide");
1048		
1049		// その他の項目は、どれか一つだけの表示なので一旦すべて消す
1050		// 補償対象者さま以外
1051		$('label[for="a_destination_person_type_04"]').addClass("hide");
1052		// ご契約者さま以外
1053		$('label[for="a_destination_person_type_05"]').addClass("hide");
1054		// ご報告者さま以外
1055		$('label[for="a_destination_person_type_06"]').addClass("hide");
1056		// 補償対象者さま・ご契約者さま以外
1057		$('label[for="a_destination_person_type_07"]').addClass("hide");
1058		// 補償対象者さま・ご報告者さま以外
1059		$('label[for="a_destination_person_type_08"]').addClass("hide");
1060		// ご契約者さま・ご報告者さま以外
1061		$('label[for="a_destination_person_type_09"]').addClass("hide");
1062		// 補償対象者さま・ご契約者さま・ご報告者さま以外
1063		$('label[for="a_destination_person_type_10"]').addClass("hide");
1064		var $ohterTarget = "";
1065		
1066		/** その他の表示制御 **/
1067		// 請求内容が、賠償事故 または その他の場合
1068		if (insureKind == 3 || insureKind == 5) {
1069			// 報告者 = 契約者 の場合はとそれ以外で分岐
1070			if (a_reporter_relationship == 1) {
1071				$('label[for="a_destination_person_type_05"]').removeClass("hide");
1072				$ohterTarget = $('#a_destination_person_type_05');
1073			} else {
1074				$('label[for="a_destination_person_type_09"]').removeClass("hide");
1075				$ohterTarget = $('#a_destination_person_type_09');
1076			}
1077		} else {
1078			// 死亡しているかで分岐
1079			if (deadFlg) {
1080				// 報告者 = 契約者さまの場合
1081				if (a_reporter_relationship == 1) {
1082					$('label[for="a_destination_person_type_05"]').removeClass("hide");
1083					$ohterTarget = $('#a_destination_person_type_05');
1084				} else {
1085					// 補償対象者 = ご契約者さまの場合
1086					if (compensation_person == 2) {
1087						$('label[for="a_destination_person_type_06"]').removeClass("hide");
1088						$ohterTarget = $('#a_destination_person_type_06');
1089					} else {
1090						$('label[for="a_destination_person_type_09"]').removeClass("hide");
1091						$ohterTarget = $('#a_destination_person_type_09');
1092					}
1093				}
1094			} else {
1095				// 報告者 = 契約者さまの場合
1096				if (a_reporter_relationship == 1) {
1097					// 補償対象者 = ご契約者さまの場合
1098					if (compensation_person == 2) {
1099						$('label[for="a_destination_person_type_04"]').removeClass("hide");
1100						$ohterTarget = $('#a_destination_person_type_04');
1101					} else {
1102						$('label[for="a_destination_person_type_07"]').removeClass("hide");
1103						$ohterTarget = $('#a_destination_person_type_07');
1104					}
1105				} else {
1106					// 補償対象者 = ご報告者さまの場合
1107					if (compensation_person == 1) {
1108						$('label[for="a_destination_person_type_07"]').removeClass("hide");
1109						$ohterTarget = $('#a_destination_person_type_07');
1110					} else if (compensation_person == 2) {
1111						// 補償対象者 = ご契約者さまの場合
1112						$('label[for="a_destination_person_type_08"]').removeClass("hide");
1113						$ohterTarget = $('#a_destination_person_type_08');
1114					} else {
1115						$('label[for="a_destination_person_type_10"]').removeClass("hide");
1116						$ohterTarget = $('#a_destination_person_type_10');
1116
1117					}
1118				}
1119			}
1120		}
1121		
1122		// 送付先の選択値が、未選択、補償対象者さま、ご契約者さま、ご報告者さま 以外の場合は設定値を振り替える
1123		if (a_destination_person_type != undefined && a_destination_person_type != 1 && 
1124							a_destination_person_type != 2 && a_destination_person_type != 3) {
1125				$ohterTarget.prop('checked', true);
1126		}
1127		
1128		/** その他以外の選択肢の表示制御 **/
1129		// 死亡している または 請求内容が、賠償事故 または その他の場合
1130		if (deadFlg || insureKind == 3 || insureKind == 5 ) {
1131			// 選択肢を非表示
1132			$('label[for="a_destination_person_type_01"]').addClass("hide");
1133			// labelは01でも、valueは3(補償対象者さま(ケガ・病気等をされた方))
1134			if (a_destination_person_type == 3) {
1135				changeDisabled([$a_destination_kjsei,$a_destination_kjmei,$a_destination_knsei,$a_destination_knmei], false);
1136				setValue([[$a_destination_kjsei,''],[$a_destination_kjmei,''],[$a_destination_knsei,''],[$a_destination_knmei,'']]);
1137				$('#a_destination_person_type_01').prop('checked', false);
1138				destinationInfoReset = false;
1139			}
1140		}
1141		
1142		// 補償対象者 = ご契約者の場合
1143		if (compensation_person == 2) {
1144			// 選択肢を非表示
1145			$('label[for="a_destination_person_type_02"]').addClass("hide");
1146			if (a_destination_person_type == 2) {
1147				changeDisabled([$a_destination_kjsei,$a_destination_kjmei,$a_destination_knsei,$a_destination_knmei], false);
1148				setValue([[$a_destination_kjsei,''],[$a_destination_kjmei,''],[$a_destination_knsei,''],[$a_destination_knmei,'']]);
1149				$('#a_destination_person_type_02').prop('checked', false);
1150				destinationInfoReset = false;
1151			}
1152		}
1153		
1154		// 報告者 = 契約者 または 補償対象者 = ご報告者の場合
1155		if (a_reporter_relationship == 1 || compensation_person == 1) {
1156			// 選択肢を非表示
1157			$('label[for="a_destination_person_type_03"]').addClass("hide");
1158			// labelは03でも、valueは1(ご報告者さま)
1159			if (a_destination_person_type == 1) {
1160				changeDisabled([$a_destination_kjsei,$a_destination_kjmei,$a_destination_knsei,$a_destination_knmei], false);
1161				setValue([[$a_destination_kjsei,''],[$a_destination_kjmei,''],[$a_destination_knsei,''],[$a_destination_knmei,'']]);
1162				$('#a_destination_person_type_03').prop('checked', false);
1163				destinationInfoReset = false;
1164			}
1165		}
1166		
1167		// 書類の送付先に選択に伴う制御
1168		a_destination_person_type = $a_destination_person_type.filter(':checked').val();
1169		if(a_destination_person_type == 1) {
1170			// ご報告者さま
1171			changeDisabled([$a_destination_kjsei,$a_destination_kjmei,$a_destination_knsei,$a_destination_knmei], true);
1172			setValue([[$a_destination_kjsei,a_reporter_kjsei],[$a_destination_kjmei,a_reporter_kjmei],[$a_destination_knsei,a_reporter_knsei],[$a_destination_knmei,a_reporter_knmei]]);
1173		} else if (a_destination_person_type == 2) {
1174			// ご契約者さま
1175			changeDisabled([$a_destination_kjsei,$a_destination_kjmei,$a_destination_knsei,$a_destination_knmei], true);
1176			setValue([[$a_destination_kjsei,a_policy_info_kjsei],[$a_destination_kjmei,a_policy_info_kjmei],[$a_destination_knsei,a_policy_info_knsei],[$a_destination_knmei,a_policy_info_knmei]]);
1177		} else if (a_destination_person_type == 3){
1178			//補償対象者さま(ケガ・病気などをされた方)
1179			changeDisabled([$a_destination_kjsei,$a_destination_kjmei,$a_destination_knsei,$a_destination_knmei], true);
1180
1181			var target_kjsei = '';
1182			var target_kjmei = '';
1183			var target_knsei = '';
1184			var target_knmei = '';
1185			
1186			if(insureKind == 1) {
1187				//ケガ
1188				target_kjsei = a_injured_kjsei;
1189				target_kjmei = a_injured_kjmei;
1190				target_knsei = a_injured_knsei;
1191				target_knmei = a_injured_knmei;
1192			} else if (insureKind == 2) {
1193				//病気
1194				target_kjsei = a_ill_kjsei;
1195				target_kjmei = a_ill_kjmei;
1196				target_knsei = a_ill_knsei;
1197				target_knmei = a_ill_knmei;
1198				
1199			} else if (insureKind == 4) {
1200				//死亡
1201				target_kjsei = a_funeral_kjsei;
1202				target_kjmei = a_funeral_kjmei;
1203				target_knsei = a_funeral_knsei;
1204				target_knmei = a_funeral_knmei;
1205			}
1206			
1207			setValue([[$a_destination_kjsei,target_kjsei],[$a_destination_kjmei,target_kjmei],[$a_destination_knsei,target_knsei],[$a_destination_knmei,target_knmei]]);
1208		} else if ($a_destination_person_type.is($ctlObject) && destinationInfoReset){
1209			changeDisabled([$a_destination_kjsei,$a_destination_kjmei,$a_destination_knsei,$a_destination_knmei], false);
1210			setValue([[$a_destination_kjsei,''],[$a_destination_kjmei,''],[$a_destination_knsei,''],[$a_destination_knmei,'']]);
1211		}
1212		
1213		// 送付先が選択されてる場合は、リセットフラグを立てる
1214		if (!(a_destination_person_type == '' || a_destination_person_type == undefined)) {
1215			destinationInfoReset = true;
1216		}
1217		
1218		 // 書類の送付先下の注釈の調整
1219		if(deadFlg || insureKind == 3 || insureKind == 5) {
1220			// 補償対象者の文言を非表示
1221			$('.compensation_person').addClass("hide");
1222		} else {
1223			// 補償対象者の文言を表示
1224			$('.compensation_person').removeClass("hide");
1225		}
1226		
1227		// 日中連絡先の表示制御
1228		$('label[for="a_contact_person_type_01"]').removeClass("hide");
1229		$('label[for="a_contact_person_type_02"]').removeClass("hide");
1230
1231		/** 3:ご報告者さま以外 **/
1232		$('label[for="a_contact_person_type_03"]').addClass("hide");
1233		/** 4:ご契約者さま以外 **/
1234		$('label[for="a_contact_person_type_04"]').addClass("hide");
1235		/** 5:ご契約者さま・ご報告者さま以外 **/
1236		$('label[for="a_contact_person_type_05"]').addClass("hide");
1237		var $contactOhterTarget = "";
1238		
1239		/** その他の表示制御 **/
1240		if(a_reporter_relationship == 1) {
1241			// ご契約者さま以外を表示
1242			$('label[for="a_contact_person_type_04"]').removeClass("hide");
1243			$contactOhterTarget = $('#a_contact_person_type_04');
1244		} else {
1245			if (compensation_person == 2 && deadFlg) {
1246				// ご報告者さま以外を表示
1247				$('label[for="a_contact_person_type_03"]').removeClass("hide");
1248				$contactOhterTarget = $('#a_contact_person_type_03');
1249			} else {
1250				// ご契約者さま・ご報告者さま以外を表示
1251				$('label[for="a_contact_person_type_05"]').removeClass("hide");
1252				$contactOhterTarget = $('#a_contact_person_type_05');
1253			}
1254		}
1255		
1256		// 連絡先の選択値が、未選択、ご契約者さま、ご報告者さま 以外の場合は設定値を振り替える
1257		if (a_contact_person_type != undefined && a_contact_person_type != 1 && a_contact_person_type != 2) {
1258				$contactOhterTarget.prop('checked', true);
1259		}
1260
1261		// 報告者=契約者の場合、報告者の選択肢を非表示
1262		if(a_reporter_relationship == 1) {
1263			$('label[for="a_contact_person_type_01"]').addClass("hide");
1264			
1265			// 報告者が選択されている場合には値をクリアする
1266			if (a_contact_person_type == 1) {
1267				changeDisabled([$a_contact_relationship,$a_contact_kjsei,$a_contact_kjmei,$a_contact_knsei,$a_contact_knmei], false);
1268				setValue([[$a_contact_relationship,''],[$a_contact_kjsei,''],[$a_contact_kjmei,''],[$a_contact_knsei,''],[$a_contact_knmei,'']]);
1269				$('#a_contact_person_type_01').prop('checked', false);
1270				contactInfoReset = false;
1271			}
1272		}
1273		
1274		// 死亡且つ、補償対象者さまが「ご契約者」の場合、ご契約者を非表示
1275		if(deadFlg && compensation_person == 2) {
1276			$('label[for="a_contact_person_type_02"]').addClass("hide");
1277			// 契約者が選択されている場合には値をクリアする
1278			if (a_contact_person_type == 2) {
1279				changeDisabled([$a_contact_relationship,$a_contact_kjsei,$a_contact_kjmei,$a_contact_knsei,$a_contact_knmei], false);
1280				setValue([[$a_contact_relationship,''],[$a_contact_kjsei,''],[$a_contact_kjmei,''],[$a_contact_knsei,''],[$a_contact_knmei,'']]);
1281				$('#a_contact_person_type_02').prop('checked', false);
1282				contactInfoReset = false;
1283			}
1284		}
1285		
1286	    // 日中連絡先の選択に伴う制御
1287		a_contact_person_type = $a_contact_person_type.filter(':checked').val();
1288		if(a_contact_person_type == 1) {
1289			// ご報告者さま
1290			changeDisabled([$a_contact_relationship,$a_contact_kjsei,$a_contact_kjmei,$a_contact_knsei,$a_contact_knmei], true);
1291			setValue([[$a_contact_relationship,tsuzuki],[$a_contact_kjsei,a_reporter_kjsei],[$a_contact_kjmei,a_reporter_kjmei],[$a_contact_knsei,a_reporter_knsei],[$a_contact_knmei,a_reporter_knmei]]);
1292		} else if (a_contact_person_type == 2) {
1293			// ご契約者さま
1294			changeDisabled([$a_contact_relationship,$a_contact_kjsei,$a_contact_kjmei,$a_contact_knsei,$a_contact_knmei], true);
1295			setValue([[$a_contact_relationship,'契約者本人'],[$a_contact_kjsei,a_policy_info_kjsei],[$a_contact_kjmei,a_policy_info_kjmei],[$a_contact_knsei,a_policy_info_knsei],[$a_contact_knmei,a_policy_info_knmei]]);
1296		} else if ($a_contact_person_type.is($ctlObject) && contactInfoReset){
1297			changeDisabled([$a_contact_relationship,$a_contact_kjsei,$a_contact_kjmei,$a_contact_knsei,$a_contact_knmei], false);
1298			setValue([[$a_contact_relationship,''],[$a_contact_kjsei,''],[$a_contact_kjmei,''],[$a_contact_knsei,''],[$a_contact_knmei,'']]);
1299		}
1300		
1301		// 日中連絡先が選択されてる場合は、リセットフラグを立てる
1302		if (!(a_contact_person_type == '' || a_contact_person_type == undefined)) {
1303			contactInfoReset = true;
1304		}
1305		
1306		// ----------------------------------
1307		// STEP4処理
1308		// ----------------------------------
1309		// 保険金ご請求情報登録完了メール
1310		// 希望する場合、メールアドレスの入力欄を表示
1311		if(a_reporter_reply_mail_confirm_val == '1') {
1312			$('.mail').removeClass("hide");
1313		} else {
1314			$('.mail').addClass("hide");
1315		}
1316	}
1317
1318	// オブジェクトへの値設定
1319	function setValue (pairs) {
1320		pairs.forEach(([obj,val]) => $(obj).val(val));
1321	}
1322	
1323	// 入力欄の有効/無効化処理
1324	function changeDisabled(objects, disabledFlg) {
1325		$.each(objects, function(index, object) {
1326			if(disabledFlg) {
1327				object.addClass('disabled');
1328				object.attr('readonly',true);
1329			} else {
1330				object.removeClass('disabled');
1331				object.attr('readonly',false);
1332			}
1333		}); 
1334	}
1335
1336	// 次へボタン押下時の処理
1337	$('.nextBtn.step').on('click', function() {
1338		// 二度押し防止
1339		if (isProcessing) {
1340			return false;
1341		} else {
1342			isProcessing = true;
1343			// ローディングを表示
1344			$('.loaderWrap').removeClass("hide");
1345			$('body').addClass('modal-open');
1346		}
1347		
1348		// ajaxにて入力内容を送信してバリデーションを行う。
1349		document.OCAHIN01.submitButton.value='next_step';
1350		// 現在のステップのinput情報を収集
1351		let formData = $('form').find('.step' + nowStep).find(':input'); 
1352		// 共通の非表示項目を収集
1353		let formHiddenData = $('form').find('input[type="hidden"]'); 
1354		// 送信するデータを整形
1355		let postData = formData.serialize() + '&' + formHiddenData.serialize() + '&step=' + nowStep;
1356		// ajaxの送信先のURLを取得
1357		let targetURL = $('form[name="OCAHIN01"]').attr('action')
1358		
1359		// エラー情報のリセット
1360		$('.page-head .error-message').addClass("hide");
1361		$('form').find('.step' + nowStep + ' .has-error').removeClass('has-error')
1362		$('form').find('.step' + nowStep + ' .error_message').text('');
1363		
1364		$.ajax({
1365		    beforeSend: function(xhr){
1366		        xhr.overrideMimeType("text/html; charset=UTF-8");
1367		    },
1368		    url: targetURL,
1369		    type: 'POST',
1370		    dataType: 'json',
1371		    data:  postData,
1372		    timeout: 5000,
1373		    success: function(response,xhr,jqXHR) {
1374		    	Object.keys(response).forEach(function (stepKey){
1375		    		var items = response[stepKey]
1376		    		// エラーがある場合には、ステップ遷移せず、エラー内容を対応するフィールドに表示
1377		    		if (items.length == 0) {
1378		    			// 最終ステップの場合は、フォームを送信する
1379						if (nowStep == lastStep) {
1380							document.OCAHIN01.submitButton.value='b_next';
1381				    		$('form[name="OCAHIN01"]').submit();
1382						} else {
1383							nowStep++;
1384							sectionCtrol();
1385						}
1386		    		} else {
1387				        items.forEach(function (item){
1388							// 対象のフィールドにエラーメッセージを表示
1389							$('.error_message.' + item.errorFieldName).append(item.errorMessage + '<br>')
1390							// エラーに対応するフィールドを赤くする
1391					        item.fieldName.forEach(function (field){
1392					        	var $ele = $('[name="' + field + '"]');
1393					        	// ラジオボタンの場合は、入力フィールドが赤くならないので、trごと赤くする。
1394					        	if($ele.is(":radio")) {
1395									$ele.closest("tr").addClass("has-error");
1396					        	} else {
1397									$ele.addClass("has-error");
1398					        	}
1399					        });
1400				        });
1401						// 画面の上部に戻る
1402						const position = $('.page-head .error-message').offset().top;
1403						$('html, body').animate({scrollTop: position}, 'slow');
1404						// 画面の上部に共通のエラーメッセージを表示
1405						$('.page-head .error-message').removeClass("hide");
1406		    		}
1407		    		// フォーカスをコンテンツの先頭に戻す
1408					$('section.step'+ nowStep).focus();
1409		    	});
1410		  	},
1411		    error: function(xhr, status, error) {
1412				document.location.href = "/err_sys.html";
1413		    }
1414		}).always(function(){
1415			// 処理フラグを倒す
1416			isProcessing = false;
1417			$('body').removeClass('modal-open');
1418			$('.loaderWrap').addClass("hide");
1419		});
1420		
1421		return false;
1422	});
1423	
1424	// 戻るボタン押下時の処理
1425	$('.prevBtn').on('click', function() {
1426		//エラーのリセット
1427		$('.page-head .error-message').addClass("hide");
1428		$('form').find('.step' + nowStep + ' .has-error').removeClass('has-error')
1429		$('form').find('.step' + nowStep + ' .error_message').text('');
1430		
1431		nowStep--;
1432		sectionCtrol();
1433		// フォーカスをコンテンツの先頭に戻す
1434		$('section.step'+ nowStep).focus();
1435		return false;
1436	});
1437	
1438    /** 文字カウントの機能 **/
1439	function createCounterText($object) {
1440		var text = cssProtection($object.val());
1441		var nowLength = text.length;
1442		var maxLength = $object.attr('maxlength');
1443		var lengthText = maxLength + '文字以内(' + nowLength + ' / ' + maxLength + ')';
1444		var $counter = $object.siblings('.text-counter');
1445		$counter.text(lengthText);
1446	}
1447
1448	$('.count-target').each(function(index, element){
1449		createCounterText($(element));
1450	});
1451
1452	$('.count-target').on('input',function() {
1453		createCounterText($(this));
1454	});
1455	
1456	// 病院、葬祭費用の追加フィールドの非表示
1457	function hideExField(target) {
1458		$('[data-contents="' + target + '"]').addClass('off');
1459		$('[data-contents="' + target + '"]').removeClass("on");
1460		$('.' + target).addClass("hide");
1461	}
1462	
1463	// 病院、葬祭費用の追加フィールドの表示
1464	function showExField(target) {
1465		$('[data-contents="' + target + '"]').addClass('on');
1466		$('[data-contents="' + target + '"]').removeClass("off");
1467		$('.' + target).removeClass("hide");
1468	}
1469
1470	// 病院追加が押下された場合の処理
1471	$('.add-button').on('click', function() {
1472		var contents = $(this).data('contents');
1473		var display = $('[name="' + contents + '"]');
1474		if(display.val() == 1) {
1475			// 病院2が表示状態 > 非表示の場合
1476			hideExField(contents);
1477			$('[name="' + contents + '"]').val("0");
1478		} else if (display.val() == 0) {
1479			// 病院2が非表示状態 > 表示の場合
1480			showExField(contents);
1481			$('[name="' + contents + '"]').val("1");
1482		}
1483		return false;
1484	});
1485
1486	// インフォメーションアイコンのモーダル表示
1487	$('.info-open').on('click', function() {
1488		$('body').addClass('modal-open');
1489		$('.modal_bg').removeClass('hide');
1490		$('.modal.infomation').removeClass('hide');
1491		$('.modal.infomation .modal_body_inner').addClass('hide');
1492		var info = $(this).data('info');
1493		$('.' + info).removeClass('hide');
1494		return false;
1495	});
1496
1497	// 住所検索が押下された際の処理
1498	$('.add-search').on('click', function() {
1499		// 二度押し防止
1500		if (isProcessing) {
1501			return false;
1502		} else {
1503			isProcessing = true;
1504			// ローディングを表示
1505			$('.loaderWrap').removeClass("hide");
1506			$('body').addClass('modal-open');
1507		}
1508
1509		// 選択値の出力先のフィールド情報を設定
1510		var serachType = $(this).data('serach-type');
1511		if (serachType == "1") {
1512			targetZip1 = a_damaged_zip1;
1513			targetZip2 = a_damaged_zip2;
1514			targetPrefecture = a_damaged_add_prefecture;
1515			targetAddDetail = a_damaged_add_detail;
1516		} else if (serachType == "2") {
1517			targetZip1 = a_destination_zip1;
1518			targetZip2 = a_destination_zip2;
1519			targetPrefecture = a_destination_add_prefecture;
1520			targetAddDetail = a_destination_add_detail;
1521		} else {
1522			return false;
1523		}
1524		
1525		document.OCAHIN01.submitButton.value = 'add_search';
1526		let formData = $('form').find('.step' + nowStep).find(':input'); 
1527		let formHiddenData = $('form').find('input[type="hidden"]'); 
1528		// 送信するデータを整形
1529		let postData = formData.serialize() + '&' + formHiddenData.serialize() + '&step=' + nowStep;
1530		// ajaxの送信先のURLを取得
1531		let targetURL = $('form[name="OCAHIN01"]').attr('action')
1532
1533		// 現在操作している郵便番号フィールドの情報を取得
1534		var zipWrap = $(this).parents('td');
1535		// エラーの削除
1536		zipWrap.find('.has-error').removeClass('has-error')
1537		zipWrap.find('.error_message').text('');
1538
1539		// ajaxにて表示する情報を取得
1540		$.ajax({
1541		    beforeSend: function(xhr){
1542		        xhr.overrideMimeType("text/html; charset=UTF-8");
1543		    },
1544		    url: targetURL,
1545		    type: 'POST',
1546		    dataType: 'json',
1547		    data:  postData,
1548		    timeout: 5000,
1549		    success: function(response,xhr,jqXHR) {
1550		    	// 住所情報がある場合は、取得した情報をモーダルに埋め込む
1551		    	// ない場合は、エラーメッセージを表示
1552		    	if (response.HTML != undefined) {
1553		    		// モーダルの郵便番号情報設定
1554		    		var zipCode = zipWrap.find("input")[0].value + "-" + zipWrap.find("input")[1].value;
1555		    		$('.modal.add-search-result .zip span.zip-code').text(zipCode);
1556
1557					// モーダルを表示
1558					$('body').addClass('modal-open');
1559					$('.modal_bg').removeClass('hide');
1560					$('.modal.add-search-result').removeClass('hide');
1561					
1562		    		// モーダルのselectボックスの選択肢を作成
1563		    		$('select#kjad1').empty();
1564		    		$('select#kjad1').append(response.HTML);
1565		    		
1566		    	} else {
1567					// エラーがある場合には、エラーメッセージを表示
1568					var key = Object.keys(response)[0];
1569					$(targetZip1).addClass('has-error')
1570					$(targetZip2).addClass('has-error')
1571					zipWrap.find('.error_message').text(response[key]);
1572		    	}
1573		  	},
1574		    error: function(xhr, status, error) {
1575	    		document.location.href = "/err_sys.html";
1576		    }
1577		}).always(function(){
1578			// 処理フラグを倒す
1579			isProcessing = false;
1580			$('body').removeClass('modal-open');
1581			$('.loaderWrap').addClass("hide");
1582		});
1583		
1584		return false;
1585	});
1586
1587	// 住所検索モーダルのcloseが押下された際の処理
1588	$('.modal-close').on('click', function() {
1589		modalClose();
1590		return false;
1591	});
1592	
1593	// 住所検索モーダルのclose
1594	function modalClose() {
1595		$('body').removeClass('modal-open');
1596		$('.modal_bg').addClass('hide');
1597		$('.modal').addClass('hide');
1598	}
1599	
1600	// 「入力欄に表示」ボタンの制御
1601	$('#kjad1').on('change', function() {
1602		var kjadval = $(this).val();
1603		if (kjadval != "") {
1604			$('.modal .button .submit').addClass('active');
1605		} else {
1606			$('.modal .button .submit').removeClass('active');
1607		}
1608	});
1609	
1610	// 「入力欄に表示」が押下された際の処理
1611	$('.modal .submit').on('click', function() {
1612		var selValue = $('select#kjad1').val();
1613		if (selValue != "") {
1614			// 郵便番号の出力
1615			var selZip = $('select#kjad1 option:selected').data('zip');
1616			var zip1 = selZip.toString().substring(0,3);
1617			var zip2 = selZip.toString().substring(3,7);
1618			$(targetZip1).val(zip1);
1619			$(targetZip2).val(zip2);
1620			// 都道府県の情報を出力
1621			var add1 = $('select#kjad1 option:selected').data('add1');
1622			$(targetPrefecture).val(add1);
1623			// 住所の情報を出力
1624			var add2 = $('select#kjad1 option:selected').data('add2');
1625			$(targetAddDetail).val(add2);
1626			
1627			$(targetPrefecture).trigger('input');
1628			$(targetAddDetail).trigger('input');
1629			modalClose();
1630		}
1631		return false;
1632	});
1633	
1634	/**
1635	** 月に合わせて、日付の表示を変更
1636	**/
1637	$('.year, .month').on('change',function() {
1638		var lastday = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
1639		var year = $(this).siblings('.year').addBack('.year').val();
1640		var month = $(this).siblings('.month').addBack('.month').val();
1641		var $dayObject = $(this).siblings('.day');
1642		var day = $dayObject.val();
1643
1644		if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)){
1645			lastday[1] = 29;
1646		}
1647	
1648		var lastday = lastday[month - 1];
1649		
1650		// 不要な選択肢を消す
1651		$dayObject.children('option:gt(' + lastday + ')').remove();
1652		// 不足している選択肢を足す
1653		for(let i = $dayObject.children('option').length; i <= lastday; i++) {
1654			$dayObject.append(`<option value="${i}">${i}</option>`);
1655		}
1656		
1657		if( day != "" && day > lastday) {
1658			$dayObject.val(lastday);
1659		}
1660	});
1661	
1662	/**
1663	** カレンダー機能
1664	**/
1665	$( ".datepicker" ).click(function() {
1666		const $calendar = $(this).siblings('[name="calendar"]');
1667		
1668		var pastYear = $(this).data('pastYear');
1669		
1670		// 死亡の場合はすべての項目で未来日入力はなくなる。
1671		// また、現在の月が10月以前の場合の場合も未来日入力不可
1672		var futureYear = $(this).data('futureYear');
1673		var deadFlg = $deadFlg.prop("checked");
1674		var now = new Date();
1675		var month = now.getMonth() + 1;
1676		if (deadFlg ||  month < 10) {
1677			futureYear = 0;
1678		}
1679		
1680		var thisYear = new Date().getFullYear();
1681		var minDate = new Date(thisYear - pastYear, 0, 1);
1682		var maxDate = new Date(thisYear + futureYear,11, 31);
1683		
1684		$calendar.datepicker("option",{
1685			minDate: minDate
1686			,maxDate: maxDate
1687		});
1688		$calendar.datepicker("show");
1689		
1690		return false;
1691	});
1692
1693	$('[name="calendar"]').datepicker({
1694		dateFormat : "yy/m/d"
1695		,prevText:"前月"
1696		,nextText:"翌月"
1697		,monthNames:['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月']
1698		,monthNamesShort:['1','2','3','4','5','6','7','8','9','10','11','12']
1699		,dayNamesMin: ['日', '月', '火', '水', '木', '金', '土']
1700		,yearSuffix:'å¹´'
1701		,showOtherMonths:true
1702		,selectOtherMonths:true
1703		,showMonthAfterYear:true
1704		
1705		,onChangeMonthYear:function(year, month, inst) {
1706			setTimeout(function() {
1707				addYearButton(inst);
1708;			}, 0);
1709		}
1710		,beforeShow : function(input,inst){
1711			//開く前に日付を上書き
1712			var year = $(this).siblings('div.group.calender').children(".year").val();
1713			var month = $(this).siblings('div.group.calender').children(".month").val();
1714			var day = $(this).siblings('div.group.calender').children(".day").val();
1715			
1716			// いずれかに入力がある場合、初期処理。
1717			if(!(year == "" && month == "" && day == "")) {
1718				// 値設定が無い場合の初期値設定
1719				if (year == "") {
1720					year = new Date().getFullYear();
1721				}
1722				
1723				if (month == "") {
1724					month = 1;
1725				}
1726				
1727				if (day == "") {
1728					day = 1;
1729				}
1730			}
1731			
1732			$(this).datepicker( "setDate" , year + "/" + month + "/" + day);
1733			
1734			setTimeout(function() {
1735				addYearButton(inst);
1736;			}, 0);
1737		},
1738		onSelect: function(dateText, inst){
1739			//カレンダー確定時にフォームに反映
1740			var dates = dateText.split('/');
1741			$(this).siblings('div.group.calender').children(".year").val(dates[0]);
1742			$(this).siblings('div.group.calender').children(".month").val(dates[1]);
1743			$(this).siblings('div.group.calender').children(".day").val(dates[2]);
1744			$(this).siblings('.datepicker').focus();
1745		}
1746	});
1747	
1748	function addYearButton(inst) {
1749		var dpHeader = $(inst.dpDiv).find('.ui-datepicker-header');
1750		var nextMonth = dpHeader.find('.ui-datepicker-next');
1751		var prevMonth = dpHeader.find('.ui-datepicker-prev');
1752		dpHeader.find('.prev-year, .next-year').remove();
1753		var $yearSelect = $(inst.dpDiv).find(".ui-datepicker-year");
1754		var currentYear = parseInt($yearSelect.text(), 10);
1755		var selectObj = document.createElement("select");
1756		var optionObj = document.createElement("option");
1757		var minDate = $.datepicker._getMinMaxDate(inst, 'min');
1758		var maxDate = $.datepicker._getMinMaxDate(inst, 'max');
1759		var selYear = inst.drawYear;
1760		var selMonth = inst.drawMonth;
1761		selMonth = ( '00' + selMonth ).slice( -2 );
1762		
1763		$('<a>', {
1764			'class':'prev-year ui-datepicker-prev ui-corner-all',
1765			'href': '#',
1766			'aria-label':'前年'
1767		}).html('<span id="prev-year">前年</span>
1767').prependTo(dpHeader).click(function(e) {
1768			e.preventDefault();
1769			var prevYear = currentYear - 1;
1770			optionObj.value = prevYear;
1771			optionObj.selected = true;
1772			selectObj.appendChild(optionObj);
1773			$.datepicker._selectMonthYear(inst.input[0], selectObj, "Y")
1774		});
1775		
1776		$('<a>', {
1777			'class':'next-year ui-datepicker-next ui-corner-all',
1778			'href': '#',
1779			'aria-label':'翌年'
1780		}).html('<span id="next-year">翌年</span>').click(function(e) {
1781			e.preventDefault();
1782			var nextYear = currentYear + 1;
1783			optionObj.value = nextYear;
1784			optionObj.selected = true;
1785			selectObj.appendChild(optionObj);
1786			$.datepicker._selectMonthYear(inst.input[0], selectObj, "Y")
1787		}).insertAfter(nextMonth);
1788		
1789		/** カレンダーの「翌月」「前月」をEnterで操作可能にする**/
1790		nextMonth.attr({'tabindex': '0'});
1791		nextMonth.on('keydown',function(e){
1792			if(e.key==='Enter') {
1793				e.preventDefault();
1794				$(this).trigger('click');
1795			}
1796		});
1797
1798		prevMonth.attr({'tabindex': '0'});
1799		prevMonth.on('keydown',function(e){
1800			if(e.key==='Enter') {
1801				e.preventDefault();
1802				$(this).trigger('click');
1803			}
1804		});
1805
1806		// 前年の表示制御
1807		if (selYear + '' + selMonth <= minDate.getFullYear() + '00') {
1808			dpHeader.find('.prev-year').addClass('ui-state-disabled');
1809		} else {
1810			dpHeader.find('.prev-year').removeClass('ui-state-disabled');
1811		}
1812		
1813		// 翌年の表示制御
1814		if (selYear + '' + selMonth >= maxDate.getFullYear() + '11') {
1815			dpHeader.find('.next-year').addClass('ui-state-disabled');
1816		} else {
1817			dpHeader.find('.next-year').removeClass('ui-state-disabled');
1818		}
1819		
1820		// カレンダー内にフォーカスを合わせる
1821		$('.prev-year').focus();
1822	}
1823	
1824	/** 
1825	** 一部のテキストエリアで改行を禁止 
1826	**/
1827	$("textarea.no-line-break").on("keydown", function(event) {
1828		// エンターキーが押された場合に無効にする
1829		if (event.key === "Enter") {
1830			event.preventDefault();
1831		}
1832	});
1833	
1834	/**
1835	** クロスサイトスクリプティングの恐れのある文字をエスケープ
1836	**/
1837	function cssProtection(val) {
1838		return val.replace(/[<>&"'”’]/g, '');
1839	}
1840	
1841	$('input[type="text"], textarea, input[type="email"]').on("input", function(event) {
1842		var text = $(this).val();
1843		$(this).val(cssProtection(text));
1844	});
1845})

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.