/*
 * @include "DDP_Framework.js"
 * @include "DDP_Search.js"
 */

/**
 * @fileOverview 各商材の検索用パネルの機能を保有するファイルです。
 */

(function() {
//////////////////////// DDP.Search.SearchPanel START //////////////////////////
// local symbol
var getN = DDP.getNode, idMgr = DDP.Search.idManager;
/**
 * DDP.Search.SearchPanel コンストラクタ
 * @class 宿泊検索パネルを操作する為のクラス
 * @constructor
 * @param useArea エリア検索パネルを使用するかどうかのフラグ
 */
DDP.Search.SearchPanel = function(useArea) {
	this.useArea = useArea;
	return this;
};
/**
 * ページ表示時の初期処理を行います。
 */
DDP.Search.SearchPanel.prototype.init = function() {
	var __this = this, pl = DDP.Search.SearchPanel.PullDown, plw = DDP.Search.SearchPanel.PullDownWithCount;
	// Pull-Down系のコントロールの初期化
	// 部屋定員
	this.capacity = new pl('capacity', this);
	this.capacity.init();
	// 下限料金
	this.rateMin = new pl('rate_min', this);
	this.rateMin.init();
	// 上限料金
	this.rateMax = new pl('rate_max', this);
	this.rateMax.init();
	// ルームタイプ
	this.roomType = new plw('room_type', this);
	this.roomType.init();
	// 食事タイプ
	this.mealType = new plw('meal_type', this);
	this.mealType.init();
	// こだわり条件リストの初期化
	this.specificList = new DDP.Search.SearchPanel.SpecificList(this);
	this.specificList.init();
	// イベントの登録 : こだわり条件全て解除ボタンを初期化
	DDP.addEvent(getN(idMgr['clear_specific']), 'click', function(){
		if (DDP.existClass(getN(idMgr['clear_specific']),
				DDP.Search.Const.CLEAR_SPECIFIC_BUTTON_DISALBE_STYLE)) {
			return;
		}
		// 全てのこだわり条件を解除
		__this.specificList.unselectAll();
		// 更新
		__this.updateForAjax();
		__this.updateCountForAjax();
	});
	// 宿泊エリアが使われる場合のみ
	if (this.useArea) {
		// 宿泊エリアの初期化を行う
		this.area = new DDP.Search.SearchPanel.AreaPanel(this);
		this.area.init();
	}
};
/**
 * Ajaxで更新する際に呼び出す関数。
 */
DDP.Search.SearchPanel.prototype.updateForAjax = function() {
	this.callUpdatePanelMethod();
};
/**
 * 件数取得ページメソッドを呼びます。
 * <pre>
 * この関数にページメソッドを呼ぶメソッドを設定することで、
 * 検索パネルの動作に対応し、件数取得のページメソッドがコールされます。
 * 使用するクラスによって上書きされることを想定しています
 * </pre>
 */
DDP.Search.SearchPanel.prototype.callUpdatePanelMethod = function() {
	return;
};
/**
 * 件数取得メソッドを呼び出します。
 */
DDP.Search.SearchPanel.prototype.updateCountForAjax = function() {
	var __this = this;
	// 件数取得メソッドを呼び出し
	this.callHotelCountMethod(
		// 成功時のコールバックメソッド
		function(response) {
			console.log('SearchPanel.updateCountForAjax : ', response);
			if (response.resultCode == DDP.Search.Const.WEB_METHOD_RESULT_CODE_SUCCESS) {
				// メソッド呼び出し成功時は、結果を処理する
				var result = response.result;
				if (__this.useArea) {
					__this.area.updateCount(result);
				}
				__this.specificList.updateCount(result);
				__this.roomType.updateCount(result);
				__this.mealType.updateCount(result);
				
			} else {
				console.log('アプリケーションエラー : ', result);
				DDP.Search.showErrorAlert();
			}
		}
	);
};
/**
 * 件数取得ページメソッドを呼ぶメソッド
 * <pre>
 * この関数にページメソッドを呼ぶメソッドを設定することで、
 * 検索パネルの動作に対応し、件数取得のページメソッドがコールされます。
 * 
 * 使用するクラスによって上書きされることを想定しています
 * </pre>
 * @param onSuccessCallBack 成功時のコールバックメソッド
 */
DDP.Search.SearchPanel.prototype.callHotelCountMethod = function(onSuccessCallBack) {
	onSuccessCallBack({});
};
/**
 * 検索パネルの選択内容を返します。
 */
DDP.Search.SearchPanel.prototype.getlHotelCondition = function() {
	var selectedArea = '';
	var isPriorSearch = false;
	if (this.useArea) {
		selectedArea = this.area.getSelectedArea();
		if (this.area.isPriorSearch.value == DDP.Search.Const.FLAG_TRUE) {
			isPriorSearch = true;
		}
	}
	return {
		'capacity' : this.capacity.getSelectedValue(),
		'rate_min' : this.rateMin.getSelectedValue(),
		'rate_max' : this.rateMax.getSelectedValue(),
		'room_type' : this.roomType.getSelectedValue(),
		'meal_type' : this.mealType.getSelectedValue(),
		'specific' : this.specificList.getSelectedSpecific(),
		'selected_area' : selectedArea,
		'isPriorSearch' : isPriorSearch
	}
};
/**
 * エリアパネル更新します。
 * UpdatePanelの更新を行った際に取得できる情報を元にエリアパネルの更新を行います。
 * @param updateInfo UpdatePanel更新時の情報
 */
DDP.Search.SearchPanel.prototype.setUpdateInfo = function(updateInfo) {
	if (this.useArea) {
		this.area.setUpdateInfo(updateInfo);
	}
};
/**
 * 検索パネルの全ての入力欄をdisableに変更します。
 */
DDP.Search.SearchPanel.prototype.disable = function(updateInfo) {
	// 各検索条件をdisableに設定
	this.capacity.disable();
	this.rateMin.disable();
	this.rateMax.disable();
	this.roomType.disable();
	this.mealType.disable();
	this.specificList.disable();
	// こだわり条件解除ボタンをdisable化
	var clearSpecificNode = getN(idMgr['clear_specific']);
	DDP.addClass(clearSpecificNode, DDP.Search.Const.CLEAR_SPECIFIC_BUTTON_DISALBE_STYLE);
	clearSpecificNode.removeAttribute('href');
	// エリアパネルをdisableに設定
	if (this.useArea) {
		this.area.disable();
	}
};
/**
 * 検索パネルの各コントロールを使用可能に設定します。
 */
DDP.Search.SearchPanel.prototype.enable = function() {
	// 各検索条件をdisableに設定
	this.capacity.enable();
	this.rateMin.enable();
	this.rateMax.enable();
	this.roomType.enable();
	this.mealType.enable();
	this.specificList.enable();
	// こだわり条件解除ボタンをenable化
	var clearSpecificNode = getN(idMgr['clear_specific']);
	DDP.removeClass(clearSpecificNode, DDP.Search.Const.CLEAR_SPECIFIC_BUTTON_DISALBE_STYLE);
	DDP.addHrefJs(clearSpecificNode);
	// エリアパネルをdisableに設定
	if (this.useArea) {
		this.area.enable();
	}
};
//////////////////////// DDP.Search.SearchPanel END ////////////////////////

///////////////////////// DDP.Search.SearchPanel.SpecificList START /////////////////////////
/**
 * コンストラクタ
 * @class 検索パネルのこだわり条件を操作する為のクラス
 * @constructor
 * @param panel 検索パネル
 */
DDP.Search.SearchPanel.SpecificList = function(panel) {
	this.panel = panel;
	this.specificList = new Array();
};
/**
 * 初期化メソッド
 */
DDP.Search.SearchPanel.SpecificList.prototype.init = function() {
	// 全てのこだわり条件について処理を行う
	var pnl = this.panel;
	for(var i = 0; true; i++){
		var node = getN(idMgr['specific_' + i]);
		if (node == null) {
			break;
		}
		// こだわり条件ボタンを初期化
		this.specificList[i] = new DDP.Search.SearchPanel.Specific(i, pnl);
		this.specificList[i].init();
	}
};
/**
 * 件数の更新を行います
 * @param result 件数取得結果
 */
DDP.Search.SearchPanel.SpecificList.prototype.updateCount = function(result) {
	if (result['specific'] == null) return;
	for(var i = 0, iLen = this.specificList.length; i < iLen; i++){
		this.specificList[i].updateCount(result);
	}
};
/**
 * 選択されているこだわり条件を連結した文字列を取得します。
 * @return 連結したこだわり条件の文字列
 * @type String
 */
DDP.Search.SearchPanel.SpecificList.prototype.getSelectedSpecific = function() {
	var result = '';
	var isFirst = true;
	// 全てのこだわり条件について処理を行う
	for(var i = 0, iLen = this.specificList.length; i < iLen; i++){
		// 選択されている場合、文字列に追加する
		var spc = this.specificList[i];
		if (spc.isSelected()) {
			if (!isFirst) {
				// 最初以外の場合、カンマを追加する
				result += ',';
			}
			result += spc.id;
			isFirst = false;
		}
	}
	return result;
};
/**
 * すべてのこだわり条件の非選択の状態に変更します。
 */
DDP.Search.SearchPanel.SpecificList.prototype.unselectAll = function() {
	// 全てのこだわり条件について処理を行う
	for(var i = 0, iLen = this.specificList.length; i < iLen; i++) {
		var spc = this.specificList[i];
		spc.setSelected(false);
		spc.setStyle();
	}
};
/**
 * こだわり条件を使用不可にします。
 */
DDP.Search.SearchPanel.SpecificList.prototype.disable = function() {
	// 全てのこだわり条件について処理を行う
	for(var i = 0, iLen = this.specificList.length; i < iLen; i++){
		this.specificList[i].disable();
	}
};
/**
 * こだわり条件を使用可能に設定します。
 */
DDP.Search.SearchPanel.SpecificList.prototype.enable = function() {
	// 全てのこだわり条件について処理を行う
	for(var i = 0, iLen = this.specificList.length; i < iLen; i++){
		this.specificList[i].enable();
	}
};
////////////////////////// DDP.Search.SearchPanel.SpecificList END //////////////////////////


///////////////////////// DDP.Search.SearchPanel.Specific START /////////////////////////
/**
 * コンストラクタ
 * @class こだわり条件クラス
 * @param num 関連付ける添え字の数値
 * @param panel 検索パネルのインスタンス
 */
DDP.Search.SearchPanel.Specific = function(num, panel) {
	this.category = 'specific';
	this.num = num;
	this.node = getN(idMgr[this.category + '_' + this.num]);
	this.panel = panel;
	this.count = NaN;
	this.isDisabled = false;
	return this;
};

/**
 * こだわり条件項目初期化
 */
DDP.Search.SearchPanel.Specific.prototype.init = function() {
	var __this = this;
	// hiddenNodeの設定
	this.hiddenNode = getN(idMgr['specific_hidden_' + this.num]);
	// IDの設定
	this.id = (this.hiddenNode.value.split(':'))[0];
	// 初期スタイルを設定
	this.setStyle();
	// イベントの登録 : こだわり条件ボタン
	DDP.addEvent(__this.node, 'click', function() {
		var node = __this.node, panel = __this.panel;
		if ((!__this.isSelected() && __this.count == 0) || __this.isDisabled) {
			return false;
		}
		__this.switchSelected();
		__this.setStyle();
		if (__this.count == 0) {
			return false;
		}
		panel.updateForAjax();
		panel.updateCountForAjax();
		return false;
	});
};
/**
 * 選択されているか判定します
 * @return 選択されている場合true、非選択の場合false
 * @type boolean
 */
DDP.Search.SearchPanel.Specific.prototype.isSelected = function() {
	// hiddenのvalue領域のフラグ箇所を取得し、状態判定し、返す
	var selectedFlagString = this.hiddenNode.value.split(DDP.Search.Const.SPECIFIC_VALUE_SEPARATOR)[1];
	if (selectedFlagString == DDP.Search.Const.FLAG_TRUE) {
		return true;
	}
	return false;
};
/**
 * 選択状態を設定します
 * @param flag 選択フラグ .. 選択済み:true, 未選択:false
 */
DDP.Search.SearchPanel.Specific.prototype.setSelected = function(flag) {
	this.hiddenNode.value = this.id + ':' + (flag ? DDP.Search.Const.FLAG_TRUE : DDP.Search.Const.FLAG_FALSE);
};
/**
 * 選択状態を切り替えます。
 * 選択されていれば非選択に、非選択であれば選択に変更します。
 */
DDP.Search.SearchPanel.Specific.prototype.switchSelected = function() {
	this.hiddenNode.value = this.id + ':' + (this.isSelected() ? DDP.Search.Const.FLAG_FALSE : DDP.Search.Const.FLAG_TRUE);
};
/**
 * 件数の更新を行います。
 * "n件"のフォーマットで出力を行います。
 * @param result 件数取得結果
 */
DDP.Search.SearchPanel.Specific.prototype.updateCount = function(result) {
	// 検索結果件数
	this.count = result[this.category][this.id];
	// 取得できなかった場合、0件
	if (!this.count){
		this.count = 0;
	}
	// スタイルを設定
	this.setStyle();
	// 名前の部分を記憶しておく
	var n = this.node;
	if (!this.name) {
		this.name = n.innerHTML;
	}
	// 件数を表示する
	n.innerHTML = this.name + '(' + this.count + '件)';
};
/**
 * 今の状態で表示すべきスタイルを設定します。
 */
DDP.Search.SearchPanel.Specific.prototype.setStyle = function() {
	var n = this.node;
	if (this.isSelected()) {
		DDP.addHrefJs(n);
		n.className = DDP.Search.Const.SELECTED_BUTTON_LINK_STYLE;
	} else {
		if (this.count != 0) {
			DDP.addHrefJs(n);
			n.className = DDP.Search.Const.ABLE_BUTTON_LINK_STYLE;
		} else {
			n.removeAttribute('href');
			n.className = DDP.Search.Const.DISABLE_BUTTON_LINK_STYLE;
		}
	}
};
/**
 * コントロールを使用不可に設定します。
 */
DDP.Search.SearchPanel.Specific.prototype.disable = function() {
	var n = this.node;
	n.removeAttribute('href');
	n.className = DDP.Search.Const.DISABLE_BUTTON_LINK_STYLE;
	this.isDisabled = true;
};
/**
 * コントロールを使用可能に設定します。
 */
DDP.Search.SearchPanel.Specific.prototype.enable = function() {
	this.setStyle();
	this.isDisabled = false;
};
////////////////////////// DDP.Search.SearchPanel.Specific END //////////////////////////

///////////////////////// DDP.Search.SearchPanel.PullDown START /////////////////////////
/**
 * コンストラクタ
 * @class 検索パネルのプルダウンを操作する為のクラス
 * @constructor
 * @param idKey サーバ上でのコントロールID
 * @param panel 検索パネルのインスタンス
 */
DDP.Search.SearchPanel.PullDown = function(idKey, panel) {
	this.panel = panel;
	// 親クラスとしての初期化
	DDP.Search.PullDown.apply(this, arguments);
};
// プロトタイプをコピー 
DDP.Search.SearchPanel.PullDown.prototype = new DDP.Search.PullDown();
/**
 * changeイベントが発生した場合の処理を記述
 */
DDP.Search.SearchPanel.PullDown.prototype.onChangeEvent = function() {
	var p = this.panel;
	p.updateForAjax();
	p.updateCountForAjax();
};
////////////////////////// DDP.Search.SearchPanel.PullDown END //////////////////////////

///////////////////// DDP.Search.SearchPanel.PullDownWithCount START /////////////////////
/**
 * コンストラクタ
 * @class 検索パネルにおいてプルダウンに件数表示するプルダウンを操作するクラス
 * @constructor
 * @param idKey サーバ上でのコントロールID
 * @param panel 検索パネルのインスタンス
 */
DDP.Search.SearchPanel.PullDownWithCount = function(idKey, panel) {
	// pullDownとしての初期化
	DDP.Search.SearchPanel.PullDown.apply(this, arguments);
};
/**
 * プロトタイプをコピー
 */
DDP.Search.SearchPanel.PullDownWithCount.prototype = new DDP.Search.SearchPanel.PullDown();
/**
 * changeイベントが発生した場合の処理を記述
 */
DDP.Search.SearchPanel.PullDownWithCount.prototype.onChangeEvent = function() {
	var p, n = this.node;
	if (n == null) { return; }
	// 0件の選択をしたら処理を終了
	if (DDP.existClass(this.getSelectedOption(), DDP.Search.Const.DISABLE_PULL_DOWN_ITEM_STYLE)) {
		n.selectedIndex = n.prevIndex;
		return;
	}
	n.prevIndex = n.selectedIndex;
	p = this.panel;
	p.updateForAjax();
	p.updateCountForAjax();
};
/**
 * 件数の更新を行います
 * @param result 件数取得結果
 */
DDP.Search.SearchPanel.PullDownWithCount.prototype.updateCount = function(result) {
	// 何もない場合は0件表示にするために空のオブジェクトを作成する
	if (result[this.category] == null) result[this.category] = {};
	// リスト分ループ
	var n = this.node, disableStyle = DDP.Search.Const.DISABLE_PULL_DOWN_ITEM_STYLE;
	for(var i = 0, iLen = n.options.length; i < iLen; i++) {
		var o = n.options[i];
		if (this.isExclusion(o.value)) {
			continue;
		}
		// 件数取得
		var count = result[this.category][o.value];
		// スタイルを定義
		if (!count || count == 0) {
			count = 0;
			// 要素がない場合 もしくは0件の場合、スタイルを設定
			DDP.addClass(o, disableStyle);
		} else {
			DDP.removeClass(o, disableStyle);
		}
		// 名前の部分を記憶しておく
		if (!o.name) {
			o.name = o.text;
		}
		// 件数を表示する
		o.text = o.name + '(' + count + '件)';
	}
};
/**
 * 対象が件数表示対象のoption.valueか否かチェックします
 * 継承したクラスによってオーバーライドされることを想定しています
 * @return true:除外対象, false:表示対象
 * @type boolean
 */
DDP.Search.SearchPanel.PullDownWithCount.prototype.isExclusion = function(value) {
	return false;
};
////////////////////// DDP.Search.SearchPanel.PullDownWithCount END //////////////////////

/////////////////////// DDP.Search.SearchPanel.AreaPanel START ///////////////////////
/**
 * コンストラクタ
 * @class 検索パネルのエリアパネルを操作する為のクラス
 * @constructor
 * @param panel 検索パネルのインスタンス
 */
DDP.Search.SearchPanel.AreaPanel = function(panel) {
	this.panel = panel;
	return this;
};
/**
 * 初期化処理を行います。
 */
DDP.Search.SearchPanel.AreaPanel.prototype.init = function() {
	var __this = this;
	this.hiddenNode = getN(idMgr['selected_area']);
	this.isPriorSearch = getN(idMgr['is_prior_search']);
	this.prefecture = new DDP.Search.PullDown('prefectur');
	this.prefecture.onChangeEvent = function() {
		var panel = __this.panel;
		DDP.Search.changeSubAreaByKenArea(this.node.id, __this.subArea.node.id);
		__this.subArea.updateTableMenu();
		// メッシュをクリア
		__this.meshList.clear();
		// 選択された県をhiddenNodeに設定
		__this.hiddenNode.value = __this.subArea.getSelectedValue();
		// 更新を行う
		panel.updateForAjax();
		panel.updateCountForAjax();
	};
	// 初期化
	this.prefecture.init();
	// サブエリアの初期化
	this.subArea = new DDP.Search.SearchPanel.AreaPanel.SubArea('sub_area', this.panel, this);
	this.subArea.init();
	// メッシュリストの初期化
	this.meshList = new DDP.Search.SearchPanel.AreaPanel.MeshList(this.panel, this);
	this.meshList.init();
	// DDP.Search.Mapのインスタンス作成
	this.supportMap = new DDP.Search.Map(
		'img_maps', idMgr['prefectur'], idMgr['sub_area'], 'map_select_link');
	this.supportMap.init();
	this.supportMap.onSelected = function() {
		__this.subArea.onChangeEvent();
		__this.subArea.updateTableMenu();
	}
	// 宿・ホテルの指定を解除リンクエリア
	this.clearPriorSearchArea = getN(idMgr['clear_prior_search_area']);
	// 宿・ホテルの指定を解除リンク
	this.clearPriorSearchLink = getN(idMgr['clear_prior_search']);
	// イベント登録
	DDP.addEvent(this.clearPriorSearchLink, 'click', function() {
		if (DDP.existClass(__this.clearPriorSearchLink, DDP.Search.Const.CLEAR_SPECIFIC_BUTTON_DISALBE_STYLE)) return;
		// disabled化されていない場合
		var pnl = __this.panel;
		// 非表示
		__this.clearPriorSearchArea.style.display = 'none';
		// 通常検索
		__this.isPriorSearch.value = DDP.Search.Const.FLAG_FALSE;
		// 更新
		pnl.updateForAjax();
		pnl.updateCountForAjax();
	});
};
/**
 * 現在選択されているAreaのIDを返します。
 * @return 選択されているAreaのID
 * @type String
 */
DDP.Search.SearchPanel.AreaPanel.prototype.getSelectedArea = function() {
	return this.hiddenNode.value;
};
/**
 * 指定されたメッシュを選択済みにし、他を未選択に設定します。
 * @param id 選択するメッシュのID
 */
DDP.Search.SearchPanel.AreaPanel.prototype.selectMesh = function(id) {
	var pnl = this.panel;
	this.hiddenNode.value = id;
	pnl.updateForAjax();
	pnl.updateCountForAjax();
	this.meshList.refreshStyle();
};
/**
 * 件数の更新を行います。
 * @param result 件数取得結果
 */
DDP.Search.SearchPanel.AreaPanel.prototype.updateCount = function(result) {
	// メッシュリストの更新を行う
	this.meshList.updateCount(result);
	this.subArea.updateCount(result);
	// 宿泊施設検索キーを使用する場合
	if (this.isPriorSearch.value == DDP.Search.Const.FLAG_TRUE) {
		// disabled化
		this.prefecture.disable();
		this.subArea.disable();
		this.meshList.disable();
		this.supportMap.disable();
	} else {
		this.enable();
	}
};
/**
 * UpdatePanel更新情報を使用し、表示を更新します。
 * @param updateInfo 更新情報
 */
DDP.Search.SearchPanel.AreaPanel.prototype.setUpdateInfo = function(updateInfo) {
	this.meshList.reload(updateInfo.mesh_list);
};
/**
 * コントロールを使用不可に設定します。
 */
DDP.Search.SearchPanel.AreaPanel.prototype.disable = function() {
	this.prefecture.disable();
	this.subArea.disable();
	this.meshList.disable();
	this.supportMap.disable();
	// 宿・ホテルを解除ボタンをdisable化
	if (this.clearPriorSearchLink != null) {
		DDP.addClass(this.clearPriorSearchLink, DDP.Search.Const.CLEAR_SPECIFIC_BUTTON_DISALBE_STYLE);
		this.clearPriorSearchLink.removeAttribute('href');
	}
};
/**
 * コントロールを使用可能に設定します。
 */
DDP.Search.SearchPanel.AreaPanel.prototype.enable = function() {
	this.prefecture.enable();
	this.subArea.enable();
	this.meshList.enable();
	this.supportMap.enable();
	// 宿・ホテルを解除ボタンをenable化
	if (this.clearPriorSearchLink != null) {
		DDP.removeClass(this.clearPriorSearchLink, DDP.Search.Const.CLEAR_SPECIFIC_BUTTON_DISALBE_STYLE);
		DDP.addHrefJs(this.clearPriorSearchLink);
	}
};

//////////////////////// DDP.Search.SearchPanel.AreaPanel END ////////////////////////

////////////////////// DDP.Search.SearchPanel.AreaPanel.MeshList START //////////////////////
/**
 * コンストラクタ
 * @class 検索パネル内のメッシュリストを操作する為のクラスです。
 * @constructor
 * @param panel 検索パネルのインスタンス
 * @param area エリア検索パネルのインスタンス
 */
DDP.Search.SearchPanel.AreaPanel.MeshList = function(panel, area) {
	this.area = area;
	this.panel = panel;
	this.meshList = null;
};
/**
 * 初期化処理をおこないます。
 */
DDP.Search.SearchPanel.AreaPanel.MeshList.prototype.init = function() {
	this.meshListNode = getN('mesh_list');
	this.meshListLabelNode = getN(idMgr['mesh_list_label']);
	this.latestResult = {};
	this._bindMeshes();
};
/**
 * メッシュリストをクリアします。
 */
DDP.Search.SearchPanel.AreaPanel.MeshList.prototype.clear = function() {
	// メッシュをクリア
	this.meshListNode.innerHTML = '&nbsp;';
	// 「詳細地区」ラベルの非表示
	this.meshListLabelNode.style.display = 'none';
};
/**
 * メッシュリストのリロードを行います。
 * @param meshList 更新内容
 */
DDP.Search.SearchPanel.AreaPanel.MeshList.prototype.reload = function(newMeshList) {
	// メッシュリストが入ってない場合、更新はないと判断
	if (newMeshList == null || newMeshList.length == 0) {
		return;
	}
	// リストをクリア
	this.clear();
	// 「詳細地区」ラベルの表示
	this.meshListLabelNode.style.display = '';
	// リストを作成
	var newMeshListStringArr = [''], aIdx = 1,
		linkTpl = DDP.Search.Const.MESH_LIST_LINK_TEMPLATE,
		hiddenTpl = DDP.Search.Const.MESH_LIST_HIDDEN_TEMPLATE,
		listTpl = DDP.Search.Const.MESH_LIST_TEMPLATE;
	for(var i = 0, iLen = newMeshList.length; i < iLen; i++) {
		var newMesh = newMeshList[i];
		var link = DDP.formatMessage(linkTpl, i, newMesh.name);
		var hidden = DDP.formatMessage(hiddenTpl, i, newMesh.mesh);
		newMeshListStringArr[aIdx++] = DDP.formatMessage(listTpl, i, link, hidden);
	}
	this.meshListNode.innerHTML = newMeshListStringArr.join('');
	// DOMとハンドラの関連付け
	this._bindMeshes();
};
/**
 * 件数の更新を行います。
 * @param result 件数取得結果
 */
DDP.Search.SearchPanel.AreaPanel.MeshList.prototype.updateCount = function(result) {
	this.latestResult = result;
	this._updateCountByLatestResult();
};
/**
 * スタイルを更新します。
 */
DDP.Search.SearchPanel.AreaPanel.MeshList.prototype.refreshStyle = function() {
	for(var i = 0, iLen = this.meshList.length; i < iLen; i++) {
		this.meshList[i].setStyle();
	}
};
/**
 * コントロールを使用不可に設定します。
 */
DDP.Search.SearchPanel.AreaPanel.MeshList.prototype.disable = function() {
	for(var i = 0, iLen = this.meshList.length; i < iLen; i++) {
		this.meshList[i].disable();
	}
};
/**
 * コントロールを使用可能に設定します。
 */
DDP.Search.SearchPanel.AreaPanel.MeshList.prototype.enable = function() {
	for(var i = 0, iLen = this.meshList.length; i < iLen; i++) {
		this.meshList[i].enable();
	}
};
/**
 * 最新の件数取得結果を使用し、件数を表示します。
 */
DDP.Search.SearchPanel.AreaPanel.MeshList.prototype._updateCountByLatestResult = function() {
	var result = this.latestResult;
	for(var i = 0, iLen = this.meshList.length; i < iLen; i++) {
		this.meshList[i].updateCount(result);
	}
	this.refreshStyle();
};
/**
 * 各メッシュのDOMとハンドラインスタンスを関連付けます。
 */
DDP.Search.SearchPanel.AreaPanel.MeshList.prototype._bindMeshes = function() {
	this.meshList = new Array();
	// 全てのメッシュについて処理を行う
	var , pnl = this.panel, area = this.area;
	for(var i = 0; true; i++){
		var node = getN('mesh_' + i);
		if (node == null) {
			break;
		}
		// メッシュのハンドラインスタンスの作成と初期化
		this.meshList[i] = new DDP.Search.SearchPanel.AreaPanel.Mesh(pnl, area, i);
		this.meshList[i].init();
	}
	// 既に件数が取得されている可能性を加味して読み込まれている件数を適応
	this._updateCountByLatestResult();
};
/////////////////////// DDP.Search.SearchPanel.AreaPanel.MeshList END ///////////////////////

////////////////////// DDP.Search.SearchPanel.AreaPanel.Mesh START //////////////////////
/**
 * コンストラクタ
 * @class 検索パネルの一つのメッシュを操作する為のクラス
 * @constructor
 * @param node 関連付けるリンクのNode
 * @param panel 検索パネルのインスタンス
 * @param area エリアパネルのインスタンス
 * @param num 関連付ける添え字の数値
 */
DDP.Search.SearchPanel.AreaPanel.Mesh = function(panel, area, num) {
	this.category = 'mesh';
	this.num = num;
	this.node = getN(this.category + '_' + this.num);
	this.panel = panel;
	this.area = area;
	this.count = NaN;
	this.isDisabled = false;
	return this;
};
/**
 * 初期化処理をおこないます。
 */
DDP.Search.SearchPanel.AreaPanel.Mesh.prototype.init = function() {
	var __this = this, ctg = this.category, n = this.num;
	this.hiddenNode = getN(ctg + '_value_' + n);
	this.anchorNode = getN(ctg + '_anchor_' + n);
	this.id = this.hiddenNode.value;
	this.name = this.anchorNode.innerHTML;
	// イベントの登録 : Meshリンク
	DDP.addEvent(__this.anchorNode, 'click', function() {
		var area = __this.area;
		if (__this.id == area.getSelectedArea() ||
			__this.count == 0 ||
			__this.isDisabled) {
			return false;
		}
		area.selectMesh(__this.id);
		return false;
	});
};
/**
 * 件数の更新を行います。
 * @param result 件数取得結果
 */
DDP.Search.SearchPanel.AreaPanel.Mesh.prototype.updateCount = function(result) {
	// カテゴリ自体の取得が出来ていない場合は、空のオブジェクトを作成する
	var ctg = this.category
	if (result[ctg] == null) result[ctg] = {};
	// 検索結果件数
	this.count = result[ctg][this.id];
	// 取得できなかった場合、0件
	if (!this.count){
		this.count = 0;
	}
};
/**
 * 今の状態で表示すべきスタイルを設定します。
 */
DDP.Search.SearchPanel.AreaPanel.Mesh.prototype.setStyle = function() {
	var selectedId = this.area.getSelectedArea(), anc = this.anchorNode;
	if (!this.count) this.count = 0;
	if (this.id == selectedId) {
		// 選択中のスタイル
		anc.removeAttribute('href');
		anc.className = DDP.Search.Const.MESH_LIST_SELECTED_STYLE;
	} else if (this.count != 0) {
		// 未選択のスタイルを適用
		DDP.addHrefJs(anc);
		anc.className = DDP.Search.Const.MESH_LIST_LINK_STYLE;
	} else {
		// 選択不可のスタイルを適用
		anc.removeAttribute('href');
		anc.className = DDP.Search.Const.MESH_LIST_NOLINK_STYLE;
	}
	anc.innerHTML = this.name + '(' + this.count + '件)';
};
/**
 * コントロールを使用不可に設定します。
 */
DDP.Search.SearchPanel.AreaPanel.Mesh.prototype.disable = function() {
	// 選択不可のスタイルを適用
	var anc = this.anchorNode;
	anc.removeAttribute('href');
	anc.className = DDP.Search.Const.MESH_LIST_DISABLE_STYLE;
	this.isDisabled = true;
};
/**
 * コントロールを使用可能に設定します。
 */
DDP.Search.SearchPanel.AreaPanel.Mesh.prototype.enable = function() {
	// 選択不可のスタイルを適用
	this.setStyle();
	this.isDisabled = false;
};
/////////////////////// DDP.Search.SearchPanel.AreaPanel.Mesh END ///////////////////////

///////////////////// DDP.Search.SearchPanel.AreaPanel.SubArea START /////////////////////
/**
 * コンストラクタ
 * @class 検索パネルのサブエリアを操作する為のクラスです。
 * @constructor
 * @param idKey コントロールID
 * @param panel 検索パネル
 * @param area 親のエリアパネル
 */
DDP.Search.SearchPanel.AreaPanel.SubArea = function(idKey, panel, area) {
	this.area = area;
	// pullDownとしての初期化
	DDP.Search.SearchPanel.PullDownWithCount.apply(this, arguments);
	// 幅調整ポップアップテーブル用
	getN(idMgr[idKey]).handler = this;
	// 調整テーブル
	this.areaTableMenu = new DDP.TableMenu(
		'txt_stay_area', idMgr['sub_area'], 'stay_area_frame', 'button_stay_area');
};
/**
 * 処理をプロトタイプにコピー
 */
DDP.Search.SearchPanel.AreaPanel.SubArea.prototype = new DDP.Search.SearchPanel.PullDownWithCount();
/**
 * changeイベントが発生した場合の処理です。
 */
DDP.Search.SearchPanel.AreaPanel.SubArea.prototype.onChangeEvent = function() {
	var n = this.node;
	if (n == null) { return; }
	// 前回と今回が同じものを選択していた場合、処理を行わない
	if (n.selectedIndex == n.prevIndex) { return; }
	var a = this.area, p = this.panel;
	// 指定無しが選ばれたかどうか
	if (this.isExclusion(this.getSelectedValue())) {
		// 選択されている県を選択エリアとする
		a.hiddenNode.value = a.prefecture.getSelectedValue();
	} else {
		// 0件の選択をしたら処理を終了
		if (DDP.existClass(this.getSelectedOption(),
				DDP.Search.Const.DISABLE_PULL_DOWN_ITEM_STYLE)) {
			n.selectedIndex = n.prevIndex;
			return;
		}
		a.hiddenNode.value = this.getSelectedValue();
	}
	n.prevIndex = n.selectedIndex;
	a.meshList.clear();
	p.updateForAjax();
	p.updateCountForAjax();
};
/**
 * 対象が件数表示対象のoption.valueか否かチェックします。
 * @return true:除外対象, false:表示対象
 * @type boolean
 */
DDP.Search.SearchPanel.AreaPanel.SubArea.prototype.isExclusion = function(value) {
	return value == '';
};
/**
 * コントロールを使用不可に設定します。
 */
DDP.Search.SearchPanel.AreaPanel.SubArea.prototype.disable = function() {
	this.areaTableMenu.disable();
	DDP.Search.PullDown.prototype.disable.apply(this, arguments);
};
/**
 * コントロールを使用可能に設定します。
 */
DDP.Search.SearchPanel.AreaPanel.SubArea.prototype.enable = function() {
	this.areaTableMenu.enable();
	DDP.Search.PullDown.prototype.enable.apply(this, arguments);
};
/**
 * 件数の更新を行います
 * @param result 件数取得結果
 */
DDP.Search.SearchPanel.AreaPanel.SubArea.prototype.updateCount = function(result) {
	DDP.Search.SearchPanel.PullDownWithCount.prototype.updateCount.apply(this, arguments);
	this.updateTableMenu();
};
/**
 * IE用調整テーブルを更新します。
 */
DDP.Search.SearchPanel.AreaPanel.SubArea.prototype.updateTableMenu = function() {
	this.areaTableMenu.update();
};
////////////////////// DDP.Search.SearchPanel.AreaPanel.SubArea END //////////////////////

////////////////////// DDP.Search.AirPanel START //////////////////////
/**
 * コンストラクタ
 * @class 航空検索結果/検索条件を操作する為のクラスです。
 * @constructor
 */
DDP.Search.AirPanel = function() {
	return this;
};
/**
 * 初期化処理をおこないます。
 */
DDP.Search.AirPanel.prototype.init = function() {
	var __this = this,
		rpf = DDP.Search.Const.RESULT_PREFIX, gopf = DDP.Search.Const.GO_PREFIX, repf = DDP.Search.Const.RETURN_PREFIX,
		el = DDP.Element, cpnl = DDP.Search.AirPanel.ConditionPanel, rpnl = DDP.Search.AirPanel.ResultPanel;
	// 航空エリア
	this.panel = new el('air_area');
	// ローディングエリア
	this.loadingArea = new el('wait_animation');
	// 往路条件入力パネル
	this.goConditionPanel = new cpnl(
		this, DDP.Search.Const.AIR_REFERENCE_TYPE_GO, gopf);
	this.goConditionPanel.init();
	// 復路条件入力パネル
	this.reConditionPanel = new cpnl(
		this, DDP.Search.Const.AIR_REFERENCE_TYPE_RETURN, repf);
	this.reConditionPanel.init();
	// マルチ空港メッセージリスト
	this.multiList = new DDP.Search.AirPanel.MultiList(this);
	this.multiList.init();
	// 往路結果パネル
	this.goResultPanel = new rpnl(this, rpf + gopf);
	this.goResultPanel.init();
	// 復路結果パネル
	this.reResultPanel = new rpnl(this, rpf + repf);
	this.reResultPanel.init();
	// キャリアプルダウン
	this.career = new DDP.Search.AirPanel.PullDown(
		'career', this, DDP.Search.Const.AIR_REFERENCE_TYPE_ROUND_TRIP);
	this.career.init();
	// 運賃種別条件
	this.fareCondition = new DDP.Search.AirPanel.FareCondition(this);
	this.fareCondition.init();
	// 更新日時
	this.updateTimeNode = getN('air_update_time');
};
/**
 * 選択中の航空金額を取得します。
 * @return 取得した金額
 * @type Number
 */
DDP.Search.AirPanel.prototype.getAmount = function() {
	return this.goResultPanel.getAmount() + this.reResultPanel.getAmount();
};
/**
 * Ajaxを使用して航空検索をおこないます。
 * @param refType 照会区分（往路のみ、復路のみ、往復のいずれかを設定）
 */
DDP.Search.AirPanel.prototype.searchAir = function(refType) {
	var __this = this;
	// 処理中画像を表示
	__this.showLoadingArea();
	// 件数取得メソッドを呼び出し
	this.callSearchAirMethod(
		// 検索区分（往路のみ、復路のみ、往復）
		refType,
		// 成功時のコールバックメソッド
		function(response) {
			console.log('AirPanel.searchAir : ', response);
			if (response.resultCode == DDP.Search.Const.WEB_METHOD_RESULT_CODE_SUCCESS) {
				console.log('SearchAir 成功時コールバックメソッド');
				// --- 正常系処理 ---
				var result = response.result;
				// 往路結果の更新
				if (result.RefType != DDP.Search.Const.AIR_REFERENCE_TYPE_RETURN) {
					var gcPnl = __this.goConditionPanel, gResult = result.GoSearchFlightResult;
					// 検索結果を更新
					__this.goResultPanel.update(gResult);
					// 検索条件の状態を更新
					gcPnl.update(gResult);
					// エラー内容更新
					gcPnl.updateError(gResult.Error);
				}
				// 復路結果の更新
				if (result.RefType != DDP.Search.Const.AIR_REFERENCE_TYPE_GO) {
					var rcPnl = __this.reConditionPanel, rResult = result.ReturnSearchFlightResult;
					// 検索結果を更新
					__this.reResultPanel.update(rResult);
					// 検索条件の状態を更新
					rcPnl.update(rResult);
					// エラー内容更新
					rcPnl.updateError(rResult.Error);
				}
				// マルチ空港メッセージの更新
				__this.multiList.update(result);
				// 更新
				__this.setUpdateTime(result);
			} else {
				// 入力エラー以外のエラー内容
			}
			// 処理中画像を非表示
			__this.hideLoadingArea();
		}
	);
};
/**
 * 航空検索コールバックメソッド
 * 使用するクラスによって上書きされることを想定しています
 * @param refType 検索区分（往路のみ、復路のみ、往復）
 * @param onSuccessCallBack 成功時コールバックメソッド
 */
DDP.Search.AirPanel.prototype.callSearchAirMethod = function(refType, onSuccessCallBack) {
	console.log('refType : ' + refType);
	onSuccessCallBack({});
};
/**
 * 設定されている検索条件を取得します。
 */
DDP.Search.AirPanel.prototype.getAirCondtition = function() {
	var selectedArea = '';
	if (this.area) {
		selectedArea = this.area.getSelectedArea();
	}
	var goCondition = this.goConditionPanel.getCondition();
	goCondition.fare = this.fareCondition.goSelected;
	var reCondition = this.reConditionPanel.getCondition();
	reCondition.fare = this.fareCondition.reSelected;
	return {
		'go' : goCondition,
		're' : reCondition,
		'career' : this.career.getSelectedValue()
	}
};
/**
 * 更新時間の画面に設定します。
 * @param result 航空空席照会結果
 */
DDP.Search.AirPanel.prototype.setUpdateTime = function(result) {
	// 往路結果の更新
	if (result.RefType != DDP.Search.Const.AIR_REFERENCE_TYPE_RETURN) {
		var gResult = result.GoSearchFlightResult;
		this.goDigitUpdateTime = gResult.DigitUpdateTime;
		this.goDispUpdateTime = gResult.DispUpdateTime;
	}
	// 復路結果の更新
	if (result.RefType != DDP.Search.Const.AIR_REFERENCE_TYPE_GO) {
		var rResult = result.ReturnSearchFlightResult;
		this.reDigitUpdateTime = rResult.DigitUpdateTime;
		this.reDispUpdateTime = rResult.DispUpdateTime;
	}
	// 0だった場合はデータなしのため、もう一つのデータを表示
	if (this.reDigitUpdateTime != 0 && this.reDigitUpdateTime < this.goDigitUpdateTime) {
		// 復路更新時間がnull、もしくは往路更新時間の方が新しい場合
		this.updateTimeNode.innerHTML = this.reDispUpdateTime;
	} else {
		this.updateTimeNode.innerHTML = this.goDispUpdateTime;
	}
};
/**
 * 合計料金を計算し、画面に表示します。
 */
DDP.Search.AirPanel.prototype.setTotalAmount = function() {
};
/**
 * 連動条件を取得します。
 */
DDP.Search.AirPanel.prototype.getAirLinkageCondition = function() {
	var goCount = this.goResultPanel.getCount(),
		reCount = this.reResultPanel.getCount();
	if (goCount == 0 && reCount == 0) {
		return null;
	}
	var goArrivalTime = null, returnDepartureTime = null;
	if (0 < goCount) {
		goArrivalTime = this.goResultPanel.getSelectedFlightInfo().ArrivalHms;
	}
	if (0 < reCount) {
		returnDepartureTime = this.reResultPanel.getSelectedFlightInfo().DepartureHms;
	}
	return {
		'GoArrivalTime' : goArrivalTime,
		'ReturnDepartureTime' : returnDepartureTime
	};
};
/**
 * ローディング領域を表示します。
 */
DDP.Search.AirPanel.prototype.showLoadingArea = function() {
	this.loadingArea.show();
	this.panel.hide();
};
/**
 * ローディング領域を非表示にします。
 */
DDP.Search.AirPanel.prototype.hideLoadingArea = function() {
	this.loadingArea.hide();
	this.panel.element.style.display = 'block';
};
////////////////////// DDP.Search.AirPanel END //////////////////////

////////////////////// DDP.Search.AirPanel.ConditionPanel Start //////////////////////
/**
 * コンストラクタ
 * @class 航空検索条件を操作する為のクラスです。
 * @constructor
 * @param panel 航空パネル
 * @param refType 検索区分（往路のみ、復路のみ、往復）
 * @param idPrefix IDのプリフィックス
 */
DDP.Search.AirPanel.ConditionPanel = function(panel, refType, idPrefix) {
	this.panel = panel;
	this.refType = refType;
	this.idPrefix = idPrefix;
	return this;
};
/**
 * 航空検索パネル条件入力パネル
 */
DDP.Search.AirPanel.ConditionPanel.prototype.init = function() {
	var idp = this.idPrefix, pnl = this.panel, rt = this.refType,
		pl = DDP.Search.AirPanel.PullDown;
	// 出発空港
	this.departureAirport = new pl(idp + 'departure_airport', pnl, rt);
	this.departureAirport.init();
	// 到着空港
	this.arrivalAirport = new pl(idp + 'arrival_airport', pnl, rt);
	this.arrivalAirport.init();
	// 時間帯
	this.time = new pl(idp + 'time', pnl, rt);
	this.time.init();
	// シートクラス
	this.seat = new DDP.Search.AirPanel.SeatPullDown(idp + 'seat', pnl, rt);
	this.seat.init();
	// 選択済み運賃名称
	this.selectedFareName = getN(idMgr[idp + 'selected_fare_name']);
	// エラーメッセージ
	this.errorMessageNode = getN(idp + 'condition_error_message');
	// エラーメッセージ領域
	this.errorMessagePanelNode = getN(idp + 'message_panel');
	// エラーハイライト
	this.departureAirportTrNode = getN(idp + 'departure_airport_tr');
	this.arrivalAirportTrNode = getN(idp + 'arrival_airport_tr');
};
/**
 * 設定されている検索条件を取得します。
 */
DDP.Search.AirPanel.ConditionPanel.prototype.getCondition = function() {
	return {
		'departureAirport' : this.departureAirport.getSelectedValue(),
		'arrivalAirport' : this.arrivalAirport.getSelectedValue(),
		'time' : this.time.getSelectedValue(),
		'seat' : this.seat.getSelectedValue()
	};
};
/**
 * マルチ空港選択処理を行います。
 * @param selectAirport 選択空港
 */
DDP.Search.AirPanel.ConditionPanel.prototype.selectMultiAirport = function(selectAirport) {
	// 往路用の検索条件入力パネルの場合は、到着空港を変更
	var rt = this.refType;
	if (rt == DDP.Search.Const.AIR_REFERENCE_TYPE_GO) {
		this.arrivalAirport.select(selectAirport);
	}
	// 復路用の検索条件入力パネルの場合は、出発空港を変更
	if (rt == DDP.Search.Const.AIR_REFERENCE_TYPE_RETURN) {
		this.departureAirport.select(selectAirport);
	}
};
/**
 * 結果を更新します。
 * @param result 検索結果
 */
DDP.Search.AirPanel.ConditionPanel.prototype.update = function(result) {
	this.seat.update(result);
};
/**
 * エラー表示処理を行ないます。
 * @param errors エラーメッセージリスト
 */
DDP.Search.AirPanel.ConditionPanel.prototype.updateError = function(errors) {
	var mesArr = [''], idx = 1;
	for(var key in errors) {
		mesArr[idx++] = errors[key] + '<br />';
	}
	var message = mesArr.join('');
	if (message != '') {
		this.errorMessageNode.innerHTML = message;
		this.errorMessagePanelNode.style.display = '';
		// 発着空港エラーハイライト
		var errStyle = DDP.Search.Const.AIR_SEARCH_CONDTION_ERROR_TABLE_CELL_STYLE;
		this.departureAirportTrNode.className = errStyle;
		this.arrivalAirportTrNode.className = errStyle;
	} else {
		this.clearError();
	}
};
/**
 * エラーを非表示にします。
 */
DDP.Search.AirPanel.ConditionPanel.prototype.clearError = function() {
	DDP.setVisible(this.errorMessagePanelNode, false);
	var normalStyle = DDP.Search.Const.AIR_SEARCH_CONDTION_NORMAL_TABLE_CELL_STYLE;
	this.departureAirportTrNode.className = normalStyle;
	this.arrivalAirportTrNode.className = normalStyle;
};
/**
 * 選択済み運賃名称を設定します。
 */
DDP.Search.AirPanel.ConditionPanel.prototype.setSelectedFareName = function(fareName) {
	this.selectedFareName.innerHTML = fareName;
};
/////////////////////// DDP.Search.AirPanel.ConditionPanel END ///////////////////////

/////////////////////// DDP.Search.AirPanel.FareCondition START ///////////////////////
/**
 * コンストラクタ
 * @class
 * @constructor
 * @param panel 航空検索パネルのインスタンス
 * @param refType 検索区分（往路のみ、復路のみ、往復）
 */
DDP.Search.AirPanel.FareCondition = function(panel) {
	this.panel = panel;
	this.fareButtonList = [];
	// 選択済みHidden
	this.goSelected = getN(idMgr['go_selected_fare']).value;
	this.reSelected = getN(idMgr['return_selected_fare']).value;
};
/**
 * 初期化します。
 */
DDP.Search.AirPanel.FareCondition.prototype.init = function() {
	var __this = this, pnl = this.panel, addE = DDP.addEvent;
	// 解除リンク
	var unselectFunc = function(ref) {
		return function() {
			__this.selectFare(false, null, ref);
		}
	};
	// 解除リンク
	addE(getN('go_fare_clear'), 'click', unselectFunc(DDP.Search.Const.AIR_REFERENCE_TYPE_GO));
	addE(getN('return_fare_clear'), 'click', unselectFunc(DDP.Search.Const.AIR_REFERENCE_TYPE_RETURN));
	addE(getN('fare_clear'), 'click', unselectFunc(DDP.Search.Const.AIR_REFERENCE_TYPE_ROUND_TRIP));
	for(var i = 0; true; i++) {
		var linkNode = getN(idMgr['fare_condition_link_' + i]);
		if (linkNode == null) {
			break;
		}
		this.fareButtonList[i] = new DDP.Search.AirPanel.FareLink(linkNode, pnl, this, getN(idMgr['fare_code_' + i]).value);
		this.fareButtonList[i].init();
	}
	this.updateRendering();
};
/**
 * 選択されている運賃種別を連結した文字列を取得します。
 * @return 連結した運賃種別の文字列
 * @type String
 */
DDP.Search.AirPanel.FareCondition.prototype.getSelectedValue = function(ref) {
	return ref == DDP.Search.Const.AIR_REFERENCE_TYPE_GO ? this.goSelected : this.reSelected;
};
/**
 * 選択している運賃の名称を取得します。
 * 選択している運賃がない場合は、'指定なし'を返します。
 * @return 選択中の運賃名称
 */
DDP.Search.AirPanel.FareCondition.prototype.getSelectedFareName = function(selected) {
	for(var i = 0, iLen = this.fareButtonList.length; i < iLen; i++) {
		var fare = this.fareButtonList[i];
		if (fare.fareCode == selected) {
			return fare.getFareName();
		}
	}
	return DDP.Search.Const.SUB_AREA_NO_SELECTED_TEXT_UNSELECTABLE;
};

/**
 * 指定した運賃の選択状態を変更します。
 * @param flag 選択する状態
 * @param fareCode 運賃種別
 * @param ref 設定する区間 何も指定しない場合は両区間
 */
DDP.Search.AirPanel.FareCondition.prototype.selectFare = function(flag, fareCode, ref) {
	var refT = DDP.Search.Const.AIR_REFERENCE_TYPE_ROUND_TRIP;
	// 区間指定なしはどっちも更新
	if (ref == refT ||
		ref == DDP.Search.Const.AIR_REFERENCE_TYPE_GO) {
		this.goSelected = flag ? fareCode : '';
	}
	if (ref == refT ||
		ref == DDP.Search.Const.AIR_REFERENCE_TYPE_RETURN) {
		this.reSelected = flag ? fareCode : '';
	}
	this.panel.searchAir(ref);
	this.updateRendering();
};
/**
 * 
 */
DDP.Search.AirPanel.FareCondition.prototype.updateRendering = function() {
	var pnl = this.panel;
	// 名称の更新
	pnl.goConditionPanel.setSelectedFareName(this.getSelectedFareName(this.goSelected));
	pnl.reConditionPanel.setSelectedFareName(this.getSelectedFareName(this.reSelected));
	// 選択済みのリストの更新
	for(var i = 0, iLen = this.fareButtonList.length; i < iLen; i++) {
		this.fareButtonList[i].setStyle();
	}
};
/////////////////////// DDP.Search.AirPanel.FareCondition END ///////////////////////

/////////////////////// DDP.Search.AirPanel.FareLink START ///////////////////////
/**
 * コンストラクタ
 * @class 運賃種別のボタンを表すクラスです。
 * @constructor
 * @param num 何番目の運賃種別条件かを表す添え字
 * @param panel 航空検索パネルのインスタンス
 * @param refType 検索区分（往路のみ、復路のみ、往復）
 */
DDP.Search.AirPanel.FareLink = function(linkNode, panel, parent, fareCode) {
	this.panel = panel;
	this.condition = parent;
	this.linkNode = linkNode;
	this.fareCode = fareCode;
	this.isDisabled = false;
};
/**
 * 初期化
 */
DDP.Search.AirPanel.FareLink.prototype.init = function() {
	var __this = this;
	// 初期スタイルを設定
	this.setStyle();
	// イベントの登録 : こだわり条件ボタン
	DDP.addEvent(this.linkNode, 'click', function() {
		if (__this.isDisabled) {
			return false;
		}
		__this.switchSelect();
		return false;
	});
};
/**
 * 選択状態を設定します
 * @param flag 選択フラグ .. 選択済み:true, 未選択:false
 */
DDP.Search.AirPanel.FareLink.prototype.select = function(flag) {
	this.condition.selectFare(flag, this.fareCode, DDP.Search.Const.AIR_REFERENCE_TYPE_ROUND_TRIP);
};
/**
 * 選択されているか判定します
 * @return 選択されている場合true、非選択の場合false
 * @type boolean
 */
DDP.Search.AirPanel.FareLink.prototype.isSelected = function() {
	if (this.fareCode == this.condition.goSelected &&
		this.fareCode == this.condition.reSelected) {
		return true;
	}
	return false;
};
/**
 * 選択状態を切り替えます。
 * 選択されていれば非選択に、非選択であれば選択に変更します。
 */
DDP.Search.AirPanel.FareLink.prototype.switchSelect = function() {
	this.select(!this.isSelected())
};
/**
 * 今の状態で表示すべきスタイルを設定します。
 */
DDP.Search.AirPanel.FareLink.prototype.setStyle = function() {
	var lnk = this.linkNode;
	DDP.addHrefJs(lnk);
	lnk.className = this.isSelected() ? DDP.Search.Const.SELECTED_BUTTON_LINK_STYLE : DDP.Search.Const.ABLE_BUTTON_LINK_STYLE;
};
/**
 * 運賃名称を返します。
 * @return 運賃名称
 */
DDP.Search.AirPanel.FareLink.prototype.getFareName = function() {
	return this.linkNode.innerHTML;
};
/////////////////////// DDP.Search.AirPanel.FareLink END ///////////////////////

////////////////////// DDP.Search.AirPanel.PullDown START //////////////////////
/**
 * コンストラクタ
 * @class 航空検索のプルダウンを操作する為のクラスです。
 * @constructor
 * @param idKey サーバ上でのコントロールID
 * @param panel 航空検索パネルのインスタンス
 * @param refType 検索区分（往路のみ、復路のみ、往復）
 */
DDP.Search.AirPanel.PullDown = function(idKey, panel, refType) {
	this.panel = panel;
	this.refType = refType;
	// pullDownとしての初期化
	DDP.Search.PullDown.apply(this, arguments);
	return this;
};
/**
 * プロトタイプをコピー
 */
DDP.Search.AirPanel.PullDown.prototype = new DDP.Search.PullDown();
/**
 * changeイベントが発生した場合の処理を記述
 */
DDP.Search.AirPanel.PullDown.prototype.onChangeEvent = function() {
	this.panel.searchAir(this.refType);
};
/////////////////////// DDP.Search.AirPanel.PullDown END ///////////////////////

////////////////////// DDP.Search.AirPanel.SeatPullDown START //////////////////////
/**
 * コンストラクタ
 * @class 航空検索パネルの座席クラスのプルダウンを操作する為のクラスです。
 * @constructor
 * @param idKey サーバ上でのコントロールID
 * @param panel 航空検索パネルのインスタンス
 * @param refType 検索区分（往路のみ、復路のみ、往復）
 */
DDP.Search.AirPanel.SeatPullDown = function(idKey, panel, refType) {
	DDP.Search.AirPanel.PullDown.apply(this, arguments);
	return this;
};
/**
 * プロトタイプをコピー
 */
DDP.Search.AirPanel.SeatPullDown.prototype = new DDP.Search.AirPanel.PullDown();
/**
 * changeイベントが発生した場合の処理を記述
 */
DDP.Search.AirPanel.SeatPullDown.prototype.onChangeEvent = function() {
	var n = this.node;
	// 選択不可を選択したら、選択させないで処理を終了
	if (DDP.existClass(this.getSelectedOption(), DDP.Search.Const.DISABLE_PULL_DOWN_ITEM_STYLE)) {
		n.selectedIndex = n.prevIndex;
		return;
	}
	n.prevIndex = n.selectedIndex;
	this.panel.searchAir(this.refType);
};
/**
 * 結果によって状態を変化させる
 * @param result 航空検索結果
 */
DDP.Search.AirPanel.SeatPullDown.prototype.update = function(result) {
	// 普通席以外項目のIndexを取得
	var otherSeatIndex = this.getValueIndex(DDP.Search.Const.AIR_SEARCH_OTHER_SEAT_VALUE);
	if (!result.IsExsitOtherSeat) {
		// 普通席以外がある場合は、スタイルを選択可能に設定
		DDP.addClass(this.node.options[otherSeatIndex], DDP.Search.Const.DISABLE_PULL_DOWN_ITEM_STYLE);
	} else {
		// 普通席以外がない場合は、スタイルを選択不能に設定
		DDP.removeClass(this.node.options[otherSeatIndex], DDP.Search.Const.DISABLE_PULL_DOWN_ITEM_STYLE);
	}
};
/////////////////////// DDP.Search.AirPanel.SeatPullDown END ///////////////////////

/////////////////////// DDP.Search.AirPanel.ResultPanel START ///////////////////////
/**
 * コンストラクタ
 * @class 航空検索結果を操作する為のクラスです。
 * @constructor
 * @param panel 関連付ける航空検索パネル
 * @param idPrefix コントロールIDの接頭語
 */
DDP.Search.AirPanel.ResultPanel = function(panel, idPrefix) {
	this.panel = panel;
	this.idPrefix = idPrefix;
};
/**
 * 初期化処理を行ないます。
 */
DDP.Search.AirPanel.ResultPanel.prototype.init = function() {
	var idPf = this.idPrefix;
	// 総件数
	this.allCountNode = getN(idPf + 'all_count');
	// 表示件数
	this.displayCountNode = getN(idPf + 'display_count');
	// 選択フライト保存領域
	this.selectedFlightNode = getN(idMgr[idPf + 'selected']);
	// 選択フライト料金
	this.selectedFlightAmount = 0;
	// フライト日付
	this.resultDateNode = getN(idPf + 'date');
	// 結果リストテーブルNode
	this.resultListTableNode = getN(idPf + 'table');
	// 更新リンク
	this.updateLink = getN(idPf + 'update');
	// 結果リスト
	this.resultList = new Array();
	for(var i = 0, iLen = DDP.Search.Const.AIR_RESULT_LENGTH; i < iLen; i++) {
		this.resultList[i] = new DDP.Search.AirPanel.ResultRow(this, idPf, i);
		this.resultList[i].init();
	}
	// エラーテーブルNode
	this.resultErrorTableNode = getN(idPf + 'error_table');
	// エラーメッセージNode
	this.resultErrorMessageNode = getN(idPf + 'error_message');
};
/**
 * 指定された検索結果で画面の結果を更新します。
 * @param result 検索結果
 */
DDP.Search.AirPanel.ResultPanel.prototype.update = function(result) {
	var _sv = DDP.setVisible;
	// 日付を更新する
	this.resultDateNode.innerHTML = result.FlightDate;
	// 総件数を更新する
	this.allCountNode.innerHTML = result.ResultLength;
	_sv(this.updateLink, !(result.ResultLength == 0));
	// 結果リスト
	var vacantList = result.SegVacantSeatResultList;
	// 表示件数を更新する
	this.displayCountNode.innerHTML = vacantList.length;
	// 結果が取得できない場合は、エラーメッセージを表示し、結果を非表示にする
	if (!vacantList || vacantList.length == 0) {
		_sv(this.resultListTableNode, false);
		_sv(this.resultErrorTableNode, true);
		this.selectedFlightNode.value = '';
		this.selectedFlightAmount = 0;
		return;
	}
	// 結果が取得できた場合には、エラーメッセージを非表示にし、結果を表示する
	_sv(this.resultListTableNode, true);
	_sv(this.resultErrorTableNode, false);
	// 結果をクリアする
	this.clear();
	// リストを更新する
	for(var i = 0, iLen = DDP.Search.Const.AIR_RESULT_LENGTH; i < iLen; i++) {
		this.resultList[i].update(vacantList[i]);
	}
	// 1便目を選択する
	this.selectAir(0);
};
/**
 * 結果内容をクリアします。
 */
DDP.Search.AirPanel.ResultPanel.prototype.clear = function() {
	// 結果をクリアする
	for(var i = 0, iLen = DDP.Search.Const.AIR_RESULT_LENGTH; i < iLen; i++) {
		this.resultList[i].clear();
	}
};
/**
 * 指定した航空便を選択便とし、他の便の選択を解除します。
 * @param selectValue 選択する便のインデックス
 */
DDP.Search.AirPanel.ResultPanel.prototype.selectAir = function(selectValue) {
	this.selectClear();
	var resultItem = this.resultList[selectValue], flightInfo = resultItem.flightInfo;
	resultItem.button.select();
	this.setStyleAll();
	// 文字列の集合を渡す
	this.selectedFlightNode.value = flightInfo.Aggregate;
	this.selectedFlightAmount = flightInfo.FareAmt;
	// 金額の更新
	this.panel.setTotalAmount();
};
/**
 * 航空検索結果の選択便の色を変えます。
 */
DDP.Search.AirPanel.ResultPanel.prototype.selectClear = function() {
	// 結果をクリアする
	for(var i = 0, iLen = DDP.Search.Const.AIR_RESULT_LENGTH; i < iLen; i++) {
		var resultItem = this.resultList[i];
		if (resultItem.button) {
			resultItem.button.unselect();
		}
	}
};
/**
 * 航空検索結果の選択便の色を変える。
 */
DDP.Search.AirPanel.ResultPanel.prototype.setStyleAll = function() {
	for(var i = 0, iLen = this.resultList.length; i < iLen; i++) {
		var resultItem = this.resultList[i];
		if (resultItem.button) {
			resultItem.button.setStyle();
		}
	}
};
/**
 * 航空金額を取得します。
 * @return 航空便の金額
 * @type Number
 */
DDP.Search.AirPanel.ResultPanel.prototype.getAmount = function() {
	// 数値に変換
	return this.selectedFlightAmount - 0;
};
/**
 * 件数を取得します。
 * @return {Number}
 */
DDP.Search.AirPanel.ResultPanel.prototype.getCount = function() {
	return this.displayCountNode.innerHTML - 0;
};
/**
 * 選択された航空便情報を取得します。
 */
DDP.Search.AirPanel.ResultPanel.prototype.getSelectedFlightInfo = function() {
	for(var i = 0, iLen = this.resultList.length; i < iLen; i++) {
		var resultItem = this.resultList[i];
		if (resultItem.button.selected) {
			return resultItem.getFlightInfo();
		}
	}
	return null;
};
//////////////////////// DDP.Search.AirPanel.ResultPanel END ////////////////////////

/////////////////////// DDP.Search.AirPanel.ResultRow START ///////////////////////

/**
 * コンストラクタ
 * @class 航空検索結果の各行を操作する為のクラスです。
 * @constructor
 * @param panel 関連付ける航空検索パネル
 * @param idPrefix コントロールIDの接頭語
 * @param num IDの最後につける添え数値
 */
DDP.Search.AirPanel.ResultRow = function(panel, idPrefix, num) {
	this.panel = panel;
	this.idPrefix = idPrefix;
	this.num = num;
};
/**
 * 初期化処理を行ないます。
 */
DDP.Search.AirPanel.ResultRow.prototype.init = function() {
	var idPf = this.idPrefix, n = this.num;
	this.airButtonCellNode = getN(idPf + 'check_cell_' + n);
	this.departureNode = getN(idPf + 'departure_' + n);
	this.arrivalNode = getN(idPf + 'arrival_' + n);
	this.airplaneNode = getN(idPf + 'airplane_' + n);
	this.seatNode = getN(idPf + 'seat_' + n);
	this.amountNode = getN(idPf + 'amount_' + n);
};
/**
 * 航空検索結果を反映します。
 * @param flightInfo 便情報
 */
DDP.Search.AirPanel.ResultRow.prototype.update = function(flightInfo) {
	if (!flightInfo) return;
	var idPf = this.idPrefix, n = this.num;
	console.log('ResultRow.update : ', flightInfo);
	// 自身にフライト情報を保持
	this.flightInfo = flightInfo;
	this.airButtonCellNode.innerHTML = DDP.formatMessage(
		DDP.Search.Const.AIR_RESULT_RADIO_BUTTON_TEMPLATE, idPf, n);
	// 出発空港／時間
	this.departureNode.innerHTML = flightInfo.DispDeparture;
	// 到着空港／時間
	this.arrivalNode.innerHTML = flightInfo.DispArrival;
	// 便名
	this.airplaneNode.innerHTML = flightInfo.DispAirplane;
	// 座席／運賃
	this.seatNode.innerHTML = flightInfo.DispSeat;
	// 大人1名(マイル)
	this.amountNode.innerHTML = flightInfo.DispAmount;
	this.button = new DDP.Search.AirPanel.AirSelectButton(getN(idPf + '_check_' + n), this);
	this.button.init();
};
/**
 * 内容をクリアします。
 */
DDP.Search.AirPanel.ResultRow.prototype.clear = function() {
	this.airButtonCellNode.innerHTML = '&nbsp;';
	this.departureNode.innerHTML = '&nbsp;';
	this.arrivalNode.innerHTML = '&nbsp;';
	this.airplaneNode.innerHTML = '&nbsp;';
	this.seatNode.innerHTML = '&nbsp;';
	this.amountNode.innerHTML = '&nbsp;';
};
/**
 * 選択済みスタイルにスタイルを設定します。
 */
DDP.Search.AirPanel.ResultRow.prototype.setSelectedStyle = function() {
	var clsNme = DDP.Search.Const.AIR_RESULT_OTHER_CELL_SELECTED_STYLE;
	this.airButtonCellNode.className = DDP.Search.Const.AIR_RESULT_RADIO_CELL_SELECTED_STYLE;
	this.departureNode.className = clsNme;
	this.arrivalNode.className = clsNme;
	this.airplaneNode.className = clsNme;
	this.seatNode.className = clsNme;
	this.amountNode.className = clsNme;
};
/**
 * 通常スタイルにスタイルを設定します。
 */
DDP.Search.AirPanel.ResultRow.prototype.setNormalStyle = function() {
	this.airButtonCellNode.className = DDP.Search.Const.AIR_RESULT_RADIO_CELL_NORMAL_STYLE;
	var clsNme = DDP.Search.Const.AIR_RESULT_OTHER_CELL_NORMAL_STYLE;
	this.departureNode.className = clsNme;
	this.arrivalNode.className = clsNme;
	this.airplaneNode.className = clsNme;
	this.seatNode.className = clsNme;
	this.amountNode.className = clsNme;
};
/**
 * 航空便情報を取得します。
 */
DDP.Search.AirPanel.ResultRow.prototype.getFlightInfo = function() {
	var fi = this.flightInfo;
	return {
		'DepartureHms' : fi.DispDepartureHms,
		'ArrivalHms' : fi.DispArrivalHms
	};
};
//////////////////////// DDP.Search.AirPanel.ResultRow END ////////////////////////

//////////////////// DDP.Search.AirPanel.AirSelectButton START //////////////////////
/**
 * コンストラクタ
 * @class 航空検索結果に表示するラジオボタンを操作する為のクラスです。
 * @constructor
 * @param node 操作対象のノード
 * @param resultRow 対象の行番号
 */
DDP.Search.AirPanel.AirSelectButton = function(node, resultRow) {
	DDP.Search.RadioButton.apply(this, arguments);
	this.resultRow = resultRow;
	this.index = this.node.value;
	return this;
};
/**
 * プロトタイプをコピー
 */
DDP.Search.AirPanel.AirSelectButton.prototype = new DDP.Search.RadioButton();
/**
 * ボタンを押した際の動作を処理します。
 */
DDP.Search.AirPanel.AirSelectButton.prototype.onClickEvent = function() {
	this.resultRow.panel.selectAir(this.index);
};
/**
 * 選択された項目のスタイルを設定します。
 */
DDP.Search.AirPanel.AirSelectButton.prototype.setSelectedStyle = function() {
	this.resultRow.setSelectedStyle();
};
/**
 * 選択されていない項目のスタイルを設定します。
 */
DDP.Search.AirPanel.AirSelectButton.prototype.setNormalStyle = function() {
	this.resultRow.setNormalStyle();
};
////////////////////// DDP.Search.AirPanel.AirSelectButton END ///////////////////////

//////////////////////// DDP.Search.AirPanel.MultiList START ////////////////////////
/**
 * コンストラクタ
 * @class 航空検索結果におけるマルチ空港候補の操作を行なう為のクラスです。
 * @constructor
 * @param panel 関連付ける航空検索パネル
 */
DDP.Search.AirPanel.MultiList = function(panel) {
	this.panel = panel;
};
/**
 * 初期化処理を行ないます。
 */
DDP.Search.AirPanel.MultiList.prototype.init = function() {
	var pnl = this.panel;
	// マルチ空港リスト
	this.multiListNode = getN('multi_list');
	// 往路
	this.goMulti = new DDP.Search.AirPanel.MultiHalfRT(
		pnl, pnl.goConditionPanel,
		DDP.Search.Const.AIR_REFERENCE_TYPE_GO,
		'GoSearchFlightResult', 'SegArrivalMultiList',
		DDP.Search.Const.GO_PREFIX, '往路');
	this.goMulti.init();
	// 復路
	this.reMulti = new DDP.Search.AirPanel.MultiHalfRT(
		pnl, pnl.reConditionPanel,
		DDP.Search.Const.AIR_REFERENCE_TYPE_RETURN,
		'ReturnSearchFlightResult', 'SegDepatureMultiList',
		DDP.Search.Const.RETURN_PREFIX, '復路');
	this.reMulti.init();
};
/**
 * 結果を更新します。
 * @param result 検索結果
 */
DDP.Search.AirPanel.MultiList.prototype.update = function(result) {
	var gm = this.goMulti, rm = this.reMulti;
	// マルチ空港情報をそれぞれ渡す
	gm.update(result);
	rm.update(result);
	// マルチ空港リストメッセージを更新する
	this._updateMultiListMessage();
	// 表示したメッセージのリンクにイベント等をバインドする
	gm.bindLinkList();
	rm.bindLinkList();
};
/**
 * マルチ空港リストのメッセージを更新します。
 */
DDP.Search.AirPanel.MultiList.prototype._updateMultiListMessage = function() {
	// 往路部復路部のメッセージを取得する
	var goMultiMessage = this.goMulti.getMultiMessage(),
		reMultiMessage = this.reMulti.getMultiMessage();
	// マルチ空港のメッセージがある場合
	if (0 < goMultiMessage.length + reMultiMessage.length) {
		// マルチ空港メッセージ作成
		this.multiListNode.innerHTML = DDP.formatMessage(
			DDP.Search.Const.MULTI_LIST_MESSAGE_TEMPLATE,
			goMultiMessage, reMultiMessage);
	} else {
		this.multiListNode.innerHTML = '';
	}
};
///////////////////////// DDP.Search.AirPanel.MultiList END /////////////////////////

//////////////////////// DDP.Search.AirPanel.MultiHalfRT START ////////////////////////
/**
 * コンストラクタ
 * @class 航空検索結果におけるマルチ空港候補の各区間(往路又は復路）の操作を行なう為のクラスです。
 * @param panel 関連付ける航空検索パネル
 * @param conditionPanel 航空検索条件パネル
 * @param refType 照会区分（往路、復路、往復）
 * @param resultKey 結果キー
 * @param segKey 区間キー
 * @param prefix プリフィックス
 * @param itemName アイテム名
 */
DDP.Search.AirPanel.MultiHalfRT = function(
	panel, conditionPanel, refType, resultKey, segKey, prefix, itemName) {
	this.panel = panel;
	this.conditionPanel = conditionPanel;
	this.refType = refType;
	this.latestResult = null;
	this.resultKey = resultKey;
	this.segKey = segKey;
	this.prefix = prefix;
	this.itemName = itemName;
	return this;
};
/**
 * 初期化処理をおこないます。
 */
DDP.Search.AirPanel.MultiHalfRT.prototype.init = function() { };
/**
 * 保持する結果を更新します。
 * @param result 結果情報
 */
DDP.Search.AirPanel.MultiHalfRT.prototype.update = function(result) {
	// 自分の参照区分が検索された場合のみ、結果を更新する
	if (result.RefType == this.refType ||
		result.RefType == DDP.Search.Const.AIR_REFERENCE_TYPE_ROUND_TRIP) {
		this.latestResult = result[this.resultKey][this.segKey];
	}
};
/**
 * 区間部のマルチ空港メッセージを取得します。
 */
DDP.Search.AirPanel.MultiHalfRT.prototype.getMultiMessage = function() {
	var multiMessage = '';
	var multiLink = this._getMultiLink();
	if (0 < multiLink.length) {
		multiMessage = DDP.formatMessage(
			DDP.Search.Const.MULTI_LIST_HALF_ROUND_TRIP_MESSAGE_TEMPLATE,
			this.itemName, multiLink);
	}
	return multiMessage;
};
/**
 * マルチ空港のリンク部のメッセージを取得します。
 */
DDP.Search.AirPanel.MultiHalfRT.prototype._getMultiLink = function() {
	var firstFlag = true;
	if (!this.latestResult || this.latestResult.length == 0) {
		return '';
	}
	var arr = [''], idx = 1, idPf = this.prefix, tpl = DDP.Search.Const.MULTI_LIST_LINK_TEMPLATE;
	for(var i = 0, iLen = this.latestResult.length; i < iLen; i++) {
		var rItem = this.latestResult[i];
		// 0件の場合、マルチ空港リンクとして追加しない
		if (!rItem || rItem.SearchCnt == 0) continue;
		// マルチ空港が複数ある場合は、カンマで区切る
		if (!firstFlag) {
			arr[idx++] = ',&nbsp;'
		}
		// リンクを作成し、追加する
		arr[idx++] = DDP.formatMessage(tpl, idPf, i, rItem.AirportDispNme, rItem.SearchCnt);
		firstFlag = false;
	}
	return arr.join('');
};
/**
 * マルチ空港のリンクとイベントをバインドします。
 */
DDP.Search.AirPanel.MultiHalfRT.prototype.bindLinkList = function() {
	var __this = this, addE = DDP.addEvent, idPf = this.prefix;
	// マルチ空港がヒットしなくなるまで処理
	for(var i = 0; true; i++){
		var node = getN(idPf + 'multi_airport_' + i);
		if (node == null) {
			break;
		}
		(function() {
			// functionを使ってループごとに変数を保持
			var num = i;
			// イベントの登録 : マルチ空港リンク
			addE(node, 'click', function() {
				// マルチ空港をConditionPanelに設定
				__this.conditionPanel.selectMultiAirport(
					__this.latestResult[num].AirportNme);
				// 航空の検索を行う
				__this.panel.searchAir(__this.refType);
			});
		})();
	}
};
///////////////////////// DDP.Search.AirPanel.MultiHalfRT END /////////////////////////

////////////////////// DDP.Search.RentACarPanel START //////////////////////
/**
 * コンストラクタ
 * @class レンタカー検索結果/検索条件を操作する為のクラスです。
 * @constructor
 * @param {DDP.Search.SyncManager} sysnManager 同期管理クラス。
 * @param {String} reserveKbn 予約区分。
 * @param {String} goDate 旅程の出発日。
 * @param {String} returnDate 旅程の帰着日。
 * @param {String} headCount 旅程の人数。
 * @param {DDP.Search.RentACarPanel.ScreenType} screenType 画面種別。
 */
DDP.Search.RentACarPanel = function(
	sysnManager, reserveKbn, goDate, returnDate, headCount, screenType) {
	this.sysnManager = sysnManager;
	this.reserveKbn = reserveKbn;
	this.goDate = goDate;
	this.returnDate = returnDate;
	this.headCount = headCount;
	this.useDate = false;
	this.useCarClass = false;
	this.screenType = screenType;
	this.enableSelectCar = false;
	if (this.screenType == DDP.Search.RentACarPanel.ScreenType.SearchResult) {
		this.useDate = true;
		this.useCarClass = true;
	} else if (this.screenType == DDP.Search.RentACarPanel.ScreenType.ChangeRentACar) {
		this.useDate = true;
		this.enableSelectCar = true;
	}
	return this;
};
/**
 * 画面タイプ
 * @type {Number}
 */
DDP.Search.RentACarPanel.ScreenType = {
	SearchResult : 0,
	ChangeRentACar : 1
};
/**
 * 初期化処理を行います。
 */
DDP.Search.RentACarPanel.prototype.init = function() {
	var __this = this, el = DDP.Element, aPnl = DDP.Search.RentACarPanel.AreaPanel;
	// レンタカーエリア
	this.panel = new el('car_area');
	// ローディングエリア
	this.loadingArea = new el('car_loading_area');
	// 入力エラー表示エリア
	this.validationErrorArea = new DDP.Search.RentACarPanel.ValidateErrorPanel('car_message_panel', this);
	// 同期条件コントロール。 
	var syndMgr = this.sysnManager;
	var syncCondition = syndMgr.getCondition();
	// レンタカー会社
	this.rentACarCompany = new DDP.Search.RentACarPanel.PullDown('car_company', this);
	this.rentACarCompany.init();
	// 貸出エリアパネル
	this.rentalStartAreaPanel = new aPnl(this, syndMgr, true);
	this.rentalStartAreaPanel.init();
	var startAreaControls = this.rentalStartAreaPanel.getControlsId();
	syncCondition.rentalStartArea = startAreaControls.area;
	syncCondition.rentalStartSubArea = startAreaControls.subArea;
	syncCondition.rentalStartOffice = startAreaControls.office;
	// 返却エリアパネル
	this.rentalEndAreaPanel = new aPnl(this, syndMgr, false);
	this.rentalEndAreaPanel.init();
	var endAreaControls = this.rentalEndAreaPanel.getControlsId();
	syncCondition.rentalEndArea = endAreaControls.area;
	syncCondition.rentalEndSubArea = endAreaControls.subArea;
	syncCondition.rentalEndOffice = endAreaControls.office;
	// 貸出パネルの同期
	syndMgr.syncRentalStartSubAreaByRentalStartArea();
	syndMgr.syncRentalStartOfficeByRentalStartSubtArea();
	// 返却パネルの同期
	syndMgr.syncRentalEndSubAreaByRentalEndArea();
	syndMgr.syncRentalEndOfficeByRentalEndSubtArea();
	// 条件パネル
	this.conditionPanel = new DDP.Search.RentACarPanel.ConditionPanel('car_', this, syndMgr);
	this.conditionPanel.init();
	// 結果パネル
	this.resultPanel = new DDP.Search.RentACarPanel.ResultPanel('car_', this);
	this.resultPanel.init();
};
/**
 * レンタカー検索を行う。
 */
DDP.Search.RentACarPanel.prototype.searchRentACar = function() {
	var __this = this;
	console.log('RentACarPanel.searchRentACar start');
	// 処理中画像を表示
	__this.showLoadingArea();
	// レンタカー検索
	this.callSearchRentACarMethod(
		// 成功時のコールバックメソッド
		function(response) {
			console.log('RentACarPanel.searchRentACar : ', response);
			if (response.resultCode == DDP.Search.Const.WEB_METHOD_RESULT_CODE_SUCCESS) {
				console.log('SearchRentACar 成功時コールバックメソッド');
				// --- 正常系処理 ---
				var result = response.result;
				// 検索結果更新
				__this.update(result);
			} else {
				// 入力エラー以外のエラー内容
			}
			// 処理中画像を非表示
			__this.hideLoadingArea();
		}
	);
	console.log('RentACarPanel.searchRentACar end');
};
/**
 * レンタカー検索を行う。
 */
DDP.Search.RentACarPanel.prototype.searchRentACarNme = function() {
	var __this = this;
	console.log('RentACarPanel.searchRentACarNme start');
	// レンタカー検索
	this.callSearchRentACarNmeMethod(
		// 成功時のコールバックメソッド
		function(response) {
			console.log('RentACarPanel.searchRentACarNme : ', response);
			if (response.resultCode == DDP.Search.Const.WEB_METHOD_RESULT_CODE_SUCCESS) {
				console.log('SearchRentACar 成功時コールバックメソッド');
				// --- 正常系処理 ---
				var result = response.result;
				// 検索結果更新
				__this.updateNme(result);
			} else {
				// 入力エラー以外のエラー内容
			}
		}
	);
	console.log('RentACarPanel.searchRentACarNme end');
};
/**
 * ローディング領域を表示します。
 */
DDP.Search.RentACarPanel.prototype.showLoadingArea = function() {
	this.loadingArea.show();
	this.panel.hide();
};
/**
 * ローディング領域を非表示にします。
 */
DDP.Search.RentACarPanel.prototype.hideLoadingArea = function() {
	this.loadingArea.hide();
	this.panel.show();
};
/**
 * レンタカー検索コールバックメソッド
 * 使用するクラスによって上書きされることを想定しています
 * 
 * @param onSuccessCallBack 成功時コールバックメソッド
 * 
 */
DDP.Search.RentACarPanel.prototype.callSearchRentACarMethod = function(onSuccessCallBack) {
	onSuccessCallBack({});
};
/**
 * レンタカー検索コールバックメソッド
 * 使用するクラスによって上書きされることを想定しています
 * 
 * @param onSuccessCallBack 成功時コールバックメソッド
 * 
 */
DDP.Search.RentACarPanel.prototype.callSearchRentACarNmeMethod = function(onSuccessCallBack) {
	onSuccessCallBack({});
};
/**
 * レンタカー検索パネルの検索条件を取得します。
 */
DDP.Search.RentACarPanel.prototype.getRentACarCondtition = function() {
	this.updateAreaPanelsHiddenValue();
	var sAreaCnd = this.rentalStartAreaPanel.getAreaCondition();
	var eAreaCnd = this.rentalEndAreaPanel.getAreaCondition();
	var cnd = this.conditionPanel.getCondition();
	var sort = parseInt(this.resultPanel.sortPanel.getSortKbn());
	var rentaCarCompanyId = this.rentACarCompany.getSelectedValue();
	return {
		BasicDepartureYmd : this.goDate,               // 旅程の出発日
		BasicArrivalYmd : this.returnDate,             // 旅程の帰着日
		ReserveKbn : this.reserveKbn,                  // 予約区分
		RentaCarCompanyId : rentaCarCompanyId,         // レンタカー会社ID。
		RentalStartSubAreaCd : sAreaCnd.subArea,       // 貸出地区。
		RentalStartRentACarOfficeCd : sAreaCnd.office, // 貸出レンタカー店舗コード。
		RentalStartYmd : cnd.rentalStartDate,          // 貸出年月日。
		RentalStartHm : cnd.rentalStartTime,           // 貸出時間。
		RentalEndSubAreaCd : eAreaCnd.subArea,         // 返却地区。
		RentalEndRentACarOfficeCd : eAreaCnd.office,   // 返却レンタカー店舗コード。
		RentalEndYmd : cnd.rentalEndDate,              // 返却年月日。
		RentalEndHm : cnd.rentalEndTime,               // 返却時間。
		UseCnt : cnd.useCount,                         // 利用台数。
		PriceClass : cnd.carClass,                     // 料金クラス。
		SmokeKbn : cnd.smokeKbn,                       // 喫煙禁煙区分。
		Transmission : cnd.transmission,               // トランスミッション。
		DriveKbn : cnd.driveKbn,                       // 駆動区分。
		UseMancount : parseInt(this.headCount),        // 利用人数
		Specific : cnd.specific,                       // こだわり条件
		SortKbn : sort                                 // ソート区分
	}
};
/**
 * レンタカー検索パネルの検索条件を取得します。
 * @param result レンタカー検索結果
 */
DDP.Search.RentACarPanel.prototype.update = function(result) {
	this.validationErrorArea.update(result);
	this.rentalStartAreaPanel.update(result);
	this.rentalEndAreaPanel.update(result);
	this.conditionPanel.update(result);
	this.resultPanel.update(result);
};
/**
 * レンタカー検索パネルの検索条件を取得します。
 * @param result レンタカー検索結果
 */
DDP.Search.RentACarPanel.prototype.updateNme = function(result) {
	this.resultPanel.updateNme(result);
};
/**
 * レンタカー検索結果をクリアします。
 */
DDP.Search.RentACarPanel.prototype.clearResult = function() {
	this.resultPanel.clear();
};
/**
 * 選択されているレンタカーの料金を取得します。
 * @return {Number} レンタカー料金。
 */
DDP.Search.RentACarPanel.prototype.getSelectedAmount = function() {
	return this.resultPanel.getSelectedAmount();
};
/**
 * 貸出・返却パネルのHiddenフィールドの値を更新します。
 */
DDP.Search.RentACarPanel.prototype.updateAreaPanelsHiddenValue = function() {
	this.rentalStartAreaPanel.updateHiddenValue();
	this.rentalEndAreaPanel.updateHiddenValue();
};
/**
 * 貸出店舗名を取得します。
 * @return {String}
 */
DDP.Search.RentACarPanel.prototype.getRentalStartOfficeName = function() {
	return this.rentalStartAreaPanel.getOfficeName();
};
/**
 * 合計料金を計算し、画面に表示します。
 */
DDP.Search.RentACarPanel.prototype.setTotalAmount = function() { };
/**
 * コントロールを使用可能に設定します。
 */
DDP.Search.RentACarPanel.prototype.enable = function() {
	if (this.enableSelectCar) {
		this.rentalStartAreaPanel.enable();
		this.rentalEndAreaPanel.enable();
		this.conditionPanel.enable();
	}
	this.resultPanel.enable();
};
/**
 * コントロールを使用不可能に設定します。
 */
DDP.Search.RentACarPanel.prototype.disable = function() {
	if (this.enableSelectCar) {
		this.rentalStartAreaPanel.disable();
		this.rentalEndAreaPanel.disable();
		this.conditionPanel.disable();
	}
	this.resultPanel.disable();
};
////////////////////// DDP.Search.RentACarPanel END //////////////////////

////////////////////// DDP.Search.RentACarPanel.CarSortKbn START //////////////////////
/**
 * レンタカー検索の並び替え順。
 * @type {String}
 */
DDP.Search.RentACarPanel.CarSortKbn = {
	Recommend : '0',
	PriceLower : '1',
	PriceHigher : '2'
};
////////////////////// DDP.Search.RentACarPanel.CarSortKbn END //////////////////////

////////////////////// DDP.Search.RentACarPanel.Link START //////////////////////
/**
 * コンストラクタ
 * @class レンタカー検索パネルのリンクを操作する為のクラスです。
 * @constructor
 * @param id リンクのID
 */
DDP.Search.RentACarPanel.Link = function(id) {
	this.initialize.apply(this, arguments);
	this.prevHrefValue = null;
	this.prevClassName = null;
};
/**
 * prototypeを上書き
 */
DDP.Search.RentACarPanel.Link.prototype = new DDP.Element();
/**
 * コンストラクタ
 * @param {} id
 */
DDP.Search.RentACarPanel.Link.prototype.initialize = function(id) {
	// 親クラスのコンストラクタを呼び出し
	DDP.Search.Element.prototype.initialize.apply(this, [id]);
	var __this = this;
	// clickイベント登録
	DDP.addEvent(this.element, 'click', function() {
		if (!__this.element.disabled) {
			__this.onClickEvent();
		}
	});
};
/**
 * clickイベントが発生した場合の処理を記述
 */
DDP.Search.RentACarPanel.Link.prototype.onClickEvent = function() { };
/**
 * コントロールを使用可能に設定します。
 */
DDP.Search.RentACarPanel.Link.prototype.enable = function() {
	this.element.disabled = false;
	if (this.prevHrefValue != null) {
		this.element.setAttribute('href', this.prevHrefValue);
	}
	if (this.prevClassName != null) {
		this.removeClass(this.getDisableStyleNames());
		this.addClass([this.prevClassName]);
	}
};
/**
 * コントロールを使用不可能に設定します。
 */
DDP.Search.RentACarPanel.Link.prototype.disable = function() {
	this.element.disabled = true;
	if (this.prevHrefValue == null) {
		this.prevHrefValue = this.element.getAttributeNode('href').value;
	}
	if (this.prevClassName == null) {
		this.prevClassName = this.element.className;
	}
	this.element.removeAttribute('href');
	this.addClass(this.getDisableStyleNames());
};
/**
 * Disable時に適用するスタイル名称の配列を取得します。
 * @return {String[]} Disable時に適用するスタイル名称の配列。
 */
DDP.Search.RentACarPanel.Link.prototype.getDisableStyleNames = function() {
	return [DDP.Search.Const.UNLINK_STYLE];
};
////////////////////// DDP.Search.RentACarPanel.Link START //////////////////////

////////////////////// DDP.Search.RentACarPanel.PullDown START //////////////////////
/**
 * コンストラクタ
 * @class レンタカー検索のプルダウンを操作する為のクラスです。
 * @constructor
 * @param idKey サーバ上でのコントロールID
 * @param rentACarPanel レンタカー検索パネルのインスタンス
 */
DDP.Search.RentACarPanel.PullDown = function(idKey, rentACarPanel) {
	this.rentACarPanel = rentACarPanel;
	// pullDownとしての初期化
	DDP.Search.PullDown.apply(this, arguments);
	return this;
};
/**
 * prototypeを上書き。
 */
DDP.Search.RentACarPanel.PullDown.prototype = new DDP.Search.PullDown();
/**
 * changeイベントが発生した場合の処理を記述
 */
DDP.Search.RentACarPanel.PullDown.prototype.onChangeEvent = function() {
	this.switchColor();
	this.rentACarPanel.searchRentACar();
};
/**
 * 未選択とそれ以外でstyle.colorを切り替えます。
 */
DDP.Search.RentACarPanel.PullDown.prototype.switchColor = function() {
	// 未選択とそれ以外でスタイルを変更
	this.node.style.color = this.getSelectedValue() == '' ? '#cc6600' : 'black';
};
////////////////////// DDP.Search.RentACarPanel.PullDown END //////////////////////

////////////////////// DDP.Search.RentACarPanel.ClassPullDown START //////////////////////
/**
 * コンストラクタ
 * @class レンタカー検索条件の車種を表すクラスです。
 * @constructor
 * @param idKey サーバ上でのコントロールID
 * @param rentACarPanel レンタカー検索パネルのインスタンス
 */
DDP.Search.RentACarPanel.ClassPullDown = function(idKey, rentACarPanel) {
	this.idKey = idKey;
	DDP.Search.RentACarPanel.PullDown.apply(this, arguments);
	return this;
};
/**
 * prototypeを上書き。
 */
DDP.Search.RentACarPanel.ClassPullDown.prototype = new DDP.Search.RentACarPanel.PullDown();
/**
 * changeイベントが発生した場合の処理を記述(独自処理が必要になったら)
 */
/*DDP.Search.RentACarPanel.ClassPullDown.prototype.onChangeEvent = function() {
};*/
/**
 * 結果によって状態を変化させる
 * @param result レンタカー検索結果
 */
DDP.Search.RentACarPanel.ClassPullDown.prototype.update = function(result) {
};
////////////////////// DDP.Search.RentACarPanel.ClassPullDown END //////////////////////

////////////////////// DDP.Search.RentACarPanel.SmokePullDown START //////////////////////
/**
 * コンストラクタ
 * @class レンタカー検索条件の喫煙禁煙を表すクラスです。
 * @constructor
 * @param idKey サーバ上でのコントロールID
 * @param rentACarPanel レンタカー検索パネルのインスタンス
 */
DDP.Search.RentACarPanel.SmokePullDown = function(idKey, rentACarPanel) {
	DDP.Search.RentACarPanel.PullDown.apply(this, arguments);
	return this;
};
/**
 * prototypeを上書き。
 */
DDP.Search.RentACarPanel.SmokePullDown.prototype = new DDP.Search.RentACarPanel.PullDown();
/**
 * changeイベントが発生した場合の処理を記述(独自処理が必要になったら)
 */
/*
DDP.Search.RentACarPanel.SmokePullDown.prototype.onChangeEvent = function() {
};
*/
/**
 * 結果によって状態を変化させる
 * @param result レンタカー検索結果
 */
DDP.Search.RentACarPanel.SmokePullDown.prototype.update = function(result) {
};
////////////////////// DDP.Search.RentACarPanel.SmokePullDown END //////////////////////

////////////////////// DDP.Search.RentACarPanel.TransmissionPullDown START //////////////////////
/**
 * コンストラクタ
 * @class レンタカー検索条件のトランスミッションを表すクラスです。
 * @constructor
 * @param idKey サーバ上でのコントロールID
 * @param rentACarPanel レンタカー検索パネルのインスタンス
 */
DDP.Search.RentACarPanel.TransmissionPullDown = function(idKey, rentACarPanel) {
	DDP.Search.RentACarPanel.PullDown.apply(this, arguments);
	return this;
};
/**
 * prototypeを上書き。
 */
DDP.Search.RentACarPanel.TransmissionPullDown.prototype = new DDP.Search.RentACarPanel.PullDown();
/**
 * changeイベントが発生した場合の処理を記述(独自処理が必要になったら)
 */
/*
DDP.Search.RentACarPanel.TransmissionPullDown.prototype.onChangeEvent = function() {
};
*/
/**
 * 結果によって状態を変化させる
 * @param result レンタカー検索結果
 */
DDP.Search.RentACarPanel.TransmissionPullDown.prototype.update = function(result) {
};
////////////////////// DDP.Search.RentACarPanel.TransmissionPullDown END //////////////////////

////////////////////// DDP.Search.RentACarPanel.DrivePullDown START //////////////////////
/**
 * コンストラクタ
 * @class レンタカー検索条件の駆動を表すクラスです。
 * @constructor
 * @param idKey サーバ上でのコントロールID
 * @param rentACarPanel レンタカー検索パネルのインスタンス
 */
DDP.Search.RentACarPanel.DrivePullDown = function(idKey, rentACarPanel) {
	DDP.Search.RentACarPanel.PullDown.apply(this, arguments);
	return this;
};
/**
 * prototypeを上書き。
 */
DDP.Search.RentACarPanel.DrivePullDown.prototype = new DDP.Search.RentACarPanel.PullDown();
/**
 * changeイベントが発生した場合の処理を記述(独自処理が必要になったら)
 */
/*
DDP.Search.RentACarPanel.DrivePullDown.prototype.onChangeEvent = function() {
};
*/
/**
 * 結果によって状態を変化させる
 * @param result レンタカー検索結果
 */
DDP.Search.RentACarPanel.DrivePullDown.prototype.update = function(result) {
};
////////////////////// DDP.Search.RentACarPanel.DrivePullDown END //////////////////////

////////////////////// DDP.Search.RentACarPanel.SpecificList START //////////////////////
/**
 * コンストラクタ
 * @class 検索パネルのこだわり条件を操作する為のクラス
 * @constructor
 * @param rentACarPanel レンタカー検索パネルのインスタンス
 */
DDP.Search.RentACarPanel.SpecificList = function(rentACarPanel) {
	this.rentACarPanel = rentACarPanel;
	this.specificList = new Array();
};
/**
 * 初期化メソッド
 */
DDP.Search.RentACarPanel.SpecificList.prototype.init = function() {
	// 全てのこだわり条件について処理を行う
	var pnl = this.rentACarPanel;
	for(var i = 0; true; i++){
		var node = getN(idMgr['car_specific_' + i]);
		if (node == null) {
			break;
		}
		// こだわり条件ボタンを初期化
		this.specificList[i] = new DDP.Search.RentACarPanel.Specific(i, pnl);
		this.specificList[i].init();
	}
};
/**
 * 検索結果で更新します。
 * @param {} result 検索結果。
 */
DDP.Search.RentACarPanel.SpecificList.prototype.update = function(result) {
	for(var i = 0, iLen = this.specificList.length; i < iLen; i++){
		this.specificList[i].update(result);
	}
};
/**
 * すべてのこだわり条件の非選択の状態に変更します。
 */
DDP.Search.RentACarPanel.SpecificList.prototype.unselectAll = function() {
	// 全てのこだわり条件について処理を行う
	for(var i = 0, iLen = this.specificList.length; i < iLen; i++){
		var spc = this.specificList[i];
		spc.setSelected(false);
		spc.setStyle();
	}
};
/**
 * 選択されているこだわり条件を連結した文字列を取得します。
 * @return 連結したこだわり条件の文字列
 * @type String[]
 */
DDP.Search.RentACarPanel.SpecificList.prototype.getSelectedSpecific = function() {
	var result = new Array();
	var resultCount = 0;
	for(var i = 0, iLen = this.specificList.length; i < iLen; i++){
		var spc = this.specificList[i];
		// 選択されている場合、文字列に追加する
		if (spc.isSelected()) {
			result[resultCount] = spc.id;
			resultCount++;
		}
	}
	return result;
};
/**
 * コントロールを使用可能に設定します。
 */
DDP.Search.RentACarPanel.SpecificList.prototype.enable = function() {
	// 全てのこだわり条件について処理を行う
	for(var i = 0, iLen = this.specificList.length; i < iLen; i++){
		this.specificList[i].enable();
	}
};
/**
 * コントロールを使用不可能に設定します。
 */
DDP.Search.RentACarPanel.SpecificList.prototype.disable = function() {
	// 全てのこだわり条件について処理を行う
	for(var i = 0, iLen = this.specificList.length; i < iLen; i++){
		this.specificList[i].disable();
	}
};
////////////////////// DDP.Search.RentACarPanel.SpecificList END //////////////////////

////////////////////// DDP.Search.RentACarPanel.Specific START //////////////////////
/**
 * コンストラクタ
 * @class こだわり条件クラス
 * @param num 関連付ける添え字の数値
 * @param rentACarPanel レンタカー検索パネルのインスタンス
 */
DDP.Search.RentACarPanel.Specific = function(num, rentACarPanel) {
	this.category = 'car_specific';
	this.num = num;
	this.node = getN(idMgr[this.category + '_' + this.num]);
	this.rentACarPanel = rentACarPanel;
	this.count = NaN;
	this.isDisabled = false;
	return this;
};
/**
 * こだわり条件項目初期化
 */
DDP.Search.RentACarPanel.Specific.prototype.init = function() {
	var __this = this;
	// hiddenNodeの設定
	this.hiddenNode = getN(idMgr['car_specific_hidden_' + this.num]);
	// IDの設定
	this.id = (this.hiddenNode.value.split(':'))[0];
	// 初期スタイルを設定
	this.setStyle();
	// イベントの登録 : こだわり条件ボタン
	DDP.addEvent(__this.node, 'click', function() {
		var node = __this.node;
		var rentACarPanel = __this.rentACarPanel;
		if ((!__this.isSelected() && __this.count == 0) ||
			__this.isDisabled) {
			return false;
		}
		__this.switchSelected();
		__this.setStyle();
		if (__this.count == 0) {
			return false;
		}
		rentACarPanel.searchRentACar();
		return false;
	});
};
/**
 * 選択されているか判定します
 * @return {Boolean} 選択されている場合true、非選択の場合false
 * @type Boolean
 */
DDP.Search.RentACarPanel.Specific.prototype.isSelected = function() {
	// hiddenのvalue領域のフラグ箇所を取得し、状態判定し、返す
	var selectedFlagString = this.hiddenNode.value.split(DDP.Search.Const.SPECIFIC_VALUE_SEPARATOR)[1];
	if (selectedFlagString == DDP.Search.Const.FLAG_TRUE) {
		return true;
	}
	return false;
};
/**
 * 選択状態を設定します
 * @param flag 選択フラグ .. 選択済み:true, 未選択:false
 */
DDP.Search.RentACarPanel.Specific.prototype.setSelected = function(flag) {
	this.hiddenNode.value = this.id + ':' + (flag ? DDP.Search.Const.FLAG_TRUE : DDP.Search.Const.FLAG_FALSE);
};
/**
 * 選択状態を切り替えます。
 * 選択されていれば非選択に、非選択であれば選択に変更します。
 */
DDP.Search.RentACarPanel.Specific.prototype.switchSelected = function() {
	this.hiddenNode.value = this.id + ':' + (this.isSelected() ? DDP.Search.Const.FLAG_FALSE : DDP.Search.Const.FLAG_TRUE);
};
/**
 * こだわり条件の更新を行います。
 * @param result 検索結果
 */
DDP.Search.RentACarPanel.Specific.prototype.update = function(result) {
	this.count = 0;
	if (result == null || result.ResultAllPriceClassList == null) return;
	// 検索結果
	var classArray = result.ResultAllPriceClassList, id = this.id;
	for(var i = 0, iLen = result.ResultAllPriceClassList.length; i < iLen; i++){
		if (result.ResultAllPriceClassList[i] == id) {
			this.count = 1;
			break;
		}
	}
	// スタイルを設定
	this.setStyle();
};
/**
 * 今の状態で表示すべきスタイルを設定します。
 */
DDP.Search.RentACarPanel.Specific.prototype.setStyle = function() {
	var n = this.node;
	if (this.isSelected()) {
		DDP.addHrefJs(n);
		n.className = DDP.Search.Const.SELECTED_BUTTON_LINK_STYLE;
	} else {
		if (this.count != 0) {
			DDP.addHrefJs(n);
			n.className = DDP.Search.Const.ABLE_BUTTON_LINK_STYLE;
		} else {
			n.removeAttribute('href');
			n.className = DDP.Search.Const.DISABLE_BUTTON_LINK_STYLE;
		}
	}
};
/**
 * コントロールを使用不可に設定します。
 */
DDP.Search.RentACarPanel.Specific.prototype.disable = function() {
	var n = this.node;
	n.removeAttribute('href');
	n.className = DDP.Search.Const.DISABLE_BUTTON_LINK_STYLE;
	this.isDisabled = true;
};
/**
 * コントロールを使用可能に設定します。
 */
DDP.Search.RentACarPanel.Specific.prototype.enable = function() {
	this.setStyle();
	this.isDisabled = false;
};
////////////////////// DDP.Search.RentACarPanel.Specific END //////////////////////

////////////////////// DDP.Search.RentACarPanel.AreaPanel START //////////////////////
/**
 * コンストラクタ
 * @class レンタカー検索条件のエリア条件を操作する為のクラスです。
 * @constructor
 * @param {DDP.Search.RentACarPanel} rentACarPanel レンタカーパネル
 * @param {DDP.Search.SyncManager} syncManager 同期管理クラス。
 * @param {Boolean} idStart 貸出かどうかを示す値。
 */
DDP.Search.RentACarPanel.AreaPanel = function(rentACarPanel, syncManager, isStart) {
	/** レンタカーパネル @type DDP.Search.RentACarPanel */
	this.rentACarPanel = rentACarPanel;
	/** 同期管理クラス。 @type DDP.Search.syncManager */
	this.syncManager = syncManager;
	/** 貸出かどうかを示す値。 @type Boolean */
	this.isStart = isStart;
	/** IDのPrefix。 @type String */
	this.idPrefix = this.isStart ?
		DDP.Search.Const.RENTAL_START_PREFIX : DDP.Search.Const.RENTAL_END_PREFIX;
	return this;
};
/**
 * レンタカー検索パネル エリア条件入力パネル
 */
DDP.Search.RentACarPanel.AreaPanel.prototype.init = function() {
	var __this = this, idPf = this.idPrefix;
	// 地域プルダウン
	this.area = new DDP.Search.RentACarPanel.PullDown(idPf + 'area', this.rentACarPanel);
	this.area.onChangeEvent = function(){
		if (__this.isStart) {
			//__this.syncManager.syncRentalEndAreaByRentalStartArea(); // 貸出地域と返却地域地区店舗の同期
			__this.syncManager.syncRentalStartSubAreaByRentalStartArea(); // 貸出地域と貸出地区の同期
			__this.areaTableMenu.update();
			__this.syncManager.syncRentalStartOfficeByRentalStartSubtArea(); // 貸出地区と貸出店舗の同期
		} else {
			__this.syncManager.syncRentalEndSubAreaByRentalEndArea(); // 返却地域と返却地区の同期
			__this.areaTableMenu.update();
			__this.syncManager.syncRentalEndOfficeByRentalEndSubtArea(); // 返却地区と返却店舗の同期
		}
		__this.updateHiddenValue();
		__this.subArea.switchColor();
		__this.office.switchColor();
		// レンタカー検索
		__this.rentACarPanel.searchRentACar();
	};
	this.area.init();
	// 地区行ノード
	this.subAreaRowElement = new DDP.Search.Element(idPf + 'subarea_tr');
	// 地区
	this.subArea = new DDP.Search.RentACarPanel.PullDown(idPf + 'subarea', this.rentACarPanel);
	this.subArea.onChangeEvent = function() {
		if (__this.isStart) {
			__this.syncManager.syncRentalStartOfficeByRentalStartSubtArea(); // 貸出地区と貸出店舗の同期
		} else {
			__this.syncManager.syncRentalEndOfficeByRentalEndSubtArea(); // 返却地区と返却店舗の同期
		}
		__this.updateHiddenValue();
		__this.subArea.switchColor();
		__this.office.switchColor();
		__this.rentACarPanel.searchRentACar();
	};
	this.subArea.init();
	this.subArea.node.handler = this.subArea; // TableMenu対応
	// 調整テーブル
	this.areaTableMenu = new DDP.TableMenu(
		idPf + 'subarea_txt', idMgr[idPf + 'subarea'], idPf + 'subarea_frame', idPf + 'subarea_button');
	// 地区選択値格納用hidden
	this.subAreaHidden = new DDP.Search.Element(idMgr[idPf + 'subarea' + '_hidden']);
	this.subAreaHidden.element.value = this.subArea.getSelectedValue();
	// 地図
	this.mapSelectLink = new DDP.Search.RentACarPanel.Link(idMgr[idPf + 'map_select_link']);
	// 店舗行ノード
	this.officeRowElement = new DDP.Search.Element(idPf + 'office_tr');
	// 店舗
	this.office = new DDP.Search.RentACarPanel.PullDown(idPf + 'office', this.rentACarPanel);
	this.office.onChangeEvent = function() {
		__this.updateHiddenValue();
		__this.rentACarPanel.searchRentACar();
	};
	this.office.init();
	// 店舗選択値格納用hidden
	this.officeHidden = new DDP.Search.Element(idMgr[idPf + 'office' + '_hidden']);
	this.officeHidden.element.value = this.office.getSelectedValue();
	// 店舗詳細ポップアップリンク
	this.officeDetailLink = new DDP.Search.RentACarPanel.Link(
		idPf + 'office_detail_link');
	this.officeDetailLink.onClickEvent = function() {
		if (__this.office.getSelectedIndex() <= 0) return;
		// 店舗詳細URL作成
		var urlFormat = 'ROfficeDetail.aspx?rsc={0}&rc={1}&aff={2}&nk=1)'
		DDP.openPopupWindow(DDP.formatMessage(
			urlFormat,
			__this.office.getSelectedValue(),
			__this.rentACarPanel.rentACarCompany.getSelectedValue(),
			''));
	};
};
/**
 * 地区・店舗の選択値をHiddenフィールドに再設定します。
 */
DDP.Search.RentACarPanel.AreaPanel.prototype.updateHiddenValue = function() {
	this.subAreaHidden.element.value = this.subArea.getSelectedValue();
	this.officeHidden.element.value = this.office.getSelectedValue();
};
/**
 * レンタカー検索パネル エリア条件入力パネルの設定されている検索条件を取得します。
 */
DDP.Search.RentACarPanel.AreaPanel.prototype.getAreaCondition = function() {
	return {
		area : this.area.getSelectedValue(),
		subArea : this.subAreaHidden.element.value,
		office : this.officeHidden.element.value
	}
};
/**
 * 同期条件を取得します。
 */
DDP.Search.RentACarPanel.AreaPanel.prototype.getControlsId = function() {
	return {
		area : this.area.uniqueId,
		subArea : this.subArea.uniqueId,
		office : this.office.uniqueId
	}
};
/**
 * レンタカー検索パネルの更新をします。
 * @param {} result レンタカー検索結果
 */
DDP.Search.RentACarPanel.AreaPanel.prototype.update = function(result) {
	var errCls = DDP.Search.Const.CAR_SEARCH_CONDTION_ERROR_TABLE_CELL_STYLE;
	var isSt = this.isStart;
	// エラースタイル削除
	this.subAreaRowElement.removeClass([errCls]);
	this.officeRowElement.removeClass([errCls]);
	if (result != null &&
		!result.ExistsResult &&
		result.ValidateResult != null) {
		var message = '';
		for(var key in result.ValidateResult) {
			if ((isSt && key == 'EmptyRentalStartSubArea') ||
				(!isSt && key == 'EmptyRentalEndSubArea')) {
				// エラースタイル適用
				this.subAreaRowElement.addClass([errCls]);
			} else if ((isSt && key == 'EmptyRentalStartOffice') ||
					   (!isSt && key == 'EmptyRentalEndOffice')) {
				// エラースタイル適用
				this.officeRowElement.addClass([errCls]);
			}
		}
	} else {
	}
};
/**
 * 店舗名を取得します。
 * @return {String}
 */
DDP.Search.RentACarPanel.AreaPanel.prototype.getOfficeName = function() {
	/** @type HTMLOptionElement */
	var option = this.office.getSelectedOption();
	return option.text;
};
/**
 * コントロールを使用可能に設定します。
 */
DDP.Search.RentACarPanel.AreaPanel.prototype.enable = function() {
	this.area.enable();
	this.subArea.enable();
	this.areaTableMenu.enable();
	this.office.enable();
	this.officeDetailLink.enable();
	if (this.mapSelectLink) {
		this.mapSelectLink.enable();
	}
};
/**
 * コントロールを使用不可能に設定します。
 */
DDP.Search.RentACarPanel.AreaPanel.prototype.disable = function() {
	this.area.disable();
	this.subArea.disable();
	this.areaTableMenu.disable();
	this.office.disable();
	this.officeDetailLink.disable();
	if (this.mapSelectLink) {
		this.mapSelectLink.disable();
	}
};
////////////////////// DDP.Search.RentACarPanel.AreaPanel END //////////////////////

////////////////////// DDP.Search.RentACarPanel.ConditionPanel START //////////////////////
/**
 * コンストラクタ
 * @class レンタカー検索条件の条件を操作する為のクラスです。
 * @constructor
 * @param {String} idPrefix Dのプリフィックス。
 * @param {DDP.Search.RentACarPanel} rentACarPanel レンタカー検索パネルのインスタンス
 * @param {DDP.Search.SyncManager} sysnManager 同期管理クラス。
 */
DDP.Search.RentACarPanel.ConditionPanel = function(idPrefix, rentACarPanel, syncManager) {
	this.idPrefix = idPrefix;
	this.rentACarPanel = rentACarPanel;
	this.syncManager = syncManager;
	return this;
};
/**
 * レンタカー検索パネル条件入力パネル
 */
DDP.Search.RentACarPanel.ConditionPanel.prototype.init = function() {
	var __this = this, idPf = this.idPrefix, rPnl = this.rentACarPanel;
	// 日時条件
	this.rentalStartDateConditionPanel = null;
	this.rentalEndDateConditionPanel = null;
	if (rPnl.useDate) {
		var dcPnl = DDP.Search.RentACarPanel.DateConditionPanel;
		// 貸出日時
		this.rentalStartDateConditionPanel = new dcPnl(rPnl, DDP.Search.Const.RENTAL_START_PREFIX);
		this.rentalStartDateConditionPanel.init();
		// 返却日時
		this.rentalEndDateConditionPanel = new dcPnl(rPnl, DDP.Search.Const.RENTAL_END_PREFIX);
		this.rentalEndDateConditionPanel.init();
	}
	// 車種
	this.carClass = null;
	if (rPnl.useCarClass) {
		this.carClass = new DDP.Search.RentACarPanel.ClassPullDown(idPf + 'class_list', rPnl);
		this.carClass.init();
	}
	// 利用台数
	this.useCount = new DDP.Search.RentACarPanel.PullDown(idPf + 'count_list', rPnl);
	this.useCount.init();
	// 禁煙喫煙
	this.smoke = new DDP.Search.RentACarPanel.SmokePullDown(idPf + 'smoke_list', rPnl);
	this.smoke.init();
	// トランスミッション
	this.transmission = new DDP.Search.RentACarPanel.TransmissionPullDown(idPf + 'transmission_list', rPnl);
	this.transmission.init();
	// 駆動
	this.drive = new DDP.Search.RentACarPanel.DrivePullDown(idPf + 'drive_list', rPnl);
	this.drive.init();
	// こだわり条件
	this.specificList = new DDP.Search.RentACarPanel.SpecificList(rPnl);
	this.specificList.init();
	// こだわり条件解除リンク
	this.clearSpecificLink = new DDP.Search.RentACarPanel.Link(idMgr[idPf + 'clear_specific']);
	this.clearSpecificLink.onClickEvent = function() {
		if (__this.specificList.getSelectedSpecific().length == 0) return;
		__this.specificList.unselectAll();
		__this.rentACarPanel.searchRentACar();
	};
};
/**
 * レンタカー検索パネル 条件入力パネルを更新します。
 * @param result レンタカー検索結果
 */
DDP.Search.RentACarPanel.ConditionPanel.prototype.update = function(result) {
	var rPnl = this.rentACarPanel;
	// 日付条件
	if (rPnl.useDate) {
		this.rentalStartDateConditionPanel.update(result, true);
		this.rentalEndDateConditionPanel.update(result, false);
	}
	// 車種条件
	if (rPnl.useCarClass) {
		this.carClass.update(result);
	}
	//this.useCount.update(result);
	this.smoke.update(result);
	this.transmission.update(result);
	this.drive.update(result);
	this.specificList.update(result);
};
/**
 * レンタカー検索パネル 条件入力パネルの設定されている検索条件を取得します。
 */
DDP.Search.RentACarPanel.ConditionPanel.prototype.getCondition = function() {
	var rPnl = this.rentACarPanel, rentalStartDateCondition = null, rentalEndDateCondition = null;
	if (rPnl.useDate) {
		rentalStartDateCondition = this.rentalStartDateConditionPanel.getDateCondition();
		rentalEndDateCondition = this.rentalEndDateConditionPanel.getDateCondition();
	}
	var carClass = '0';
	if (rPnl.useCarClass) {
		carClass = this.carClass.getSelectedValue();
	}
	return {
		rentalStartDate : (rentalStartDateCondition == null) ? '': rentalStartDateCondition.date,
		rentalStartTime : (rentalStartDateCondition == null) ? '': rentalStartDateCondition.time,
		rentalEndDate : (rentalEndDateCondition == null) ? '': rentalEndDateCondition.date,
		rentalEndTime : (rentalEndDateCondition == null) ? '': rentalEndDateCondition.time,
		useCount : this.useCount.getSelectedValue(),
		carClass : carClass,
		smokeKbn : this.smoke.getSelectedValue(),
		transmission : this.transmission.getSelectedValue(),
		driveKbn : this.drive.getSelectedValue(),
		specific : this.specificList.getSelectedSpecific()
	}
};
/**
 * コントロールを使用可能に設定します。
 */
DDP.Search.RentACarPanel.ConditionPanel.prototype.enable = function() {
	var rPnl = this.rentACarPanel;
	if (rPnl.useDate) {
		this.rentalStartDateConditionPanel.enable();
		this.rentalEndDateConditionPanel.enable();
	}
	if (rPnl.useCarClass) {
		this.carClass.enable();
	}
	this.useCount.enable();
	this.smoke.enable();
	this.transmission.enable();
	this.drive.enable();
	this.specificList.enable();
	this.clearSpecificLink.enable();
};
/**
 * コントロールを使用不可能に設定します。
 */
DDP.Search.RentACarPanel.ConditionPanel.prototype.disable = function() {
	var rPnl = this.rentACarPanel;
	if (rPnl.useDate) {
		this.rentalStartDateConditionPanel.disable();
		this.rentalEndDateConditionPanel.disable();
	}
	if (rPnl.useCarClass) {
		this.carClass.disable();
	}
	this.useCount.disable();
	this.smoke.disable();
	this.transmission.disable();
	this.drive.disable();
	this.specificList.disable();
	this.clearSpecificLink.disable();
};
////////////////////// DDP.Search.RentACarPanel.ConditionPanel END //////////////////////

////////////////////// DDP.Search.RentACarPanel.DateConditionPanel START //////////////////////
/**
 * コンストラクタ
 * @class レンタカー検索条件の日時条件を操作する為のクラスです。
 * @constructor
 * @param rentACarPanel レンタカー検索パネルのインスタンス
 * @param idPrefix IDのプリフィックス
 */
DDP.Search.RentACarPanel.DateConditionPanel = function(rentACarPanel, idPrefix) {
	this.rentACarPanel = rentACarPanel;
	this.idPrefix = idPrefix;
	return this;
};
/**
 * レンタカー検索パネル 日時条件入力パネル
 */
DDP.Search.RentACarPanel.DateConditionPanel.prototype.init = function() {
	var __this = this, idPf = this.idPrefix, rPnl = this.rentACarPanel,
		pl = DDP.Search.RentACarPanel.PullDown;
	// 年月日
	this.date = new pl(idPf + 'date', rPnl);
	this.date.init();
	// 時間
	this.time = new pl(idPf + 'time', rPnl);
	this.time.init();
};
/**
 * レンタカー検索パネル 日時条件入力パネルの検索条件を取得します。
 */
DDP.Search.RentACarPanel.DateConditionPanel.prototype.getDateCondition = function() {
	return {
		date : this.date.getSelectedValue(),
		time : this.time.getSelectedValue()
	}
};
/**
 * レンタカー検索パネル 条件入力パネルを更新します。
 * @param result レンタカー検索結果
 * @param isStartCondition {Boolean} 開始かどうか
 */
DDP.Search.RentACarPanel.DateConditionPanel.prototype.update = function(result, isStartCondition) {
	if (result == null ||
		result.Items == null ||
		result.Items.length == 0) {
		return;
	}
	var ymd = null, hm = null, rItem = result.Items[0];
	if (isStartCondition) {
		ymd = rItem.RentalStartYmd;
		hm = rItem.RentalStartHm;
	} else {
		ymd = rItem.RentalEndYmd;
		hm = rItem.RentalEndHm;
	}
	this.date.select(ymd);
	this.time.select(hm);
};
/**
 * コントロールを使用可能に設定します。
 */
DDP.Search.RentACarPanel.DateConditionPanel.prototype.enable = function() {
	this.date.enable();
	this.time.enable();
};
/**
 * コントロールを使用不可能に設定します。
 */
DDP.Search.RentACarPanel.DateConditionPanel.prototype.disable = function() {
	this.date.disable();
	this.time.disable();
};
////////////////////// DDP.Search.RentACarPanel.DateConditionPanel END //////////////////////

////////////////////// DDP.Search.RentACarPanel.ResultPanel START //////////////////////
/**
 * コンストラクタ
 * @class レンタカー検索結果を操作する為のクラスです。
 * @constructor
 * @param {String} idPrefix IDのプリフィックス。
 * @param {DDP.Search.RentACarPanel} rentACarPanel レンタカーパネル
 */
DDP.Search.RentACarPanel.ResultPanel = function(idPrefix, rentACarPanel) {
	/** IDのプリフィックス。 * @type String */
	this.idPrefix = idPrefix;
	/** 選択された結果行。 * @type Number */
	this.selectedIndex = -1;
	/** レンタカーパネル。 * @property DDP.Search.RentACarPanel */
	this.rentACarPanel = rentACarPanel;
	/** 「全てのクラスを見る」リンクを使用するかどうかを示す値。 * @type Boolean */
	this.useShowAllLink = false;
	/** クラス選択にRadioButtonを使用するかどうかを示す値。 * @type Boolean */
	this.useSelectRadioButton = false;
	/** 選択内容確認への遷移ボタン。 @type DDP.Button */
	this.redirectButton = null;
	/** 初回更新かどうかを示す値。 * @type Boolean */
	this.isFirstUpdate = true;
	/** 割引エリアのパネル。 @type DDP.Search.Element */
	this.discountPanel = null;
	/** 割引エリアに表示するテンプレート。 @type DDP.Button */
	this.discountTemplate = null;
	/** 割引エリアを使用するかどうかを示す値。 * @type Boolean */
	this.useDiscountArea = false;
};
/**
 * 初期化処理を行ないます。
 */
DDP.Search.RentACarPanel.ResultPanel.prototype.init = function() {
	var __this = this, rPnl = this.rentACarPanel, idPf = this.idPrefix;
	if (rPnl.screenType ==
		DDP.Search.RentACarPanel.ScreenType.SearchResult) {
		this.useShowAllLink = true;
		this.useSelectRadioButton = true;
	} else {
		this.redirectButton = new DDP.Button(idMgr[idPf + 'redirect_button'])
		// 割引エリア
		this.discountPanel = new DDP.Search.Element(idPf + 'result_discount_panel');
		this.discountTemplate = getN(idPf + 'result_discount_template');
		this.useDiscountArea = true;
	}
	// タイトル
	this.resultTitle = getN(idMgr[idPf + 'result_title']);
	this.resultTitle.innerHTML = rPnl.getRentalStartOfficeName();
	// 検索結果ヘッダ
	this.header = getN(idPf + 'result_header');
	// 検索結果ヘッダテンプレート
	this.headerTemplate = getN(idPf + 'result_header_template');
	// ソートパネル
	this.sortPanel = new DDP.Search.RentACarPanel.SortPanel(idPf + 'sort_panel', rPnl, this);
	this.sortPanel.hide();
	// 検索結果コンテンツ
	this.content = getN(idPf + 'result_content');
	// 検索結果コンテンツテンプレート
	this.contentTemplate = getN(idPf + 'result_content_template');
	// 結果行の配列
	this.resultRowArray = new Array();
	// 選択レンタカー料金
	this.selectedAmount = 0;
	// 選択レンタカー情報
	this.selectedRentACar = getN(idMgr[idPf + 'result_selected']);
	// 選択レンタカー料金クラス
	this.selectedRentACarPriceClassNode = getN(idMgr[idPf + 'result_selected_price_class']);
	// 選択車名コード
	this.selectedCarNmeNode = null;
	// 車名指定が有効
	if (rPnl.enableSelectCar) {
		this.selectedCarNmeNode = getN(idMgr[idPf + 'result_selected_car']);
	}
};
/**
 * 検索結果をクリアします。
 */
DDP.Search.RentACarPanel.ResultPanel.prototype.clear = function() {
	// ヘッダ初期化
	var result = {
		ResultAllCount : 0,
		ResultCount : 0,
		DisplayProcessDateTime : this.prevDisplayProcessDateTime
	};
	var headerTemplateProcessor = new DDP.TemplateProcessor(this.headerTemplate.value);
	this.header.innerHTML = headerTemplateProcessor.apply(result);
	// 割引エリア
	if (this.useDiscountArea) {
		this.discountPanel.hide();
	}
	// 結果初期化
	this.content.innerHTML = '&nbsp;';
	// 選択レンタカー情報初期化
	this.selectedRentACar.value = '';
	// 選択レンタカー料金クラス
	this.selectedRentACarPriceClassNode.value = '';
	// 選択車名コード
	if (this.rentACarPanel.enableSelectCar) {
		this.selectedCarNmeNode.value = '';
	}
	// タイトル
	this.resultTitle.innerHTML = this.rentACarPanel.getRentalStartOfficeName();
	// ソートパネル
	this.sortPanel.hide();
};
/**
 * 更新処理を行います。
 * @param result レンタカー検索結果
 */
DDP.Search.RentACarPanel.ResultPanel.prototype.update = function(result) {
	// タイトル
	this.resultTitle.innerHTML = this.rentACarPanel.getRentalStartOfficeName();
	if (result == null) { return; }
	//if (result.ValidateResult != null) { return; }
	var __this = this;
	// レンタカー検索結果を保持
	this.result = result;
	// 日時を保持
	this.prevDisplayProcessDateTime = result.DisplayProcessDateTime;
	// ヘッダ描画
	var headerTp = new DDP.TemplateProcessor(this.headerTemplate.value);
	this.header.innerHTML = headerTp.apply(this.result);
	// 結果描画
	var contentTp = new DDP.TemplateProcessor(this.contentTemplate.value);
	this.content.innerHTML = contentTp.apply(this.result);
	if (this.useDiscountArea) {
		this.discountPanel.hide();
	}
	// 選択レンタカー情報初期化
	this.selectedRentACar.value = '';
	// 結果列初期化
	this.resultRowArray = new Array();
	// ソートパネル更新
	this.sortPanel.update(result);
	var rItms = this.result.Items;
	if (rItms == null ||
		rItms.length == 0 ||
		rItms[0].Cars == null ||
		rItms[0].Cars.length == 0) {
		return;
	}
	var rItmCars = rItms[0].Cars;
	// 割引エリア
	if (this.useDiscountArea &&
		rItmCars[0].DiscountCategoryCd != '') {
		var discountTemplateProcessor = new DDP.TemplateProcessor(this.discountTemplate.value);
		this.discountPanel.element.innerHTML = discountTemplateProcessor.apply(this.result);
		this.discountPanel.show();
	}
	// 選択レンタカー料金クラスのindex
	var prevIndex = -1;
	// 結果列を作成
	var idPf = this.idPrefix, rr = DDP.Search.RentACarPanel.ResultRow;
	for(var i = 0, iLen = rItmCars.length; i < iLen; i++) {
		this.resultRowArray[i] = new rr(this, idPf, i, rItmCars[i]);
		this.resultRowArray[i].init();
		if (this.selectedRentACarPriceClassNode.value == rItmCars[i].PriceClass) {
			prevIndex = i;
		}
	}
	if (this.isFirstUpdate &&
		-1 < prevIndex &&
		this.rentACarPanel.screenType == DDP.Search.RentACarPanel.ScreenType.ChangeRentACar) {
		// 引継ぎ料金クラスを初期表示
		this.select(prevIndex);
		this.isFirstUpdate = false;
	} else {
		// 1件目を初期選択
		this.select(0);
	}
};
/**
 * 更新処理を行います。
 * @param result レンタカー検索結果
 */
DDP.Search.RentACarPanel.ResultPanel.prototype.updateNme = function(result) {
	if (result == null) { return; }
	var carItem, rItms = result.Items;
	if (rItms == null ||
		rItms.length == 0 ||
		rItms[0].Cars == null) {
		carItem = {};
	} else {
		carItem = rItms[0].Cars[0];
	}
	this.resultRowArray[this.selectedIndex].updateNme(carItem);
};
/**
 * 結果列の配列を取得します
 */
DDP.Search.RentACarPanel.ResultPanel.prototype.getResultRowArray = function() {
	return this.resultRowArray;
};
/**
 * 選択されたレンタカーを選択済みとし、他のレンタカーの選択を解除します。
 * @param selectIndex 選択されたインデックス
 */
DDP.Search.RentACarPanel.ResultPanel.prototype.select = function(selectIndex) {
	this.selectedIndex = selectIndex;
	this.selectClear();
	var row = this.resultRowArray[selectIndex];
	row.select();
	this.setStyleAll();
	// 選択料金の更新
	this.selectedAmount = row.getSelectedAmount();
	var rCar = row.getResult();
	// 文字列の集合を渡す
	this.selectedRentACar.value = rCar.Aggregate;
	// 選択レンタカー料金クラス
	this.selectedRentACarPriceClassNode.value = rCar.PriceClass;
	// 選択レンタカー車名コード
	if (this.rentACarPanel.enableSelectCar) {
		this.selectedCarNmeNode.value = row.getCarNmeCd();
	}
	// 合計料金の設定
	this.rentACarPanel.setTotalAmount();
};
/*
 * 選択された料金クラスを取得します。
 */
DDP.Search.RentACarPanel.ResultPanel.prototype.getSelectedPriceClass = function() {
	return this.selectedRentACarPriceClassNode.value;
};
/**
 * レンタカー検索結果を全て未選択にします。
 */
DDP.Search.RentACarPanel.ResultPanel.prototype.selectClear = function() {
	for(var i = 0, iLen = this.resultRowArray.length; i < iLen; i++) {
		this.resultRowArray[i].unSelect();
	}
};
/**
 * レンタカー検索結果の全てのスタイルを設定する。
 */
DDP.Search.RentACarPanel.ResultPanel.prototype.setStyleAll = function() {
	for(var i = 0, iLen = this.resultRowArray.length; i < iLen; i++) {
		this.resultRowArray[i].setStyle();
	}
};
/**
 * 選択されたレンタカーの料金を取得します。
 * @return {Number} 選択されたレンタカーの料金。
 */
DDP.Search.RentACarPanel.ResultPanel.prototype.getSelectedAmount = function() {
	return this.selectedAmount;
};
/**
 * コントロールを使用可能に設定します。
 */
DDP.Search.RentACarPanel.ResultPanel.prototype.enable = function() {
	for(var i = 0, iLen = this.resultRowArray.length; i < iLen; i++) {
		this.resultRowArray[i].enable();
	}
	this.sortPanel.enable();
};
/**
 * コントロールを使用不可能に設定します。
 */
DDP.Search.RentACarPanel.ResultPanel.prototype.disable = function() {
	for(var i = 0, iLen = this.resultRowArray.length; i < iLen; i++) {
		this.resultRowArray[i].disable();
	}
	this.sortPanel.disable();
};
////////////////////// DDP.Search.RentACarPanel.ResultPanel END //////////////////////

/////////////////////// DDP.Search.RentACarPanel.ResultRow START ///////////////////////
/**
 * コンストラクタ
 * @class レンタカー検索結果の各行を操作する為のクラスです。
 * @constructor
 * @param rentACarResultPanel 関連付けるレンタカー検索パネル
 * @param idPrefix コントロールIDの接頭語
 * @param num IDの最後につける添え数値
 */
DDP.Search.RentACarPanel.ResultRow = function(rentACarResultPanel, idPrefix, num, result) {
	this.rentACarResultPanel = rentACarResultPanel;
	/** * RadioButtonを使用する場合true、Buttonを使用する場合false * @type {Boolean} */
	this.useSelectRadioButton = this.rentACarResultPanel.useSelectRadioButton;
	this.idPrefix = idPrefix;
	this.num = num;
	this.resultSelectButton = null;
	this.resultSelectRadioButton = null;
	this.isSelected = false;
	this.selectCarRadioArray = new Array();
	this.isClass = true;
	this.result = result;
	this.resultNme = null;
	this.canSelectCar = this.result.CanSelectCar;
};
/**
 * 初期化処理を行ないます。
 */
DDP.Search.RentACarPanel.ResultRow.prototype.init = function() {
	var __this = this, idPf = this.idPrefix, n = this.num, rrPnl = this.rentACarResultPanel,
		el = DDP.Search.Element;
	if (this.useSelectRadioButton) {
		// ラジオボタン
		this.resultSelectRadioButton = new DDP.Search.RentACarPanel.ResultSelectRadioButton(
			getN(idPf + 'check_' + n), this);
		this.resultSelectRadioButton.init();
		this.resultSelectRadioButton.onClickEvent = function() {
			__this.rentACarResultPanel.select(this.index);
		};
	} else {
		this.resultSelectButton = new DDP.Button(idPf + 'select_' + n);
		this.resultSelectButton.onClickEvent = function() {
			rrPnl.disable();
			rrPnl.select(__this.num);
			rrPnl.redirectButton.raiseClickEvent();
		};
	}
	// セル
	this.resultSelectButtonCell = new el(idPf + 'p_td_' + n);
	this.resultContentCell = new el(idPf + 'c_td_' + n);

	// 車名指定
	if (!rrPnl.rentACarPanel.enableSelectCar) { return; }
	this.discountedPricePerson = getN(idPf + 'discounted_price_p_' + n);
	this.discountedPriceTotal = getN(idPf + 'discounted_price_t_' + n);
	this.diffPriceTotal = getN(idPf + 'diff_price_t_' + n);
	if (this.canSelectCar) {
		this.selectCarLink = new DDP.Search.RentACarPanel.Link('select_car_link_' + n);
		this.selectCarLabel = getN('select_car_label_' + n);
		this.selectCarArea = getN('select_car_area_' + n);
		this.selectCarLink.onClickEvent = function() { __this.onUpdateNme(); };
	}
};
/**
 * 車名更新を行ないます。
 */
DDP.Search.RentACarPanel.ResultRow.prototype.updateNme = function(result) {
	if (result == null) {
		return;
	}
	result.num = this.num;
	this.resultNme = result;
	if (!this.canSelectCar) { return; }
	var __this = this;
	var tp = new DDP.TemplateProcessor(getN('select_car_template').value);
	this.selectCarArea.innerHTML = tp.apply(result);
	this.selectCarLink.hide();
	DDP.setVisible(this.selectCarLabel, true);
	DDP.setVisible(this.selectCarArea, true);
	this.selectCarRadioArray = new Array();
	for(var i = -1, l = result.CarDetails.length; i < l; i++) {
		var rNum = i + 1;
		this.selectCarRadioArray[rNum] = new DDP.Search.RentACarPanel.SelectCarRadioButton(
			getN(this.idPrefix + this.num + "_" + rNum), this, i);
		this.selectCarRadioArray[rNum].init();
		this.selectCarRadioArray[rNum].onClickEvent = function() {
			__this.isClass = false;
			__this.rentACarResultPanel.select(__this.num);
			__this.isClass = true;
		};
	}
};
/**
 * 車名更新時のイベントハンドラ。
 */
DDP.Search.RentACarPanel.ResultRow.prototype.onUpdateNme = function() {
	this.rentACarResultPanel.select(this.num)
	this.rentACarResultPanel.rentACarPanel.searchRentACarNme();
};
/**
 * 結果オブジェクトを取得します。
 */
DDP.Search.RentACarPanel.ResultRow.prototype.getResult = function() {
	return this.isClass ? this.result : this.resultNme;
};
/**
 * 車名コードを取得します。
 */
DDP.Search.RentACarPanel.ResultRow.prototype.getCarNmeCd = function() {
	if (!this.rentACarResultPanel.rentACarPanel.enableSelectCar) { return ''; }
	for (var i = 0, l = this.selectCarRadioArray.length; i < l; i++) {
		if (this.selectCarRadioArray[i].selected()) {
			return this.selectCarRadioArray[i].getValue();
		}
	}
	return '';
};
/**
 * 選択されたレンタカーの料金を取得します。
 */
DDP.Search.RentACarPanel.ResultRow.prototype.getSelectedAmount = function() {
	var result = this.getResult();
	if (result == null) return 0;
	return result.BasicPriceTotalPerHeadCount +
		result.OnewayPriceTotalPerHeadCount +
		result.FourWDPriceTotalPerHeadCount;
};
/**
 * 行を選択状態にします。
 */
DDP.Search.RentACarPanel.ResultRow.prototype.select = function() {
	this.isSelected = true;
	if (this.useSelectRadioButton) {
		this.resultSelectRadioButton.select();
	}
	if (!this.rentACarResultPanel.rentACarPanel.enableSelectCar) { return; }
	// 車名指定の場合は料金を連動
	var carItem = this.getCarNmeCd() == '' ? this.result : this.resultNme;
	this.discountedPricePerson.innerHTML = DDP.convertToAmountString(carItem.BasicPriceTotalPerHeadCount);
	this.discountedPriceTotal.innerHTML = DDP.convertToAmountString(carItem.DiscountedBasicPriceTotal);
	if (this.diffPriceTotal) {
		this.diffPriceTotal.innerHTML = DDP.convertToAmountString(
			carItem.BasicPriceTotal - carItem.DiscountedBasicPriceTotal);
	}
};
/**
 * 行を未選択状態にします。
 */
DDP.Search.RentACarPanel.ResultRow.prototype.unSelect = function() {
	this.isSelected = false;
	if (this.useSelectRadioButton) {
		this.resultSelectRadioButton.unselect();
	}
};
/**
 * 行にスタイルを設定します。
 */
DDP.Search.RentACarPanel.ResultRow.prototype.setStyle = function() {
	if (this.useSelectRadioButton) {
		this.resultSelectRadioButton.setStyle();
	} else {
		if (this.isSelected) {
			this.setSelectedStyle();
		} else {
			this.setNormalStyle();
		}
	}
};
/**
 * 選択済みスタイルにスタイルを設定します。
 */
DDP.Search.RentACarPanel.ResultRow.prototype.setSelectedStyle = function() {
	this.resultSelectButtonCell.removeClass(
		[DDP.Search.Const.CAR_RESULT_RADIO_CELL_NORMAL_STYLE]);
	this.resultContentCell.removeClass(
		[DDP.Search.Const.CAR_RESULT_OTHER_CELL_NORMAL_STYLE]);
	this.resultSelectButtonCell.addClass(
		[DDP.Search.Const.CAR_RESULT_RADIO_CELL_SELECTED_STYLE]);
	this.resultContentCell.addClass(
		[DDP.Search.Const.CAR_RESULT_OTHER_CELL_SELECTED_STYLE]);
};
/**
 * 通常スタイルにスタイルを設定します。
 */
DDP.Search.RentACarPanel.ResultRow.prototype.setNormalStyle = function() {
	this.resultSelectButtonCell.removeClass(
		[DDP.Search.Const.CAR_RESULT_RADIO_CELL_SELECTED_STYLE]);
	this.resultContentCell.removeClass(
		[DDP.Search.Const.CAR_RESULT_OTHER_CELL_SELECTED_STYLE]);
	this.resultSelectButtonCell.addClass(
		[DDP.Search.Const.CAR_RESULT_RADIO_CELL_NORMAL_STYLE]);
	this.resultContentCell.addClass(
		[DDP.Search.Const.CAR_RESULT_OTHER_CELL_NORMAL_STYLE]);
};
/**
 * コントロールを使用可能に設定します。
 */
DDP.Search.RentACarPanel.ResultRow.prototype.enable = function() {
	if (!this.useSelectRadioButton) {
		this.resultSelectButton.enable();
	}
	if (this.rentACarResultPanel.rentACarPanel.enableSelectCar) {
		if (this.canSelectCar) {
			this.selectCarLink.enable();
		}
		for(var i = 0, l = this.selectCarRadioArray.length; i < l; i++) {
			this.selectCarRadioArray[i].enable();
		}
	}
};
/**
 * コントロールを使用不可能に設定します。
 */
DDP.Search.RentACarPanel.ResultRow.prototype.disable = function() {
	if (!this.useSelectRadioButton) {
		this.resultSelectButton.disable();
	}
	if (this.rentACarResultPanel.rentACarPanel.enableSelectCar) {
		if (this.canSelectCar) {
			this.selectCarLink.disable();
		}
		for(var i = 0, l = this.selectCarRadioArray.length; i < l; i++) {
			this.selectCarRadioArray[i].disable();
		}
	}
};
//////////////////////// DDP.Search.RentACarPanel.ResultRow END ////////////////////////

////////////////////// DDP.Search.RentACarPanel.ResultSelectRadioButton START //////////////////////
/**
 * コンストラクタ
 * @class レンタカー検索結果に表示するラジオボタンを操作する為のクラスです。
 * @constructor
 * @param {} node 操作対象のラジオボタンノード
 * @param {DDP.Search.RentACarPanel.ResultRow} resultRow 対象の行番号
 */
DDP.Search.RentACarPanel.ResultSelectRadioButton = function(node, resultRow) {
	this.resultRow = resultRow;
	// DDP.Search.RadioButton としての初期化
	DDP.Search.RadioButton.apply(this, arguments);
	return this;
};
/**
 * prototypeを上書き。
 */
DDP.Search.RentACarPanel.ResultSelectRadioButton.prototype = new DDP.Search.RadioButton();
/**
 * 初期化メソッドをオーバーライド
 */
DDP.Search.RentACarPanel.ResultSelectRadioButton.prototype.init = function() {
	DDP.Search.RadioButton.prototype.init.apply(this, arguments);
	this.index = parseInt(this.node.value);
};
/**
 * ボタンを押した際の動作を処理します。
DDP.Search.RentACarPanel.ResultSelectRadioButton.prototype.onClickEvent = function() {
	this.resultRow.rentACarResultPanel.select(this.index);
};
 */
/**
 * 選択された項目のスタイルを設定します。
 */
DDP.Search.RentACarPanel.ResultSelectRadioButton.prototype.setSelectedStyle = function() {
	this.resultRow.setSelectedStyle();
};
/**
 * 選択されていない項目のスタイルを設定します。
 */
DDP.Search.RentACarPanel.ResultSelectRadioButton.prototype.setNormalStyle = function() {
	this.resultRow.setNormalStyle();
};
////////////////////// DDP.Search.RentACarPanel.ResultSelectRadioButton END //////////////////////

////////////////////// DDP.Search.RentACarPanel.SelectCarRadioButton START //////////////////////
/**
 * コンストラクタ
 * @class レンタカー検索結果に表示するラジオボタンを操作する為のクラスです。
 * @constructor
 * @param {} node 操作対象のラジオボタンノード
 * @param {DDP.Search.RentACarPanel.ResultRow} resultRow 対象の行
 * @param {Number} idx 対象データのインデックス
 */
DDP.Search.RentACarPanel.SelectCarRadioButton = function(node, resultRow, idx) {
	this.resultRow = resultRow;
	this.dataIndex = idx;
	this.lock = false;
	// DDP.Search.RadioButton としての初期化
	DDP.Search.RadioButton.apply(this, arguments);
	return this;
};
/**
 * prototypeを上書き。
 */
DDP.Search.RentACarPanel.SelectCarRadioButton.prototype = new DDP.Search.RadioButton();
/**
 * 初期化メソッドをオーバーライド
 */
DDP.Search.RentACarPanel.SelectCarRadioButton.prototype.init = function() {
	var __this = this;
	DDP.Search.RadioButton.prototype.init.apply(this, arguments);
	if (this.dataIndex == -1) { return; }
	var useCnt = this.resultRow.rentACarResultPanel.rentACarPanel.getRentACarCondtition().UseCnt;
	var stock = this.resultRow.resultNme.CarDetails[this.dataIndex].StockCount;
	if (stock < useCnt) {
		this.disable();
		this.lock = true;
	}
};
DDP.Search.RentACarPanel.SelectCarRadioButton.prototype.disable = function() {
	if (!this.lock) {
		DDP.Search.RadioButton.prototype.disable.apply(this, arguments);
	}
};
DDP.Search.RentACarPanel.SelectCarRadioButton.prototype.enable = function() {
	if (!this.lock) {
		DDP.Search.RadioButton.prototype.enable.apply(this, arguments);
	}
};
////////////////////// DDP.Search.RentACarPanel.SelectCarRadioButton END //////////////////////

////////////////////// DDP.Search.RentACarPanel.SortPanel START //////////////////////
/**
 * コンストラクタ
 * @class レンタカー検索結果のソートパネルを操作する為のクラスです。
 * @constructor
 * @param id レンタカー検索結果のソートパネルのID
 * @param rentACarPanel 関連付けるレンタカー検索パネル
 * @param rentACarResultPanel 関連付けるレンタカー検索結果パネル
 */
DDP.Search.RentACarPanel.SortPanel = function(id, rentACarPanel, rentACarResultPanel) {
	this.initialize.apply(this, arguments);
};
/**
 * prototypeを上書き
 */
DDP.Search.RentACarPanel.SortPanel.prototype = new DDP.Search.Element();
/**
 * 初期化処理を行ないます。
 * @constructor
 * @param id レンタカー検索結果のソートパネルのID
 * @param rentACarPanel 関連付けるレンタカー検索パネル
 * @param rentACarResultPanel 関連付けるレンタカー検索結果パネル
 */
DDP.Search.RentACarPanel.SortPanel.prototype.initialize = function(id, rentACarPanel, rentACarResultPanel) {
	DDP.Search.Element.prototype.initialize.apply(this, [id]);
	this.rentACarPanel = rentACarPanel;
	this.rentACarResultPanel = rentACarResultPanel;
	var __this = this, CSK = DDP.Search.RentACarPanel.CarSortKbn,
		sl = DDP.Search.RentACarPanel.SortLink, el = DDP.Search.Element;
	// ソート区分
	var sortKbn = this.sortKbn = getN(idMgr['car_sort_kbn']);
	// おすすめ順リンク
	this.sortRecommendLink = new sl('car_sort_recommend_link', CSK.Recommend, sortKbn, rentACarPanel);
	this.sortRecommendLink.hide();
	// おすすめ順選択済みラベル
	this.sortRecommendSelected = new el('car_sort_recommend_selected');
	this.sortRecommendSelected.hide();
	// 価格が安い順リンク
	this.sortLowerLink = new sl('car_sort_price_lower_link', CSK.PriceLower, sortKbn, rentACarPanel);
	this.sortLowerLink.hide();
	// 価格が安い順選択済みラベル
	this.sortLowerSelected = new el('car_sort_price_lower_selected');
	this.sortLowerSelected.hide();
	// 価格が高い順リンク
	this.sortHigherLink = new sl('car_sort_price_higher_link', CSK.PriceHigher, sortKbn, rentACarPanel);
	this.sortHigherLink.hide();
	// 価格が高い順選択済みラベル
	this.sortHigherSelected = new el('car_sort_price_higher_selected');
	this.sortHigherSelected.hide();
	this.elementDictionary = [
		{Link : this.sortRecommendLink, Selected : this.sortRecommendSelected },
		{Link : this.sortLowerLink,     Selected : this.sortLowerSelected },
		{Link : this.sortHigherLink,    Selected : this.sortHigherSelected }
	];
};
/**
 * ソート区分を取得します。
 * @return {String} ソート区分
 */
DDP.Search.RentACarPanel.SortPanel.prototype.getSortKbn = function() {
	return this.sortKbn.value;
};
/**
 * 内容更新する。
 * @param {} result
 */
DDP.Search.RentACarPanel.SortPanel.prototype.update = function(result) {
	// 表示の切り替え
	if (result.ExistsResult &&
		result.Items != null &&
		result.Items.length != 0 &&
		result.Items[0].Cars != null &&
		0 < result.Items[0].Cars.length) {
		// 表示
		this.show();
		for(var i = 0, iLen = this.elementDictionary.length; i < iLen; i++) {
			var el = this.elementDictionary[i];
			if (this.getSortKbn() == el.Link.getSortValue()) {
				el.Link.hide();
				el.Selected.show();
			} else {
				el.Link.show();
				el.Selected.hide();
			}
		}
	} else {
		// 非表示
		this.hide();
	}
};
/**
 * コントロールを使用可能に設定します。
 */
DDP.Search.RentACarPanel.SortPanel.prototype.enable = function() {
	this.sortRecommendLink.enable();
	this.sortLowerLink.enable();
	this.sortHigherLink.enable();
};
/**
 * コントロールを使用不可能に設定します。
 */
DDP.Search.RentACarPanel.SortPanel.prototype.disable = function() {
	this.sortRecommendLink.disable();
	this.sortLowerLink.disable();
	this.sortHigherLink.disable();
};
////////////////////// DDP.Search.RentACarPanel.SortPanel END //////////////////////

////////////////////// DDP.Search.RentACarPanel.SortLink START //////////////////////
/**
 * コンストラクタ
 * @class レンタカー検索パネルのソートリンクを操作する為のクラスです。
 * @constructor
 * @param idKey リンクのID
 * @param sortValue ソート区分の値
 * @param sortHidden ソート区分Hidden
 * @param rentACarPanel 関連付けるレンタカー検索パネル
 */
DDP.Search.RentACarPanel.SortLink = function(id, sortValue, sortHidden, rentACarPanel) {
	this.initialize.apply(this, arguments);
};
/**
 * prototypeを上書き
 */
DDP.Search.RentACarPanel.SortLink.prototype = new DDP.Search.RentACarPanel.Link();
/**
 * 初期化します。
 * @param idKey リンクのID
 * @param sortValue ソート区分の値
 * @param sortHidden ソート区分Hidden
 * @param rentACarPanel 関連付けるレンタカー検索パネル
 */
DDP.Search.RentACarPanel.SortLink.prototype.initialize = function(id, sortValue, sortHidden, rentACarPanel) {
	DDP.Search.RentACarPanel.Link.prototype.initialize.apply(this, [id]);
	this.sortValue = sortValue;
	this.sortHidden = sortHidden;
	this.rentACarPanel = rentACarPanel;
};
/**
 * clickイベントが発生した場合の処理を記述
 */
DDP.Search.RentACarPanel.SortLink.prototype.onClickEvent = function() {
	this.sortHidden.value = this.sortValue;
	this.rentACarPanel.searchRentACar();
};
/**
 * 自身のソート値を取得します。
 * @return {String}
 */
DDP.Search.RentACarPanel.SortLink.prototype.getSortValue = function() {
	return this.sortValue;
};
////////////////////// DDP.Search.RentACarPanel.SortLink END //////////////////////

////////////////////// DDP.Search.RentACarPanel.ValidateErrorPanel END //////////////////////
/**
 * コンストラクタ
 * @class レンタカー検索の入力エラーメッセージ表示エリアを操作する為のクラスです。
 * @constructor
 * @param {String} id エリアのID
 * @param {DDP.Search.RentACarPanel} rentACarPanel 関連付けるレンタカー検索パネル
 */
DDP.Search.RentACarPanel.ValidateErrorPanel = function(id, rentACarPanel) {
	this.initialize.apply(this, arguments);
};
/**
 * prototype上書き
 */
DDP.Search.RentACarPanel.ValidateErrorPanel.prototype = new DDP.Search.Element();
/**
 * 初期化します。
 * @param {String} id
 * @param {DDP.Search.RentACarPanel} rentACarPanel レンタカー検索パネル
 */
DDP.Search.RentACarPanel.ValidateErrorPanel.prototype.initialize = function(id, rentACarPanel) {
	DDP.Search.Element.prototype.initialize.apply(this, [id]);
	this.rentACarPanel = rentACarPanel;
	this.messageElement = new DDP.Search.Element('car_validation_error_message');
};
/**
 * 更新処理を行います。
 * @param {} result 検索結果
 */
DDP.Search.RentACarPanel.ValidateErrorPanel.prototype.update = function(result) {
	if (result != null &&
		!result.ExistsResult &&
		result.ValidateResult != null) {
		var msgArr = [''], idx = 1;
		for(var key in result.ValidateResult) {
			msgArr[idx++] = result.ValidateResult[key] + '<br />';
		}
		this.messageElement.element.innerHTML = msgArr.join('');
		this.show();
	} else {
		this.messageElement.element.innerHTML = '';
		this.hide();
	}
};
////////////////////// DDP.Search.RentACarPanel.ValidateErrorPanel END //////////////////////
})();

