var images = new Array(
	'IMG_0016.PNG',
	'Screenshot 2010.02.26 09.57.45.png',
	'Screenshot 2010.02.26 09.58.47.png',
	'Screenshot 2010.02.26 09.59.18.png',
	'Screenshot 2010.02.26 10.00.43.png',
	'Screenshot 2010.02.26 11.07.59.png'
);
var cur = 0;
var prev = 0;
var stop_auto = false;
var animating = false;
function next() { stop_auto = true; cur++; show(); }
function prev() { stop_auto = true; cur--; show(); }
function goto(i) { stop_auto = true; cur = i; show();	}
function show()
{
	if (!animating && cur != prev)
	{				
		if (cur >= images.length) cur = 0;
		if (cur < 0) cur = images.length - 1;

		var s_out = document.getElementById('screenshot1');
		var s_in = document.getElementById('screenshot2');

		s_out.src = s_in.src;
		s_out.style.left = "0px";
		s_in.style.left = "202px";
		s_in.src = 'images/' + images[cur];
		animating = true;
		animate();

		prev = cur;
	}
}
function animate()
{
	if (animating)
	{
		var s_out = document.getElementById('screenshot1');
		var s_in = document.getElementById('screenshot2');
		var s_out_left = parseInt(s_out.style.left);
		var s_in_left = parseInt(s_in.style.left);
		if (s_out_left > -192)
		{
			s_out.style.left = (s_out_left - 10) + "px";
			s_in.style.left = (s_in_left - 10) + "px";
			setTimeout('animate()', 10);
		}
		else
		{
			s_out.src = s_in.src;
			s_out.style.left = "0px";
			s_in.style.left = "202px";
			animating = false;
		}
	}
}
function auto()
{
	if (!stop_auto)
	{
		cur++; show();
		setTimeout('auto()', 3000);
	}				
}
function load_shadows()
{
	document.getElementById('t2_shadow').innerHTML = document.getElementById('t2_main').innerHTML;
	document.getElementById('t1_shadow').innerHTML = document.getElementById('t1_main').innerHTML;
}
function show_video()
{
	document.getElementById('stuff').style.display = 'none';
	document.getElementById('video').style.display = 'block';
}
function hide_video()
{
	document.getElementById('stuff').style.display = 'block';
	document.getElementById('video').style.display = 'none';
}
setTimeout('auto()', 3000);
