var intro = document.getElementById('intro');
var alpha = 100;
var introBildes = [];
var iB = 0;
var iFade = -1;
var adrese = '';

function mainamBildi() {
      iST = 0;
      if(alpha == 100) {
            if(iFade < 0) { 
      //alert(introBildes[iB].image);
                  iB++;
                  if(!introBildes[iB]) iB = 0;
                  imgNew = new Image();
                  imgNew.onload = function() {
                        imgNew.onload = null;
                        alpha += 10 * iFade;
                        setTimeout("mainamBildi()", 50);
                  }
                  imgNew.src = introBildes[iB].image;
            } else {
                  iFade = -1;
                  setTimeout("mainamBildi()", 5000);            
            }
      } else if(alpha == 0) {
            intro.innerHTML = '<span style="display:block; padding:10px 0px 0px 0px"><h1 style="color:' + introBildes[iB].kr1 + '; font-family:' + introBildes[iB].fnt1 + '">' + introBildes[iB].text1 + '</h1><h2 style="color:' + introBildes[iB].kr2 + '; font-family:' + introBildes[iB].fnt2 + '">' + introBildes[iB].text2 + '</h2></span><div style="color:' + introBildes[iB].kr3 + '; font-family:' + introBildes[iB].fnt3 + '">' + adrese + '</div>';
            intro.style.background = 'transparent url(' + introBildes[iB].image + ') no-repeat scroll left top';
            iFade = 1;
            iST = 1;            
      } else {
            intro.style.opacity = alpha / 100;
            intro.style.filter = 'alpha(opacity:' + alpha +')';
            iST = 1;
      }
      
      if(iST == 1) {
            alpha += 10 * iFade;
            setTimeout("mainamBildi()", 50);
      }
}
