var currentImage = 0;
var switchLeftImage = true;

function switchImage() {
	if (switchLeftImage)
		var id = 'left-image';
	else
		var id = 'right-image';
	switchLeftImage = !switchLeftImage;

	var image = ggImages[currentImage];
	currentImage++;
	if (currentImage >= ggImages.length)
		currentImage = 0;

	new Effect.Fade($(id), {
		duration: 0.4,
		/*from: 1.0,
		to: 0.001,*/
		afterFinish: function(obj) {
			$(id).setAttribute('src', image.url);
			$(id).setAttribute('alt', image.title);
			new Effect.Appear($(id), {
				duration: 0.4/*,
				from: 0.001,
				to: 1.0,*/
			});
		}
	});
	
}

/*
function switchImages() {
	switchImage('left-image');
	setTimeout("switchImage('right-image')", 2500);
}
*/
