function doBanners()
{
  if ( typeof currentBanner == 'undefined' )
    currentBanner = Math.floor(Math.random() * bannersList.length);
  else
    currentBanner++;
  if ( currentBanner >= bannersList.length )
    currentBanner = 0;

//  getObj('bannerName').innerHTML = '<a href="' + bannersList[currentBanner]['page'] + '">' + bannersList[currentBanner]['name'] + '</a>';
  if ( bannersList[currentBanner]['page'] != '' )  
    getObj('bannerImg').innerHTML = '<a href="' + bannersList[currentBanner]['page'] + '"><img id="bannerLogo" src="' + bannersList[currentBanner]['logo'] + '" alt="logo" /></a>';
  else
    getObj('bannerImg').innerHTML = '<img id="bannerLogo" src="' + bannersList[currentBanner]['logo'] + '" alt="logo" />';
  window.setTimeout("waitForLogo();", 500);
}

function waitForLogo()
{
  if ( imageIsLoaded(getObj('bannerLogo')) )
  {
    getObj('banners').style.visibility = 'visible';
    fadeIn('banners', 10, 10, 30, "bannerPause();");
  }
  else
    window.setTimeout("waitForLogo();", 50);
}

function bannerPause()
{
  window.setTimeout("fadeOut('banners', 100, 10, 30, 'doBanners();');", 5000);
}


