function TacticaFader()
{
	this.elem = null;
	this.elemBack = null;
	this.elemFore = null;
	this.id = arguments[0];
	this.itemDelay = 2000;
	this.itemIndex = 0;
	this.items = new Array();
	this.stepCount = 0;
	this.stepDelay = 40;
	this.stepMax = 30;
	this.timer = null;
	this.width = arguments[1];
	
	this.addItem = function(text)
	{
		this.items[this.items.length] = text;
	}
	
// function setContent
//-----------------------
	if (document.all)
	{
		this.elem = document.all[this.id];
		this.setContent = function(text)
		{
			var temp = this.elemBack;
			 
			this.elemBack = this.elemFore;
			this.elemFore = document.createElement("SPAN");
			this.elemFore.style.display = "block";
			this.elemFore.style.height = "310px";
			this.elemFore.style.left = "0px";
			this.elemFore.style.position = "absolute";
			this.elemFore.style.top = "0px";
			this.elemFore.style.width = "365px";
			this.elemFore.innerHTML = text;
			this.setOpacity(this.elemFore, 0);
			this.elem.appendChild(this.elemFore);

			if (temp != null)
			{
				this.elem.removeChild(temp);
			}
		}
	}
	else if (document.getElementById)
	{
		this.elem = document.getElementById(this.id);
		this.setContent = function(text)
		{
			var temp = this.elemBack;
			
			this.elemBack = this.elemFore;
			this.elemFore = document.createElement("SPAN");
			this.elemFore.style.display = "block";
			this.elemFore.style.height = "310px";
			this.elemFore.style.left = "0px";
			this.elemFore.style.position = "absolute";
			this.elemFore.style.top = "0px";
			this.elemFore.style.width = "365px";
			this.elemFore.innerHTML = text;
			this.setOpacity(this.elemFore, 0);
			this.elem.appendChild(this.elemFore);

			if (temp != null)
			{
				this.elem.removeChild(temp);
			}
		}
	}
	
// function setOpacity
//-----------------------
	if (document.all)
	{
		this.setOpacity = function(element, value)
		{
			if (value <= 0.0) value = 0.000;
			if (value >= 1.0) value = 0.999;

//			element.style.width = element.offsetWidth + "px";
			element.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=" + (100 * value) + ")";
		}
	}
	else if (document.getElementById)
	{
		this.setOpacity = function(element, value)
		{
			if (value <= 0.0) value = 0.000;
			if (value >= 1.0) value = 0.999;

			element.style.MozOpacity = value;
		}
	}
	
	// fades in the next item
	this.fade = function()
	{
		var ref = this;
		
		if (this.stepCount < this.stepMax)
		{
			this.stepCount++;
			this.setOpacity(this.elemFore, this.stepCount / this.stepMax);
			
			setTimeout(function(){ref.fade()}, this.stepDelay);
		}
		else
		{
			this.stepCount = 0;
			
			setTimeout(function(){ref.switchContent()}, this.itemDelay);
		}
	}
	
	// initializes the fader
	this.init = function()
	{
		this.switchContent();
	}
	
	// switches to the next content item
	this.switchContent = function()
	{
		var ref = this;
		
		this.setContent(this.items[this.itemIndex % this.items.length]);
		this.itemIndex++;

		setTimeout(function(){ref.fade()}, this.stepDelay);
	}
}
