docs: function setRightStyle(w) {
          var dockedMargin, safeMargin;
          var lastDocked, right, ws, tmp;
  
          safeMargin = 200;
          dockedMargin = 20;
  
          ws = node.widgets;
  
          right = 0;
          // The widget w has been already added to the docked list.
          if (ws.docked.length > 1) {
              lastDocked = ws.docked[(ws.docked.length - 2)];
              right = getPxNum(lastDocked.panelDiv.style.right);
              right += lastDocked.panelDiv.offsetWidth;
          }
          right += dockedMargin;
  
          w.panelDiv.style.right = (right + "px");
  
          // Check if there is enough space on page?
          tmp = 0;
          right += w.panelDiv.offsetWidth + safeMargin;
          while (ws.docked.length > 1 &&
                 right > window.innerWidth &&
                 tmp < (ws.docked.length - 1)) {
  
              // Make some space...
              closeDocked(ws.docked[tmp].wid, true);
              tmp++;
          }
          // Store final offsetWidth in widget, because we need it after
          // it is destroyed.
          w.dockedOffsetWidth = w.panelDiv.offsetWidth + dockedMargin;
      }