    /*
      xSlideShow - A simple slideshow object.
    
      uInterval  - The time in milliseconds for auto-slide.
      sImgEleId  - The IMG element in the HTML.
      sImagePath - The path to be prepended to each image file name.
                   It must have a trailing backslash.
      aFiles     - An array of image file names.
      aLinks     - An optional array of URLs for when the image is clicked.
      aTitles    - An optional array of titles for each image.
    
      If provided, aLinks and aTitles must have the same length as aFiles.
    */
	
    function xSlideShow(uInterval, sImgEleId, sImagePath, aFiles, aTitles, aLinks)
    {
      // Private Properties
    
      var ths = this;
      var tmr = null;
      var idx = -1;
      var imgs = []; // zero-based
    
      // Private Methods
    
      function run()
      {
        tmr = setTimeout(run, uInterval);
        ths.next(true);
      }
    
      function onClick()
      {
        // note: In this function, 'this' points to the IMG object
        var t = aTitles ? aTitles[idx] + ': ' : '';
        if (confirm('Do you want to visit the following page?\n' + t + aLinks[idx])) {
          window.location = aLinks[idx];
        }
      }
    
      // Public Methods
    
      this.start = function()
      {
        if (tmr == null) {
          run();
        }
        else {
          this.stop(); // implements a 'toggle'
        }
      };
    
      this.stop = function()
      {
        if (tmr != null) {
          clearTimeout(tmr);
          tmr = null;
        }  
      };
    
      this.next = function(bRunning)
      {
        var i = document.getElementById(sImgEleId);
        if (i) {
          if (!bRunning) {
            // stop auto-slide unless next() is called from run()
            this.stop();
          }
          if (++idx >= imgs.length) {
            idx = 0;
          }
          i.src = imgs[idx].src;
          if (aTitles) {
            i.title = aTitles[idx];
			document.getElementById('galleriBilledTekst').innerHTML = aTitles[idx];
          }
        }
      };
    
      this.prev = function()
      {
        var i = document.getElementById(sImgEleId);
        if (i) {
          this.stop(); // stop auto-slide
          if (--idx <= 0) {
            idx = imgs.length - 1;
          }
		  i.src = imgs[idx].src;
          if (aTitles) {
            i.title = aTitles[idx];
			document.getElementById('galleriBilledTekst').innerHTML = aTitles[idx];
          }
        }
      };
    
      this.onunload = function()
      {
        var i = document.getElementById(sImgEleId);
        if (i) {
          i.onclick = null;
        }
        ths = null;
      };
    
      // Constructor Code
    
      var i;
      i = document.getElementById(sImgEleId);
      if (i) {
        if (aLinks) {
          i.onclick = onClick;
        }
        for (i = 0; i < aFiles.length; ++i) {
          imgs[i] = new Image();
          imgs[i].src = 'skalerBillede.asp?TumbMax=350&path=' + sImagePath + aFiles[i];
        }
        this.next(true); // show first image
      }
      else return null; // error
    }
    // end xSlideShow Object Prototype
	
	
	function SaetKnap() {
		var sText = document.getElementById('btnAuto2').src;
		if (sText.indexOf("Start") > 0) {
			document.getElementById('btnAuto2').src = "images/galleriStop.gif";
		} else {
			document.getElementById('btnAuto2').src = "images/galleriStart.gif";
		}
	}
