function msgWindow( _id, _classx, _width, _height, _text )
{
	this.id = _id;
	this.dom_id;
	this.visible;
	this.width = _width;
	this.height = _height;
	this.classx = _classx;

	this.text = _text;
		
	this.show = show;
	this.hide = hide;
	this.setText = setText;
	this.setPos = setPos;
	this.init = init;
	this.draw = draw;
}

function show()
{
	this.setPos();
	if(document.all) { this.dom_id.style.visibility = "visible"; }
	else { this.dom_id.style.visibility = "show"; }
	this.visible = true;
}

function hide()
{
	if(document.all) { this.dom_id.style.visibility = "hidden"; }
	else { this.dom_id.style.visibility = "hide"; }
	this.visible = false;
}

function setText( _text )
{
	this.dom_id.innerText = _text;
	this.text = _text;
}

function setPos()
{
	this.dom_id.style.width = this.width;
	this.dom_id.style.height = this.height;

	var x;
	var y;
	var w = parseInt(this.dom_id.style.width);
	var h = parseInt(this.dom_id.style.height);

	x = document.all ? ((document.body.clientWidth	/ 2) - (w / 2)):((window.innerWidth / 2) - (w / 2));
	y = document.all ? ((document.body.clientHeight / 2) - (h / 2)):((window.innerHeight / 2) - (h / 2));

	this.dom_id.style.left = x += "px";
	this.dom_id.style.top = y += "px";
}

function init()
{
	this.draw( this.text );
	this.dom_id = document.getElementById( this.id );

	this.setPos();
	this.show();
}

function draw( _text )
{
	document.write('<div id="'+ this.id +'" class="'+ this.classx +'">'+ this.text +'</div>');
}