window.onload   = initPage;
window.onresize = initPage;

function initPage() {
	
  // Get paragraph height
  var paragraph =  document.getElementById('paragraphID');
  var paragraphHeight   = paragraph.offsetHeight;
  
  // Get browser window height
  var windowHeight = getWindowHeight();

  // Set paragraph area on page
  paragraph.style.position = 'relative';
  var windowtop = ((windowHeight - paragraphHeight) / 2);
  
  if(windowtop>0)
  {
  paragraph.style.top = windowtop + 'px';
  }
  else
  {
  paragraph.style.top = '0' + 'px';
  }
  
}

function getWindowHeight() {
  var windowHeight = 0;
	
  if (typeof(window.innerHeight) == 'number')
    windowHeight = window.innerHeight;
  else {
    if (document.documentElement && document.documentElement.clientHeight)
      windowHeight = document.documentElement.clientHeight;
    else {
      if (document.body && document.body.clientHeight)
        windowHeight = document.body.clientHeight; }; };
	
  return windowHeight;
};