/*TODO: Doesn't work jet why???
function doCufonMagic()
{
               Cufon.replace('h1');
               Cufon.replace('div#schwarzelinie');
               Cufon.replace('div#navigationsleiste',{hover: true});
               Cufon.replace('div#fusszeile',{hover: true});
}

$(window).load(function() {
if($('body').data('nomyriad') == true)
{
   doCufonMagic();
}
});

$(document).ready(function() {
   if(!$.fontAvailable('Myriad Pro'))
   {
      $('body').data('nomyriad', true);
      fontnotavaible=true;
      $.getScript('Myriad_Pro_900.font.js', doCufonMagic);
   }
});
*/

function changeFooterPositionType()
{
   var main = $('div#hauptinhaltsbereich');
   var foot = $('div#fusszeile');
   var navi = $('div#navigationsleiste');

   canvas_height=$(window).height()-$('div#header').outerHeight()-$('div#schwarzelinie').outerHeight()-foot.outerHeight();
   content_height=main.height();
   if (content_height < navi.outerHeight())
      content_height = navi.outerHeight();

   if(canvas_height < content_height)
   {
      if (content_height <= navi.outerHeight())
      {
            main.css('margin-bottom', '15%');
      }
      else
      {
            main.css('margin-bottom', '3%');
      }
      foot.css('position', 'relative');
   }
   else
   {
      main.css('margin-bottom', '10%');
      foot.css('position', 'fixed');
   }
}

$(window).resize(changeFooterPositionType);
$(document).ready(changeFooterPositionType);
$(window).load(changeFooterPositionType);
