function Pic (pictures) {
	this._pics = pictures;
	this.url = "/images/scenes/";
	this.id = "main";
	this.integer = Math.floor(pictures.length*Math.random()); 
}

Pic.prototype.url;
Pic.prototype.id;
Pic.prototype.integer;
Pic.prototype._pics;

Pic.prototype.displayPic = function() { 
	document.writeln("<img src='"+this.url+this._pics[this.integer]+"' id='"+this.id+"' alt='' />");
}

Pic.prototype.changeForward = function() { 
	this.integer < this._pics.length - 1 ? this.integer++ : this.integer = 0; 
	document.getElementById(this.id).src = this.url + this._pics[this.integer];
}

Pic.prototype.changeBack = function() {
	this.integer == 0 ? this.integer = this._pics.length - 1 : this.integer--;
	document.getElementById(this.id).src = this.url + this._pics[this.integer];
} 

Pic.prototype.displayAllPics = function(where, width) { 
	var dsphtml = "";
	for (i = 0; i < this._pics.length - 1; i++) {
		dsphtml = dsphtml + "<p><img src='"+this.url+this._pics[i]+"' width='"+width+"' alt='' /><br />"+this._pics[i]+"</p>";
	}
	document.getElementById(where).innerHTML = dsphtml;
}
