function slideshow(name) {
	this.open = function(list, index) {
		if (list != null)
			List = list;
		if (index < 0)
			Index = List.length - 1;
		else if (index >= List.length)
			Index = 0;
		else
			Index = index;

		var request = new swx_AjaxRequest("POST", "./modules/slideshow/onopen.php", true);
		request.setResponseHandler(4, this.openPost);
		request.sendRequest("table=" + encodeURIComponent(List[Index][1]) + "&uid=" + encodeURIComponent(List[Index][2]));
	}
	this.openPost = function(request) {
		PictureFrame.setContent("<div class=\"Slideshow_Picture\" style=\"background-image:url("+List[Index][0]+");\"></div><p class=\"Slideshow_Text\"><strong>"+(Index + 1)+"/"+List.length+":</strong> "+request.responseText+"</p>");		
		PictureFrame.show();
	}

	this.onClick = function(button) {
		if (button == "<<") {
			this.open(null, Index - 1);
		}
		else if (button == ">>") {
			this.open(null, Index + 1);
		}
		else {
			Index = -1;
			List = null;
			PictureFrame.hide();
		}
	}

	var PictureFrame = new swx_Dialog("Slideshow_Dialog", name+".onClick", Array("<<", "Close", ">>"), "Close", "NOTE: Will be filled by open()");
	var Index = -1;
	var List = null;
}
