function centerElement (id) {
 var el, windowWidth, windowHeight, elWidth, elHeight, cx, cy;
 if (document.layers) {
  el = document[id];
  windowWidth = window.innerWidth;
  windowHeight = window.innerHeight;
  elWidth = el.document.width;
  elHeight = el.document.height;
 }
 else if (document.all) {
  el = document.all[id];
  windowWidth = document.body.clientWidth;
  windowHeight = document.body.clientHeight;
  elWidth = el.offsetWidth;
  elHeight = el.offsetHeight;
 }
 else if (document.getElementById) {
  el = document.getElementById(id);
  windowWidth = window.innerWidth;
  windowHeight = window.innerHeight;
  elWidth = el.offsetWidth;
  elHeight = el.offsetHeight;
 }
 cx = Math.max(0, Math.floor((windowWidth - elWidth) / 2));
 cy = 0; //Math.max(0, Math.floor((windowHeight - elHeight) / 2));
 if (document.layers) {
  el.left = cx;
  el.top = cy;
  el.visibility = 'show';
 }
 else if (document.all || document.getElementById) {
  el.style.left = cx + 'px';
  el.style.top = cy + 'px';
  el.style.visibility = 'visible';
 }
}
