function CSlide(path, width, height, text){
         this.path = path;
         this.width = width;
         this.height = height;
         this.text = text;
         if (document.images) {  this.image = new Image(); } 
         this.load = function() { // This function loads the image for the slide
                    if (!document.images) { return; }
                    this.image.src = this.path;
                 /*    if (!this.image.src) { this.image.src = this.path; } */
         }

}
function CSlideShow(Name){
         this.Name = Name;
         this.Slides = new Array();
         this.current = 0;
         this.prefetch = -1;
         
         this.addSlide = function(Slide) { 
                    if (!document.images) { return; }// If this version of JavaScript does not allow us to change images, then we can't do the slideshow.
                    var i = this.Slides.length;
                    if (this.prefetch == -1) { Slide.load(); }// Prefetch the slide image if necessary
                    this.Slides[i] = Slide;
          }
          this.next = function(){
                   if(this.current < this.Slides.length - 1){  this.current = this.current + 1; }
                   else{ this.current = 0; }
                   this.detail(this.current);
          }
          this.prev = function(){
                   if(this.current >  0){  this.current = this.current - 1; }
                   else{ this.current = this.Slides.length - 1; }
                   this.detail(this.current);
          }
          this.overview = function(){
          
               document.getElementById("right").style.backgroundImage = "url(../bg/right.jpg)";
               document.getElementById("tab").style.display = "block";
               document.getElementById("detail").style.display = "none";
               document.getElementById("taster").style.display = "none";
               document.getElementById("BildText").innerHTML = "";          
          
          }
          this.detail = function(n){
          
              // source = imageArr[obj]['img'];
               this.setCurrent(n);
               document.getElementById("right").style.backgroundImage = "url(../bg/right_foto_detail.jpg)";
               document.getElementById("tab").style.display = "none";
               document.getElementById("detail").style.display = "block";
               document.getElementById("taster").style.display = "block";
               document.images.detailImg.src =  this.Slides[this.current].image.src;
               //document.images.detailImg.width = this.Slides[this.current].width;
               //document.images.detailImg.height = this.Slides[this.current].height;
               document.getElementById("BildText").innerHTML = this.Slides[ this.current ].text;
              // this.current = obj;          
          
          }
          this.setCurrent = function(n) {   this.current = n; }          
}
