Mys.replyPopup = function(){
	this.dlg = Ext.get('commentpreview');
	this.replyList = new Mys.ReplyList({
		headerTemplate : null,
		footerTemplate : null,
		pager : null,
		itemClass : Mys.SimpleReplyItem
	});
	
	this.replyList.render(Ext.fly(document.getElementById("commentpreview")).child(".mys-reply-list"));
	this.replyList.startLoading();
};

Mys.replyPopup.prototype = {
	
	popup: function(data, el, position)
	{
		if(this.hideID)
		{
			clearTimeout(this.hideID);
			
			this.hideID = null;
			
			return true;
		}
		
		this.data = data;
		
		this.replyList.setItemData(this.data);
		this.replyList.startLoading();
		this.replyList.refresh();
		
		this.show(el, position);
	},
	show : function(el, position)
	{
		this.dlg.alignTo(el, position);
		
		this.dlg.show();
	}
	
	,hide : function()
	{
		this.hideID = this.onHide.defer(50, this);
	},
	
	onHide : function()
	{
		this.hideID = null;
		this.dlg.hide();
	}

};