// array delle 3 categorie
var arrImg = new Array()
arrImg[0] = new Array("pa01","pa02","pa03","pa04","pa05");
arrImg[1] = new Array("ri01","ri02","ri03","ri04","ri05");
arrImg[2] = new Array("sv01","sv02","sv03","sv04","sv05");
paImg = 
riImg = 
avImg = 


row = 0
elm = 0

function fadeInRow() {
//  alert(arrImg[row][elm])
  imgSrc = "img/" + arrImg[row][elm].substr(0,2) + "/" + arrImg[row][elm].substr(0,2) + "0" + (elm + 1) + ".jpg"
  //return confirm(imgSrc);
  document.getElementById(arrImg[row][elm]).src=imgSrc;
  fadeIn(arrImg[row][elm],1)
  if (row <= 2) {
    if (elm < 4) {
      elm++
      setTimeout('fadeInRow()',100)
    }
    else {
      elm = 0
      row++
      if (row < 3) setTimeout('fadeInRow()',100)
      else {
        row = 0
        elm = 0
        setTimeout('fadeOutRow()',1000)
      }
    }
  }
}

function fadeOutRow() {
//  alert(arrImg[row][elm])
  //imgSrc = "img/" + arrImg[row][elm].substr(0,2) + "/" + arrImg[row][elm].substr(0,2) + "0" + (elm + 1) + ".jpg"
  //return confirm(imgSrc);
  //document.getElementById(arrImg[row][elm]).src="img/empty.jpg";
  fadeOut(arrImg[row][elm],90)
  if (row <= 2) {
    if (elm < 4) {
      elm++
      setTimeout('fadeOutRow()',100)
    }
    else {
      elm = 0
      row++
      if (row < 3) setTimeout('fadeOutRow()',100)
      else {
        row = 0
        elm = 0
        setTimeout('fadeInWrite()',1000)
        setTimeout('showEcoallene()',5500)
      }
    }
  }
}

function fadeInWrite() {
  hideOut('low2',5)
  document.getElementById('low2').style.visibility='visible'
  fadeInFrom0('low2',10)
  
  hideOut('dso',1)
  document.getElementById('dso').style.visibility='visible'
  setTimeout('fadeIn("dso",10)',1500)
}

function showEcoallene() {
//  alert(arrImg[row][elm])
  imgSrc = "img/" + arrImg[row][elm].substr(0,2) + "/" + arrImg[row][elm].substr(0,2) + "1" + (elm + 1) + ".jpg"
  //return confirm(imgSrc);
  document.getElementById(arrImg[row][elm]).src=imgSrc;
  fadeIn(arrImg[row][elm],1)
  if (row <= 2) {
    if (elm < 4) {
      elm++
      setTimeout('showEcoallene()',100)
    }
    else {
      elm = 0
      row++
      if (row < 3) setTimeout('showEcoallene()',100)
      else {
        row = 0
        elm = 0
       // setTimeout('fadeOutRow()',1000)
      }
    }
  }
}