$(function() {
  if (!$(".combovraag").length) {
     fixBackground();
  };
  $(window).resize(fixBackground);

});

function fixBackground() {
  var debug="";
  var minHeight = $("#Omhulsel").height();
  debug+=(minHeight +'minHeight');

  var eltsHeight = $("#Pagina").height()+$("#Header").height()+$("#Functies").height();
  debug+=(eltsHeight +'eltsHeight');
  minHeight = eltsHeight>minHeight?eltsHeight:minHeight;

  var winHeight = $(document).height();
  debug+=(winHeight +'winHeight');

  var fixHeight =  minHeight < winHeight?winHeight:minHeight;
  debug+=(fixHeight +'fixHeight');


  $("#Omhulsel").css({ 'height' : fixHeight-8+'px' });
  $(".linkermenu").css({ 'height' : fixHeight-8-$("#Header").height()-$("#Functies").height()+'px' });
  $(".bodyvandesite").css({ 'height' : fixHeight-8-$("#Header").height()-$("#Functies").height()+'px' });
  //$("#payoff").css({ 'bottom' : '42px' });
  $("#Pagina").css({ 'position':'absolute' });

  //document.title=debug;
}
