function slideshow(action){
	//alert("slideshow - going to: " + action);
	var json = document.getElementById("json_catcher").value;
	var pictures = eval(json);
	var index = document.getElementById("index_catcher").value;	
  var total_pictures = document.getElementById("count_catcher").value;

	//alert("index is: " + index);
	if(action == "next"){
		//alert("increase index/picture by 1");
		index++;
		if(index > (total_pictures - 1)){
			//alert("going past last picture (wrapping): " + total_pictures);
			index = 0;
		};
		document.getElementById("slideshow_picture").src = pictures[index];
		document.getElementById("index_catcher").value = index;
		//alert("new value has been set to: " + document.getElementById("index_catcher").value);
	};

	if(action == "prev"){
		//alert("decrease index/picture by 1");
		index--;
		if(index < 0){
			//alert("going past last picture (wrapping): " + total_pictures);
			index = (total_pictures - 1);
		};
		document.getElementById("slideshow_picture").src = pictures[index];
		document.getElementById("index_catcher").value = index;
		//alert("new value has been set to: " + document.getElementById("index_catcher").value);
	};

	counter = document.getElementById("index_catcher").value;
	counter++;
	document.getElementById("picture_counter").innerHTML = (counter + " / " + total_pictures);
};
