function ClassSlides()
{
	this.steps = 15
	this.timeout = false
	this.DoubleClickUrl = ''
	this.currentHouse = 0
        this.slideHeight = 170
	if(!this.currentHouse) {
		this.currentHouse = 0
	}

	this.ClickThumb = function(n)
	{
		var size = BigSize
		var foto = ArrayPhotos[n]
		var omschrijving = 'Foto'
		foto_attr = foto.split("#");
		foto_src = foto_attr[0].replace(SmallSize, BigSize)
		omschrijving = foto_attr[1]
		titel = foto_attr[2]
		img_href = "<a href=\"" + foto_attr[3] + "\">"
		document.getElementById('Thumb' + this.CurrentImage).className = 'thumb'
		document.getElementById('Thumb' + n).className = 'on'
		this.CurrentImage = n
		image = "<img src=\"" + foto_src + "\" class=\"photo\" alt=\"" + omschrijving + "\" title=\"" + omschrijving + "\" style=\"border: 1px solid lightgrey; padding: 3px\" />"
		document.getElementById('PhotoXL2').innerHTML = img_href + image + "</a>"
		document.getElementById('Photo_title').innerHTML = titel
		this.From = document.getElementById('ThumbnailDiv').scrollLeft
		this.To = n*MoveLeft 
		this.DoStep(0)
		this.CallStatistics()
	}

	this.DoStep = function(step)
	{
		step ++
		document.getElementById('ThumbnailDiv').scrollLeft = 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.DoUpStep = function(step)
	{
		step ++
		document.getElementById('houseRow').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.DoUpStep(' + step + ')', 10)
	}

	this.Left = function()
	{
		var Next = this.CurrentImage - 1
		if (Next < 0) Next = 0
		this.ClickThumb(Next)
	}
	
	this.Up = function()
	{
		if(this.currentHouse == 0) {
			this.currentHouse = this.currentHouse
		} else {
			this.currentHouse = this.currentHouse - 170
		}
		this.From = document.getElementById('houseRow').scrollTop
		this.To = this.currentHouse
		this.DoUpStep(0)
	}

	this.Down = function()
	{
		if(this.currentHouse == (fotos-3)*170) {
			this.currentHouse = this.currentHouse
		} else {
			this.currentHouse = this.currentHouse + 170
		}
		this.From = document.getElementById('houseRow').scrollTop
		this.To = this.currentHouse
		this.DoUpStep(0)
	}

	this.Right = 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()
	{
		var size = BigSize		
		if (document.getElementById('ThumbnailDiv'))
		{
			this.CurrentImage = 0
			this.To = this.CurrentImage*MoveLeft - MoveLeft
			
			var sHtml = ''
			for(var i=0; i<ArrayPhotos.length; i++)
			{
				var foto = ArrayPhotos[i]
				var omschrijving = 'Foto'
				foto_attr = foto.split("#");
				foto_src = foto_attr[0].replace(SmallSize, BigSize)
				omschrijving = foto_attr[1]
				titel = foto_attr[2]
				img_href = "<a href=\"" + foto_attr[3] + "\">"
				if (i == this.CurrentImage)
				{
					image = "<img src=\"" + foto_src + "\" class=\"photo\" alt=\"" + omschrijving + "\" title=\"" + omschrijving + "\" style=\"border: 1px solid lightgrey; padding: 3px\" />"
					document.getElementById('PhotoXL2').innerHTML = img_href + image + "</a>"
					document.getElementById('Photo_title').innerHTML = titel
				}

				sHtml += '<a href="javascript:Slides.ClickThumb(' + i + ')"><img'
				if (i == this.CurrentImage)
				{
					sHtml += ' class="on"'
				}
				else
				{
					sHtml += ' class="thumb"'
				}
				sHtml += ' id="Thumb' + i + '" src="' + foto + '" alt="' + omschrijving + '" title="' + omschrijving + '" style="vertical-align: middle" /></a>'
			}
			document.getElementById('ThumbnailDiv').innerHTML = sHtml
			setTimeout("document.getElementById('ThumbnailDiv').scrollTop = " + this.To, 1)
		}
		else
		{
			setTimeout('Slides.Initialize()', 250)
		}
	}

	this.InitializeNoPhotoFrame = function()
	{
		var size = BigSize		
		if (document.getElementById('ThumbnailDiv'))
		{
			this.CurrentImage = 0
			this.To = this.CurrentImage*MoveLeft - MoveLeft
			
			var sHtml = ''
			for(var i=0; i<ArrayPhotos.length; i++)
			{
				var foto = ArrayPhotos[i]
				var omschrijving = 'Foto'
				foto_attr = foto.split("#");
				foto_src = foto_attr[0].replace(SmallSize, BigSize)
				omschrijving = foto_attr[1]
				titel = foto_attr[2]
				img_href = "<a href=\"" + foto_attr[3] + "\">"
				if (i == this.CurrentImage)
				{
					image = "<img src=\"" + foto_src + "\" class=\"photo\" alt=\"" + omschrijving + "\" title=\"" + omschrijving + "\" style=\"border: 1px solid lightgrey; padding: 3px\" />"
					document.getElementById('PhotoXL2').innerHTML = img_href + image + "</a>"
					document.getElementById('Photo_title').innerHTML = titel
				}

				sHtml += '<a href="' + foto_attr[3] + '"><img'
				if (i == this.CurrentImage)
				{
					sHtml += ' class="on"'
				}
				else
				{
					sHtml += ' class="thumb"'
				}
				sHtml += ' id="Thumb' + i + '" src="' + foto + '" alt="' + omschrijving + '" title="' + omschrijving + '" style="vertical-align: middle" /></a>'
			}
			document.getElementById('ThumbnailDiv').innerHTML = sHtml
			setTimeout("document.getElementById('ThumbnailDiv').scrollTop = " + this.To, 1)
		}
		else
		{
			setTimeout('Slides.InitializeNoPhotoFrame()', 250)
		}
	}

	this.CallStatistics = function()
	{
		if (!document.getElementById("Stats")) return
		var Url = this.DoubleClickUrl
		document.getElementById("Stats").src = Url
	}
}


