var _MoePopup = function() {
	this.bg = null;
	this.container = null;

	this.init();
};
_MoePopup.prototype.init = function() {
	var bg = document.createElement('div'), container = document.createElement('div');
	bg.style.cssText = 'position:absolute;top:0;left:0;background:#fff;cursor:pointer';
	$(bg).css('opacity', 0.5);

	container.className = 'moePopup';
	container.innerHTML = '<div class="head"><h3>모에보드 알리미</h3><p class="close"><a href="#"><img src="/_images/btn_close.gif" alt="닫기"/></a></p><div class="clear"></div></div><div class="content"></div>';

	this.bg = bg;
	this.container = container;
};
_MoePopup.prototype.show = function(message) {
	var body = $(document.body);
	this.bg.style.width = body.width() + 'px';
	this.bg.style.height = body.height() + 'px';
	this.bg.onclick = function() { self.hide(); return false; };

	var c = getClientInfo();

	this.container.style.left = ((body.width() - 300) / 2 + body.scrollLeft()) + 'px';
	//this.container.style.top = ((body.height() - 180) / 2 + body.scrollTop()) + 'px';
	this.container.style.top = (200 + c.top) + 'px';

	var container = $(this.container), self = this;
	container.find('div.content').html(message);
	container.find('a').click ( function() { self.hide(); return false; } );

	document.body.appendChild(this.bg);
	document.body.appendChild(this.container);
};
_MoePopup.prototype.hide = function() {
	this.bg.onclick = null;
	document.body.removeChild(this.bg);
	document.body.removeChild(this.container);
};

MoePopup = new _MoePopup();