Как-то так
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<style type="text/css">html, body { margin: 0; padding: 0; }</style>
</head>
<body onresize="test()" onload="test()">
<div id="test" style="position: absolute; width: 300px; background-color: green; height: 100%;"></div>
<script type="text/javascript">
function test() {
var e = document.getElementById('test');
e.style.left = Math.floor(Math.max(document.body.clientWidth, 1000) / 2 + 200) + 'px';
}
test();
</script>
</body>
</html>