    $(document).ready(function() {
      $('div#nav_main a#smaller').click(function() {
        if($('body').hasClass("big")) {
          $('body').addClass('medium');
          $('body').removeClass('big');
          $.get("index.php", { sid: getURLParam('sid'), fontsize: "medium" } );
        } else {
          if(!($('body').hasClass("small"))) {
            $.get("index.php", { sid: getURLParam('sid'), fontsize: "small" });
          }
          $('body').addClass('small');
          $('body').removeClass('medium');
          $('body').removeClass('big');
        }

        /*
         * The following code switches between two minus-/plus-buttons based on
         * current fontsize class
         */
        var sMinusPath = $('img#minus').attr('src');
        if ($('body').hasClass("small")) {
            sNewPath = sMinusPath.replace(/minus.gif/, 'minus-inactive.gif');
        } else {
            sNewPath = sMinusPath.replace(/minus-inactive.gif/, 'minus.gif');
        }
        $('img#minus').attr('src', sNewPath);

        var sPlusPath = $('img#plus').attr('src');
        if ($('body').hasClass("big")) {
            sNewPath = sPlusPath.replace(/plus.gif/, 'plus-inactive.gif');
        } else {
            sNewPath = sPlusPath.replace(/plus-inactive.gif/, 'plus.gif');
        }
        $('img#plus').attr('src', sNewPath);

        return false;
      });
      $('div#nav_main a#bigger').click(function() {
        if($('body').hasClass("small")) {
          $('body').addClass('medium');
          $('body').removeClass('small');
          $.get("index.php", { sid: getURLParam('sid'), fontsize: "medium" } );
        } else {
          if(!($('body').hasClass("big"))) {
            $.get("index.php", { sid: getURLParam('sid'), fontsize: "big" });
          }
          $('body').addClass('big');
          $('body').removeClass('medium');
          $('body').removeClass('small');
        }

         /*
         * The following code switches between two minus-/plus-buttons based on
         * current fontsize class
         */
        var sMinusPath = $('img#minus').attr('src');
        if ($('body').hasClass("small")) {
            sNewPath = sMinusPath.replace(/minus.gif/, 'minus-inactive.gif');
        } else {
            sNewPath = sMinusPath.replace(/minus-inactive.gif/, 'minus.gif');
        }
        $('img#minus').attr('src', sNewPath);

        var sPlusPath = $('img#plus').attr('src');
        if ($('body').hasClass("big")) {
            sNewPath = sPlusPath.replace(/plus.gif/, 'plus-inactive.gif');
        } else {
            sNewPath = sPlusPath.replace(/plus-inactive.gif/, 'plus.gif');
        }
        $('img#plus').attr('src', sNewPath);

        return false;
      });
    });