code: function loadScripts(scripts, loadedCallback) {
      var srcs = [], property, count, i, src,
          countDown = function () {
            count -= 1;
            if (!count) {
              loadedCallback();
            }
          };
  
      for (property in scripts) {
        if (!(property in window)) {
          srcs.push(scripts[property]);
        }
      }
  
      count = srcs.length;
      if (!count) {
        loadedCallback();
      }
  
      for (i = 0; i < srcs.length; i += 1) {
        src = srcs[i];
        loadScript(src, countDown);
      }
    }
docs: Load scripts into the page, and call a callback when they are loaded.
  
  @param {Array} scripts The scripts to be loaded.
  @param {Function} loadedCallback The function to be called when all the scripts have loaded.