function imageViewer(imgID){
	this.imageID = imgID;
	this.currentImage = 0;
	this.numImages = 0;
	this.images = [];
	
	this.next = function(){
		var theImage = document.getElementById(this.imageID);
		var nextImage = this.currentImage + 1;
		if(nextImage >= this.numImages){
			nextImage = 0;
		}
		this.currentImage = nextImage;
		theImage.src = this.images[nextImage].src;
	};
	
	this.prev = function(){
		var theImage = document.getElementById(this.imageID);
		var nextImage = this.currentImage - 1;
		if(nextImage < 0){
			nextImage = this.numImages - 1;
		}
		this.currentImage = nextImage;
		theImage.src = this.images[nextImage].src;
	};
	
	this.addImage = function(url, width, height){
		var tmpImage = new Image();
		tmpImage.src = url;
		if(width){
			tmpImage.width = width;
		}
		if(height){
			tmpImage.height = height;
		}
		this.images[this.numImages] = tmpImage;
		this.numImages++;
	};
}