function Slideshow(conf) {
        if (!conf.id || !document.getElementById(conf.id) || conf.images.length < 2) {
                return new Boolean(false);
        }

        var i;
        var orig = document.getElementById(conf.id);
        
        this.id = conf.id;      // id of the slideshow div
        // showimage : time in ms how long the image is shown before fade to next
        // must be between 100 and 300000 ms (5 min)
        this.showimage = (typeof conf.showimage!="undefined" && conf.showimage >= 100 && conf.showimage <=300000) ? conf.showimage : 2000;
        // fadespeed must be between 1 (very slow) and 100 (fast switch)
        this.fadespeed = (typeof conf.fadespeed!="undefined" && conf.fadespeed >= 1 && conf.fadespeed <= 100) ? conf.fadespeed : 1;
        this.images = new Array();
        this.counter = 0;

        this.element = document.createElement("div");
        this.element.className = "slideshow";
        orig.parentNode.replaceChild(this.element, orig);

        for (i = 0; i < conf.images.length; i++) {
                tmpdiv = document.createElement("div");
                tmpdiv.id = "single_img";
                
                tmpimg = document.createElement("img");
                tmpimg.src = "?cmd=download&hash="+conf.images[i];
                tmpimg.alt = "Bild "+(i+1);
                
                if (i > 0) {
                        tmpdiv.style.opacity = "0";
                        tmpdiv.style.filter = "alpha(opacity=0)";
                        tmpdiv.className = "next_img";
                } 
                this.images[i] = tmpdiv;
                tmpdiv.appendChild(tmpimg);

                this.element.appendChild(tmpdiv);
        }

        this.fade = function (step) {
                var fader = this;

                step = (!step) ? 0 : step;

                this.images[this.counter].style.opacity = step/100;
                this.images[this.counter].style.filter = "alpha(opacity=" + step + ")";

                step = step + this.fadespeed;

                if (step <= 100) {
                        window.setTimeout(function () { fader.fade(step); }, 10);
                } else {
                        // if step is > 100 then make sure to set the image fully transperant
                        this.images[this.counter].style.opacity = 1;
                        this.images[this.counter].style.filter = "alpha(opacity=100)";
                        // goto next image... with timeout
                        window.setTimeout(function () { fader.nextImage(); }, this.showimage);
                }
        };

        this.nextImage = function () {
                this.counter++;

                if (this.counter < this.images.length) {
                        this.fade();
                } else {
                        for (i=0; i<this.images.length; i++) {
                                if (i>0) {
                                        this.images[i].style.opacity = 0;
                                        this.images[i].style.filter = "alpha(opacity=0)";
                                } 
                        }
                        this.counter = 1;
                        this.fade();
                }
        };
        
        var fader = this;
        if (conf.autorun) {
                window.setTimeout(function () { fader.nextImage(); }, this.showimage);
        }
}
