
var arrImages = new Array();

arrImages[0] = "01.gif";
arrImages[1] = "02.gif";
arrImages[2] = "03.gif";
arrImages[3] = "04.gif";
arrImages[4] = "05.gif";
arrImages[5] = "06.gif";
arrImages[6] = "07.gif";
arrImages[7] = "08.gif";
arrImages[8] = "09.gif";
arrImages[9] = "10.gif";
arrImages[10] = "11.gif";
arrImages[11] = "12.gif";
arrImages[12] = "13.gif";
arrImages[13] = "14.gif";
arrImages[14] = "15.gif";
arrImages[15] = "16.gif";
arrImages[16] = "17.gif";
arrImages[17] = "18.gif";
arrImages[18] = "19.gif";
arrImages[19] = "20.gif";


var anzImages = arrImages.length;
var index = -1;
var height = 540;



function showIntro()
{
  var h = getWinHeight();

  if(h < 840)
  {
    m = 840 - h;
    height = 540 - m;
  }

  changeImage();
}

function changeImage()
{
  if(index == anzImages-1)
  {
    index = 0;
  }
  else
  {
    index++;
  }

  document.getElementById("imageIntro").innerHTML = "<img src='images/intro/" + arrImages[index] + "' height='" + height + "' id='imgIntro' style='opacity:0; filter:alpha(opacity=0)'>";

  setTimeout(function () { fadeIn(0); }, 4);
}

function fadeIn(step)
{
  var imgs = document.getElementById("imgIntro");

  imgs.style.opacity = step/100;
  imgs.style.filter = "alpha(opacity=" + step + ")"; // IE

  step = step + 2;

  if (step <= 100)
  {
    window.setTimeout(function () { fadeIn(step); }, 10);
  }
  else
  {
    window.setTimeout(function () { fadeOut(100); }, 4000);
  }
}

function fadeOut(step)
{
  var imgs = document.getElementById("imgIntro");

  imgs.style.opacity = step/100;
  imgs.style.filter = "alpha(opacity=" + step + ")"; // IE

  step = step - 2;

  if (step >= 0)
  {
    window.setTimeout(function () { fadeOut(step); }, 10);
  }
  else
  {
    changeImage();
  }
}


