function Message(node,textNode,button) {
	var self = this;
	this.wnd = node;
	this.textNode = textNode;
	this.btn = button;
	this.func = function(evt){self.show.call(self);}
	this.funcPointer = null;
	if (node.style.position != 'absolute') node.style.position = 'absolute';
	node.style.visibility = 'hidden';
}
Message.prototype.show = function(msg,showBtn) {
	var self = this;
	this.wnd.style.display = 'block';
	this.wnd.style.left = ((document.documentElement.clientWidth/2 + document.documentElement.scrollLeft) - (this.wnd.offsetWidth)/2)+'px';
	this.wnd.style.top = ((document.documentElement.clientHeight/2 + document.documentElement.scrollTop) - (this.wnd.offsetHeight)/2)+'px';
	this.wnd.style.visibility = 'visible';
	if (!this.funcPointer) {
		this.setText(msg,showBtn);
		this.funcPointer = this.func.bindAsEventListener('scroll',window,this);
	}
}
Message.prototype.hide = function() {
	this.wnd.style.display = 'none';
	this.wnd.style.visibility = 'hidden';
	Element.removeEventListener('scroll',window,this.funcPointer);
	this.funcPointer = null;
}
Message.prototype.setText = function(msg,showBtn) {
	if (showBtn) this.btn.style.display = 'block';
	else this.btn.style.display = 'none';
	this.textNode.innerHTML = msg;
}
Message.prototype.reset = function() {
	if (this.funcPointer != null) {
		Element.removeEventListener('scroll',window,this.funcPointer);
		this.funcPointer = null;
	}
}
