function messageWindowObject(in_intLevel, in_strInstanceName)
{
	this.animationStartTimeout = 500;		//Timeout bis zum Start der Animation
	this.animationStepWidth = 10;	//Schrittweite der Animation
	this.animationTimeout = 15;		//Timeout der Animation in ms
	this.hideTimeout = 6000;		//Timeout bis zum automatischen Schliessen des Fensters
	
	this.intLevel = in_intLevel;
	this.strInstanceName = in_strInstanceName;
	this.objNodeMessageWindow = null;
	this.intDefaultY;
	this.intAnimationYEnd;
	this.bolAnimationRunning = false;
	
	this.init = function()
	{
		{
			this.objNodeMessageWindow = document.getElementById('message_window');
			this.intDefaultY = -this.objNodeMessageWindow.offsetHeight;
		}
	}

	this.show = function()
	{
		this.objNodeMessageWindow.style.top = this.intDefaultY + 'px';
		this.objNodeMessageWindow.style.visibility = 'visible'
		if (!this.bolAnimationRunning)
		{
			window.setTimeout(this.strInstanceName + ".animate(1)", this.animationStartTimeout);
		}
	}

	this.hide = function()
	{
		if (!this.bolAnimationRunning)
		{
			window.setTimeout(this.strInstanceName + ".animate(-1)", this.animationStartTimeout);
		}
	}
	
	this.onHideAnimationFinished = function()
	{
		this.bolAnimationRunning = false;
		if (this.intLevel < 4)	//wenn keine Fehlermeldung, Fenseter nach Timout wiede automatisch schliessen
		{
			window.setTimeout(this.strInstanceName + ".hide()", this.hideTimeout);
		}
	}

	this.animate = function(in_intDirection)
	{
		this.bolAnimationRunning = true;
		this.intAnimationYEnd = parseInt(this.objNodeMessageWindow.style.top) + this.objNodeMessageWindow.offsetHeight * in_intDirection;
		this.animateStep(in_intDirection);
	}

	this.animateStep = function(in_intDirection)
	{
		if (Math.abs(parseInt(this.objNodeMessageWindow.style.top) - this.intAnimationYEnd) == 0)
		{
			this.onHideAnimationFinished()
		}
		else
		{
			var intStepWidth; 
			if (Math.abs(parseInt(this.objNodeMessageWindow.style.top) - this.intAnimationYEnd) < this.animationStepWidth * 10)
			{
				intStepWidth = Math.round(Math.abs(parseInt(this.objNodeMessageWindow.style.top) - this.intAnimationYEnd) / 10);
				intStepWidth = intStepWidth == 0 ? 1 : intStepWidth;
			}
			else
			{
				intStepWidth = this.animationStepWidth;
			}
			this.objNodeMessageWindow.style.top = (parseInt(this.objNodeMessageWindow.style.top) + intStepWidth * in_intDirection) + 'px';
			window.setTimeout(this.strInstanceName + ".animateStep(" + in_intDirection + ")", this.animationTimeout);
		}
	}
	
}
