window.onload = init
window.onresize = adjust

function init()
{ adjust()
  showProject()
}

function adjust()
{ if (document.getElementById("project"))
  { proj = document.getElementById("project").clientHeight
  }
  else if (document.getElementById("projectNarrow"))
  { proj = document.getElementById("projectNarrow").clientHeight
  }
  
  

  if (typeof window.innerWidth != 'undefined')
  { windowHeight = window.innerHeight
  }
  else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth !='undefined' && document.documentElement.clientWidth != 0)
  { windowHeight = document.documentElement.clientHeight
  }
  
  hgt = Math.floor((windowHeight - proj) / 2)
  document.getElementById("portfolio").style.marginTop = hgt + "px"
  
}

function showProject()
{ if (document.getElementById("project"))
  { document.getElementById("project").style.visibility = "visible"
  }
  else if (document.getElementById("projectNarrow"))
  { document.getElementById("projectNarrow").style.visibility = "visible"
  }
}
