$(function() {
  /*fixContentHeight()
  $(window).resize(function() {
    fixContentHeight();
  });*/
  
  // hover images
  $('.hover').hover(function() {
      var id = $(this).attr('src').replace('.', '-hover.');
      $(this).attr('src', id);
  }, function() {
      var id = $(this).attr('src').replace('-hover.', '.');
      $(this).attr('src', id);
  });
  
  // overlay labels
  $('label input').each(function() {
    var $label = $(this).siblings('span');
    
    if ($(this).val() != '') {$label.hide();}
    
    $(this).focus(function() {
      $label.hide();
    });
    
    $(this).blur(function() {
      if ($(this).val() == '') {$label.show();}
    });
  });

  // colorbox
  $('.colorbox').colorbox({transition: 'fade'});

  // external links
  $('a[rel=external]').click(function() {
    window.open($(this).attr('href'));
    return false;
  });
  
  // print this page
  $('.print').click(function() {
    window.print();
    return false;
  });
});

/*function fixContentHeight() {
  // fix page height & background
  $('#lukov').css('backgroundImage', 'none');
  var $window = $(window).height();
  var $content = $('#content');
  var $additional = $('#header').outerHeight() + $('#footer').outerHeight() + $content.outerHeight() - $content.height();
  if ($content.height() + $additional < $window) {
    $content.height($window - $additional);
  }
}*/
