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;
}
function setContent(){
 if (document.getElementById){
  var windowHeight = getWindowHeight();
  if (windowHeight > 0){
   var contentElement = document.getElementById('content');
   var contentHeight = contentElement.offsetHeight;
   if(windowHeight - contentHeight > 0){
    contentElement.style.position = 'relative';
    contentElement.style.top = (windowHeight / 2) - (contentHeight / 2) + 'px';
   }
   else{
    contentElement.style.position = 'static';
   }
  }
 }
}
function setBox(){
 if(document.getElementById('update') && document.getElementById('icons')){
  var windowHeight = getWindowHeight();
  var contentTop = document.getElementById('content').offsetTop;
  var imageHeight = document.getElementById('image').offsetHeight;
  document.getElementById('update').style.bottom = windowHeight - (contentTop + imageHeight) + 'px';
  document.getElementById('icons').style.bottom = windowHeight - (contentTop + imageHeight) + 'px';
 }
}
window.onload = function(){
 setContent();
 setBox();
}
window.onresize = function(){
 if (document.getElementById('boxcontent-photo')){
  location.href = location.href;
 }
 else{
 setContent();
 setBox();
 }
}
