$(document).ready(function() {
  $("a.ref").fancybox({ 'imageScale': false, 'centerOnScroll':false, 'hideOnContentClick': true, 'zoomOpacity': true,'overlayShow': true, 'zoomSpeedIn': 500, 'zoomSpeedOut': 500 });
  $("a.ref_group").attr("rel","group"); 
  $("a.ref_group").fancybox({ 'imageScale': false, 'centerOnScroll':false, 'hideOnContentClick': true, 'zoomOpacity': true,'overlayShow': true, 'zoomSpeedIn': 500, 'zoomSpeedOut': 500 });
  
//  $(".menu .srodek a:first").css({'width':'40px','padding-left':'0','padding-right':'0'});
//  $(".menu .srodek a:first span").css({'display':'block', 'background':'url(images/images/home.gif) no-repeat 13px 3px','width':'40px','height':'22px'});
//  $(".menu .srodek a:first span").html('');
  
  $(".center-block .NewsSummary:last").css({'padding-right':'0'});
  
  $(".formbuilderform div:eq(5)").css({'position':'absolute', 'left':'330px'});
  $(".formbuilderform div:eq(6)").css({'position':'absolute', 'right':'8px', 'top':'148px'});
  $('.formbuilderform div:eq(5)').find('p').css({'display':'block','font-weight':'bold'}).html("Uzupelnij wymagane pola");
  

  
  $wysokoscMenu = $(".menu ul li ul").height();
  $(".content_all#sub").css("margin-top",$wysokoscMenu-5);
  $(".content_all#art").css("margin-top",$wysokoscMenu-5);
  
  $(".slider a").click(function(){
  var zmienna = 1;
  if($(this).next('div').css("display") == "none"){
    $(this).next('div').fadeIn('fast');
    $(this).html("zwiń").removeClass().addClass("more zwin");
  }
  else if($(this).next('div').css("display") == "block"){
    $(this).next('div').fadeOut('fast');
    $(this).html("rozwiń").removeClass().addClass("more rozwin");
  }
 
  });
  
  if($(".zwykla .NewsSummary").find('img').attr("class") == "jest"){
    $(this).parent().html("xx");   
  }
   var prevIndex = 1111;
   var elementIndex = 0;  
   
  $(".baza table a").click(function(){ 
  var id = $(this).attr("id"); 
  //alert();
  id = parseFloat(id.substr(4));
  elementIndex = id-1;
  //alert(elementIndex+" -- "+prevIndex);
  $(this).addClass("active"); 
  $(".baza .odpowiedz:eq("+prevIndex+")").hide();
  $(".baza .odpowiedz:eq("+elementIndex+")").show();
  //alert($(".baza table").find("a#link"+prevIndex).html());
  $(".baza table").find("a#link"+(prevIndex+1)).removeClass()
  prevIndex = elementIndex;  
  });

 
  
});


$(window).load(function(){
  $wysokosc = $(".bottom-block").height();
  
  
  //$(".blok1").css("height",$wysokosc);
  $(".blok2").css("height",$wysokosc);
  $(".blok3").css("height",$wysokosc);
  
  
});

