
// Overlay popups

function popit()
{ var ovl=document.getElementById('overlay')
  ovl.style.height = document.body.offsetHeight + 'px'
  ovl.style.display = "block"
  setTimeout('popit2()',500)
}

function popit2()
{ var winw, winh, wint
  var pop=document.getElementById('ngsplus_popup')

  if (window.innerWidth)
  { winw = window.innerWidth
    winh = window.innerHeight
  } else
  { winw = document.documentElement.clientWidth
    winh = document.documentElement.clientHeight
  }
  if (window.pageYOffset)
  { wint = window.pageYOffset
  } else
  { wint = document.documentElement.scrollTop
  }

  pop.style.display = "block"
  winw = (winw - pop.offsetWidth) / 2
  winh = ((winh - pop.offsetHeight) / 2) + wint
  pop.style.top = winh + 'px'
  pop.style.left = winw + 'px'
}

function unpopit()
{ var ovl=document.getElementById('overlay')
  var pop=document.getElementById('ngsplus_popup')
  ovl.style.display = "none"
  pop.style.display = "none"
}
