function ClassSlides()
{
	this.CurrentImage = 0
	this.steps = 40
	this.timeout = false
	this.DoubleClickUrl = ''

	this.ClickThumb = function(n)
	{
		document.getElementById('Thumb' + this.CurrentImage).className = 'thumb'
		document.getElementById('Thumb' + n).className = 'on'
		this.CurrentImage = n
		var tmp = ArrayPhotos[n].replace('128x85', 'bigimg');
        document.getElementById('PhotoXL').src = tmp.replace('url', 'jpg');
        
		this.From = document.getElementById('ThumbnailDiv').scrollTop
		this.To = n * 92 - 184
		this.DoStep(0)
		this.CallStatistics()
	}

	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 + ')" onmouseover="Slides.ClickThumb(' + i + ')"><img height="85" width="128"'
				if (i == 0)
				{
					sHtml += ' class="on"'
				}
				else
				{
					sHtml += ' class="thumb"'
				}
				sHtml += ' id="Thumb' + i + '" src="' + ArrayPhotos[i] + '" /></a>'
			}
			document.getElementById('ThumbnailDiv').innerHTML = sHtml
			document.getElementById('PhotoXL').src = ArrayPhotos[0].replace('128x85', 'bigimg')
		}
		else
		{
			setTimeout('Slides.Initialize()', 250)
		}
	}

	this.CallStatistics = function()
	{
		if (!document.getElementById("Stats")) return
		var Url = this.DoubleClickUrl
		document.getElementById("Stats").src = Url
	}
}