

  function showInitialUI(needsParent, hasPreview) {
    parentFrameSection.style.display = needsParent ? 'block' : 'none';
    autoContentSection.style.display = needsParent ? 'none' : 'block';
    formattingSection.style.display = (needsParent || !hasPreview) ? 'none' : 'block';
    sourceSection.style.display = needsParent ? 'none' : 'block';
  }

  document.getElementById('autoContentFrame').addEventListener('change', autoContentFrameChanged, false);
  document.getElementById('formattingSection').addEv