/**
*
* Calendario.
*
*/
function SlideShow() {
	// Constants

	// Attributes
	this.containerId;
	this.base;
	this.images;
	this.image;

	if (SlideShow._initialized == undefined) {
		// Methods

		SlideShow.prototype.setContainerId = function(containerId) {
			this.containerId = containerId;
		}

		SlideShow.prototype.setBase = function(base) {
			this.base = base;
		}

		SlideShow.prototype.setImages = function(images) {
			this.images = new Array(images.length);
			for (var i = 0; i < images.length; i++) {
				this.images[i] = images[i];
			}
		}

		SlideShow.prototype.setImage = function(image) {
			this.image = image;
		}

		SlideShow.prototype.play = function() {
			var container = document.getElementById(this.containerId);
			var index = Math.round(Math.random()*(this.images.length - 1));
			container.style.backgroundImage = "url('" + this.base + this.images[index] + "')";
			var isIe = navigator.appVersion.indexOf('MSIE 6.0') != -1; // Es Internet Explorer 6
			if (isIe) {
				container.style.backgroundImage = "none";
				container.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.base + this.images[index] + "')";
			}
		}

		SlideShow.prototype.displayImage = function() {
			var container = document.getElementById(this.containerId);
			container.style.backgroundImage = "url('" + this.base + this.image + "')";
			var isIe = navigator.appVersion.indexOf('MSIE 6.0') != -1; // Es Internet Explorer 6
			if (isIe) {
				container.style.backgroundImage = "none";
				container.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.base + this.image + "')";
			}
		}

	}
	SlideShow._initialized = true;
}
