function ArtistFade(log, artists, fade_interval, fade_duration, update_interval)
{
	this.log = log;
	this.debug = false;
	
	this.artists = new Array();
	for (var a = 0; a < artists.length; a++) this.artists[a] = document.getElementById(artists[a]);
	
	this.fade_interval = fade_interval;
	this.fade_duration = fade_duration;
	this.fade_trans = fade_interval;
	this.update_interval = update_interval;
	this.pos = 0;
	this.max_pos = this.artists.length * fade_interval;

	this.start = function()
	{
		var _this = this;
		window.setInterval(function() { _this.update(); }, this.update_interval, this);
	};
	
	this.update = function()
	{
		if (this.debug) this.log.innerHTML = "Update: " + this.pos + "<br/>\n";
		
		for (var a = 0; a < this.artists.length; a++)
		{
			var df = (this.pos - a * fade_interval) % this.max_pos;
			df = (df + this.max_pos) % this.max_pos;
			
			if (this.debug) this.log.innerHTML += "df: " + df + "<br/>\n";
			
			var op = 0.0;
			
			if (df < this.fade_duration + this.fade_trans * 2)
			{
				if (df < this.fade_trans)
				{
					op = df / this.fade_trans;
				}
				else if (df < this.fade_duration + this.fade_trans)
				{
					op = 1.0;
				}
				else
				{
					op = 1.0 - (df - (this.fade_duration + this.fade_trans)) / this.fade_trans;
				}
			}
			if (this.debug) this.log.innerHTML += "op: " + op + "<br/>\n";

			this.artists[a].style.opacity = op;
			if (this.artists[a].filters)
				this.artists[a].filters.item("DXImageTransform.Microsoft.Alpha").opacity = op * 100;
		}
		
		this.pos = (this.pos + this.update_interval) % this.max_pos;
	};
}

