var current = 0;
var soubor = "";
var AVpole = new Array();
var AVpocet = "";
function startChanging(item){
  soubor = item;
  timerID = setInterval("changeThumbnail()", 900);     
}

function stopChanging(){
  clearInterval(timerID);
  current = 0;
}

function revertingThumbs(item){
  stopChanging();
  document.getElementById("AP" + item).src = "http://www.porno-amateri.cz/gallery/thumbs/"+AVpole[0]+".jpg";
}
function setArray(imageArray){
  AVpole = imageArray.split("+");
  AVpocet = AVpole.length;
}

function startingThumbs(item){
  soubor = item;
  document.getElementById("AP"+item).src = "http://www.porno-amateri.cz/gallery/thumbs/"+AVpole[1]+".jpg";
  current = 2;
  timerID = setInterval("changeThumbs()", 650); 
}

function changeThumbs(){
  if (current == (AVpocet-1)) { 
    current = 0; 
  }
  document.getElementById("AP"+soubor).src = "http://www.porno-amateri.cz/gallery/thumbs/"+AVpole[current]+".jpg";
  current++;
}
