// JavaScript Document

var step = 1
var play = false;
var photocount = 24;

function listthumbs()
{
	for (i=1; i<=photocount; i++)
	{
		var img = "image"+i
		img = new Image();
		img.src = "images/gallery/photo"+i+".jpg";
		
		//display thumbnails
		document.write('<a href="#" onclick="javascript: changePhoto('+i+'); return false;"><img src="images/gallery/thumb_photo'+i+'.jpg" border="0" /></a>');
	}
}

function changePhoto(steper)
{
	step = steper;
	document.getElementById('photox').src='images/gallery/photo'+step+'.jpg';
}

function slideshow()
{

	//if(!document.getElementById('photo'))
	//return
	
	document.getElementById('photox').src='images/gallery/photo'+step+'.jpg';
	
	if(step < photocount)
	step++
	else 
	step = 1
	
	if(play != false)
	setTimeout("slideshow()", 2500)
	
}

function startshow ()
{
	play = true;
	step++;
	slideshow();
	
	document.getElementById('playbtn').style.display = "none";
	document.getElementById('stopbtn').style.display = "block";
}
function stopshow()
{
	play = false;
	document.getElementById('playbtn').style.display = "block";
	document.getElementById('stopbtn').style.display = "none";
}