   scrollTo(navPos)
 
 scrollTo = (pos) ->
-  if win.scrollTop < pos
-    document.body.scrollTop += 20
+  if (window.pageYOffset || doc.scrollTop)  - (doc.clientTop || 0) < pos
+    document.documentElement.scrollTop += 20
     setTimeout ->
       scrollTo(pos)
     , 5

staticNav = d3.select("#nav")
navList = d3.selectAll(".nav-list")
sticky = false

toggleSticky = ->
  if not sticky and win.scrollTop > hero.offsetHeight
    nav.classed "hidden", false
    sticky = true
  else if sticky and win.scrollTop <= hero.offsetHeight
    nav.classed "hidden", true
    sticky = false



getSectionId = ->
  winHeight = win.offsetHeight
  midScroll = (window.pageYOffset || doc.scrollTop)  - (doc.clientTop || 0) + winHeight * 0.5
  offset = null
  section = "cyberpunk"
  for el in sections[0]
