slideShow = function()
{
	ChangeClass = function()
	{
		var anim = animation[index]
		
		anim.img.className = animation[index].css
		anim.fxIn.start(1)
		
		InitTexto(index)
		
		if(++index > animation.length - 1)
		{
			index = 0
		}
		
		setTimeout("document.SlideShow.Fade()", animation[index].time)
	}
	
	InitTexto = function(index)
	{
		var anim = animation[index]
		
		if(anim.texto != undefined)
		{
			anim.img.TextoDiv = anim.img.getElementsByTagName('div')[0]
			anim.img.TextoDiv.Texto = anim.img.TextoDiv.getElementsByTagName('div')[0]
			anim.img.TextoDiv.Texto.innerHTML = anim.texto
			anim.img.fxTexto = new Fx.Tween(anim.img.TextoDiv, { property: 'opacity', link: 'cancel' })
			anim.img.fxTexto.set(0)
			
			anim.img.onmouseover = function(e)
				{
					if(this.TextoDiv.Texto.innerHTML != '')
					{
						this.fxTexto.start(1)
					}
				}
			
			anim.img.onmouseout = function(e)
				{
					this.fxTexto.start(0)
				}
		}
	}
	
	var images = $$('.slideShow')
	var animation = new Array()
	var index = 0

	animation.push({ img: images[0], css: 'home6', time: 4000 })
	animation.push({ img: images[1], css: 'home7', time: 0, texto: 'Produto 01' })
	animation.push({ img: images[2], css: 'home8', time: 0 })
	animation.push({ img: images[3], css: 'home9', time: 0 })
	animation.push({ img: images[4], css: 'home10', time: 0 })

	animation.push({ img: images[4], css: 'home15', time: 4000 })
	animation.push({ img: images[0], css: 'home11', time: 0 })
	animation.push({ img: images[3], css: 'home14', time: 0 })
	animation.push({ img: images[1], css: 'home12', time: 0, texto: 'Produto 02' })
	animation.push({ img: images[2], css: 'home13', time: 0 })

	animation.push({ img: images[2], css: 'home3', time: 4000 })
	animation.push({ img: images[0], css: 'home1', time: 0 })
	animation.push({ img: images[4], css: 'home5', time: 0 })
	animation.push({ img: images[1], css: 'home2', time: 0, texto: 'Produto 03' })
	animation.push({ img: images[3], css: 'home4', time: 0 })
	
	for (var i = 0; i < animation.length; i++)
	{
		var anim = animation[i]
		anim.fxOut = new Fx.Tween(anim.img, { property: 'opacity', onComplete: ChangeClass })
		anim.fxIn = new Fx.Tween(anim.img, { property: 'opacity' })
	}
	
	InitTexto(13)
	
	document.SlideShow = this

	setTimeout("document.SlideShow.Fade()", animation[index].time)

	this.Fade = function()
	{
		animation[index].fxOut.start(0)
	}
	
	this.ShowTexto = function()
	{
		
	}
}
