function Slideshow(top, bot, imgsArray){
	this.top = top;
	this.bot = bot;
	this.idx = 0;
	this.total = imgsArray.length;
	this.imgs = [];
	this.topOn = true;
	this.t = null;
	
	for(var x=0; x<this.total; x++){
		this.imgs[x] = new Image();
		this.imgs[x].src = imgsArray[x];
	}
	this.next = function (){
		if(this.idx < this.total-1){
			this.idx++;
		}else {
			this.idx = 0;
		}
		this.change();
	}
	this.prev = function(){
		if(this.idx>0){
			this.idx--;
		}else {
			this.idx = this.total-1;
		}
		this.change();
	}
	this.change = function() {
		if(this.topOn){
			this.topOn = false;
			this.bot.setAttribute("src", this.imgs[this.idx].src);
			this.bot.className = "slides unfade";
			this.top.className = "slides fade";
		}else{
			this.topOn = true;
			this.top.setAttribute("src", this.imgs[this.idx].src);
			this.top.className = "slides unfade";
			this.bot.className = "slides fade";
		}
	}
	this.auto = function(){
		this.next();
		var _this = this;
		this.t = setTimeout(function() {
			_this.auto();
		} , 4000);
	}
	this.pause = function(){
		clearTimeout(this.t);
	}
}
