docs: function reloadScripts(iframe, func) {
          var contentDocument;
          var headNode;
          var tag, scriptNodes, scriptNodeIdx, scriptNode;
          var attrIdx, attr;
          var numLoading;
          var needsLoad;
  
          contentDocument = W.getIFrameDocument(iframe);
          headNode = W.getIFrameAnyChild(iframe);
  
          // Start counting loading tags at 1 instead of 0 and decrement the
          // count after the loop.
          // This way the callback cannot be called before the loop finishes.
          numLoading = 1;
  
          scriptNodes = contentDocument.getElementsByTagName('script');
          for (scriptNodeIdx = 0; scriptNodeIdx < scriptNodes.length;
               scriptNodeIdx++) {
  
              // Remove tag:
              tag = scriptNodes[scriptNodeIdx];
              tag.parentNode.removeChild(tag);
  
              // Reinsert tag for reloading:
              scriptNode = document.createElement('script');
              if (tag.innerHTML) scriptNode.innerHTML = tag.innerHTML;
              needsLoad = false;
              for (attrIdx = 0; attrIdx < tag.attributes.length; attrIdx++) {
                  attr = tag.attributes[attrIdx];
                  scriptNode.setAttribute(attr.name, attr.value);
                  if (attr.name === 'src') needsLoad = true;
              }
              if (needsLoad) {
                  //scriptNode.async = true;
                  ++numLoading;
                  scriptNode.onload = function(sn) {
                      return function() {
                          sn.onload = null;
                          --numLoading;
                          if (numLoading <= 0) func();
                      };
                  }(scriptNode);
              }
              headNode.appendChild(scriptNode);
          }
          --numLoading;
          if (numLoading <= 0) func();
      }