function SlideShow(id, elementid, pictures){
    this.speed = 3000;
    this.current = 0;
    this.pics = pictures;
    this.timeoutid = 0;
    
    this.preLoad = function(){
        var imgs = new Array();
        for (i = 0; i < this.pics.length; i++){
            imgs[i] = new Image();
            imgs[i].src = this.pics[i][0];
        }
        this.setImage();
    }
    
    this.setImage = function(){
        if (document.images) {
            if (document.getElementById) {
		        this.image = document.getElementById(elementid);
	        }
	        else if (document.all) {
		        this.image = document.all[elementid];
	        }
	        else if (document.layers) {
		        this.image = document.layers[elementid];
	        } 
        }
    }
    
    this.play = function(){
        //this.image.style.background = 'url(' + this.pics[this.current][0] + ')';
        this.image.src = this.pics[this.current][0];
        this.image.alt = this.pics[this.current][1];
        this.image.title = this.image.alt;
        this.current++;
        
        if ( this.current > this.pics.length - 1 ) this.current = 0;
        
        this.timeoutid = setTimeout(id + '.play()', this.speed)
    }
}
