/**
 * 画面読込時追加処理
 * @param 無し
 * @return 無し
 * @throws 実行時例外
 */
function onLoadExtra() {
	// 項目背景色設定
	setFieldsBgColor(ARY_FIELDS_ID    , COLOR_FIELD_NORMAL);
	setFieldsBgColor(ARY_ERR_FIELDS_ID, COLOR_FIELD_ERROR );
	// 項目長設定
	setMaxLength(PRM_TXT_PRESENCE				, LEN_DOUBLE_DAYS);
	setMaxLength(PRM_TXT_PRESENCE_NUMBER 		, LEN_NUMBER);
	setMaxLength(PRM_TXT_WORK_HOUR 				, LEN_WORK_HOUR);
	setMaxLength(PRM_TXT_WORK_MIN 				, LEN_TIME);
	setMaxLength(PRM_TXT_BREAK_HOUR 			, LEN_TIME);
	setMaxLength(PRM_TXT_BREAK_MIN 				, LEN_TIME);
	setMaxLength(PRM_TXT_PAID_HOLIDAY 			, LEN_DOUBLE_DAYS);
	setMaxLength(PRM_TXT_PARTICULAR_HOLIDAY		, LEN_DOUBLE_DAYS);
	setMaxLength(PRM_TXT_ABSENCE 				, LEN_DOUBLE_DAYS);
	setMaxLength(PRM_TXT_SICK 					, LEN_DOUBLE_DAYS);
	setMaxLength(PRM_TXT_COMPENSATION_DAY 		, LEN_DOUBLE_DAYS);
	setMaxLength(PRM_TXT_TRANSFER 				, LEN_DOUBLE_DAYS);
	setMaxLength(PRM_TXT_OTHER 					, LEN_DOUBLE_DAYS);
	setMaxLength(PRM_TXT_LEAVE_AND_LATE 		, LEN_NUMBER);
	setMaxLength(PRM_TXT_LEAVE_AND_LATE_HOUR 	, LEN_TIME);
	setMaxLength(PRM_TXT_LEAVE_AND_LATE_MIN 	, LEN_TIME);
	setMaxLength(PRM_TXT_OVER_HOUR 				, LEN_TIME);
	setMaxLength(PRM_TXT_OVER_MIN 				, LEN_TIME);
	setMaxLength(PRM_TXT_WORK_ON_HOLIDAY_HOUR 	, LEN_TIME);
	setMaxLength(PRM_TXT_WORK_ON_HOLIDAY_MIN 	, LEN_TIME);
	setMaxLength(PRM_TXT_LATE_NIGHT_HOUR 		, LEN_TIME);
	setMaxLength(PRM_TXT_LATE_NIGHT_MIN 		, LEN_TIME);
	setMaxLength(PRM_TXT_SYOKUJI 				, LEN_NUMBER);
	setMaxLength(PRM_TXT_CYOKU1 				, LEN_NUMBER);
	setMaxLength(PRM_TXT_CYOKU2 				, LEN_NUMBER);
	setMaxLength(PRM_TXT_CYOKU3 				, LEN_NUMBER);
	setMaxLength(PRM_TXT_HOKA1 					, LEN_NUMBER);
	setMaxLength(PRM_TXT_HOKA2 					, LEN_NUMBER);
	setMaxLength(PRM_TXT_HOKA3 					, LEN_NUMBER);
	setMaxLength(PRM_TXT_HOKA4 					, LEN_NUMBER);
	setMaxLength(PRM_TXT_HOKA5 					, LEN_NUMBER);
/*	2008/10/16	m.yoshida	2時間年休	次期Verにて対応 */
	//setMaxLength(PRM_TXT_2HOUR_HOLIDAY			, LEN_NUMBER);	
	// 編集/表示判定
	if (MODE == 1) {
		// フォーカス設定
		setFocus(PRM_TXT_PRESENCE);
	} else if (MODE == 2) {
		setVisibility("btnRegist", false);
		setWidth("btnRegist", 0);
	}
}

/**
 * サーバー通信処理
 * @param 無し
 * @return 無し
 * @throws 実行時例外
 */
function submitForm(objForm) {
	// 入力チェック
	if (validate()) {
		doSubmitMessage(objForm, 'P1047', 'QC0001', '');
	}
}

/**
 * 入力チェック
 * @param 無し
 * @return チェック結果(true：OK、false：NG)
 * @throws 実行時例外
 */
function validate() {
	// フィールド背景色設定
	setFieldsBgColor(ARY_FIELDS_ID, COLOR_FIELD_NORMAL);
	// 入力チェック
	var aryMessage = new Array();
	
	checkRequired(PRM_TXT_PRESENCE				, NAM_PRESENCE				, aryMessage);
	checkRequired(PRM_TXT_PRESENCE_NUMBER		, NAM_PRESENCE_NUMBER		, aryMessage);
	checkRequired(PRM_TXT_WORK_HOUR				, NAM_WORK_TIME				, aryMessage);
	checkRequired(PRM_TXT_WORK_MIN				, NAM_WORK_TIME				, aryMessage);
	checkRequired(PRM_TXT_BREAK_HOUR			, NAM_BREAK_TIME			, aryMessage);
	checkRequired(PRM_TXT_BREAK_MIN				, NAM_BREAK_TIME			, aryMessage);
	checkRequired(PRM_TXT_PAID_HOLIDAY			, ARY_HOLIDAY_REASON["0"][0]	, aryMessage);
	checkRequired(PRM_TXT_PARTICULAR_HOLIDAY	, ARY_HOLIDAY_REASON["1"][0]	, aryMessage);
	checkRequired(PRM_TXT_ABSENCE				, ARY_HOLIDAY_REASON["2"][0]	, aryMessage);
	checkRequired(PRM_TXT_SICK					, ARY_HOLIDAY_REASON["3"][0]	, aryMessage);
	checkRequired(PRM_TXT_COMPENSATION_DAY		, ARY_HOLIDAY_REASON["4"][0]	, aryMessage);
	checkRequired(PRM_TXT_TRANSFER				, ARY_HOLIDAY_REASON["5"][0]	, aryMessage);
	checkRequired(PRM_TXT_OTHER					, NAM_OTHER					, aryMessage);
	checkRequired(PRM_TXT_LEAVE_AND_LATE		, NAM_LEAVE_AND_LATE		, aryMessage);
	checkRequired(PRM_TXT_LEAVE_AND_LATE_HOUR	, NAM_LEAVE_AND_LATE_TIME	, aryMessage);
	checkRequired(PRM_TXT_LEAVE_AND_LATE_MIN	, NAM_LEAVE_AND_LATE_TIME	, aryMessage);
	checkRequired(PRM_TXT_OVER_HOUR				, NAM_OVER_TIME				, aryMessage);
	checkRequired(PRM_TXT_OVER_MIN				, NAM_OVER_TIME				, aryMessage);
	checkRequired(PRM_TXT_WORK_ON_HOLIDAY_HOUR	, NAM_WORK_ON_HOLIDAY_TIME	, aryMessage);
	checkRequired(PRM_TXT_WORK_ON_HOLIDAY_MIN	, NAM_WORK_ON_HOLIDAY_TIME	, aryMessage);
	checkRequired(PRM_TXT_LATE_NIGHT_HOUR		, NAM_LATE_NIGHT_TIME		, aryMessage);
	checkRequired(PRM_TXT_LATE_NIGHT_MIN		, NAM_LATE_NIGHT_TIME		, aryMessage);
	checkRequired(PRM_TXT_SYOKUJI				, ARY_ALLOWANCE["09"][0]		, aryMessage);
	checkRequired(PRM_TXT_CYOKU1				, ARY_ALLOWANCE["10"][0]		, aryMessage);
	checkRequired(PRM_TXT_CYOKU2				, ARY_ALLOWANCE["11"][0]		, aryMessage);
	checkRequired(PRM_TXT_CYOKU3				, ARY_ALLOWANCE["12"][0]		, aryMessage);
	checkRequired(PRM_TXT_HOKA1					, ARY_ALLOWANCE["13"][0]		, aryMessage);
	checkRequired(PRM_TXT_HOKA2					, ARY_ALLOWANCE["14"][0]		, aryMessage);
	checkRequired(PRM_TXT_HOKA3					, ARY_ALLOWANCE["15"][0]		, aryMessage);
	checkRequired(PRM_TXT_HOKA4					, ARY_ALLOWANCE["16"][0]		, aryMessage);
	checkRequired(PRM_TXT_HOKA5					, ARY_ALLOWANCE["17"][0]		, aryMessage);
/*	2008/10/16	m.yoshida	2時間年休	次期Verにて対応 */
	//checkRequired(PRM_TXT_2HOUR_HOLIDAY		, NAM_2HOUR_HOLIDAY		, aryMessage);
		
	checkNumeric(PRM_TXT_PRESENCE			, NAM_PRESENCE				, aryMessage);
	checkNumber(PRM_TXT_PRESENCE_NUMBER	, NAM_PRESENCE_NUMBER		, aryMessage);
	checkNumber(PRM_TXT_WORK_HOUR			, NAM_WORK_TIME				, aryMessage);
	checkNumber(PRM_TXT_WORK_MIN			, NAM_WORK_TIME				, aryMessage);
	checkNumber(PRM_TXT_BREAK_HOUR			, NAM_BREAK_TIME			, aryMessage);
	checkNumber(PRM_TXT_BREAK_MIN			, NAM_BREAK_TIME			, aryMessage);
	checkNumeric(PRM_TXT_PAID_HOLIDAY		, ARY_HOLIDAY_REASON["0"][0]	, aryMessage);
	checkNumeric(PRM_TXT_PARTICULAR_HOLIDAY	, ARY_HOLIDAY_REASON["1"][0]	, aryMessage);
	checkNumeric(PRM_TXT_ABSENCE			, ARY_HOLIDAY_REASON["2"][0]	, aryMessage);
	checkNumeric(PRM_TXT_SICK				, ARY_HOLIDAY_REASON["3"][0]	, aryMessage);
	checkNumeric(PRM_TXT_COMPENSATION_DAY	, ARY_HOLIDAY_REASON["4"][0]	, aryMessage);
	checkNumeric(PRM_TXT_TRANSFER			, ARY_HOLIDAY_REASON["5"][0]	, aryMessage);
	checkNumber(PRM_TXT_OTHER				, NAM_OTHER					, aryMessage);
	checkNumber(PRM_TXT_LEAVE_AND_LATE		, NAM_LEAVE_AND_LATE		, aryMessage);
	checkNumber(PRM_TXT_LEAVE_AND_LATE_HOUR	, NAM_LEAVE_AND_LATE_TIME	, aryMessage);
	checkNumber(PRM_TXT_LEAVE_AND_LATE_MIN	, NAM_LEAVE_AND_LATE_TIME	, aryMessage);
	checkNumber(PRM_TXT_OVER_HOUR			, NAM_OVER_TIME				, aryMessage);
	checkNumber(PRM_TXT_OVER_MIN			, NAM_OVER_TIME				, aryMessage);
	checkNumber(PRM_TXT_WORK_ON_HOLIDAY_HOUR, NAM_WORK_ON_HOLIDAY_TIME	, aryMessage);
	checkNumber(PRM_TXT_WORK_ON_HOLIDAY_MIN	, NAM_WORK_ON_HOLIDAY_TIME	, aryMessage);
	checkNumber(PRM_TXT_LATE_NIGHT_HOUR		, NAM_LATE_NIGHT_TIME		, aryMessage);
	checkNumber(PRM_TXT_LATE_NIGHT_MIN		, NAM_LATE_NIGHT_TIME		, aryMessage);
	checkNumber(PRM_TXT_SYOKUJI				, ARY_ALLOWANCE["09"][0]		, aryMessage);
	checkNumber(PRM_TXT_CYOKU1				, ARY_ALLOWANCE["10"][0]		, aryMessage);
	checkNumber(PRM_TXT_CYOKU2				, ARY_ALLOWANCE["11"][0]		, aryMessage);
	checkNumber(PRM_TXT_CYOKU3				, ARY_ALLOWANCE["12"][0]		, aryMessage);
	checkNumber(PRM_TXT_HOKA1				, ARY_ALLOWANCE["13"][0]		, aryMessage);
	checkNumber(PRM_TXT_HOKA2				, ARY_ALLOWANCE["14"][0]		, aryMessage);
	checkNumber(PRM_TXT_HOKA3				, ARY_ALLOWANCE["15"][0]		, aryMessage);
	checkNumber(PRM_TXT_HOKA4				, ARY_ALLOWANCE["16"][0]		, aryMessage);
	checkNumber(PRM_TXT_HOKA5				, ARY_ALLOWANCE["17"][0]		, aryMessage);
/*	2008/10/16	m.yoshida	2時間年休	次期Verにて対応 */
	//checkNumber(PRM_TXT_2HOUR_HOLIDAY		, NAM_2HOUR_HOLIDAY		, aryMessage);

	if (aryMessage.length == 0) {
		return true;
	} else {
		showMessage(aryMessage);
		return false;
	}
}
