function getMaxWidthHeight() {
	if (self.innerWidth) {
		document.frameWidth = self.innerWidth;
		document.frameHeight = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientWidth) {
		document.frameWidth = document.documentElement.clientWidth;
		document.frameHeight = document.documentElement.clientHeight;
	}
	else if (document.body) {
		document.frameWidth = document.body.clientWidth;
		document.frameHeight = document.body.clientHeight;
	}
}

function doResize() {
	getMaxWidthHeight();

	winW = document.frameWidth;
	winH = document.frameHeight;

	MObj = document.getElementById("Main");
	
	if((winW <= 970) && (winH <= 580)) {
		MObj.height = 580;
		MObj.width = 970;
	}
	else if ((winW <= 970) && (winH > 580)) {
		MObj.height = '100%';
		MObj.width = 970;
	}
	else if ((winW > 970) && (winH > 580)) {
		MObj.height = '100%';
		MObj.width = '100%';
	}
	else if ((winW > 970) && (winH <= 580)) {
		MObj.height = 580;
		MObj.width = '100%';
	}
}