var infoBox = null;
var infoBoxHeader = null;

function init(img)
{
  // Footer Height Fix - I've given up on CSS !
  footerFixer.fix('#content', '#footer');

  // Individual Backgrounds
  $('#main').css('background-image', 'url(' + img + ')');

  // Hide Sidebar when viewing images
  var url = $(window.location).attr('href');
  var erg = url.match(/op=loadImg/);
  if (erg) {
    $('#sidebar').hide('slow');
    $('#content').css('width', '90%');
    $('#content').css({'margin-left' : '5%', 'margin-right' : '5%'});
  }

  // Apply effects only when NOT on mobile...
  if (!navigator.userAgent.match(/(IEMobile|Windows CE|NetFront|PlayStation|PLAYSTATION|like Mac OS X|MIDP|UP\.Browser|Symbian|Nintendo|Android|webOS)/i))
  {
    // Meilensteine Info Box => Hover Effekt
    infoBox = $('#infoBox').html();
    infoBoxHeader = $('#infoBoxHeader').html();
    $('.sidebarMenuBoxContent a img').hover(
      function() {
        $('#infoBoxHeader').html($(this).parent().attr('title'));
        $('#infoBox').html($(this).parent().next().html() + '...');
      },
      function() {}
    );

    $('#hotStuffBox').hover(
      function() {},
      function() {
        $('#infoBox').html(infoBox);
        $('#infoBoxHeader').html(infoBoxHeader);
      }
    );

    // Das Wichtigste von allem => die Ajaxifizierung schreitet unaufhaltbar voran, Genossen!
    $('body').cbajax('#content');
    $('#searchForm').cbsearch('#content');
  }
}

