﻿function pageWidth() {
	var x = 0;
	if (self.innerWidth) {
		x = self.innerWidth;
	}
	else if (document.documentElement && document.documentElement.clientWidth) {
		x = document.documentElement.clientWidth;
	}
	else if (document.body) {
		x = document.body.clientWidth;
	}
	x -= 35;
	if (x < 730) x = 730;
	if (x > 1680) x = 1680;
	return x;
}
function pageHeight() {
	var y = 0;
	if (self.innerHeight) {
		y = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight) {
		y = document.documentElement.clientHeight;
	}
	else if (document.body) {
		y = document.body.clientHeight;
	}
	y -= 35;
	if (y < 500) y = 500;
	if (y > 1050) y = 1050;
	return y;
}
function sizePage() {
	d = document.getElementById('container');
	d.style.width = pageWidth() + "px";
	d.style.height = pageHeight() + "px";
	d = document.getElementById('background');
	d.style.left = -(1680 - pageWidth())/2 + "px";
	d.style.top = -(1050 - pageHeight())/2 + "px";
	d = document.getElementById('content');
	d.style.left = -(480 - pageWidth())/2 + "px";
	d.style.top = -(500 - pageHeight())/2 + "px";
	d = document.getElementById('hitbox');
	d.style.left = -(480 - pageWidth())/2 + "px";
	d.style.top = -(500 - pageHeight())/2 + "px";
}