// PositionBox.js
//
// dynamically set the position of the box div in order to avoid shenanigans with Safari and Firefox scrollbars.

var box = null;
var boxWidth = 0;

function setBoxPosition()
{
  var w = window.outerWidth;
  if (!w) { w = document.body.clientWidth; }
  
  if (box == null) box = document.getElementById("divBody");
  if (boxWidth <= 0) boxWidth = box.clientWidth;
  
  var leftOffset = Math.round((w - boxWidth) / 2);
  if (leftOffset < 10) leftOffset = 10;
  
  box.style.left = leftOffset;
  box.style.visibility = 'visible';
}

window.onresize = setBoxPosition;
