
// (C) 2008 Przemysław Wądołowski

$(document).ready(pageSetup);

function pageSetup()
{
  $('#page-content-wrapper h2').each(function(){
    var text = $(this).text().split(' ');
    text = "<b>" + text.shift() + "</b> " + text.join(' ');
    $(this).html(text);
  });
  $('#page-content, #page-left, #page-right, #page-bottom, #page-bottom2, #phb2left, #page-home-bottom3').each(function(){
    $(this).children(':first').css('margin-top', 0);
    $(this).children(':last').css('margin-bottom', 0);
  });
  $('#aktualnosci h4').next().css('margin-top', 0);
  
  $('#page-header-menu a img').each(function(){
    if ( this.className == 'current' )
    {
      this.srcOver = this.srcOriginal = this.src = this.src.replace('std', 'over'); 
    }
    else
    {
      this.srcOver = this.src.replace('std', 'over'); 
      this.srcOriginal = this.src;
      var img = new Image();
      img.src = this.srcOver;
    }
  });
  $('#page-header-menu a img').mouseover(function(){
    this.src = this.srcOver; 
  });
  $('#page-header-menu a img').mouseout(function(){
    this.src = this.srcOriginal; 
  });
  
  
  
  var slide = new PhotoViewer();
  var slideNo = 0;
  
  $('a[rel=lightbox]').each(function(){
    slide.add(this.href);
    this.slideNo = slideNo;
    $(this).click(function(){
      slide.show(this.slideNo);
      return false;
    });
    slideNo++;
  });
  

  
  
}

