function vertical_center(content_height) {

  height = get_viewport_height();
  margin = (height - content_height) / 2

  get_object('ruler', 'height', margin);
}

function get_object(id, prop, value) {
  var object = null;
  if( document.layers ) {
    object = document.layers[id];
  } else if( document.all ) {
    object = document.all[id];
  } else if( document.getElementById ) {
    object = document.getElementById(id);
  }

  if (prop) {
    eval('object.' + prop + '=' + value);
  }

  return object;
}

function get_viewport_height() {
  var viewportwidth;
  var viewportheight;
 
  // the more standards compliant browsers (mozilla/netscape/opera/IE7) 
  if (typeof window.innerWidth != 'undefined')
  {
    viewportwidth = window.innerWidth,
    viewportheight = window.innerHeight
  }
 
  // IE6 in standards compliant mode (i.e. with a valid doctype)
  else if (typeof document.documentElement != 'undefined'
    && typeof document.documentElement.clientWidth !=
    'undefined' && document.documentElement.clientWidth != 0)
  {
    viewportwidth = document.documentElement.clientWidth,
    viewportheight = document.documentElement.clientHeight
  }
 
  // older versions of IE
  else
  {
    viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
    viewportheight = document.getElementsByTagName('body')[0].clientHeight
  }

  return viewportheight;
}


