function ClassSlides()
{
	this.CurrentImage = 0
	this.steps = 10
	this.timeout = false

	this.ClickThumb = function(n)
	{
		document.getElementById('Thumb' + this.CurrentImage).className = 'thumb'
		document.getElementById('Thumb' + n).className = 'on'
		this.CurrentImage = n
		document.getElementById('PhotoXL').src = ArrayPhotos[n].replace('width=120&height=120', 'width=400&height=400')
		this.From = document.getElementById('ThumbnailDiv').scrollTop
		this.To = n*92 - 0
		this.DoStep(0)
	}

	this.DoStep = function(step)
	{
		step ++
		document.getElementById('ThumbnailDiv').scrollTop = this.Factor(step / this.steps) * (this.To - this.From) + this.From
		if (this.timeout) clearTimeout(this.timeout)
		if (step < this.steps) this.timeout = setTimeout('Slides.DoStep(' + step + ')', 10)
	}

	this.Up = function()
	{
		var Next = this.CurrentImage - 1
		if (Next < 0) Next = 0
		this.ClickThumb(Next)
	}

	this.Down = function()
	{
		Next = this.CurrentImage + 1
		if (Next > ArrayPhotos.length - 1) Next = ArrayPhotos.length - 1
		this.ClickThumb(Next)
	}

	this.Factor = function(f)
	{
		return .5 - Math.cos(f * Math.PI) * .5
	}

	this.Initialize = function()
	{
		if (document.getElementById('ThumbnailDiv'))
		{
			var sHtml = ''
			for(var i=0; i<ArrayPhotos.length; i++)
			{
				sHtml += '<a href="javascript:Slides.ClickThumb(' + i + ')"><img'
				if (i == 0)
				{
					sHtml += ' class="on"'
				}
				else
				{
					sHtml += ' class="thumb"'
				}
				sHtml += ' id="Thumb' + i + '" src="' + ArrayPhotos[i] + '" alt="Foto" /></a>'
			}
			document.getElementById('ThumbnailDiv').innerHTML = sHtml
			document.getElementById('PhotoXL').src = ArrayPhotos[0].replace('width=120&height=120', 'width=400&height=400')
		}
		else
		{
			setTimeout('Slides.Initialize()', 250)
		}
	}

}
Slides = new ClassSlides()
Slides.Initialize()

