function slideshow(container,textContainer)
{
	this.container = document.getElementById(container);
	this.textContainer = document.getElementById(textContainer);
	this.slides = new Array();
	this.text = new Array();
	this.current = 0;
	this.rate = 2.0
	
	this.init = function(text)
	{
		var imgs = this.container.getElementsByTagName('img');
		this.setText(text);
		for(var i =0;i < imgs.length;i++)
		{
			this.slides[i] = new Object();
			imgs[i].style.position = 'absolute';
			this.slides[i].image = imgs[i];
			if(i == 0)
			{
				this.slides[i].defaultImage = true;
				if(typeof this.textContainer != 'undefined')
				{
					var txt = '';
					if(typeof this.text[i] != 'undefined')
					{
						txt = this.text[i];
						this.textContainer.innerHTML = txt;
					}
				}
			}
			else
			{
				this.slides[i].defaultImage = false;
				this.hide(this.slides[i].image,0);
				//this.slides[i].image.style.display = 'none';
			}
		}
	}
	
	this.switchSlide = function(index)
	{
		if(typeof this.slides[index] != 'undefined' && index != this.current)
		{
			setArrow(index,this.current);
			this.hide(this.slides[this.current].image,this.rate);
			if(typeof this.textContainer != 'undefined')
			{
				var txt = '';
				if(typeof this.text[index] != 'undefined')
				{
					txt = this.text[index];
				}
				//this.hide(this.textContainer,this.rate);
				//this.textContainer.innerHTML = '';
				this.textContainer.innerHTML = txt;
				//this.show(this.textContainer,this.rate);
			}
			this.show(this.slides[index].image,this.rate);
			this.current = index;
		}
		return false;
	}
	
	this.hide = function(el,dur)
	{
		new Effect.Opacity(el,
		{ duration: dur, 
		transition: Effect.Transitions.linear, 
		from: 1, to: 0 });
	}
	
	this.show = function(el,dur)
	{
		new Effect.Opacity(el,
		{ duration: dur, 
		transition: Effect.Transitions.linear, 
		from: 0, to: 1.0 });
	}
	
	this.setText = function(txt)
	{
		if(typeof txt != 'undefined' && txt.join)
		{
			for(var i = 0;i < txt.length;i++)
			{
				this.text[i] = txt[i];
			}
		}
	}
}

function setArrow(indx,curr)
{
	var el = document.getElementById('arrow_' + indx);
	var cel = document.getElementById('arrow_' + curr);
	if(typeof el != 'undefined')
	{
		el.src = 'images/arrow.gif';
		cel.src = 'images/arrowb.gif';
	}/**/
}