function page_size()
{
  var height = jQuery(window).height() - jQuery("#header").height() - jQuery("#footer").height() - 10;
  
  jQuery("#main").css("min-height", height);
}

jQuery(window).ready(function() {
  page_size();
});

jQuery(window).resize(function() {
  page_size();
});

/**** Cufon ****/
cufon_replacement('.header_logo a, .header_logo span', 1, 'Fertigo Pro', true, '1px 1px 1px #000000', '-linear-gradient(#ffffff, #555555)' );
cufon_replacement('#content h1', 1, 'Fertigo Pro', true, '1px 1px 1px #000000', '-linear-gradient(#ffffff, #555555)' );
cufon_replacement('#right_menu h3, #contact h1', 1, 'Fertigo Pro', true, '1px 1px 1px #000000', '-linear-gradient(#ffffff, #555555)' );
cufon_replacement('#contact h2, #contact h3', 1, 'Sansation', true, '1px 1px 0 #000000', '-linear-gradient(#ffffff, #555555)' );

function cufon_replacement($cufonThis, $fineAdjust, $cufonFont, $hoverEffect, $textShadows, $colorEffects) {
  
  jQuery($cufonThis).each( function() {
    $currentSize = parseInt(jQuery(this).css('fontSize'));
    jQuery(this).css({ 'font-size' : $currentSize * $fineAdjust })
  });
  
  Cufon.replace($cufonThis, { fontFamily: $cufonFont, hover : $hoverEffect, textShadow : $textShadows, color: $colorEffects });
}

jQuery(document).ready(function(){
  // Domyślnie zwijamy wszystkie listy.
  jQuery('ul li ul').css('display', 'none');
  // Obsługa myszy- zwijanie i rozwijanie list.
  jQuery('ul li.sub_page').hover(function() {
      jQuery(this).children('ul li ul').toggle(300);
      return false;
  });
});


