// JavaScript Document
window.onresize = centerfix;

//call this function once html page too (anywhere after <div id="blyon">...)
function centerfix(){
  c_fix(1000, 100000, 0, 10);
}

function c_fix(cont_x, cont_y, min_l, min_t) {
  var frame = document.getElementById("site_holder");  
  var total_height = document.documentElement.clientHeight;
  var total_width = document.documentElement.clientWidth;
  var pos_y = 0;
  var pos_x = 0;
  
  if (cont_y > total_height - 2*min_t) {
    pos_y = min_t;
  } else {
    pos_y = (total_height - cont_y)/2;
  }
  
  if (cont_x > total_width - 2*min_l) {
    pos_x = min_l;
  } else {
    pos_x = (total_width - cont_x)/2;
  }
  
  frame.style.top = pos_y + "px";
  frame.style.left = pos_x + "px";

}