function image_cycle(timeout){
	this.obj_link = new Array();
	this.obj_image = new Array();
	this.obj_count = 0;

	this.timeout = timeout;

	this.image_link = new Array();
	this.image_title = new Array();
	this.image_href = new Array();
	this.image_count = 0;

	this.addObj = function(link, image){
		this.obj_link[this.obj_count] = link;
		this.obj_image[this.obj_count] = image;
		this.obj_count++;
	}

	this.addImage = function(image, title, href){
		this.image_link[this.image_count] = image;
		this.image_title[this.image_count] = title;
		this.image_href[this.image_count] = href;
		this.image_count++;
	}

	this.start = function(){
		current_link = 0;
		for(var i = 0; i <= (this.obj_count - 1); i++){
			if(this.image_count == 1){
				current_link = 0;
			} else {
				temp_link = current_link;
				while(temp_link == current_link){
					current_link = this._rand(0,this.image_count - 1);
				}
			}
			this.obj_link[i].href = this.image_href[current_link];
			this.obj_link[i].title = this.image_title[current_link];
			this.obj_image[i].src = this.image_link[current_link];
			this.obj_image[i].alt = this.image_title[current_link];
		}
	}

	this._rand = function(start, end){
		var cycle = 0;
		var rand = Math.round(end * Math.random());
		while(rand < start){
			var rand = Math.round(end * Math.random());
			cycle++;
			if(cycle == 10){
				return end;
			}
		}
		return rand;
	}

}

