+= md.yaml.menu[i] + '">' + i + '</a>' 
    }
    document.getElementById('menu').innerHTML = html
  }
  
  xmlhttp.open("GET", fname , true)
  xmlhttp.send();
}


//=== touch event for mobile (swipe to show/hide left-panel)
if (window.innerWidth<900) {

  function toggleTOC(show) {
    var disp = document.getElementById('left-panel').style.display
    document.getElementById('left-panel').style.display = show||(disp=='none')? 'block' : 'none'
    document.getElementById('right-panel').style.display = show|