// 検索クラス
var ReitSearch = function(){};

/**
 * 初期化処理
 */
ReitSearch.init = function() {
	if (!document.getElementById('keyword')) {
		return false;
	}
	
	document.getElementById('keyword').onchange =
	document.getElementById('keyword').onkeyup = 
	document.getElementById('keyword').onblur = function(){
		var source = document.getElementById('toshihojin').innerHTML;
		var texts = document.getElementById('toshihojin').innerText;
		if (source.indexOf(this.value) != -1) {
			source = source.replace(this.value, '<span style="background:#ffcc00;">'+this.value+'</span>');
			document.getElementById('toshihojin').innerHTML = source;
		}
	};
};


// 投資法人選択クラス
var ToshihojinSelector = function(){};

ToshihojinSelector.init = function() {
	// リストを開く
	document.getElementById('openlist').onclick = function() {
		document.getElementById('toshihojinselector').style.display = 'block';
		return false;
	};
	// リストを閉じる
	document.getElementById('closelist').onclick = function() {
		document.getElementById('toshihojinselector').style.display = 'none';
		return false;
	};
};

ToshihojinSelector.open = function() {

};

addLoadEvent(ReitSearch.init);
addLoadEvent(ToshihojinSelector.init);
