
$(document).ready(init);

function init()
{
  $('#header-menu img').each(function()
  {
    this.srcOrig = this.src;
    this.srcOver = this.src.replace('/menu/', '/menu-over/');
    var img = new Image();
    img.src = this.srcOver; 
  }).mouseover(function()
  {
    this.src = this.srcOver;
  }).mouseout(function()
  {
    this.src = this.srcOrig;
  });
  
  $('.over').each(function()
  {
    this.srcOrig = this.src;
    this.srcOver = this.src.replace(/\.([^.]*)$/,'-over.$1');
    var img = new Image();
    img.src = this.srcOver; 
  }).mouseover(function()
  {
    this.src = this.srcOver;
  }).mouseout(function()
  {
    this.src = this.srcOrig;
  });
  
  $('#popup').hide();
  
  $('a[rel=lightbox]').lightbox();
  
  $('.chmurka2').each(function()
  {
    var c2 = $(this);
    var c  = c2.parent();
    
    if ( c.height() > c2.height() )
    {
      c2.height(c.height());
    }
    
  });
  
  banery = $('#baner > div');
  
  if ( banery.length )
  {
    banery.hide();
    banery.first().show();
    baneryKtory = 0;
    setTimeout(baneryNastepny, 10000);
  }
  
}

function baneryNastepny()
{
  banery.hide();
  baneryKtory++;
  if ( baneryKtory >= banery.length )
  {
    baneryKtory = 0;
  }
  banery.eq(baneryKtory).show();
  setTimeout(baneryNastepny, 10000);
}



