// JavaScript Document
var ImgArray = function() {
	
	this.imgElement;
	this.numElement;
	this.imgs = new Array();
	this.currentImage = 0;
	
}

ImgArray.prototype.fill = function() {
	this.imgElement = $('contentImage');
	this.numElement = $('contentControl').getElementsByTagName('SPAN')[0];
	this.imgs = arguments;
}

ImgArray.prototype.prev = function() {
	this.currentImage = (this.currentImage == 0 ? this.imgs.length-1 : this.currentImage-1 );
	this.loadImage();
}

ImgArray.prototype.next = function() {
	this.currentImage = (this.currentImage >= this.imgs.length-1 ? 0 : this.currentImage+1 );
	this.loadImage();
}

ImgArray.prototype.loadImage = function() {
	this.imgElement.src = "/getImage.cfm?size=big&dir=content&file=" + this.imgs[ this.currentImage ];
	this.numElement.innerHTML = this.currentImage + 1;
}

