<?xml version="1.0"?>
<bindings id="userChromeBindings" xmlns="http://www.mozilla.org/xbl">
  /* Komfort-Scrollen in Mailnews - zusammen mit dem Eintrag aus http://chewey.de/mozilla/komfort-scrollen.html */
  <binding id="userChromeBindingMailNews">
    <implementation>
      <constructor>
        <![CDATA[
          /* proof of concept für messagepane ohne "halfscroll" auf der letzten Seite */
          var p = OnMsgParsed.__parent__;
          p.OnMsgParsedOld = OnMsgParsed;
          p.OnMsgParsed = function(aURL)
          {
          var messagepanebody = document.getElementById('messagepane')   
                                          .webNavigation.document.body;
            var dContent      = messagepanebody.offsetHeight;
            var dClientHeight = messagepanebody.clientHeight;
            if (dContent > dClientHeight)
            {
              var dPage     = dClientHeight * 0.9;
              var dOverlap  = dClientHeight - dPage;
              var dFraction = (dContent - dOverlap) % dPage + 8; //+ 8 experimentell bestimmt...
              if (dFraction > 0)
              { // set new height
                var dNewHeight = dContent + dPage - dFraction;
                messagepanebody.style.height = dNewHeight;
              }
            }
            OnMsgParsedOld(aURL);
          }
        ]]>
      </constructor>
    </implementation>
  </binding>
  
  /* Längere Zurück-Button-History - zusammen mit dem Eintrag aus http://chewey.de/mozilla/lange-back-history.html */
  <binding id="userChromeBindingNavigator">
    <implementation>
      <constructor>
        <![CDATA[
          var fRaiseMaxHistory = 
            function()
            { // raise MAX_HISTORY_MENU_ITEMS
              const NEW_MAX_HISTORY_MENU_ITEMS = 25;
              window.FillHistoryMenu = eval('(' + window.FillHistoryMenu.toSource().replace(/MAX_HISTORY_MENU_ITEMS/g, NEW_MAX_HISTORY_MENU_ITEMS) + ')');
              // do it only once
              window.removeEventListener('load', fRaiseMaxHistory, true); 
            };
          window.addEventListener('load', fRaiseMaxHistory, true);
         ]]>
      </constructor>
    </implementation>
  </binding>
</bindings>