var CmooErrorLayer = new Class({
	state: false,
	oContainer: null,
	oPopuptext: null,
	oCloseBTN: null,
	isOpen: function(){ return this.state; },
	initialize: function() {
		var layer = new Element('div',{'class':'mmt_layer mmt_layer_550 select-free','id':'mmt_cmooerrorlayer_popup'});
		layer.set('html','<div class="mmt_layer_top">\
							<div class="box_head_text head_rendszeruzenet">Rendszerüzenet</div>\
						  </div>\
						  <div class="mmt_layer_bg">\
							<div class="mmt_layer_cont">\
							  <div id="mmt_cmooerrorlayer_text"></div>\
							  <div class="clear_10"></div>\
							  <div class="form_button">\
								<img id="mmt_cmooerrorlayer_close" alt="" src="/images/button_bezar.gif" />\
							  </div>\
							  <div class="clear"></div>\
							 </div>\
						  </div>\
						  <div class="mmt_layer_bot"></div>\
						<!--[if lte IE 6.5]><iframe></iframe><![endif]-->').setStyle('visibility','hidden');
		layer.inject(document.getElement('BODY'));
		this.oContainer = $('mmt_cmooerrorlayer_popup');
		this.oPopuptext = $('mmt_cmooerrorlayer_text');
		this.oCloseBTN = $('mmt_cmooerrorlayer_close');
		window.addEvent('resize',(this.moveCenter).bind(this));
		window.addEvent('scroll',(this.moveCenter).bind(this));
		this.oCloseBTN.addEvent('click',(this.close).bind(this));
		this.moveCenter();
	},
	moveCenter: function(){
		//y pozicio szamitasa, beallitasa***** CREDITS: thx Gui, Lefi :))
		//itt most fixen 550x170 az ablak merete
		ypos = window.getScroll().y + ((window.getSize().y/2)-(170/2));
		xpos = window.getScroll().x + ((window.getSize().x/2)-(550/2));
		this.oContainer.setStyle('left', xpos);
		this.oContainer.setStyle('top', ypos);
		// ************************************
	},
	open: function(){
		if (!this.isOpen()){
			this.moveCenter();
			this.state=true;
			this.oContainer.setStyle('visibility','visible');
		}
	},
	close: function(){
		if (this.isOpen()){
			this.state=false;
			this.oContainer.setStyle('visibility','hidden');
		}
	},
	pop: function(text){
		if (this.isOpen()) return false;
		this.oPopuptext.set('html',text);
		this.open();
	}
});
