//アイコン選択ポップアップクラス
var compIcon = Class.create();

compIcon.prototype = {
	initialize: function() {
		this.id = null;
		this.el = null;
		this.popup = new Object();
	},

	showDialogBox: function(id, el, hidden) {
		this.id = id;
		this.el = el;
		this.hidden = hidden;
		commonCls.referComp[this.id] = this;
	
		var src = _js_url + "/include/comp/textarea/popup.php?prefix_id_name="+ "dialog_insertsmiley&parent_name=" + 
					this.id + "&cmd_name=insertsmiley";

		if(!this.popup[this.id]) {
			this.popup[this.id] = new compPopup(document.body, "insertsmiley"+this.id);
		}
		this.popup[this.id].observer = function(){this.closePopup();}.bind(this);
		this.popup[this.id].observing = true;
		this.popup[this.id].modal = true;

		this.popup[this.id].showSrcPopup(src, this.el);
	},
	
	insertImage: function(params) {
		this.el.src = params["f_url"];
		this.el.title = params["f_title"];
		this.el.alt = params["f_alt"];
		var arr = params["f_url"].split("/");
		this.hidden.value = arr[arr.length-1];
		this.closePopup();
	},
	
	closePopup: function() {
		if(this.popup[this.id]) {
			this.popup[this.id].closePopup();
		}
	}
}
