function slider (id, images) {
	this.id = id;
	this.images = images;
	this.currentImage = 0;
	this.upperImage = $(id+">.upperImage>img");
	this.lowerImage = $(id+">.lowerImage>img");
	
	this.upperImage.attr("src", images[this.currentImage]);
		
	this.changeImage = function () {
		this.currentImage++;
		if(this.currentImage >= this.images.length) this.currentImage = 0;
		
		imageName = this.images[this.currentImage];
		upperDiv = $(id+">.upperImage");
		upperImage = this.upperImage;
		lowerImage = this.lowerImage;
		
		lowerImage.unbind('load');
		lowerImage.load(function () {
			upperDiv.fadeOut("slow", function () {
				upperImage.attr("src", imageName);
				upperDiv.show().css("opacity", "1.0");
			});
		});
		lowerImage.attr("src", imageName);
	}
	
}

function updateSlider () {
	mainSlider.changeImage();
	setTimeout("updateSlider();", 2000);
}