/* center.js - Javascript script to center a document body.
 * Created	: Fri 01 Oct 2004 02:25:53 PM CDT
 * Modified	: Fri 01 Oct 2004 02:27:17 PM CDT
 * Description	: Sets the body width to 720 pixels and centers the body (if
 *		  the screen width is greater than 720). Otherwise sets a full
 *		  width.
 */

window.onresize = setBodyWidth;

setBodyWidth();

function setBodyWidth() {
    var left = (window.innerWidth - 720) / 2;

    if (left > 0) {
	document.body.style.position	= "absolute";
	document.body.style.left	= left.toString() + 'px';
	document.body.style.width	= "720px";
    } else {
	document.body.style.position	= "";
	document.body.style.left	= "";
	document.body.style.width	= "";
    }
}
