function centerDiv() {
  var sheight1=window.innerHeight
  var sheight2=document.body.clientHeight
  var swidth1=window.innerWidth
  var swidth2=document.body.clientWidth
  var sdh=644
  var sdw=800
  if(sheight1<sdh) {sheight1=parseInt(sheight1/2)}
  else {sheight1=parseInt(sdh/2)}
  if(sheight2<sdh){sheight2=parseInt(sheight2/2)}
  else {sheight2=parseInt(sdh/2)}
  if(swidth1<sdw){swidth1=parseInt(swidth1/2)}
  else {swidth1=parseInt(sdw/2)}
  if(swidth2<sdw){swidth2=parseInt(swidth2/2)}
  else {swidth2=parseInt(sdw/2)}
  if(window.innerHeight) { //checking for browsers that support window.innerHeight
    document.getElementById("centeredcontent").style.marginTop=-sheight1 + "px"
    document.getElementById("centeredcontent").style.marginLeft=-swidth1 + "px"
  }
  else if (document.body.clientHeight) { //checking for browsers that support document.body.clientHeight
    document.getElementById("centeredcontent").style.marginTop=-sheight2 + "px"
    document.getElementById("centeredcontent").style.marginLeft=-swidth2 + "px"
  }
}
window.onload=centerDiv;
window.onresize=centerDiv;
