﻿function recenter() {
        var container = document.getElementById("container");
        var newleft = Math.max(0,(getWindowWidth()-parseInt(container.style.width))/2);
        container.style.left=newleft + 'px';
}
function initHPage() {
    recenter();
    window.onresize=recenter;
}
function getWindowWidth() {
  var myWidth = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
  } else if( document.documentElement && ( document.documentElement.clientWidth ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
  } else if( document.body && ( document.body.clientWidth ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
  }
  return myWidth;
}