function imageSwitch(imageElement,imageCount,random) {
  
  var imageSuffix = imageElement.src.match(/\.(\d+)\.(jpg|jpeg|png|gif)/i);
  
  /*
  if(random) {
    imageSuffix[1] = Math.ceil( (wj_zufall/(im*1.0)) * Anzahl_1);
  }
  */
  
  if(imageSuffix[1] >= imageCount) {
    imageSuffix[1] = 1;
  }else{
    imageSuffix[1] = parseInt(imageSuffix[1]) + 1;
  }
  
  imageElement.src = imageElement.src.replace(imageSuffix[0], "." + imageSuffix[1] + "." + imageSuffix[2]);
  
}


function showOverlay(imageElement,overlayElementId,overlayOntoImageNum) {
  
  var imageSuffix = imageElement.src.match(/\.(\d+)\.(jpg|jpeg|png|gif)/i);
  
  document.getElementById(overlayElementId).style.display = (imageSuffix[1] == overlayOntoImageNum) ? 'block' : 'none';
  
}
