var position = 0;
var container = null;
var containerId = 'container'
var containerWidth = 996;

function fixContainerPosition()
{
	if( (position = (document.body.clientWidth - containerWidth) / 2) < 0 ) {
		position = 0;
	}

	if( (container = document.getElementById( containerId )) ) {
		container.style.left = position + 'px';
	} else {
		document.writeln( '<style type="text/css">#' + containerId +
				' { position : absolute; left : ' + position + 'px; }</style>' );
	}
}

fixContainerPosition();
window.onresize = fixContainerPosition;

