function SlideShow(Pic,slideShowSpeed,container) {
me=this

this.slideShowSpeed=slideShowSpeed
this.container=container
this.t
this.j = 0
this.preLoad 


this.loadPics = function(Pic) {
	this.preLoad = new Array()
	for (i = 0; i < Pic.length; i++){
   		this.preLoad[i] = new Image()
		this.preLoad[i].src = Pic[i]
	}
}

this.loadPics(Pic)


this.addImage = function(img) {
	this.preLoad[this.preLoad.length]=new Image()
	this.preLoad[this.preLoad.length-1].src=img

}
this.runShow =function(){
   	document.getElementById(me.container).style.backgroundImage = "url('" + me.preLoad[me.j].src + "')"
   	me.j = me.j + 1
   	if (me.j > (me.preLoad.length-1)) me.j=0
   	me.t = setTimeout(me.runShow, slideShowSpeed)
}
this.stopShow=function() {
	clearTimeout(me.t)
}
}

