var newFoto = new Array();

newFoto[0] = "10.jpg";
newFoto[1] = "11.jpg";


var timer = 5000; <!--Millisekunden-->
var imgCount = newFoto.length;
var imgIndex = Math.floor(Math.random() * imgCount);
//var index2 = Math.floor(Math.random() * arraylaenge);
var imgSrc = '<img id="newestFoto" src="' + newFoto[imgIndex] + '">';

function imgChange() {
  if (imgIndex == imgCount-1){// || index == index2) {
    imgIndex = 0;
  }
  else{
      imgIndex++;
  }
/*  if(index2 == arraylaenge-1){
    index2 = 0;
  }*/

//  index2++;

  imgSrc = '<img id="newestFoto" src="' + newFoto[imgIndex] + '">';
//  Bildstring2 = '<img id="imgSponsor" src="' + newFoto[index2] + '">';
  document.getElementById("dynNew").innerHTML = imgSrc;
//  document.getElementById("divSponsor2").innerHTML = Bildstring2;
  setTimeout("imgChange()", timer);
}

function Newest() {
  document.getElementById("dynNew").innerHTML = imgSrc;
//  document.getElementById("divSponsor2").innerHTML = Bildstring2;
  imgChange();
}
