var totalpictures=testurl.length-1;
var pictures=1;

function start() {
  timedelay();
}

function slideshowupdate(imgName,controls) {
  if (play == 1)  {
    slidesslideshow = new Image();
    slidesslideshow.src = testurl[pictures];
    slideshow = eval(imgName + "slideshow.src");
    document[imgName].src = slideshow;
    pictures=pictures + 1;
    if (pictures > totalpictures) pictures=1;
    if (controls != 1)  timedelay();
    return;
  };
  timedelay();
  return;
};

function timedelay() {
  timerID = setTimeout("slideshowupdate('slides',0)",zeit);
};

function cplay() {
  play=1;
};

function cbegin() {
  if (play == 0)  {
    play=1;
    pictures=1;
    slideshowupdate('slides');
    play=0;
    return;
  };
  pictures=1;
  slideshowupdate('slides',1);
};

function cprev() {
  if (play == 0) {
    play=1;
    if (pictures < 3) pictures=pictures+totalpictures;
    pictures=pictures-2;
    slideshowupdate('slides',1);
    play=0;
    return;
  }
  if (pictures < 3) pictures=pictures+totalpictures;
  pictures=pictures-2;
  slideshowupdate('slides',1);
};

function cnext() {
  if (play == 0) {
    play=1;
    slideshowupdate('slides',1);
    play=0;
    return;
  };
  slideshowupdate('slides',1);
};

function cend() {
  if (play == 0) {
    play=1;
    pictures=totalpictures;
    slideshowupdate('slides',1);
    play=0;
    return;
  };
  pictures=totalpictures;
  slideshowupdate('slides',1);
};

function cstop() {
  play=0;
};

