$(document).ready(function(){
  $('div.scroller marquee').marquee('pointer').mouseover(function () {
    $(this).trigger('stop');
  }).mouseout(function () {
    $(this).trigger('start');
  }).mousemove(function (event) {
    if ($(this).data('drag') == true) {
      this.scrollLeft = $(this).data('scrollX') + ($(this).data('x') - event.clientX);
    }
  }).mousedown(function (event) {
    $(this).data('drag', true).data('x', event.clientX).data('scrollX', this.scrollLeft);
  }).mouseup(function () {
    $(this).data('drag', false);
  });


  $("#it1").hover(function() { $(this).attr("src","/gfx/but1_h.png"); }, function() { $(this).attr("src","/gfx/but1.png"); });  
  $("#it2").hover(function() { $(this).attr("src","/gfx/but2_h.png"); }, function() { $(this).attr("src","/gfx/but2.png"); });  
  $("#it3").hover(function() { $(this).attr("src","/gfx/but3_h.png"); }, function() { $(this).attr("src","/gfx/but3.png"); });  

  $("#bx1").hover(function() { $(this).attr("src","/gfx/box1_h.png"); }, function() { $(this).attr("src","/gfx/box1.png"); });  
  $("#bx2").hover(function() { $(this).attr("src","/gfx/box2_h.png"); }, function() { $(this).attr("src","/gfx/box2.png"); });  
  $("#bx3").hover(function() { $(this).attr("src","/gfx/box3_h.png"); }, function() { $(this).attr("src","/gfx/box3.png"); });  
  $("#bx4").hover(function() { $(this).attr("src","/gfx/box4_h.png"); }, function() { $(this).attr("src","/gfx/box4.png"); });  
  
  $("#szukaj_guzik").hover(function() { $(this).attr("src","/gfx/szukajbut_h.png"); }, function() { $(this).attr("src","/gfx/szukajbut.png"); });  


 if ($('#stat_page').length == 0) {
  var colbox_max_height = 0;
  $(".colbox").each(function(i) { 
    colbox_height = $(this).height();
    if(colbox_height > colbox_max_height) { colbox_max_height = colbox_height; }
  });
  $(".colbox").height(colbox_max_height);
  }
  
});

function resizeStat() {
  var colbox_height = $(".colbox").height();
  var stat_height   = $(".statystyki").height();
  if(colbox_height < stat_height) { colbox_height = stat_height + 20; }
  $("#content").height(1200);
}


