var s_slideShow = {

	count: 0,
  	pageSize: 4,
	pageWidth: 372,
	currentPage: 0,
	slideID: "",
	zoomID: "",
	prevID: "",
	nextID: "",

	init: function(count, slideID, zoomID, prevID, nextID) {
		this.count = count;
		this.slideID = slideID;
		this.zoomID = zoomID;
		this.prevID = prevID;
		this.nextID = nextID;
		if (this.prevID != "")
			$("#" + this.prevID).click(function() {
	  		s_slideShow.prev();
			});
		if (this.nextID != "")
			$("#" + this.nextID).click(function() {
	  		s_slideShow.next();
			});
		if (this.prevID != "" && this.nextID != "")
			this.updateButton();
	},

	next: function() {
		this.currentPage++;
		this.slide();
		this.updateButton();
	},

	prev: function() {
		this.currentPage--;
		this.slide();
		this.updateButton();
	},

	slide: function() {
		$("#" + this.slideID).animate({left:-(this.pageWidth*this.currentPage)},'slow');
	},

  zoomPhoto: function(thisID) {
		var zoomImage = document.getElementById(this.zoomID);
		var thisImage = document.getElementById(thisID);
		zoomImage.src = thisImage.src;
  },

	updateButton: function() {
		if (this.currentPage < 1)
			$("#" + this.prevID).hide();
		else
			$("#" + this.prevID).show();
		if (this.currentPage >= Math.floor((this.count-1)/this.pageSize))
			$("#" + this.nextID).hide();
		else
			$("#" + this.nextID).show();
	}

}
