jQuery(document).ready(function( $ ) {
   $("#mobilemenu").mmenu({
      "slidingSubmenus": false,
      "navbar": {
         "title": "Der Oberstufen- und Abiturplaner für Bayern"
      },
      "navbars": [
         {
            "position": "top"
         }
      ]
   });


   $('#wrapper').on('click', '#kontrast_toggle, #schrift_toggle', function() {
      var controller = 'tx_ifaccessbuttons_pi1[controller]=AccessibilityButtons';
      var action = 'tx_ifaccessbuttons_pi1[action]=ajax';
      var typeNum = 123;
      var btn;

      if ($(this).attr('id') == 'kontrast_toggle') {
         btn = 'kontrast';
      }

      if ($(this).attr('id') == 'schrift_toggle') {
         btn = 'schriftgroesse';
      }

      var path = 'index.php';

      jQuery.ajax({
         url: path + '?' + controller + '&' + action + '&type=' + typeNum,
         data: 'tx_ifaccessbuttons_pi1[btn]=' + btn,

         success: function (resultData) {
            document.location.reload();
         },
         error: function (error) {
            alert('Diese Funktion steht zur Zeit nicht zur Verfügung');
         }
      });
   });
});
