Debug = false;
function init_int2(tabId) {

	int_form2  = new formControll(document.int_itaCal);
	int_form2.init = function() {
		
		/***************************************************************************
		// 各プルダウンの読み込み
		***************************************************************************/
		
		this.formView.createPulldown("depApo", intDepApo_list);	// 出発空港
		
		if( document.getElementById("arrArea") != null){
			this.formView.createPulldown("arrArea",intArrArea_list);					// 到着地域
			
			this.formView.createPulldown("arrApo", allIntArrApo_list);			// 到着空港
			
			//this.formView.createPulldown("arrApo", intArrApo_list);			// 到着空港
			
			this.formView.createPulldown("adultCount", persons_list.slice(1, 10));		// 人数：大人
			this.formView.createPulldown("childCount", persons_list.slice(0, 9));		// 　　：子供
			this.formView.createPulldown("babyCount", persons_list.slice(0, 10));		// 　　：幼児
			
		}else{
		
			this.formView.createPulldown("arrApo", intArrApo_list);			// 到着空港
			
			this.formView.createPulldown("adultCount", persons_list.slice(1, 5));		// 人数：大人
			this.formView.createPulldown("childCount", persons_list.slice(0, 2));		// 　　：子供
			this.formView.createPulldown("babyCount", persons_list.slice(0, 2));		// 　　：幼児
			
		}
		
		
		/***************************************************************************
		// 各エレメントの初期値のセット
		***************************************************************************/

		if( document.getElementById("arrArea") != null){
			this.formView.setPulldown("arrArea", "");									// 到着地域
		}

		var _depApo_def = (int_depApo_def == "") ? "TYO" : int_depApo_def;
		this.formView.setPulldown("depApo", _depApo_def);					// 出発空港

		var _arrApo_def = (int_arrApo_def == "") ? "" : int_arrApo_def;
		this.formView.setPulldown("arrApo", _arrApo_def);					// 到着空港

		this.formView.setPulldown("adultCount", 1);					// 人数：大人
		this.formView.setPulldown("childCount", 0);					// 　　：子供
		this.formView.setPulldown("babyCount", 0);					// 　　：幼児
		this.formView.setPulldown("seatKind", "Y"); 					// クラス

		// 出発日時再設定
		switch(tabId) {
			case "ItaCalender" :
				var dd = new Date();
				var mon = dd.getMonth() + 2;
				if (mon == 13) {
					mon = 1;
				}
				this.formView.setPulldown("calMonth", mon); 					// 出発日
				this.formView.setPulldown("durationOfTrip", "06"); 		// 旅行日数
				break;
			default :
				break;
		}

		/***************************************************************************
		// 各エレメントのイベントのセット
		***************************************************************************/

		// 到着地域プルダウン変更　=>　到着空港プルダウン生成
		if( document.getElementById("arrArea") != null){
			this.arrArea = function(evt, val, targetElem) {
				if(val == "") {
					this.formView.createPulldown(targetElem, allIntArrApo_list);
					//this.apoListener(targetElem);
					return false;
				}
				var targetList = intArrApo_list[val].slice(1);
				this.formView.createPulldown(targetElem, targetList);
			};
		}
		// 到着空港プルダウン変更　=>　valueが"IDX"の場合その次を表示
		this.arrApo = function(evt, val, targetElem) {
			if(val == "NOP") {
				this.formView.setSelectedIndex(evt, 0);
				val = this.formView.getValue(evt);
			}
			if(val == "IDX") {
				this.formView.setSelectedIndex(evt, this.formView.getSelectedIndex(evt)+1);
			}					
		};

		// 往路出発：月プルダウン変更　=>　往路：日を1日に設定　=>　復路：月日を3日後に設定
		this.wayToMonth = function(evt, val, targetElem) {
		};
		// 往路出発：日プルダウン変更　=>　復路：月日を3日後に設定
		this.wayToDay = function(evt, val, targetElem) {
		};		
		// 復路出発：月プルダウン変更　=>　復路：日を1日に設定
		this.wayBackMonth = function(evt, val, targetElem) {
		};

		// イベントの追加
		// 到着地域プルダウン変更　=>　到着空港プルダウン生成
		if( document.getElementById("arrArea") != null){
			this.addEvent("arrArea", "change", this.delegate(this, this.relationListener));
		}
		// 往路出発：月プルダウン変更　=>　往路：日を1日に設定　=>　復路：月日を3日後に設定
		this.addEvent("wayToMonth", "change", this.delegate(this, this.relationListener));
		// 往路出発：日プルダウン変更　=>　復路：月日を3日後に設定
		this.addEvent("wayToDay", "change", this.delegate(this, this.relationListener));
		// 復路出発：月プルダウン変更 => その月の日数を反映
		this.addEvent("wayBackMonth", "change", this.delegate(this, this.monthListener));
		// 復路出発：月プルダウン変更　=>　復路：日を1日に設定
		this.addEvent("wayBackMonth", "change", this.delegate(this, this.relationListener));
		// 到着空港プルダウン変更　=>　valueが"IDX"の場合その次を表示
		this.addEvent("arrApo", "change", this.delegate(this, this.relationListener));	

	}
	int_form2.init();

}

// タブメニュー切り替え時の処理
function onChangePage(tabId) {

    // 到着空港リスト再設定
    switch(tabId) {
    case "ItaCalender" :
		break;

	default :
		break;
    }

    // 発着空港初期値
    if( document.getElementById("arrArea") != null){
	    int_depApo_def = intApoDef_list_New[tabId][0];
	    int_arrApo_def = intApoDef_list_New[tabId][1];
    }else{
	    int_depApo_def = intApoDef_list[tabId][0];
	    int_arrApo_def = intApoDef_list[tabId][1];
	}
	// 初期設定処理
	init_int2(tabId);
}

// 各ページの初期値設定用
var arrApoList = intArrApo_list;
var int_depApo_def = "";	// 出発空港初期値
var int_arrApo_def = "";	// 到着空港初期値
var person_adult_only = "n"; // 人数プルダウン大人のみフラグ


//更新前　090311 初期設定
var intApoDef_list = {
                  'ItaCalender'        :['TYO', 'SFO']
                };
//更新後　090311 初期設定
var intApoDef_list_New = {
                  'ItaCalender'        :['TYO', '']
                };
